/* =========================================================================
   Lawra Municipal Assembly — base stylesheet
   Palette + type from docs/LMA_Brand_Identity_Brief.md §5–6.
   Fonts are self-hosted (no CDN). Drop font files into /assets/fonts/
   as described in /assets/fonts/README.md; robust fallbacks are used meanwhile.
   ========================================================================= */

/* ---- Self-hosted webfonts ------------------------------------------------ */
@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/libre-franklin-700.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Franklin';
    src: url('../fonts/libre-franklin-800.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: 'Source Sans 3';
    src: url('../fonts/source-sans-3-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Source Sans 3';
    src: url('../fonts/source-sans-3-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

/* ---- Design tokens ----------------------------------------------------- */
:root {
    /* Brand palette (sampled from the seal) */
    --maroon:      #7A1204;
    --green:       #0B5A22;
    --gold:        #C98A00;
    --ink:         #2A1608;
    --bg:          #FBF8F2;
    --border:      #E4DACB;

    --maroon-dark: #5c0d03;
    --green-dark:  #083f18;
    --white:       #ffffff;
    --muted-text:  #5b4a3a;

    --font-head: 'Libre Franklin', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-body: 'Source Sans 3', 'Segoe UI', Tahoma, Arial, sans-serif;

    --maxw: 1120px;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(42, 22, 8, .12), 0 4px 16px rgba(42, 22, 8, .06);
}

/* ---- Reset-ish -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }

/* Links: no underline by default site-wide. Genuine inline text links inside body
   prose opt back in below; navigation, buttons and whole-card links stay clean. */
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-dark); }

.site-main p a,
.post-body a,
.prose a {
    text-decoration: underline;
    text-underline-offset: .14em;
    text-decoration-thickness: from-font;
}
.site-main p a.btn,
.post-body a.btn { text-decoration: none; }

/* Rich-text alignment utilities — the only classes sanitize_post_html() lets through
   (see Attr.AllowedClasses in functions.php). Matches assets/css/tinymce-content.css,
   which loads the same rules inside the TinyMCE editing iframe. */
.post-body .align-left { float: left; margin: 0 1.25rem 1rem 0; }
.post-body .align-center { display: block; margin-left: auto; margin-right: auto; }
.post-body .align-right { float: right; margin: 0 0 1rem 1.25rem; }
.post-body video { max-width: 100%; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 800;
    line-height: 1.2;
    color: var(--maroon);
    margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin: 0 0 1rem; }

/* ---- Layout helpers ------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.site-main { display: block; padding: 2.5rem 0 3.5rem; }
#main { scroll-margin-top: 96px; }  /* clear the sticky header when jumping to an anchor */
/* A page that opens with a full-bleed hero sits flush under the nav (no gap band).
   Explicit class (set in header.php) plus a :has() fallback for other hero pages. */
.site-main--flush,
.site-main:has(> .hero:first-child) { padding-top: 0; }
.section { padding: 2.5rem 0; }
.section--tint { background: var(--white); border-block: 1px solid var(--border); }
.grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
/* Leadership preview — currently just MCE + MCD (see leadership() in functions.php).
   Fixed-width, auto-fit columns (rather than --4's equal 1fr tracks) mean the row
   only ever grows as wide as its cards, so justify-content can center it instead of
   the cards hugging the left edge with the unused tracks visible as dead space. */
.leadership-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); justify-content: center; }

.sr-only, .skip-link {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed; top: .5rem; left: .5rem; width: auto; height: auto;
    clip: auto; padding: .6rem 1rem; background: var(--maroon); color: #fff;
    border-radius: var(--radius); z-index: 1000;
}

/* ---- Scroll-reveal entrance animation --------------------------------
   Subtle fade-in-up as a section/card scrolls into view (main.js). Cards in a
   .reveal-stagger container reveal with a slight delay between each. The
   noscript.css link (in header.php) forces everything visible with JS off. */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-stagger .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger .reveal:nth-child(2) { transition-delay: .09s; }
.reveal-stagger .reveal:nth-child(3) { transition-delay: .18s; }
.reveal-stagger .reveal:nth-child(4) { transition-delay: .27s; }
.reveal-stagger .reveal:nth-child(5) { transition-delay: .36s; }
.reveal-stagger .reveal:nth-child(6) { transition-delay: .45s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { transition: none; opacity: 1; transform: none; }
}

/* ---- Header / nav --------------------------------------------------- */
/* Single-row bar: brand left, nav right. Sticks to the top of the viewport. */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--maroon);
    color: #fff;
    border-bottom: 4px solid var(--gold);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; padding-block: .6rem; flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand__seal { border-radius: 50%; background: #fff; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-family: var(--font-head); font-size: 1rem; }
.brand__text small { color: var(--gold); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }

.primary-nav ul { list-style: none; display: flex; flex-wrap: nowrap; gap: .05rem; margin: 0; padding: 0; }
.primary-nav a {
    display: block; padding: .4rem .45rem; color: #fff; text-decoration: none;
    font-weight: 600; font-size: .8rem; letter-spacing: -.005em; white-space: nowrap; border-radius: var(--radius);
}
.primary-nav a:hover { background: var(--maroon-dark); color: #fff; }
.primary-nav a[aria-current="page"] { background: var(--gold); color: var(--ink); }

.nav-toggle {
    display: none; background: none; border: 0; cursor: pointer;
    padding: .6rem; min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
    content: ""; display: block; width: 24px; height: 2px; background: #fff; position: relative;
}
.nav-toggle__bar::before { position: absolute; top: -7px; }
.nav-toggle__bar::after  { position: absolute; top: 7px; }

/* Below this width the full nav can't share one row with the brand -> hamburger.
   The open menu drops down as an overlay so it never inflates the sticky bar. */
@media (max-width: 1040px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        position: absolute; top: 100%; left: 0; right: 0; display: none;
        background: var(--maroon); border-bottom: 4px solid var(--gold);
        max-height: calc(100vh - 100%); overflow-y: auto;
        box-shadow: 0 12px 20px rgba(42, 22, 8, .25);
    }
    .primary-nav.is-open { display: block; }
    .primary-nav ul { flex-direction: column; gap: 0; }
    .primary-nav li + li { border-top: 1px solid rgba(255, 255, 255, .12); }
    .primary-nav a { padding: .9rem 1.25rem; font-size: .95rem; border-radius: 0; }
}

/* ---- Flash / messages --------------------------------------------- */
.flash {
    width: min(var(--maxw), calc(100% - 2.5rem));
    margin: 0 auto 1.5rem; padding: .8rem 1.1rem;
    border-radius: var(--radius); border-left: 4px solid; font-weight: 600;
}
.flash--success { background: #eef6f0; border-color: var(--green); color: var(--green-dark); }
.flash--error   { background: #fbeeec; border-color: var(--maroon); color: var(--maroon-dark); }

/* ---- Buttons ----------------------------------------------------- */
.btn {
    display: inline-block; padding: .65rem 1.25rem; border-radius: var(--radius);
    background: var(--maroon); color: #fff; text-decoration: none; border: 1px solid var(--maroon);
    font-family: var(--font-head); font-weight: 700; font-size: .95rem; cursor: pointer;
}
.btn:hover { background: var(--maroon-dark); color: #fff; }
.btn--green { background: var(--green); border-color: var(--green); }
.btn--green:hover { background: var(--green-dark); }
.btn--ghost { background: transparent; color: var(--maroon); }
.btn--ghost:hover { background: var(--maroon); color: #fff; }
.btn--sm { padding: .35rem .75rem; font-size: .85rem; }
/* Distinct from --ghost (deactivate) — a harder red for the secondary, less-reversible delete action */
.btn--danger { background: #fff; color: #b3261e; border-color: #b3261e; }
.btn--danger:hover { background: #b3261e; color: #fff; }

/* ---- Hero + rotating photo carousel --------------------------- */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    /* Shown if no carousel photos are present yet — a subtle radial keeps it
       from reading as a flat block. */
    background: radial-gradient(120% 120% at 25% 15%, var(--maroon) 0%, var(--maroon-dark) 70%);
    color: #fff; padding: 4.5rem 0;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1.2s ease-in-out;
}
.hero__slide.is-active { opacity: 1; }
/* Slide photos live in assets/images/hero/ (see that folder's README). A missing
   file just leaves its slide transparent, so the maroon hero still looks right. */
.hero__slide--1 { background-image: url('../images/hero/assembly-hall.jpg'); }
.hero__slide--2 { background-image: url('../images/hero/office-block.jpg'); }
.hero__overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(rgba(42, 22, 8, .60), rgba(122, 18, 4, .82));
}
.hero > .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero p { font-size: 1.15rem; max-width: 55ch; color: #f5ece0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero__actions .btn { margin: 0; }
.hero .btn--ghost { color: #fff; border-color: #fff; }
.hero .btn--ghost:hover { background: #fff; color: var(--maroon); }
@media (prefers-reduced-motion: reduce) {
    .hero__slide { transition: none; }
}

.section-cta { margin-top: 2rem; margin-bottom: 0; }
.vmm-band .section-cta { text-align: center; }

/* ---- Quick-stat strip ----------------------------------------- */
.stat-strip { background: var(--green); color: #fff; }
.stat-strip .grid { padding: 1.75rem 0; }
.stat { text-align: center; }
.stat__value { font-family: var(--font-head); font-weight: 800; font-size: 2rem; display: block; }
.stat__label { font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; color: #d7e8dc; }

/* ---- Vision / Mission / Motto band -------------------------- */
.vmm-band { background: var(--white); border-block: 1px solid var(--border); }
.vmm-band__grid { display: grid; gap: 2rem; }
@media (min-width: 780px) { .vmm-band__grid { grid-template-columns: repeat(3, 1fr); } }
.vmm-band__item { text-align: center; }
.vmm-band__icon {
    width: 48px; height: 48px; margin: 0 auto .9rem; color: var(--maroon);
    display: flex; align-items: center; justify-content: center;
}
.vmm-band__icon svg { width: 100%; height: 100%; }
.vmm-band__item h3 { color: var(--maroon); }
.vmm-band__item p:not(.vmm-band__motto) { color: var(--muted-text); }
.vmm-band__motto {
    font-family: var(--font-head); font-weight: 800; font-size: 1.35rem;
    color: var(--gold); text-transform: uppercase; letter-spacing: .04em;
}

/* ---- Leadership (homepage preview + Management page) --------- */
.leadership-card { text-align: center; }
.leadership-card .avatar-photo,
.leadership-card .avatar { width: 96px; height: 96px; margin: 0 auto .9rem; }
.name-badge {
    display: inline-block; background: var(--maroon); color: #fff;
    font-family: var(--font-head); font-weight: 700; font-size: .95rem;
    padding: .3rem .9rem; border-radius: 999px; margin-bottom: .35rem;
}
.leadership-card .card__meta { margin-bottom: 0; }

/* ---- Cards --------------------------------------------------- */
.card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem; box-shadow: var(--shadow); height: 100%;
}
.card h3 { margin-top: 0; }
.card__meta { font-size: .85rem; color: var(--muted-text); margin-bottom: .5rem; }
/* Whole-card links: hover feedback in place of an underline */
a.card { color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--maroon); box-shadow: 0 4px 14px rgba(42, 22, 8, .16); transform: translateY(-2px); }
a.card h3 { color: var(--maroon); }
.card__cta { display: inline-block; margin-top: .4rem; font-weight: 700; color: var(--maroon); }
a.card:hover .card__cta { text-decoration: underline; }
.card--dept { border-top: 4px solid var(--border); }
.card--dept.tone-maroon { border-top-color: var(--maroon); }
.card--dept.tone-green  { border-top-color: var(--green); }

.dept-icon { width: 44px; height: 44px; margin-bottom: .6rem; }

/* ---- Avatars (photo, or colored initials when there is none) -- */
.avatar-photo { border-radius: 50%; object-fit: cover; width: 64px; height: 64px; }
.avatar {
    border-radius: 50%; width: 64px; height: 64px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    font-family: var(--font-head); font-weight: 700; color: #fff;
}
.avatar span { font-size: 1.1rem; line-height: 1; }
.avatar--tone-0 { background: var(--maroon); }
.avatar--tone-1 { background: var(--green); }
.avatar--tone-2 { background: #8a5a00; }
.avatar--sm, .avatar--sm.avatar-photo { width: 36px; height: 36px; }
.avatar--sm span { font-size: .8rem; }
.upload-preview { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.upload-preview__remove { font-size: .85rem; font-weight: 400; display: flex; align-items: center; gap: .35rem; }

/* ---- Tables (documents, admin) ------------------------------ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--white); }
table.data th, table.data td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
table.data th { font-family: var(--font-head); background: var(--bg); }
table.data tr:last-child td { border-bottom: 0; }

/* ---- Breadcrumb + page head -------------------------------- */
.page-head { border-bottom: 1px solid var(--border); margin-bottom: 2rem; padding-bottom: 1rem; }
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem .5rem; padding: 0; margin: 0 0 .75rem; font-size: .85rem; color: var(--muted-text); }
.breadcrumb a { color: var(--muted-text); }

/* ---- Filters --------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter-bar a {
    padding: .55rem 1rem; border: 1px solid var(--border); border-radius: 999px;
    text-decoration: none; color: var(--ink); background: var(--white); font-size: .9rem;
    line-height: 1.3;
}
.filter-bar a[aria-current="true"] { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* Year/Month filter (documents.php) — combines with the category filter-bar above */
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.filter-form .form-field { margin-bottom: 0; }
.filter-form select { width: auto; min-width: 140px; }

/* ---- Forms --------------------------------------------- */
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=password],
.form-field input[type=file],
.form-field select,
.form-field textarea {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--border);
    border-radius: var(--radius); font: inherit; background: var(--white); color: var(--ink);
}
.form-field textarea { min-height: 8rem; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: 2px solid var(--gold); outline-offset: 1px;
}
/* Honeypot — off-screen, never shown to real users */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Current-image preview above a file input (admin cover-image fields) */
.cover-preview { max-width: 220px; border-radius: var(--radius); margin-bottom: .5rem; display: block; }

/* Featured-image thumbnail on a News/Projects card — cropped for a uniform grid */
.card__cover { border-radius: var(--radius); margin-bottom: .8rem; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }

/* ---- Footer ------------------------------------------- */
.site-footer { background: var(--green-dark); color: #e9efe9; margin-top: 3rem; }
.site-footer__inner { display: grid; gap: 2rem; padding-block: 2.5rem; }
@media (min-width: 720px) { .site-footer__inner { grid-template-columns: repeat(3, 1fr); } }
.site-footer h2 { color: #fff; font-size: 1.05rem; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-line { display: flex; align-items: flex-start; gap: .55rem; }
.footer-line + .footer-line { margin-top: .5rem; }
.footer-line__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: .15rem; color: var(--gold); }
.footer-line__icon svg { width: 100%; height: 100%; }
.site-footer__bar { background: rgba(0,0,0,.25); font-size: .85rem; }
.site-footer__bar .container {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .35rem 1.25rem; padding-block: .9rem;
}
.site-footer__bar p { margin: 0; }
.site-footer__colophon { display: flex; align-items: baseline; gap: 1.25rem; margin-left: auto; }
.site-footer__credit { color: rgba(255, 255, 255, .5); font-size: .78rem; }
.site-footer__credit a { color: rgba(255, 255, 255, .7); }
.site-footer__credit a:hover { color: #fff; }

/* ---- Admin shell ------------------------------------- */
.admin-body { background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
    background: var(--maroon); color: #fff; border-bottom: 3px solid var(--gold);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .25rem .75rem; padding: .75rem 1.25rem;
}
.admin-topbar a { color: #fff; }
.admin-layout { flex: 1; display: grid; grid-template-columns: 220px 1fr; }
@media (max-width: 780px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--white); border-right: 1px solid var(--border); padding: 1.25rem 0; }
.admin-sidebar a {
    display: block; padding: .6rem 1.25rem; text-decoration: none; color: var(--ink); font-weight: 600;
}
.admin-sidebar a:hover { background: var(--bg); }
.admin-sidebar a[aria-current="page"] { border-left: 4px solid var(--maroon); background: var(--bg); color: var(--maroon); }
.admin-content { padding: 1.75rem; }
.admin-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.admin-login-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 380px; }
.login-back { margin-top: 1.5rem; }

.stat-tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 2rem; }
.stat-tile { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.stat-tile__value { font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--maroon); }
.stat-tile__label { color: var(--muted-text); font-size: .9rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.inline-form { display: inline; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge--draft { background: var(--border); color: var(--ink); }
.badge--published { background: #eef6f0; color: var(--green-dark); }
.badge--active { background: #eef6f0; color: var(--green-dark); }
.badge--inactive { background: var(--border); color: var(--ink); }
.badge--unread { background: #fbeee0; color: #8a5a00; }
.badge--read { background: var(--border); color: var(--ink); }
.badge--phase { text-transform: uppercase; letter-spacing: .03em; }
.badge--ongoing   { background: #eef6f0; color: var(--green-dark); }
.badge--completed { background: var(--border); color: var(--ink); }
.badge--planned   { background: #fbeee0; color: #8a5a00; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.utility-list { columns: 2; gap: 2rem; }
@media (max-width: 560px) { .utility-list { columns: 1; } }

/* ---- "Content coming soon" empty state ---------------------- */
.coming-soon {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.coming-soon__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--maroon);
    margin: 0 0 .5rem;
}
.coming-soon p { margin: 0 auto; max-width: 48ch; color: var(--muted-text); }

.profile-note { color: var(--muted-text); font-style: italic; }

/* ---- Standalone error page (500.php) ----------------------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; margin: 0; }
.error-page__box { text-align: center; max-width: 30rem; }

/* ---- Media gallery lightbox (media/index.php, main.js) ------- */
.lightbox-trigger {
    display: block; width: 100%; padding: 0; margin: 0 0 .6rem; border: 0;
    background: none; cursor: zoom-in; font: inherit;
}
.lightbox-trigger img { border-radius: var(--radius); transition: opacity .15s ease; }
.lightbox-trigger:hover img, .lightbox-trigger:focus-visible img { opacity: .85; }
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(20, 10, 4, .92);
    display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem;
}
.lightbox[hidden] { display: none; }
.lightbox__content { margin: 0; max-width: min(90vw, 1100px); max-height: 90vh; text-align: center; }
.lightbox__img { max-width: 100%; max-height: 80vh; width: auto; margin: 0 auto; border-radius: var(--radius); }
.lightbox__caption { color: #f5ece0; margin-top: .75rem; font-size: .95rem; }
.lightbox__close {
    position: fixed; top: 1rem; right: 1.25rem; z-index: 2001;
    width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1;
    cursor: pointer;
}
.lightbox__close:hover, .lightbox__close:focus-visible { background: rgba(255, 255, 255, .25); }

/* Post/Project photo gallery (news/article.php, projects/detail.php) — thumbnails
   reuse the same .lightbox-trigger/#lightbox pattern as the Media Gallery, so
   main.js's lightbox code (page-agnostic) opens them with no extra wiring. */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1.5rem 0; }
.gallery-grid .lightbox-trigger {
    position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius);
}
.gallery-grid .lightbox-trigger img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.gallery-grid__more {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(20, 10, 4, .6); color: #fff; font-size: 1.6rem; font-weight: 700;
    font-family: var(--font-head);
}
@media (max-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
