/* ==========================================================================
   Govigama.org — design system
   --------------------------------------------------------------------------
   Single stylesheet. The previous site defined good custom properties and
   then ignored them, hardcoding ~35 inline style attributes across the
   router and header. Nothing here is applied inline.

   Contents
     1. Tokens
     2. Reset & base
     3. Typography
     4. Layout
     5. Header & navigation
     6. Hero
     7. Components
     8. Prose (database-authored content)
     9. Forms
    10. Footer
    11. Utilities
    12. Motion & print
   ========================================================================== */

/* 1. Tokens ============================================================== */

:root {
    /* Bottle-green ramp — the community's traditional colour, per the
       convention documented in Pieris' "The Community" and confirmed by
       Anuru de Silva: dark green ground, gold lettering. Extended into a
       ramp so components stop inventing one-off rgba() values. */
    --green-900: #0C2A1E;
    --green-800: #113828;
    --green-700: #1A5638;   /* brand anchor */
    --green-600: #216844;
    --green-500: #2E7E54;
    --green-400: #559972;
    --green-200: #BFDCCB;
    --green-050: #ECF4EF;

    /* Gold ramp. --gold-800 exists purely so gold *text* clears WCAG AA on
       parchment; --gold-700 only reaches 4.13:1 there. */
    --gold-800: #7A5D15;
    --gold-700: #8A6D1F;
    --gold-600: #B08E2A;
    --gold-500: #D4AF37;     /* original --secondary-color */
    --gold-400: #E0C25F;
    --gold-200: #F0E0AE;

    /* Warm neutrals — parchment, not grey */
    --parchment: #F9F6F0;
    --paper:     #FFFFFF;
    --sand-100:  #F1EBE0;
    --sand-200:  #E3D9C8;
    --sand-300:  #C9BCA6;
    --ink-700:   #4A443C;
    --ink-800:   #332F29;
    --ink-900:   #1C1A17;

    /* Semantic surfaces */
    --bg:            var(--parchment);
    --bg-raised:     var(--paper);
    --bg-sunken:     var(--sand-100);
    --bg-inverse:    var(--green-800);
    --border:        var(--sand-200);
    --border-strong: var(--sand-300);

    --text:          var(--ink-800);
    --text-muted:    var(--ink-700);
    --text-inverse:  #F7F1E8;
    --text-on-dark-muted: rgba(247, 241, 232, 0.72);

    --accent:        var(--green-700);
    --accent-hover:  var(--green-600);
    --highlight:     var(--gold-500);
    --highlight-ink: var(--gold-800);   /* gold text on light backgrounds */

    --danger:     #8C2F2F;
    --danger-bg:  #FBEDED;
    --success:    #2C6A45;
    --success-bg: #EAF4EE;

    /* Type */
    --font-display: 'Playfair Display', 'Georgia', serif;
    --font-body:    'Lora', 'Georgia', serif;
    --font-sinhala: 'Noto Serif Sinhala', 'Iskoola Pota', sans-serif;
    --font-ui:      system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Fluid type scale */
    --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
    --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.13rem);
    --step-1:  clamp(1.20rem, 1.13rem + 0.35vw, 1.42rem);
    --step-2:  clamp(1.44rem, 1.32rem + 0.60vw, 1.80rem);
    --step-3:  clamp(1.73rem, 1.53rem + 0.98vw, 2.27rem);
    --step-4:  clamp(2.07rem, 1.76rem + 1.55vw, 2.87rem);
    --step-5:  clamp(2.49rem, 2.01rem + 2.40vw, 3.63rem);

    /* Spacing — 8px base */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.5rem;
    --sp-6:  2rem;
    --sp-7:  3rem;
    --sp-8:  4rem;
    --sp-9:  6rem;

    /* Layout */
    --measure:      68ch;
    --width-page:   1200px;
    --width-narrow: 780px;
    --gutter:       clamp(1rem, 4vw, 2.5rem);

    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(28, 26, 23, 0.06);
    --shadow:    0 2px 8px rgba(28, 26, 23, 0.08);
    --shadow-lg: 0 12px 32px rgba(28, 26, 23, 0.14);

    --ring: 0 0 0 3px var(--gold-200), 0 0 0 5px var(--green-700);

    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 4.5rem;
}

/* Dark mode. The green identity is preserved by tinting the darks toward
   the brand green rather than falling back to neutral grey. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg:            #0F1713;
        --bg-raised:     #16211B;
        --bg-sunken:     #0B110E;
        --bg-inverse:    #0C2A1E;
        --border:        #26332C;
        --border-strong: #39493F;

        --text:         #EDE4D8;
        --text-muted:   #B8AB9B;
        --text-inverse: #F7F1E8;

        --accent:       var(--gold-400);
        --accent-hover: var(--gold-500);
        --highlight:    var(--gold-500);
        --highlight-ink: var(--gold-400);

        --danger:     #E88B8B;
        --danger-bg:  #2E1919;
        --success:    #7FC79E;
        --success-bg: #16261D;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow:    0 2px 8px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
    }
}

:root[data-theme='dark'] {
    --bg:            #0F1713;
    --bg-raised:     #16211B;
    --bg-sunken:     #0B110E;
    --bg-inverse:    #0C2A1E;
    --border:        #26332C;
    --border-strong: #39493F;
    --text:          #EDE4D8;
    --text-muted:    #B8AB9B;
    --accent:        var(--gold-400);
    --accent-hover:  var(--gold-500);
    --highlight-ink: var(--gold-400);
    --danger:     #E88B8B;
    --danger-bg:  #2E1919;
    --success:    #7FC79E;
    --success-bg: #16261D;
}

/* 2. Reset & base ======================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--sp-4));
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* Sinhala gets its own face wherever it appears. The old site injected
   `body, h1..h6, p, a, div { font-family: ... !important }` inline. */
:lang(si),
.lang-si {
    font-family: var(--font-sinhala);
    line-height: 1.85;
}

.lang-si h1, .lang-si h2, .lang-si h3,
.lang-si h4, .lang-si h5, .lang-si h6 {
    font-family: var(--font-sinhala);
    letter-spacing: 0;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--gold-200);
    color: var(--ink-900);
}

.skip-link {
    position: absolute;
    top: 0;
    left: var(--sp-4);
    transform: translateY(-120%);
    z-index: 200;
    padding: var(--sp-3) var(--sp-5);
    background: var(--green-700);
    color: var(--text-inverse);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    border-radius: 0 0 var(--radius) var(--radius);
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
    color: var(--text-inverse);
}

/* 3. Typography ========================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, ul, ol, blockquote, figure, table { text-wrap: pretty; }

.eyebrow {
    display: block;
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--highlight-ink);
    margin-bottom: var(--sp-3);
}

.lang-si .eyebrow { letter-spacing: 0.04em; text-transform: none; }

.lede {
    font-size: var(--step-1);
    line-height: 1.65;
    color: var(--text-muted);
}

/* 4. Layout ============================================================== */

.wrap {
    width: 100%;
    max-width: var(--width-page);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--width-narrow); }

.site-main {
    flex: 1 0 auto;
    display: block;
}

.section {
    padding-block: var(--sp-8);
}

.section--sunken { background: var(--bg-sunken); }
.section--raised { background: var(--bg-raised); }
.section--tight  { padding-block: var(--sp-6); }

.section-head {
    max-width: var(--measure);
    margin-bottom: var(--sp-6);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

/* Gold rule under section headings — the old content did this with an
   inline border-bottom on every h2. */
.section-title {
    position: relative;
    padding-bottom: var(--sp-3);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 3.5rem;
    height: 3px;
    background: var(--highlight);
    border-radius: 2px;
}

.section-head--center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.grid {
    display: grid;
    gap: var(--sp-5);
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }

/* 5. Header & navigation ================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--green-800);
    color: var(--text-inverse);
    box-shadow: var(--shadow);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    min-height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--gold-500);
    text-decoration: none;
    flex-shrink: 0;
}

.brand:hover { color: var(--gold-400); }

.brand svg { width: 2rem; height: 2rem; flex-shrink: 0; }

.brand__name {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

.lang-si .brand__name {
    font-family: var(--font-sinhala);
    letter-spacing: 0;
    text-transform: none;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

/* -- primary menu -- */

.nav { font-family: var(--font-ui); }

.nav__list {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--text-inverse);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.nav__link:hover,
.nav__item:focus-within > .nav__link {
    background: rgba(255, 255, 255, 0.10);
    color: var(--gold-400);
}

.nav__link[aria-current='true'],
.nav__link.is-active {
    color: var(--gold-500);
}

.nav__link.is-active::after,
.nav__link[aria-current='true']::after {
    content: '';
    position: absolute;
    left: var(--sp-3);
    right: var(--sp-3);
    bottom: 0.35rem;
    height: 2px;
    background: var(--gold-500);
    border-radius: 2px;
}

.nav__item {
    position: relative;
}

.nav__item > .nav__link { position: relative; }

.nav__caret {
    width: 0.7em;
    height: 0.7em;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.nav__item:hover .nav__caret,
.nav__item:focus-within .nav__caret { transform: rotate(180deg); }

/* -- dropdown -- */

.nav__sub {
    position: absolute;
    top: 100%;
    /* Anchored to the right edge of its parent, not the left. The menu sits
       in the right half of the header, so a left-anchored dropdown pushes
       past the viewport — and because these are only visibility:hidden, that
       overflow still widens the page even while closed. */
    right: 0;
    left: auto;
    min-width: 17rem;
    max-width: min(22rem, calc(100vw - 2 * var(--gutter)));
    padding: var(--sp-2);
    margin: 0;
    list-style: none;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.nav__item:hover > .nav__sub,
.nav__item:focus-within > .nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav__sub a {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--step--1);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav__sub a:hover,
.nav__sub a:focus-visible {
    background: var(--bg-sunken);
    color: var(--accent);
}

.nav__sub a[aria-current='page'] {
    color: var(--accent);
    font-weight: 600;
}

/* -- search -- */

.search-form {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-pill);
    transition: border-color var(--transition), background var(--transition);
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--gold-500);
}

.search-form input {
    width: 8rem;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--text-inverse);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    padding-block: var(--sp-1);
}

.search-form input::placeholder { color: rgba(247, 241, 232, 0.65); }

.search-form button {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--gold-500);
    cursor: pointer;
    transition: background var(--transition);
}

.search-form button:hover { background: rgba(255, 255, 255, 0.12); }

/* -- language switcher -- */

.lang-switch {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-pill);
    overflow: hidden;
    font-family: var(--font-ui);
}

.lang-switch a {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--text-on-dark-muted);
    text-decoration: none;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}

.lang-switch a:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-inverse); }

.lang-switch a[aria-current='true'] {
    background: var(--gold-500);
    color: var(--green-900);
}

/* -- mobile toggle & drawer -- */

.menu-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-sm);
    color: var(--text-inverse);
    cursor: pointer;
}

.menu-toggle svg { width: 1.25rem; height: 1.25rem; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded='true'] .icon-open  { display: none; }
.menu-toggle[aria-expanded='true'] .icon-close { display: block; }

/* The drawer takes over earlier than it used to: seven top-level items plus
   the search field and language switcher no longer fit at 960px. */
@media (max-width: 1100px) {
    .menu-toggle { display: grid; }

    .nav {
        position: fixed;
        inset: var(--header-height) 0 0 0;
        background: var(--green-800);
        padding: var(--sp-5) var(--gutter) var(--sp-8);
        overflow-y: auto;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform var(--transition), visibility var(--transition);
    }

    .nav.is-open { transform: translateX(0); visibility: visible; }

    .nav__list { flex-direction: column; align-items: stretch; gap: 0; }

    .nav__link {
        padding: var(--sp-4) var(--sp-2);
        font-size: var(--step-0);
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
        border-radius: 0;
        justify-content: space-between;
    }

    .nav__link.is-active::after,
    .nav__link[aria-current='true']::after { display: none; }

    .nav__sub {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.18);
        border: 0;
        border-radius: 0;
        padding: var(--sp-2) var(--sp-2) var(--sp-3);
        display: none;
    }

    .nav__item.is-expanded > .nav__sub { display: block; }
    .nav__item.is-expanded .nav__caret { transform: rotate(180deg); }

    .nav__sub a { color: var(--text-on-dark-muted); padding-left: var(--sp-5); }
    .nav__sub a:hover, .nav__sub a:focus-visible { background: rgba(255,255,255,0.08); color: var(--gold-400); }

    .search-form input { width: 5rem; }
}

@media (max-width: 560px) {
    .search-form { display: none; }
    .brand__name { font-size: var(--step-0); }
}

body.nav-open { overflow: hidden; }

/* 6. Hero ================================================================ */

.hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(78vh, 40rem);
    padding-block: var(--sp-9);
    background: var(--green-800);
    color: var(--text-inverse);
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(17, 56, 40, 0.55) 0%, rgba(12, 42, 30, 0.88) 70%),
        linear-gradient(180deg, rgba(7, 26, 18, 0.35) 0%, rgba(7, 26, 18, 0.75) 100%);
}

.hero__content {
    max-width: 46rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.hero__title {
    font-size: var(--step-5);
    color: var(--text-inverse);
    margin-bottom: var(--sp-4);
}

.hero__subtitle {
    font-size: var(--step-1);
    color: var(--text-on-dark-muted);
    margin-bottom: var(--sp-6);
}

.hero__eyebrow { color: var(--gold-400); }

/* A thin gold rule, like a manuscript border */
.hero__rule {
    width: 5rem;
    height: 2px;
    margin: 0 auto var(--sp-5);
    background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

/* Compact hero for interior pages */
.page-hero {
    background: var(--green-800);
    color: var(--text-inverse);
    padding-block: var(--sp-7);
}

.page-hero h1 { color: var(--text-inverse); }
.page-hero .lede { color: var(--text-on-dark-muted); }
.page-hero .eyebrow { color: var(--gold-400); }

/* 7. Components ========================================================== */

/* -- buttons -- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    background: var(--gold-500);
    color: var(--green-900);
    border: 1px solid var(--gold-500);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.lang-si .btn { letter-spacing: 0; text-transform: none; font-family: var(--font-sinhala); }

.btn:hover {
    background: var(--gold-400);
    border-color: var(--gold-400);
    color: var(--green-900);
    transform: translateY(-1px);
}

.btn--outline {
    background: transparent;
    border-color: currentColor;
    color: var(--gold-500);
}

.btn--outline:hover { background: rgba(212, 175, 55, 0.12); color: var(--gold-400); transform: translateY(-1px); }

.btn--ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--accent);
}

.btn--ghost:hover { background: var(--bg-sunken); border-color: var(--accent); color: var(--accent); }

/* -- link with arrow -- */

.link-more {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent);
}

.lang-si .link-more { letter-spacing: 0; text-transform: none; font-family: var(--font-sinhala); }

.link-more::after {
    content: '→';
    transition: transform var(--transition);
}

.link-more:hover::after { transform: translateX(3px); }

/* -- card -- */

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.card__body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-5);
    flex: 1;
}

.card__title { font-size: var(--step-1); }

.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--accent); }

.card__text { color: var(--text-muted); font-size: var(--step--1); flex: 1; }

.card__meta {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
}

.card__media {
    aspect-ratio: 16 / 10;
    background: var(--bg-sunken);
    object-fit: cover;
    width: 100%;
}

/* Gold accent bar on featured cards */
.card--accent { border-top: 3px solid var(--highlight); }

/* -- person card -- */

.person-card {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.person-card:hover {
    border-color: var(--highlight);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: inherit;
}

.person-card__avatar {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    /* green-800, not 700: gold initials on green-700 sit at 4.11:1,
       under the 4.5:1 AA floor — green is luminance-brighter than the
       maroon this ramp replaced. On green-800 the pair clears 6:1. */
    background: var(--green-800);
    color: var(--gold-500);
    font-family: var(--font-display);
    font-size: var(--step-0);
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
}

.person-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.person-card__name {
    font-family: var(--font-display);
    font-size: var(--step-0);
    font-weight: 700;
    line-height: 1.3;
}

.lang-si .person-card__name { font-family: var(--font-sinhala); }

.person-card__role {
    display: block;
    margin-top: var(--sp-1);
    font-size: var(--step--1);
    color: var(--text-muted);
    line-height: 1.45;
}

/* -- chips / filters -- */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    list-style: none;
    padding: 0;
    margin-bottom: var(--sp-6);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip[aria-current='true'] {
    background: var(--green-700);
    border-color: var(--green-700);
    color: var(--text-inverse);
}

.chip__count {
    font-size: 0.78em;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

/* -- breadcrumbs -- */

.breadcrumbs {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    margin-bottom: var(--sp-5);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    list-style: none;
    padding: 0;
}

.breadcrumbs li { display: flex; align-items: center; gap: var(--sp-2); }

.breadcrumbs li + li::before {
    content: '/';
    color: var(--border-strong);
}

.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs [aria-current='page'] { color: var(--text); font-weight: 600; }

.page-hero .breadcrumbs a { color: var(--text-on-dark-muted); }
.page-hero .breadcrumbs a:hover { color: var(--gold-400); }
.page-hero .breadcrumbs [aria-current='page'] { color: var(--text-inverse); }
.page-hero .breadcrumbs li + li::before { color: rgba(247, 241, 232, 0.4); }

/* -- pager (prev / next) -- */

.pager {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--sp-4);
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
}

.pager__link {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.pager__link:hover { border-color: var(--highlight); box-shadow: var(--shadow); color: inherit; }

.pager__link--next { text-align: right; }

.pager__label {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lang-si .pager__label { letter-spacing: 0; text-transform: none; }

.pager__title {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.35;
}

.lang-si .pager__title { font-family: var(--font-sinhala); }

/* -- pagination -- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-2);
    margin-top: var(--sp-7);
    font-family: var(--font-ui);
}

.pagination a, .pagination span {
    display: grid;
    place-items: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: var(--sp-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: var(--step--1);
    text-decoration: none;
    color: var(--text-muted);
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }

.pagination [aria-current='page'] {
    background: var(--green-700);
    border-color: var(--green-700);
    color: var(--text-inverse);
    font-weight: 700;
}

/* -- timeline (heritage index) -- */

.timeline {
    position: relative;
    list-style: none;
    padding: 0;
    margin-inline-start: var(--sp-2);
}

.timeline::before {
    content: '';
    position: absolute;
    inset-inline-start: 0.45rem;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: linear-gradient(180deg, var(--highlight), var(--border-strong));
}

.timeline__item {
    position: relative;
    padding-inline-start: var(--sp-6);
    padding-block: var(--sp-4);
}

.timeline__item::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 1.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--highlight);
    box-shadow: 0 0 0 3px var(--bg);
}

.timeline__title {
    font-size: var(--step-1);
    margin-bottom: var(--sp-2);
}

.timeline__title a { color: inherit; text-decoration: none; }
.timeline__title a:hover { color: var(--accent); }

.timeline__text { color: var(--text-muted); font-size: var(--step--1); }

/* -- peer grid (sections whose children are equals) --------------------
 *
 * The counterpart to .timeline. The timeline's single vertical rail reads
 * as a descent, which on /communities/ implied a rank the page's own text
 * rejects. These cards sit side by side at identical weight: same border,
 * same padding, same type scale, no numbering, no connecting line and no
 * first or last position that a wide screen makes look privileged.
 */

.peer-grid {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.peer-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-5);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    /* The accent sits on every card, not just the first — the rule is a
       shared marker of the set, not a marker of importance. */
    border-top: 3px solid var(--highlight);
    border-radius: var(--radius);
    transition: border-color var(--transition), transform var(--transition);
}

.peer-card:hover {
    border-color: var(--border-strong);
    border-top-color: var(--highlight);
    transform: translateY(-2px);
}

.peer-card__title {
    font-size: var(--step-1);
}

.peer-card__title a { color: inherit; text-decoration: none; }
.peer-card__title a:hover { color: var(--accent); }

.peer-card__text {
    color: var(--text-muted);
    font-size: var(--step--1);
    line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
    .peer-card, .peer-card:hover { transition: none; transform: none; }
}

/* -- gallery -- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: var(--sp-3);
    list-style: none;
    padding: 0;
}

.gallery-item {
    position: relative;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-sunken);
}

.gallery-item button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 320ms ease;
}

.gallery-item:hover img { transform: scale(1.04); }

.gallery-item figcaption {
    padding: var(--sp-3);
    font-size: var(--step--1);
    color: var(--text-muted);
    background: var(--bg-raised);
}

.gallery-item__credit {
    display: block;
    margin-top: var(--sp-2);
    font-family: var(--font-ui);
    font-size: 0.85em;
    opacity: 0.85;
}

.gallery-item__credit a { color: inherit; text-decoration: underline; }
.gallery-item__credit a:hover { color: var(--accent); }

/* lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: var(--sp-5);
    background: rgba(8, 20, 15, 0.94);
    border: 0;
}

.lightbox::backdrop { background: rgba(8, 20, 15, 0.94); }

.lightbox img {
    max-width: min(92vw, 1100px);
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lightbox__caption {
    margin-top: var(--sp-4);
    max-width: 60ch;
    text-align: center;
    color: var(--text-inverse);
    font-size: var(--step--1);
}

.lightbox__close {
    position: absolute;
    top: var(--sp-4);
    inset-inline-end: var(--sp-4);
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: var(--text-inverse);
    cursor: pointer;
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }

/* -- notice / empty state -- */

.notice {
    padding: var(--sp-4) var(--sp-5);
    border: 1px solid var(--border-strong);
    border-inline-start: 3px solid var(--highlight);
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    font-size: var(--step--1);
    color: var(--text-muted);
}

.notice--error   { border-inline-start-color: var(--danger);  background: var(--danger-bg);  color: var(--danger); }
.notice--success { border-inline-start-color: var(--success); background: var(--success-bg); color: var(--success); }

.empty-state {
    padding: var(--sp-8) var(--sp-5);
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.empty-state h2 { font-size: var(--step-2); margin-bottom: var(--sp-3); }

/* 8. Prose =============================================================== */

/* Content authored in the admin panel. Deliberately scoped so stored HTML
   cannot leak styles into the chrome. */

.prose {
    max-width: var(--measure);
    font-size: var(--step-0);
    line-height: 1.8;
}

.prose > * + * { margin-top: var(--sp-5); }

.prose h2 {
    font-size: var(--step-3);
    margin-top: var(--sp-8);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--highlight);
}

.prose h3 { font-size: var(--step-2); margin-top: var(--sp-7); }
.prose h4 { font-size: var(--step-1); margin-top: var(--sp-6); }

.prose h2:first-child, .prose h3:first-child { margin-top: 0; }

.prose p { color: var(--text); }

.prose a { text-decoration: underline; }

.prose strong { font-weight: 700; color: var(--text); }

.prose em { font-style: italic; }

.prose ul, .prose ol { padding-inline-start: var(--sp-6); }

.prose li + li { margin-top: var(--sp-2); }

.prose li::marker { color: var(--highlight-ink); }

.prose blockquote {
    padding: var(--sp-4) var(--sp-5);
    border-inline-start: 3px solid var(--highlight);
    background: var(--bg-sunken);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

.prose hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--border);
    margin-block: var(--sp-7);
}

.prose img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.prose figure figcaption {
    margin-top: var(--sp-2);
    font-size: var(--step--1);
    color: var(--text-muted);
    text-align: center;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--step--1);
}

.prose th, .prose td {
    padding: var(--sp-3);
    border: 1px solid var(--border);
    text-align: start;
}

.prose th { background: var(--bg-sunken); font-weight: 700; }

/* Tables and wide blocks scroll rather than breaking the page */
.prose .table-scroll { overflow-x: auto; }

/* Neutralise the inline colour/font declarations baked into the stored
   content by the previous site — including var(--text-dark), which was
   never defined and therefore rendered as no colour at all. */
.prose [style] {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    background: none !important;
}

.prose h2[style] {
    color: var(--text) !important;
    border-bottom: 2px solid var(--highlight) !important;
    padding-bottom: var(--sp-3) !important;
}

/* WordPress block classes present in the stored content */
.prose .wp-block-heading { margin-top: var(--sp-7); }
.prose .wp-block-separator { margin-block: var(--sp-7); }

/* 8b. Citations & references ============================================= */

.cite {
    font-family: var(--font-ui);
    font-size: 0.68em;
    font-weight: 700;
    line-height: 0;
    vertical-align: super;
    white-space: nowrap;
}

.cite a {
    padding: 0 0.15em;
    color: var(--highlight-ink);
    text-decoration: none;
    border-radius: 2px;
}

.cite a::before { content: '['; }
.cite a::after  { content: ']'; }

.cite a:hover,
.cite a:focus-visible {
    background: var(--gold-200);
    color: var(--green-800);
}

/* A marker whose key is not in the sources table. Deliberately loud so a
   typo is caught rather than silently swallowed. */
.cite--missing {
    padding: 0 0.2em;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 2px;
    cursor: help;
}

.references {
    max-width: var(--measure);
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 2px solid var(--border);
}

.references__title {
    font-size: var(--step-1);
    margin-bottom: var(--sp-4);
}

.references__list {
    padding-inline-start: var(--sp-6);
    font-size: var(--step--1);
    line-height: 1.65;
    color: var(--text-muted);
}

.references__list li + li { margin-top: var(--sp-3); }

.references__list li::marker {
    color: var(--highlight-ink);
    font-weight: 700;
}

/* Highlight the entry a superscript just jumped to. */
.references__list li:target {
    background: var(--gold-200);
    box-shadow: 0 0 0 var(--sp-2) var(--gold-200);
    border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .references__list li:target {
        background: rgba(212, 175, 55, 0.18);
        box-shadow: 0 0 0 var(--sp-2) rgba(212, 175, 55, 0.18);
    }
}

:root[data-theme='dark'] .references__list li:target {
    background: rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 0 var(--sp-2) rgba(212, 175, 55, 0.18);
}

.references__backlink {
    margin-inline-end: var(--sp-2);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
}

.references__backlink:hover { color: var(--accent); }

.references__url {
    margin-inline-start: var(--sp-2);
    white-space: nowrap;
    font-size: 0.92em;
}

.references__note {
    display: block;
    margin-top: var(--sp-1);
    font-style: italic;
    opacity: 0.85;
}

.references__foot {
    margin-top: var(--sp-5);
    font-size: var(--step--1);
    color: var(--text-muted);
}

/* 8c. Places ============================================================= */

.place-figure {
    margin-bottom: var(--sp-6);
}

.place-figure img {
    width: 100%;
    max-height: 30rem;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--bg-sunken);
}

/* Licence attribution. Small, but never hidden — it is a condition of use. */
.place-figure__credit {
    margin-top: var(--sp-2);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
}

.place-figure__credit a { color: inherit; text-decoration: underline; }
.place-figure__credit a:hover { color: var(--accent); }

.place-card__media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--bg-sunken);
    overflow: hidden;
}

.place-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 320ms ease;
}

.place-card:hover .place-card__media img { transform: scale(1.04); }

.place-card__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: var(--step-3);
    color: var(--border-strong);
}

.chips--secondary { margin-top: calc(var(--sp-4) * -1); }

/* Scoped away from the active chip: an unqualified `background: transparent`
   here overrode .chip[aria-current] further up the sheet, leaving the
   selected filter as near-white text on parchment. */
.chips--secondary .chip:not([aria-current='true']) {
    background: transparent;
    border-style: dashed;
}

.place-coords {
    margin-top: var(--sp-7);
    padding: var(--sp-5);
    background: var(--bg-sunken);
    border-radius: var(--radius);
    max-width: var(--measure);
}

.place-coords__title {
    font-size: var(--step-1);
    margin-bottom: var(--sp-3);
}

.place-coords__value {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-size: var(--step-1);
}

@media (prefers-reduced-motion: reduce) {
    .place-card:hover .place-card__media img { transform: none; }
}

/* 8d. Glossary =========================================================== */

.alpha-index {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-bottom: var(--sp-7);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-ui);
}

.alpha-index a {
    display: grid;
    place-items: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: var(--step--1);
    text-decoration: none;
    color: var(--text-muted);
}

.alpha-index a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.glossary-group + .glossary-group { margin-top: var(--sp-7); }

.glossary-group__letter {
    font-size: var(--step-2);
    color: var(--highlight-ink);
    padding-bottom: var(--sp-2);
    border-bottom: 2px solid var(--highlight);
    margin-bottom: var(--sp-5);
}

.glossary-list { max-width: var(--measure); }

.glossary-entry + .glossary-entry {
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
}

.glossary-entry__term {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--sp-3);
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 700;
    margin-bottom: var(--sp-2);
}

.lang-si .glossary-entry__term { font-family: var(--font-sinhala); }

.glossary-entry__script {
    font-family: var(--font-sinhala);
    font-size: 0.9em;
    font-weight: 400;
    color: var(--highlight-ink);
}

.glossary-entry__translit {
    font-family: var(--font-ui);
    font-size: 0.72em;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
}

.glossary-entry__definition {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
}

/* 8e. Timeline (chronology page) ========================================= */

.timeline-era + .timeline-era { margin-top: var(--sp-8); }

.timeline-era__title {
    font-size: var(--step-2);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--highlight);
    margin-bottom: var(--sp-5);
}

.timeline--chrono .timeline__item { padding-block: var(--sp-5); }

.timeline__year {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--highlight-ink);
    margin-bottom: var(--sp-2);
}

.timeline-flag {
    color: var(--text-muted);
    font-size: 0.9em;
    cursor: help;
}

/* Chronicle accounts are marked rather than mixed in silently — the
   distinction between narrative and attested record is load-bearing here. */
.timeline__item--disputed::before {
    background: var(--bg);
    border-style: dashed;
    border-color: var(--border-strong);
}

.timeline__item--disputed .timeline__title { font-style: italic; }

/* 8f. Sources ============================================================ */

.source-list {
    padding-inline-start: var(--sp-6);
    max-width: var(--measure);
}

.source-entry + .source-entry {
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
}

.source-entry::marker {
    color: var(--highlight-ink);
    font-weight: 700;
}

.source-entry__citation {
    font-size: var(--step-0);
    line-height: 1.6;
}

.source-entry__note {
    margin-top: var(--sp-2);
    font-size: var(--step--1);
    font-style: italic;
    color: var(--text-muted);
}

.source-entry__meta {
    margin-top: var(--sp-3);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
}

.source-entry__cited a { text-decoration: underline; }

.source-entry:target {
    background: var(--gold-200);
    box-shadow: 0 0 0 var(--sp-2) var(--gold-200);
    border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .source-entry:target {
        background: rgba(212, 175, 55, 0.18);
        box-shadow: 0 0 0 var(--sp-2) rgba(212, 175, 55, 0.18);
    }
}

:root[data-theme='dark'] .source-entry:target {
    background: rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 0 var(--sp-2) rgba(212, 175, 55, 0.18);
}

/* 9. Forms =============================================================== */

.form { max-width: 40rem; }

.form__row { margin-bottom: var(--sp-5); }

.form__row--split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--sp-4);
}

.form label {
    display: block;
    margin-bottom: var(--sp-2);
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--text);
}

.form .required { color: var(--danger); }

.form input[type='text'],
.form input[type='email'],
.form textarea {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form input:focus, .form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--gold-200);
}

.form textarea { min-height: 10rem; resize: vertical; }

.form__hint {
    margin-top: var(--sp-2);
    font-size: var(--step--1);
    color: var(--text-muted);
}

/* Honeypot — hidden from people, visible to bots that ignore CSS. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 10. Footer ============================================================= */

.site-footer {
    margin-top: auto;
    background: var(--green-900);
    color: var(--text-inverse);
    padding-block: var(--sp-8) var(--sp-6);
}

.footer-grid {
    display: grid;
    /* One homogeneous auto-fit repeat, like every other grid on the site.
       The previous explicit first column (18rem min) plus the mandatory
       first auto-fit repetition (10rem min) had a combined floor of 480px —
       wider than any phone — because auto-fit can shrink only its own
       tracks, never an explicit one. The footer forced page-level
       horizontal scroll on mobile as a result. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: var(--sp-6) var(--sp-5);
    padding-bottom: var(--sp-7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* The brand takes its own full-width row above the link columns. */
.footer-brand { grid-column: 1 / -1; }

.footer-brand__name {
    font-family: var(--font-display);
    font-size: var(--step-2);
    color: var(--gold-500);
    margin-bottom: var(--sp-3);
}

.lang-si .footer-brand__name { font-family: var(--font-sinhala); }

.footer-brand p {
    color: var(--text-on-dark-muted);
    font-size: var(--step--1);
    max-width: 32ch;
}

.footer-col h2 {
    font-family: var(--font-ui);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-500);
    margin-bottom: var(--sp-4);
}

.lang-si .footer-col h2 {
    font-family: var(--font-sinhala);
    letter-spacing: 0;
    text-transform: none;
}

.footer-col ul { list-style: none; padding: 0; }

.footer-col li + li { margin-top: var(--sp-2); }

.footer-col a {
    color: var(--text-on-dark-muted);
    font-size: var(--step--1);
    text-decoration: none;
}

.footer-col a:hover { color: var(--gold-400); text-decoration: underline; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-top: var(--sp-5);
    font-size: var(--step--1);
    color: var(--text-on-dark-muted);
}

/* 11. Utilities ========================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.flow > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.muted  { color: var(--text-muted); }

/* Trailing "see all" link below a grid */
.section-cta { margin-top: var(--sp-6); }

.stack-top   { margin-top: var(--sp-6); }
.stack-top-l { margin-top: var(--sp-8); }

/* 12. Motion & print ===================================================== */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card:hover, .person-card:hover, .btn:hover { transform: none; }
    .gallery-item:hover img { transform: none; }
}

@media print {
    .site-header, .site-footer, .skip-link,
    .pager, .pagination, .chips, .breadcrumbs { display: none !important; }

    body { background: #fff; color: #000; }
    .prose { max-width: none; }
    a::after { content: ' (' attr(href) ')'; font-size: 0.85em; color: #555; }
}

/* 8g. Section-under-review notice ======================================== */

/* Component-local tokens so the amber reads correctly on parchment and on
   the dark ground, without leaking a one-off colour into the global ramp. */
.review-strip,
.review-modal__inner {
    --review-bg:     #FDF4DC;
    --review-line:   var(--gold-600);
    --review-text:   #4A3A0E;
    /* Dark glyph on gold, not white: white on gold-600 is only 3.11:1. */
    --review-mark-bg: var(--gold-600);
    --review-mark-fg: #1C1A17;
}

.review-strip {
    background: var(--review-bg);
    border-bottom: 3px solid var(--review-line);
    color: var(--review-text);
    padding-block: var(--sp-4);
}

.review-strip__inner {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
}

.review-strip__mark,
.review-modal__mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--review-mark-bg);
    color: var(--review-mark-fg);
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1;
}

.review-strip__text {
    font-size: var(--step--1);
    line-height: 1.6;
}

/* On a phone the heading and the explanation stack rather than running on. */
.review-strip__text strong { display: block; }

.review-strip__text span { display: block; margin-top: var(--sp-1); }

/* -- modal -- */

.review-modal {
    /* The reset's `* { margin: 0 }` also hits <dialog>, and the UA's
       `margin: auto` is the only thing that centres a modal inside its
       inset:0 box — without this it collapses to the top-left corner. */
    margin: auto;
    max-width: min(34rem, calc(100vw - 2 * var(--gutter)));
    max-height: calc(100dvh - 2 * var(--gutter));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    box-shadow: var(--shadow-lg);
}

.review-modal::backdrop {
    background: rgba(7, 26, 18, 0.72);
}

.review-modal__inner {
    padding: var(--sp-6);
    background: var(--bg-raised);
    border-top: 4px solid var(--review-line);
    border-radius: var(--radius-lg);
    color: var(--text);
}

.review-modal__mark {
    width: 2.25rem;
    height: 2.25rem;
    font-size: var(--step-1);
    margin-bottom: var(--sp-4);
}

.review-modal__title {
    font-size: var(--step-2);
    margin-bottom: var(--sp-3);
}

.review-modal__body {
    color: var(--text-muted);
    line-height: 1.75;
}

.review-modal__actions {
    margin-top: var(--sp-6);
    display: flex;
    justify-content: flex-end;
}

/* Dark mode: the amber has to sit on a dark ground, so it inverts to a
   muted gold on near-black rather than staying a light wash. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .review-strip,
    :root:not([data-theme='light']) .review-modal__inner {
        --review-bg:      #23200F;
        --review-line:    var(--gold-500);
        --review-text:    #F0E2BC;
        --review-mark-bg: var(--gold-500);
        --review-mark-fg: #1C1A17;
    }
}

:root[data-theme='dark'] .review-strip,
:root[data-theme='dark'] .review-modal__inner {
    --review-bg:      #23200F;
    --review-line:    var(--gold-500);
    --review-text:    #F0E2BC;
    --review-mark-bg: var(--gold-500);
    --review-mark-fg: #1C1A17;
}

@media print {
    .review-modal { display: none !important; }
}
