/* ==========================================================================
   uwezo-home.css  (added 2026-11-12)
   Home page: "Latest Activities" cards + 16:9 photo frames (news and activities).
   All class names start with .ua- so nothing else on the site is affected.
   Linked in resources/views/frontend/layout/layout.blade.php after the other stylesheets.
   ========================================================================== */

/* ---------- 16:9 photo frame: the whole photo always shows, gaps are a soft blur ---------- */
.ua-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #E9EEF2; }
.ua-frame-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: blur(14px) brightness(.85); transform: scale(1.15); }
.ua-frame-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }

/* ---------- Latest Activities section ---------- */
.ua-act { background: #F4F7FA; padding: 56px 0 64px; }
.ua-act-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.ua-act-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
@media (max-width: 899px) { .ua-act-grid { grid-template-columns: 1fr; } }

.ua-act-card { position: relative; display: flex; flex-direction: column; background: #fff;
    border: 1px solid #E1E8EE; border-radius: 12px; overflow: hidden; color: inherit; text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.ua-act-card:hover, .ua-act-card:focus-visible { transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(19, 95, 122, .16); border-color: #B9D3DD; }
.ua-act-card:focus-visible { outline: 2px solid #135F7A; outline-offset: 2px; }

.ua-act-media { width: 100%; }
.ua-act-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(14, 58, 74, .55); opacity: 0; transition: opacity .3s ease; }
.ua-act-pill { background: #fff; color: #135F7A; font-size: 14px; font-weight: 600; padding: 10px 18px;
    border-radius: 999px; transform: translateY(8px); transition: transform .3s ease; }
.ua-act-card:hover .ua-act-overlay, .ua-act-card:focus-visible .ua-act-overlay { opacity: 1; }
.ua-act-card:hover .ua-act-pill, .ua-act-card:focus-visible .ua-act-pill { transform: translateY(0); }

.ua-act-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.ua-act-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ua-act-tag { background: #E2F0F4; color: #0E4D63; font-size: 12px; line-height: 1.4; font-weight: 500;
    padding: 3px 10px; border-radius: 999px; }
.ua-act-date { color: #5F6B74; font-size: 13px; }
.ua-act-title { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.35; color: #1E2A32; transition: color .3s ease; }
.ua-act-card:hover .ua-act-title, .ua-act-card:focus-visible .ua-act-title { color: #135F7A; }
.ua-act-excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ua-summary, #222B33); text-align: left; }
.ua-act-more { margin-top: auto; padding-top: 4px; font-size: 14px; font-weight: 600; color: #C62828; }

.ua-act-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #C62828;
    transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.ua-act-card:hover .ua-act-bar, .ua-act-card:focus-visible .ua-act-bar { transform: scaleX(1); }

.ua-act-empty { padding: 16px 0; color: #4A5560; }
.ua-act-btn-wrap { text-align: center; margin-top: 36px; }
.ua-act-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 28px;
    border: 2px solid var(--ua-act-btn, #006991); border-radius: 999px; background: transparent; color: var(--ua-act-btn, #006991);
    font-size: 15px; font-weight: 600; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.ua-act-btn:hover, .ua-act-btn:focus-visible { background: var(--ua-act-btn, #006991); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .ua-act-card, .ua-act-overlay, .ua-act-pill, .ua-act-title, .ua-act-bar, .ua-act-btn { transition: none; }
    .ua-act-card:hover, .ua-act-card:focus-visible { transform: none; }
}

/* A4 left-aligned text: now set in Admin > Site settings > Colours and text style (rule lives in the layout). */

/* Social cards row when Facebook/LinkedIn cards are shown (2026-11-12): equal-height cards, last row centred. */
.ua-follow { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.ua-follow > a { flex: 0 0 100%; min-height: 120px; padding-top: 0 !important; padding-bottom: 0 !important; }
@media (min-width: 640px) { .ua-follow > a { flex-basis: calc(50% - .5rem); } }
@media (min-width: 768px) { .ua-follow > a { flex-basis: calc(33.333% - .667rem); min-height: 140px; } }
@media (min-width: 1280px) { .ua-follow > a { flex-basis: calc(20% - .8rem); } }

/* Section headings with the red bar: colour from Admin > Site settings (2026-11-12). */
.border-red-500.text-\[\#006991\] { color: var(--ua-heading, #006991); }

/* Home: Who we are + Vision/Mission (A12/A13, 2026-11-12) */
.ua-who p, .ua-who div { max-width: none !important; width: auto !important; }
.ua-who img { max-width: var(--ua-badge-w, 180px) !important; height: auto !important; margin-top: 8px; }
.ua-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.ua-fact { background: #F4F7FA; border: 1px solid #E1E8EE; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.ua-fact-n { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ua-heading, #006991); }
.ua-fact-l { font-size: 14px; line-height: 1.4; color: #4A5560; }
.ua-vm { border-radius: 14px; padding: 32px 36px; }
@media (max-width: 767px) { .ua-vm { padding: 28px 24px; } }

/* Download buttons on document and publication lists: blue instead of pale green (A18, 2026-11-12) */
a .bg-green-100.rounded-lg { background-color: color-mix(in srgb, var(--ua-dl, #006991) 12%, white) !important; color: var(--ua-dl, #006991) !important; transition: background-color .2s ease, color .2s ease; }
a:hover .bg-green-100.rounded-lg, a:focus-visible .bg-green-100.rounded-lg { background-color: var(--ua-dl, #006991) !important; color: #fff !important; }

/* Latest News rows: moved here from includes/news-v2.blade.php on 2026-11-12 so /news can use them too (A21). */
.ln-list { list-style: none; margin: 0; padding: 0; }
    .ln-row { border-bottom: 1px solid #E5D6C6; }
    .ln-link { display: flex; align-items: flex-start; gap: 24px; padding: 16px 12px; color: inherit; text-decoration: none; border-radius: 10px; transition: background-color .25s ease; }
    .ln-link:hover, .ln-link:focus-visible { background: #FBEDE1; }
    .ln-link:focus-visible { outline: 2px solid #C62828; outline-offset: 2px; }
    .ln-thumb { flex: 0 0 220px; width: 220px; height: 132px; border-radius: 8px; overflow: hidden; background: #F3E6DA; }
    .ln-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
    /* portrait or square photos (e.g. a person on a white background): show the whole photo on white so faces are not cut off */
    .ln-thumb img.is-portrait { object-fit: contain; background: #fff; }
    .ln-link:hover .ln-thumb img { transform: scale(1.05); }
    .ln-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
    .ln-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .ln-tag { background: #FCE4E1; color: #9E1F1F; font-size: 12px; line-height: 1.4; font-weight: 500; padding: 3px 10px; border-radius: 999px; }
    .ln-date { color: #5F6B74; font-size: 13px; }
    .ln-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.35; color: #1E2A32; transition: color .2s ease; }
    .ln-link:hover .ln-title, .ln-link:hover .ln-excerpt, .ln-link:hover .ln-date, .ln-link:hover .ln-more { color: var(--ua-news-hover, #006991); } /* set in Site settings; blue like the menu tabs (2026-11-12); was red #C62828 on the title only */
.ln-excerpt, .ln-date, .ln-more { transition: color .2s ease; }
    .ln-excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ua-summary, #222B33); font-weight: 400; text-align: left; } /* darker summary text (2026-11-12); was #4A5560 */
    .ln-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: #C62828; }
    .ln-arrow { display: inline-block; transition: transform .25s ease; }
    .ln-link:hover .ln-arrow { transform: translate(3px, -3px); }
    .ln-empty { padding: 16px 0; color: #4A5560; }
    .ln-btn-wrap { text-align: center; margin-top: 28px; }
    .ln-btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 28px; border: 2px solid var(--ln-btn); border-radius: 999px; color: var(--ln-btn); background: transparent; font-size: 15px; font-weight: 600; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
    .ln-btn:hover, .ln-btn:focus-visible { background: var(--ln-btn); color: #fff; }
    @media (max-width: 699px) {
        .ln-link { flex-direction: column; gap: 12px; padding: 16px 0; }
        .ln-thumb { flex: none; width: 100%; height: 180px; }
    }
    @media (prefers-reduced-motion: reduce) {
        .ln-link, .ln-thumb img, .ln-title, .ln-arrow, .ln-btn { transition: none; }
        .ln-link:hover .ln-thumb img, .ln-link:hover .ln-arrow { transform: none; }
    }

/* /projects page: 2 cards per row on medium screens (A22, 2026-11-12) */
@media (min-width: 600px) and (max-width: 899px) { .ua-act-grid--page { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* Social cards: smaller text when five cards share one row */
@media (min-width: 1280px) { .ua-follow > a h2, .ua-follow > a span { font-size: 1.25rem; } .ua-follow > a h2.mr-4 { margin-right: .6rem; } }
/* Cards and rows without a photo: show the Uwezo logo instead of an empty box (2026-11-12) */
.ua-act-media:not(:has(img)), .ln-thumb:not(:has(img)) { background: #F4F7FA url('/img/logo.png') center / 38% auto no-repeat; }

/* Article pages: back link, date line, main photo (A23, 2026-11-12) */
.ua-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ua-heading, #006991); text-decoration: none; margin-top: 4px; }
.ua-back:hover, .ua-back:focus-visible { text-decoration: underline; }
.ua-article-meta { font-size: 15px; color: #5F6B74; padding-bottom: 12px; }
.ua-article-photo { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 12px; margin: 0 0 24px; }

/* Contact page map (A26, 2026-11-12) */
.ua-map { position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 280px; border-radius: 12px; overflow: hidden; border: 1px solid #E1E8EE; background: #F4F7FA; }
.ua-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .ua-map { aspect-ratio: 4 / 3; } }

/* Vision / Mission card colours from Site settings (2026-11-12) */
.ua-vm.bg-red-400 { background-color: var(--ua-vision, #f87171); }
.ua-vm.bg-\[\#539CC0\] { background-color: var(--ua-mission, #539cc0); }
