:root {
    color-scheme: dark;

    /* Surfaces (warm near-blacks) */
    --bg-page: #17120E;
    --bg-surface: #241D17;
    --bg-card: #2A231E;
    --bg-inset: #1D1712;

    /* Ink */
    --text-primary: #F4ECDD;
    --text-muted: #B5A896;
    --bronze: #B9A583;

    /* Flame — ember is for gradients/glows ONLY, never text */
    --flame: #F2A33C;
    --flame-bright: #F7B255;
    --ember: #C2571B;
    --gradient-flame: radial-gradient(circle at 50% 30%,
                        var(--flame-bright) 0%, var(--flame) 60%, var(--ember) 100%);

    /* Feedback */
    --error: #E8756B;

    /* Lines */
    --border-hairline: rgba(185, 165, 131, 0.25);
    --border-strong: #8A7A64;
    --header-divider: rgba(244, 236, 221, 0.18);

    /* Type */
    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-body: 'Lato', 'Segoe UI', system-ui, sans-serif;
    --font: var(--font-body);

    --text-xs: 0.75rem;
    --text-s: 0.875rem;
    --text-base: 1rem;
    --text-m: 1.125rem;
    --text-l: 1.375rem;
    --text-xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.375rem);

    /* Spacing (4px base) */
    --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem;  --sp-4: 1rem;
    --sp-6: 1.5rem;   --sp-8: 2rem;    --sp-12: 3rem;    --sp-16: 4rem;

    /* Radii */
    --radius-s: 4px;
    --radius-m: 10px;
    --radius-pill: 999px;
    --radius-circle: 50%;

    /* Elevation + glow */
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 10px 30px rgba(0, 0, 0, 0.55);
    --glow-focus: 0 0 0 3px rgba(242, 163, 60, 0.35);
    --glow-flame: 0 0 0 3px rgba(242, 163, 60, 0.22), 0 0 18px rgba(242, 163, 60, 0.18);

    /* Single source of truth for header height — map.css derives its
       #map/#search-bar/#map-panels offsets from this; never hard-code it there. */
    --header-h: 78px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-page);
}

/* Typography — Cinzel carries h1/h2 only; deeper levels stay Lato */
h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xl);
    letter-spacing: 0.05em;
    line-height: 1.2;
}

h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-l);
    letter-spacing: 0.04em;
    line-height: 1.3;
}

h3, h4 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-m);
    letter-spacing: 0.01em;
}

a {
    color: var(--bronze);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(185, 165, 131, 0.5);
    transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
    color: var(--flame-bright);
    text-decoration-color: currentColor;
}

/* Focus system — one amber ring everywhere (fields opt out, see below) */
:where(a, button, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--flame);
    outline-offset: 2px;
    box-shadow: var(--glow-focus);
    border-radius: var(--radius-s);
}

/* Header */
.site-header {
    background: var(--bg-surface);
    box-shadow: var(--shadow-1);
    border-bottom: 1px solid var(--border-hairline);
    z-index: 2000;
    position: relative;
}

.header-container {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2rem);
    padding-inline: clamp(1rem, 3vw, 2.5rem);
}

/* Branding: wordmark is the home link */
.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-branding {
    height: 44px;
    width: auto;
    display: block;
}

/* Partner logos, separated from the wordmark by a hairline divider */
.partner-logos {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-left: clamp(1rem, 2.5vw, 2rem);
    border-left: 1px solid var(--header-divider);
    margin-right: auto;
    flex-shrink: 0;
}

.partner-logos a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.partner-logos img {
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#mhp_header_logo {
    height: 34px;
}

#MKiDN_header_logo {
    height: 26px;
}

.partner-logos a:hover img,
.partner-logos a:focus-visible img {
    opacity: 1;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.5rem, 1.2vw, 1.25rem);
}

/* Wrapper exists for the mobile slide-down animation; on desktop it is
   layout-transparent so the links are direct flex items of .main-nav. */
.nav-links {
    display: contents;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    padding: 0.75rem 0.25rem;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--flame-bright);
}

/* Hover + active underline */
.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    left: 0.25rem;
    right: 0.25rem;
    bottom: 0.45rem;
    height: 2px;
    background-color: var(--flame);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s;
}

.nav-links a:not(.nav-cta):hover::after,
.nav-links a:not(.nav-cta)[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav-links a[aria-current="page"] {
    color: var(--bronze);
}

/* Primary action */
.nav-links a.nav-cta {
    color: var(--flame);
    border: 1px solid var(--flame);
    border-radius: var(--radius-s);
    padding: 0.6rem 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-links a.nav-cta:hover,
.nav-links a.nav-cta[aria-current="page"] {
    background-color: var(--flame);
    color: var(--bg-page);
    box-shadow: var(--glow-flame);
}

/* Search (map page) + hamburger group; shared baseline for both buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-actions button {
    background: none;
    border: 0;
    color: var(--text-primary);
    font-family: var(--font-body);   /* buttons don't inherit the body font */
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: color 0.2s;
}

.header-actions button:hover {
    color: var(--flame-bright);
}

.nav-toggle {
    display: none;   /* mobile only */
    width: 48px;
    height: 48px;
}

.user-info {
    color: var(--bronze);
    font-weight: 600;
    font-size: 0.85rem;
    padding-left: 1rem;
    border-left: 1px solid var(--header-divider);
    white-space: nowrap;
}

/* Skip link (WCAG 2.4.1) */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3000;
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 10px 16px;
    text-decoration: none;
    transform: translateY(-250%);
}

.skip-link:focus {
    transform: none;
}

/* Squeeze tiers — after the base rules on purpose: equal specificity, so
   source order decides; placed earlier these blocks would be no-ops. */
@media (max-width: 1200px) {
    .nav-links a,
    .header-actions button {
        font-size: 0.82rem;
    }
    .nav-links a.nav-cta {
        padding: 0.5rem 0.8rem;
    }
    .site-branding { height: 38px; }
    #mhp_header_logo { height: 30px; }
    #MKiDN_header_logo { height: 22px; }
}

@media (max-width: 1000px) {
    .user-info { display: none; }
    .header-container { gap: 0.75rem; }
    .partner-logos { gap: 0.75rem; padding-left: 0.75rem; }
}

/* Messages */
.messages-container {
    max-width: 1400px;
    margin: var(--sp-6) auto;
    padding: 0 30px;
}

.message {
    padding: 15px 25px;
    border-radius: var(--radius-s);
    margin-bottom: 12px;
    border-left: 3px solid;
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-1);
}

.message.success {
    border-left-color: var(--bronze);
}

.message.error {
    border-left-color: var(--error);
}

.message.info {
    border-left-color: var(--flame);
}

/* Forms */
.form-container {
    max-width: 720px;
    margin: 50px auto;
    padding: 0 30px;
}

/* Auth pages: a tighter column */
.form-container.narrow {
    max-width: 520px;
}

.form-card {
    background: var(--bg-card);
    padding: 45px 40px;
    border-radius: var(--radius-m);
    border: 1px solid var(--border-hairline);
    box-shadow: var(--shadow-2);
}

.form-card :is(h1, h2) {
    margin-bottom: var(--sp-8);
    color: var(--text-primary);
    font-size: 1.5rem;
}

.form-card :is(h1, h2)::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    margin-top: var(--sp-3);
    background: var(--bronze);
}

.form-card form p {
    margin-bottom: 24px;
}

.form-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: var(--text-s);
    letter-spacing: 0.2px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="date"],
.form-card input[type="number"],
.form-card input[type="file"],
.form-card textarea,
.form-card select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-inset);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card ::placeholder {
    color: #9A8D7B;
    opacity: 1;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
    outline: none;
    border-color: var(--flame);
    box-shadow: var(--glow-focus);
}

/* Chrome autofill paints its own yellow; repaint it into the inset well */
.form-card input:-webkit-autofill,
.form-card input:-webkit-autofill:hover,
.form-card input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-inset) inset;
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
}

.form-card input[type="file"] {
    padding: 8px 10px;
}

::file-selector-button {
    background: transparent;
    color: var(--bronze);
    border: 1px solid var(--bronze);
    border-radius: var(--radius-s);
    padding: 6px 14px;
    margin-right: var(--sp-3);
    font-family: var(--font-body);
    font-size: var(--text-s);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

::file-selector-button:hover {
    background: var(--bronze);
    color: var(--bg-page);
}

.form-card textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    padding: 13px 28px;
    background: var(--flame);
    color: var(--bg-page);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-s);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-align: center;
    text-transform: uppercase;
}

.btn:hover {
    background: var(--flame-bright);
    color: var(--bg-page);
    box-shadow: var(--glow-flame);
}

.btn-secondary {
    background: transparent;
    color: var(--bronze);
    border: 1px solid var(--bronze);
}

.btn-secondary:hover {
    background: var(--bronze);
    color: var(--bg-page);
    box-shadow: none;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

.errorlist {
    list-style: none;
    color: var(--error);
    font-size: var(--text-s);
    margin: 6px 0 0 0;
    font-weight: 700;
}

.field-error {
    color: var(--error);
    font-size: var(--text-s);
    font-weight: 700;
    margin-top: 6px;
}

.helptext {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
    font-style: italic;
}

/* Intro/hint paragraphs (replaces the old inline color:#776355 styles) */
.form-hint {
    color: var(--text-muted);
    font-size: var(--text-s);
    line-height: 1.6;
    margin-bottom: var(--sp-6);
}

/* Links */
.form-links {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-hairline);
}

.form-links p {
    margin-bottom: var(--sp-3);
}

/* Leaflet zoom control — dark chip matching the night chrome.
   .leaflet-container prefix: style.css loads BEFORE leaflet.css, so these
   selectors must out-specify Leaflet's own .leaflet-bar rules to apply. */
.leaflet-container .leaflet-bar {
    border-color: rgba(185, 165, 131, 0.35);
}

.leaflet-container .leaflet-bar a {
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-hairline);
}

.leaflet-container .leaflet-bar a:hover,
.leaflet-container .leaflet-bar a:focus {
    background: var(--bg-surface);
    color: var(--flame-bright);
}

.leaflet-container .leaflet-bar a.leaflet-disabled {
    background: var(--bg-inset);
    color: var(--text-muted);
}

/* OSM attribution — visible at all times (OSM policy), styled as a quiet chip */
.leaflet-container .leaflet-control-attribution {
    background: rgba(23, 18, 14, 0.85);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-s) 0 0 0;
}

.leaflet-container .leaflet-control-attribution a {
    color: var(--bronze);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Pin Popup - memorial card (scoped via the bindPopup className) */

.memorial-popup .leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden; /* clips the hero photo to the rounded corners */
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    border: 1px solid rgba(185, 165, 131, 0.35);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-2);
}
.memorial-popup .leaflet-popup-tip {
    background: var(--bg-card);
    border: 1px solid rgba(185, 165, 131, 0.35);
    box-shadow: var(--shadow-2);
}
.memorial-popup .leaflet-popup-content {
    margin: 0;
    /* Leaflet writes an inline width; max-width caps it on narrow phones. */
    max-width: min(340px, calc(100vw - 36px));
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 0.9rem;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: rgba(185, 165, 131, 0.55) transparent;
}
.memorial-popup .leaflet-popup-content::-webkit-scrollbar { width: 8px; }
.memorial-popup .leaflet-popup-content::-webkit-scrollbar-track { background: transparent; }
.memorial-popup .leaflet-popup-content::-webkit-scrollbar-thumb {
    background: rgba(185, 165, 131, 0.45);
    border-radius: var(--radius-s);
}
.memorial-popup .leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(185, 165, 131, 0.75);
}

/* .leaflet-container prefix beats leaflet.css's
   .leaflet-container a.leaflet-popup-close-button despite load order */
.leaflet-container .memorial-popup .leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-circle);
    background: rgba(23, 18, 14, 0.65);
    color: var(--text-primary);
    font: 400 18px/26px var(--font-body);
    text-align: center;
    transition: color 0.15s, background 0.15s;
}
.leaflet-container .memorial-popup .leaflet-popup-close-button:hover,
.leaflet-container .memorial-popup .leaflet-popup-close-button:focus-visible {
    color: var(--flame);
    background: rgba(23, 18, 14, 0.85);
}
.memorial-popup .leaflet-popup-close-button span { color: inherit; }

/* Hero gallery */
.memorial-popup .popup-hero { position: relative; }
.memorial-popup .popup-hero .gallery-link { display: block; text-decoration: none; }
.memorial-popup .popup-hero .gallery-img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover; /* stable card height; the link opens the full photo */
    background: var(--bg-surface);
}
.memorial-popup .popup-hero::after {
    /* bottom scrim so the arrows/counter stay legible on bright photos */
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 48px;
    background: linear-gradient(rgba(23, 18, 14, 0), rgba(23, 18, 14, 0.55));
    pointer-events: none;
}
.memorial-popup .gallery-prev,
.memorial-popup .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-circle);
    background: rgba(23, 18, 14, 0.75);
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.memorial-popup .gallery-prev { left: 6px; }
.memorial-popup .gallery-next { right: 6px; }
.memorial-popup .gallery-prev:hover,
.memorial-popup .gallery-next:hover {
    color: var(--flame-bright);
}
.memorial-popup .gallery-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 1;
    background: rgba(23, 18, 14, 0.75);
    color: var(--text-primary);
    border-radius: var(--radius-m);
    padding: 1px 8px;
    font-size: var(--text-xs);
}

/* Card body */
.memorial-popup .popup-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 12px;
    overflow-wrap: anywhere;
}
.memorial-popup .popup-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--text-primary);
}
.memorial-popup .popup-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    color: var(--bronze);
    font-size: 0.8rem;
}
.memorial-popup .popup-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.memorial-popup .popup-edition {
    border: 1px solid var(--bronze);
    border-radius: var(--radius-pill);
    padding: 0 8px;
    font-size: 0.72rem;
    line-height: 1.6;
    white-space: nowrap;
}

/* Moderation / rejection */
.memorial-popup .popup-moderation {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-left: 3px solid var(--error);
    border-radius: 0 6px 6px 0;
    background: rgba(232, 117, 107, 0.08); /* 0.12 dips below 4.5:1 for --error text */
    font-size: 0.85rem;
}
.memorial-popup .popup-moderation p { margin: 0; }
.memorial-popup .moderation-title {
    color: var(--error);
    font-weight: 700;
}
.memorial-popup .popup-moderation a {
    color: var(--error);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Facts */
.memorial-popup .popup-facts {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-hairline);
    border-bottom: 1px solid var(--border-hairline);
}
.memorial-popup .popup-facts dt {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bronze);
}
.memorial-popup .popup-facts dd {
    margin: 0;
    font-size: 0.92rem;
}

/* Collapsible long-text sections */
.memorial-popup .popup-sections {
    display: flex;
    flex-direction: column;
}
.memorial-popup .popup-section {
    border-bottom: 1px solid rgba(185, 165, 131, 0.18);
}
.memorial-popup .popup-section:last-child { border-bottom: none; }
.memorial-popup .popup-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.memorial-popup .popup-section summary::-webkit-details-marker { display: none; }
.memorial-popup .popup-section summary::after {
    /* bronze chevron; points down when closed */
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    margin-right: 2px;
    border-right: 2px solid var(--bronze);
    border-bottom: 2px solid var(--bronze);
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.memorial-popup .popup-section[open] > summary::after { transform: rotate(-135deg); }
.memorial-popup .popup-section summary:hover,
.memorial-popup .popup-section summary:focus-visible {
    color: var(--flame-bright);
}
.memorial-popup .section-body {
    padding: 0 0 10px;
    font-size: 0.88rem;
    white-space: pre-line; /* keep participants' paragraph breaks */
}
.memorial-popup .section-body p { margin: 0 0 6px; }
.memorial-popup .reflection-label {
    margin: 8px 0 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bronze);
}
.memorial-popup .reflection-label:first-child { margin-top: 0; }

/* Footer */
.memorial-popup .popup-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--border-hairline);
    color: var(--bronze);
    font-size: 0.78rem;
}
.memorial-popup .popup-sections + .popup-footer { border-top: none; }

@media (max-width: 420px) {
    .memorial-popup .leaflet-popup-content { max-height: min(400px, 58vh); }
    .memorial-popup .popup-hero .gallery-img { height: 150px; }
}

/* Site footer — the vigil's quiet end; home of the living flame */
.site-footer {
    margin-top: var(--sp-16);
    border-top: 1px solid var(--border-hairline);
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: var(--text-s);
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-12) 30px var(--sp-8);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--sp-8);
}

.footer-brand .footer-wordmark {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-m);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.footer-tagline {
    margin-top: var(--sp-2);
    font-style: italic;
}

.footer-partners {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    margin-top: var(--sp-6);
}

.footer-partners a { text-decoration: none; display: flex; }

.footer-partners img {
    width: auto;
    height: 30px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-partners a:hover img,
.footer-partners a:focus-visible img { opacity: 1; }

.footer-col h2 {
    font-size: var(--text-s);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-bottom: var(--sp-4);
}

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

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

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--flame-bright);
}

.footer-bottom {
    border-top: 1px solid var(--border-hairline);
    padding: var(--sp-4) 30px;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

@media (max-width: 850px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
        padding: var(--sp-8) 20px var(--sp-6);
    }
}

/* The living flame — the site's single animated signature */
.living-flame {
    display: inline-block;
    width: 0.55em;
    height: 0.8em;
    flex: none;
    background: var(--gradient-flame);
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    transform-origin: 50% 90%;
    filter: drop-shadow(0 0 6px rgba(242, 163, 60, 0.45));
}

@media (prefers-reduced-motion: no-preference) {
    .living-flame {
        animation: flame-flicker 2.6s ease-in-out infinite;
    }
}

@keyframes flame-flicker {
    0%, 100% { transform: scaleX(1) scaleY(1) rotate(-1deg); opacity: 1; }
    30%      { transform: scaleX(0.96) scaleY(1.05) rotate(1.2deg); opacity: 0.92; }
    60%      { transform: scaleX(1.03) scaleY(0.97) rotate(-0.5deg); opacity: 0.97; }
    80%      { transform: scaleX(0.98) scaleY(1.02); opacity: 0.9; }
}

.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;
}

/* Responsive */
@media (max-width: 850px) {
    :root { --header-h: 64px; }

    /* No-JS fallback: wrapped rows (the map page needs JS anyway) */
    .header-container {
        height: auto;
        min-height: var(--header-h);
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem 1rem;
        padding: 0.5rem 1rem;
    }

    .partner-logos { margin-right: 0; }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem 1rem;
    }

    .site-branding { height: 36px; }
    #mhp_header_logo { height: 24px; }
    #MKiDN_header_logo { height: 18px; }

    .user-info { display: none; }

    /* JS present (html.js): single 64px row + slide-down panel.
       grid-template-rows 0fr->1fr animates to true auto height; browsers too
       old to animate fr values snap open, still correct. visibility:hidden
       removes the closed menu from the AT tree and tab order while staying
       animatable. */
    html.js .header-container {
        height: var(--header-h);
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 0 8px 0 12px;
    }

    html.js .partner-logos { margin-right: auto; }

    html.js .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    html.js #main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        box-shadow: var(--shadow-3);
        display: grid;
        grid-template-rows: 0fr;
        visibility: hidden;
        transition: grid-template-rows 0.25s ease, visibility 0s linear 0.25s;
    }

    html.js #main-nav.open {
        grid-template-rows: 1fr;
        visibility: visible;
        transition: grid-template-rows 0.25s ease;
    }

    html.js .nav-links {
        flex-direction: column;
        overflow: hidden;   /* required by the 0fr pattern */
        min-height: 0;
        gap: 0;
    }

    html.js .nav-links a {
        display: block;
        padding: 14px 24px;   /* ~51px rows, above the 44px tap-target floor */
        font-size: 1.05rem;
    }

    html.js .nav-links a + a {
        border-top: 1px solid rgba(244, 236, 221, 0.08);
    }

    html.js .nav-links a.nav-cta {
        margin: 10px 24px 14px;
        text-align: center;
    }

    .form-card {
        padding: 35px 25px;
    }

    .form-container {
        padding: 0 20px;
    }
}

@media (max-width: 420px) {
    .site-branding { height: 32px; }
    #mhp_header_logo { height: 20px; }
    #MKiDN_header_logo { height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    /* html.js #main-nav: must match the animating rule's specificity or lose.
       #search-bar / .leaflet-control-zoom have their own reduce override at
       the END of map.css (that file re-declares their transitions later). */
    html.js #main-nav,
    .nav-links a:not(.nav-cta)::after,
    .leaflet-container .memorial-popup .leaflet-popup-close-button,
    .memorial-popup .popup-section summary::after {
        transition: none;
    }
}
