@import url("styles-20260815a.css");

:root {
    --c-paper: #fbfaf6;
    --c-paper-deep: #f2eee5;
    --c-ink: #142532;
    --c-ink-soft: #405563;
    --c-ink-muted: #71818a;
    --c-line: #d8e1e4;
    --c-line-strong: #b4c6cc;
    --c-navy: #024679;
    --c-navy-deep: #012f50;
    --c-navy-soft: #1a5a8c;
    --c-cyan: #4dc2ec;
    --c-cyan-bright: #00b9df;
    --c-cyan-soft: #b9e7f5;
    --c-bg: var(--c-paper);
    --c-surface: #fffefb;
    --c-surface-2: #f4f7f6;
    --c-surface-3: #e8f0f0;
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(1,47,80,.05), 0 8px 24px -18px rgba(1,47,80,.22);
    --shadow-md: 0 10px 32px -20px rgba(1,47,80,.28);
    --shadow-lg: 0 22px 60px -26px rgba(1,47,80,.32);
    --shadow-nav: 0 7px 26px -18px rgba(1,47,80,.35);
    --maxw: 78rem;
    --nav-h: 72px;
    --dur-fast: 160ms;
    --dur-mid: 260ms;
}

html { background: var(--c-paper); }
body { color: var(--c-ink); background: var(--c-paper); line-height: 1.75; text-wrap: pretty; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .24; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M0 89.5h90M89.5 0v90' stroke='%23024679' stroke-opacity='.035'/%3E%3C/svg%3E"); z-index: -1; }
h1, h2, h3, h4 { color: var(--c-navy-deep); letter-spacing: -.025em; }
::selection { background: var(--c-cyan-soft); color: var(--c-navy-deep); }
.container { max-width: var(--maxw); padding-inline: clamp(1rem, 3vw, 2.5rem); }
.page-stack { gap: clamp(2.75rem, 6vw, 5rem); padding-block: clamp(1.5rem, 4vw, 3.5rem) 5rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; color: var(--c-navy); font-size: .68rem; letter-spacing: .12em; line-height: 1; }
.eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: var(--c-cyan); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.35rem); }
.rule { background: var(--c-line); }

.header-wrap { padding: .75rem clamp(.75rem, 2.5vw, 2rem); }
.header-shell { max-width: var(--maxw); background: rgba(255,254,251,.94); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-nav); backdrop-filter: blur(12px); }
.header-inner { min-height: var(--nav-h); padding-inline: clamp(.85rem, 2vw, 1.4rem); gap: 1.25rem; }
.brand { gap: .75rem; }
.brand-mark { width: 44px; height: 44px; }
.brand-text { gap: .25rem; }
.brand-title { color: var(--c-navy-deep); font-size: .9rem; letter-spacing: -.02em; }
.brand-sub { display: block; color: var(--c-ink-muted); }
.nav-rail { gap: .1rem; }
.nav-link { position: relative; padding: .55rem .75rem; border-radius: 0; color: var(--c-ink-soft); font-size: .82rem; }
.nav-link::after { content: ""; position: absolute; inset-inline: .75rem; inset-block-end: .15rem; height: 2px; background: var(--c-cyan); transform: scaleX(0); transform-origin: center; transition: transform var(--dur-fast); }
.nav-link:hover { background: transparent; color: var(--c-navy); }
.nav-link:hover::after, .nav-link-active::after { transform: scaleX(1); }
.nav-link-active, .nav-link-active:hover { background: transparent; color: var(--c-navy-deep); }
.header-chip { min-height: 36px; border-radius: 999px; border-color: var(--c-line-strong); background: transparent; font-size: .76rem; }
.header-chip:hover { background: var(--c-surface-2); }
.icon-btn { border-radius: 999px; }

.main-shell { position: relative; }
.footer-shell { margin-top: 1rem; background: var(--c-navy-deep); border-top: 0; color: #e8f4f7; }
.footer-inner { padding-block: 3.5rem 2.25rem; }
.footer-brand .brand-title, .footer-shell .brand-title { color: #fff; }
.footer-rights { color: #b9d4dc; }
.footer-links a { color: #d0e4e8; border-radius: var(--r-sm); }
.footer-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.footer-bottom { border-color: rgba(255,255,255,.14); color: #9bb9c3; }

.hero-grid { gap: 1.25rem; }
@media (min-width: 900px) {
    .hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .8fr); align-items: stretch; }
    [dir="rtl"] .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(18rem, .8fr); }
}
.hero-main { min-height: 410px; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--r-lg); border: 1px solid var(--c-navy-deep); background: var(--c-navy-deep); isolation: isolate; }
.hero-main::before { content: ""; position: absolute; inset: 1rem; border: 1px solid rgba(185,231,245,.22); border-radius: calc(var(--r-lg) - 5px); pointer-events: none; }
.hero-main::after { content: ""; position: absolute; inset-inline-end: -2rem; inset-block-start: -3rem; width: 16rem; height: 16rem; border: 1px solid rgba(77,194,236,.42); border-radius: 48% 52% 54% 46%; transform: rotate(25deg); pointer-events: none; }
.hero-main h1 { max-width: none; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.05; color: #fff; }
@media (min-width: 900px) { .hero-main h1 { max-width: 13ch; } }
.hero-main p { max-width: 38rem; margin-top: 1.35rem; color: #d6edf2; font-size: clamp(.95rem, 1.5vw, 1.1rem); }
.hero-main .btn-row { margin-top: 2rem; }
.hero-main .btn-secondary { background: transparent; border-color: rgba(185,231,245,.5); color: #fff; }
.hero-main .btn-secondary:hover { background: rgba(255,255,255,.1); }
.hero-side { display: flex; justify-content: space-between; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); box-shadow: none; }
.hero-side h2 { max-width: 15ch; font-size: clamp(1.3rem, 2.4vw, 2rem); }
.hero-side .quick-links { border-top: 1px solid var(--c-line); padding-top: .8rem; }
.hero-side .quick-link { border-bottom: 1px solid var(--c-line); border-radius: 0; padding: .8rem 0; color: var(--c-navy); }
.hero-side .quick-link:hover { background: transparent; color: var(--c-cyan-bright); padding-inline: .25rem; }
.hero-side .arrow { color: var(--c-cyan-bright); }

.panel, .panel-ink, .block-item { border-radius: var(--r-lg); box-shadow: none; }
.panel { background: var(--c-surface); border-color: var(--c-line); }
.panel-ink { background: var(--c-navy-deep); }
.split-cta { gap: 1rem; }

.news-grid { gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); }
.news-card { border: 0; border-radius: 0; background: var(--c-surface); box-shadow: none; transition: background var(--dur-mid), transform var(--dur-mid); }
.news-card:hover { background: #f4faf9; transform: translateY(-3px); }
.news-card .cover { border-radius: 0; aspect-ratio: 16 / 10; background: var(--c-navy-deep); }
.news-card .cover img { transition: transform var(--dur-mid); }
.news-card:hover .cover img { transform: scale(1.035); }
.news-card .body { padding: 1.15rem 1.2rem 1.3rem; }
.news-card h3 { font-size: 1.12rem; line-height: 1.45; }
.news-card h3 a:hover { color: var(--c-navy-soft); }
.news-card .meta { color: var(--c-ink-muted); font-size: .72rem; }
.news-card .excerpt { color: var(--c-ink-soft); font-size: .85rem; }
.read-more { color: var(--c-navy); font-weight: 700; font-size: .8rem; }
.read-more:hover { color: var(--c-cyan-bright); }

.newsletter-cta { border-radius: var(--r-lg); background: var(--c-navy); padding: clamp(1.5rem, 4vw, 2.5rem); }
.newsletter-cta h3 { font-size: clamp(1.25rem, 2.5vw, 1.8rem); }
.newsletter-form .input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }

.btn-primary, .btn-secondary, .btn-ghost, .btn-ink { border-radius: var(--r-sm); min-height: 46px; }
.btn-primary { background: var(--c-navy); box-shadow: none; }
.btn-primary:hover { background: var(--c-navy-deep); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--c-surface); border-color: var(--c-line-strong); }
.btn-secondary:hover { background: var(--c-surface-2); }
.btn-ghost { color: var(--c-navy); }
.btn-ghost:hover { background: var(--c-surface-2); }

.input, .select, .textarea { border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-surface); min-height: 46px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-cyan-bright); box-shadow: 0 0 0 3px rgba(77,194,236,.17); }
.field label { color: var(--c-navy-deep); font-size: .82rem; font-weight: 700; }
.field-hint, .text-muted { color: var(--c-ink-muted); }
.alert { border-radius: var(--r-sm); border-inline-start: 3px solid currentColor; }

.article { max-width: 48rem; margin-inline: auto; }
.article > h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.08; }
.article > time { color: var(--c-ink-muted); font-size: .8rem; }
.article .cover { border-radius: var(--r-lg); margin-block: 2rem; }
/* Cover keeps its natural portrait/landscape shape instead of a fixed
   16:8 crop: portrait photos must not be flattened to a strip. */
.article .cover { aspect-ratio: auto; overflow: visible; background: transparent; text-align: center; }
.article .cover img { width: auto; max-width: 100%; max-height: min(70vh, 640px); height: auto; margin-inline: auto; border-radius: var(--r-lg); }
/* Admin: gallery picker grid on the news form */
.gallery-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; max-height: 21rem; overflow-y: auto; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: .6rem; }
.gallery-pick { display: flex; flex-direction: column; gap: .35rem; padding: .5rem; border: 1px solid var(--c-line); border-radius: var(--r-sm); background: var(--c-surface); cursor: pointer; font-weight: 400; }
.gallery-pick:hover { border-color: var(--c-line-strong); }
.gallery-pick:has(input:checked) { border-color: var(--c-cyan); box-shadow: 0 0 0 2px rgba(77,194,236,.25); }
.gallery-pick input { margin: 0; }
.gallery-pick img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-sm); background: var(--c-surface-2); }
.gallery-pick span { font-size: .72rem; color: var(--c-ink-muted); line-height: 1.5; }
.article .body { font-size: 1.05rem; line-height: 2; }
.article .body p, .article .body h2, .article .body h3 { margin-block: 1.4rem; }
.article .body h2 { font-size: 1.55rem; border-block-start: 1px solid var(--c-line); padding-top: 1rem; }
.article-meta { color: var(--c-ink-muted); border-block: 1px solid var(--c-line); padding-block: .75rem; }

/* Article photo gallery — respects portrait vs landscape */
.article-gallery { margin-block-start: 2.5rem; }
.article-gallery h2 { font-size: 1.35rem; margin-block-end: 1rem; }
.gallery-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-grid figure { margin: 0; background: var(--c-surface-2); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.gallery-grid a { display: block; }
.gallery-grid img { width: 100%; height: auto; display: block; }
.gallery-grid figcaption { padding: .5rem .75rem; font-size: .78rem; color: var(--c-ink-muted); line-height: 1.6; }

.pagination a, .pagination .current { border-radius: var(--r-sm); }
.pagination .current { background: var(--c-navy); }
.search-box { max-width: 30rem; }

.donation-bank-modal { background: rgba(1,47,80,.58); backdrop-filter: blur(4px); }
.donation-bank-dialog { border-radius: var(--r-lg); border-color: var(--c-line-strong); }
.donation-bank-head h2 { color: var(--c-navy-deep); }
.donation-bank-item { border-radius: var(--r-sm); background: var(--c-surface-2); }

.admin-shell { background: var(--c-paper); }
.admin-sidebar { background: var(--c-navy-deep); border-inline-end: 0; }
.admin-brand, .admin-nav-link { color: #d8eef2; }
.admin-nav-link { border-radius: var(--r-sm); }
.admin-nav-link:hover, .admin-nav-link.active { background: rgba(77,194,236,.16); color: #fff; }
.admin-main { background: var(--c-paper); }
.admin-head { border-bottom: 1px solid var(--c-line); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.admin-cards { gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); }
.stat-card { border: 0; border-radius: 0; background: var(--c-surface); box-shadow: none; }
.stat-card .num { color: var(--c-navy); }
.table-wrap { border: 1px solid var(--c-line); border-radius: var(--r-sm); background: var(--c-surface); }
.data-table th { background: var(--c-surface-2); color: var(--c-navy-deep); }
.data-table td, .data-table th { border-color: var(--c-line); }
.badge { border-radius: 999px; }

@media (max-width: 767px) {
    .header-inner { min-height: 60px; }
    .brand-title { font-size: .82rem; }
    .hero-main { min-height: 360px; }
    .hero-main h1 { font-size: clamp(2rem, 11vw, 3rem); }
    .hero-side { min-height: 300px; }
    .news-grid { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .article .body { font-size: .98rem; }
}

@media (prefers-reduced-motion: reduce) {
    .news-card, .news-card .cover img, .nav-link::after { transition: none; }
}
/* History cards: one clean card, aligned circular marker, flush text */
.site-frame .block-item { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.site-frame .block-item > .article-meta { display: flex; align-items: center; justify-content: flex-start; min-block-size: 2rem; margin: 0 0 1rem; padding: 0; border: 0; font-size: .82rem; line-height: 1; }
.site-frame .block-item > .article-meta .tag { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2rem; inline-size: 2rem; block-size: 2rem; padding: 0; border: 0; border-radius: 50%; background: var(--c-cyan); color: var(--c-navy-deep); font-size: .78rem; font-weight: 800; line-height: 1; }
.site-frame .block-item h3 { margin: 0 0 .65rem; line-height: 1.45; text-align: start; }
.site-frame .block-item p { margin: 0; line-height: 1.9; text-align: start; }
@media (max-width: 767px) {
    .site-frame .block-item { padding: 1.15rem; }
    .site-frame .block-item > .article-meta { margin-block-end: .85rem; }
}

.site-frame .timeline { list-style: none; }
.site-frame .timeline::before { top: .875rem; bottom: 1.5rem; }
.site-frame .timeline-item { padding-block: 1.5rem 2rem; }
.site-frame .timeline-item::before { inset-inline-start: -1.41rem; top: .5rem; box-shadow: 0 0 0 1px rgba(77,194,236,.35); }
.site-frame .timeline-item .year { display: none; }
.site-frame .timeline-item .tnum { display: block; margin-block-end: .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .05em; color: var(--c-navy); }
.site-frame .timeline-item h3 { margin: 0 0 .5rem; line-height: 1.45; }
.site-frame .timeline-item p { margin: 0; line-height: 1.9; }

/* ---- Missing .lg-grid utility: desktop two-column layout ---- */
.lg-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) {
    .lg-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Admin mobile: sticky top bar + off-canvas drawer ---- */
.admin-topbar { display: none; }
.admin-drawer-close { display: none; }
.admin-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(1, 20, 33, .55);
    border: 0; padding: 0;
}

@media (max-width: 991px) {
    /* Sticky top bar replaces the desktop sidebar column */
    .admin-topbar {
        display: flex; align-items: center; gap: .6rem;
        position: sticky; top: 0; z-index: 100;
        min-height: 56px; padding: .5rem .75rem;
        background: var(--c-navy-deep); color: #fff;
        box-shadow: var(--shadow-nav);
    }
    .admin-topbar-brand {
        display: flex; align-items: center; gap: .6rem;
        color: #fff; text-decoration: none; margin-inline-end: auto;
    }
    .admin-topbar-brand .brand-chip { width: 28px; height: 28px; border-radius: 8px; }
    .admin-topbar-brand .brand-chip img { width: 20px; height: 20px; }
    .admin-topbar-brand .brand-title { color: #fff; font-size: .95rem; }
    .admin-topbar-logout {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; flex-shrink: 0;
        border-radius: var(--r-sm); color: rgba(255,255,255,.85);
        background: rgba(77,194,236,.14);
    }
    .admin-menu-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; flex-shrink: 0;
        border: 0; border-radius: var(--r-sm); cursor: pointer;
        background: rgba(77,194,236,.14); color: #fff;
    }
    .admin-menu-toggle:hover, .admin-topbar-logout:hover { background: rgba(77,194,236,.28); }

    /* Off-canvas drawer: slides over a backdrop instead of pushing content.
       visibility:hidden while closed keeps the off-screen fixed panel from
       creating horizontal scroll overflow and keeps it out of tab order. */
    .admin-shell { display: block; }
    .admin-sidebar {
        position: fixed; inset-block: 0; inset-inline-start: 0;
        z-index: 110; width: min(82vw, 300px);
        max-height: none; overflow-y: auto; overscroll-behavior: contain;
        padding: 1rem .9rem 1.5rem;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform var(--dur-mid) ease, visibility 0s linear var(--dur-mid);
        box-shadow: var(--shadow-lg);
    }
    [dir="rtl"] .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.open, [dir="rtl"] .admin-sidebar.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform var(--dur-mid) ease, visibility 0s;
    }
    .admin-sidebar .brand { margin-bottom: 1rem; }
    .admin-drawer-close {
        display: inline-flex; align-items: center; justify-content: center;
        position: absolute; top: .55rem; inset-inline-end: .55rem;
        width: 40px; height: 40px; border: 0; border-radius: var(--r-sm);
        background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
    }
    .admin-drawer-close:hover { background: rgba(255,255,255,.22); }
    body.admin-drawer-open { overflow: hidden; }

    /* Content density on small screens */
    .admin-main { padding: 1rem; }
    /* 1fr grid tracks refuse to shrink below the 600px min-width of
       .data-table, pushing the whole page 240px off-screen in RTL. Allow
       tracks and children to shrink; tables scroll inside .table-wrap. */
    .admin-main > * { min-width: 0; }
    .admin-main [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    .admin-main .table-wrap { max-width: 100%; }
    .admin-head h1 { font-size: 1.2rem; }
    .admin-cards { gap: .6rem; }
    .stat-card { padding: .8rem .9rem; }
    .admin-main form div[style*="display:flex"] { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .admin-sidebar { transition: none; }
}
