/* ==========================================================================
   National Deaf Education Data Index: "Ledger" palette layer (ndedi-theme)
   Loaded AFTER ncg-a11y.css + the parent ncg-theme style.css, so these win.

   Aligned to the publisher's Rural Modern scheme (ncg-theme): dark chrome, one
   warm accent, near-black type on warm paper. The publisher's Rural Modern structure, shifted to ink and amber.
   Redefines the ncg --ncg-color-* tokens for the a11y toolbar's three modes
   (default / dark / high-contrast, via html[data-ncg-theme=...]). Contrast
   targets, checked at generation: body and link text 4.5:1 or better, UI and
   focus 3:1 or better, text on the accent 4.5:1 or better. High-contrast is
   the plugin's black / white / yellow scheme (ncg-a11y.css forces links cyan
   and headings yellow with !important; this file only guarantees that the
   yellow buttons keep black text). Chrome tokens (--ncg-hero-*, --ncg-chrome)
   are MODE-STABLE so heroes, the CTA band, and the footer stay dark in every
   mode; high-contrast forces them black.

   Tokens the ncg-core/templates/ndedi/ pages read beyond the parent's set:
   --ncg-link, --ncg-focus, --ncg-accent-text, --ncg-accent-2, --ncg-chrome,
   --ncg-on-chrome, --ncg-hero-1/2/3, --ncg-chrome-accent, --ncg-on-accent.
   ========================================================================== */

/* ---- Base / light ----------------------------------------------------- */
:root {
    --ncg-color-primary:    #1E2B45; /* deep ink navy, the Index's brand ink */
    --ncg-color-secondary:  #4B5B7A; /* slate blue */
    --ncg-color-accent:     #D4A24C; /* amber: button ground with ink text */
    --ncg-on-accent:        #1E2B45; /* text that sits ON the accent */
    /* Accent that sits ON the dark chrome (heroes, CTA band, footer). */
    --ncg-chrome-accent:    #E6BC63;
    /* The accent as TEXT on the light ground (labels, hover, small type): the
       plain accent is a button color and is not legible as text on paper. */
    --ncg-accent-text:      #7A5410;
    --ncg-focus:            #7A5410; /* focus ring: 3:1 or better against paper and white */
    --ncg-color-heading:    #050505;
    --ncg-color-body:       #111111;
    --ncg-color-muted:      #444444;
    --ncg-color-bg-paper:   #F7F6F2; /* warm off-white, a shade cooler than NCG's */
    --ncg-color-bg-surface: #FFFFFF;
    --ncg-color-border:     #767676; /* 3:1 boundary on paper and white */
    --ncg-link:             #1E2B45;

    /* mode-stable chrome: ink into deep blue */
    --ncg-hero-1:   #1E2B45;
    --ncg-hero-2:   #1B3550;
    --ncg-hero-3:   #142A3E;
    --ncg-chrome:   #141D30;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #5C8FBF; /* steel blue: card numbers, accent borders, the second voice */
    --ndedi-hover-tint: rgba(122, 84, 16, 0.10);
    --ndedi-focus-glow: rgba(122, 84, 16, 0.25);
}
/* ---- Dark ------------------------------------------------------------- */
html[data-ncg-theme="dark"] {
    --ncg-color-primary:    #A9C4E6;
    --ncg-color-secondary:  #B3BFD3;
    --ncg-color-accent:     #E6BC63;
    --ncg-on-accent:        #1E2B45;
    --ncg-chrome-accent:    #E6BC63;
    --ncg-accent-text:      #E6BC63;
    --ncg-focus:            #E6BC63;
    --ncg-color-heading:    #FAFAFA;
    --ncg-color-body:       #E4E4E4;
    --ncg-color-muted:      #B7B7B7;
    --ncg-color-bg-paper:   #14181F;
    --ncg-color-bg-surface: #1E2430;
    --ncg-color-border:     #6B7686; /* raised from the parent's #5A5A5A, which is 2.4:1 on this ground */
    --ncg-link:             #A9C4E6;
    --ncg-hero-1:   #0E131C;
    --ncg-hero-2:   #15243A;
    --ncg-hero-3:   #101C2B;
    --ncg-chrome:   #0E131C;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #8FB8E0;
}

/* ---- HIGH CONTRAST: black / white / yellow ---------------------------- */
html[data-ncg-theme="high-contrast"] {
    --ncg-color-primary:    #FFFFFF;
    --ncg-color-secondary:  #FFFFFF;
    --ncg-color-accent:     #FFFF00;
    --ncg-on-accent:        #000000;
    --ncg-chrome-accent:    #FFFF00;
    --ncg-accent-text:      #FFFF00;
    --ncg-focus:            #FFFF00;
    --ncg-color-heading:    #FFFFFF;
    --ncg-color-body:       #FFFFFF;
    --ncg-color-muted:      #FFFFFF;
    --ncg-color-bg-paper:   #000000;
    --ncg-color-bg-surface: #000000;
    --ncg-color-border:     #FFFFFF;
    --ncg-link:             #FFFF00;
    --ncg-hero-1:   #000000;
    --ncg-hero-2:   #000000;
    --ncg-hero-3:   #000000;
    --ncg-chrome:   #000000;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #FFFF00;
    --ndedi-hover-tint: transparent;
    --ndedi-focus-glow: transparent;
}

/* ==========================================================================
   PAGE SURFACES: body follows the tokens in light mode too
   (the parent already handles dark via html[data-ncg-theme="dark"] body).
   ========================================================================== */
body { background-color: var(--ncg-color-bg-paper); color: var(--ncg-color-body); margin: 0; }
/* Nothing upstream resets box-sizing, and the parent gives .site-footer-legal
   width: 100% while this file gives it side padding: border-box keeps the
   header and footer inside the viewport at every width. */
.site-header, .site-footer, .ndedi-footer * { box-sizing: border-box; }

/* ==========================================================================
   LINKS: the parent points a{} at --primary and hover at the plain accent,
   which is a button color, not a text color. Hover uses the text-safe accent.
   Underline is inherited from the parent (kept for color-blind users).
   ========================================================================== */
a { color: var(--ncg-link); }
a:hover, a:focus { color: var(--ncg-accent-text); background-color: var(--ndedi-hover-tint); }

/* ==========================================================================
   FOCUS + SKIP LINK: the plugin's copper focus ring is 2.3:1 on paper; use the
   dedicated focus token (dark accent in light mode, light accent in dark).
   ========================================================================== */
.ncg-skip-link { background: var(--ncg-chrome) !important; color: var(--ncg-on-chrome) !important; }
:focus-visible,
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible,
summary:focus-visible,
.ncg-skip-link:focus { outline-color: var(--ncg-focus) !important; }
html[data-ncg-theme="high-contrast"] :focus-visible { outline-color: #FFFF00 !important; }
/* The plugin's high-contrast rules force every <a> cyan and every <button>
   yellow-on-black; a button that is an <a> (the header CTA, the template
   .rec-btn) would be cyan on yellow. Keep those black on yellow. */
html[data-ncg-theme="high-contrast"] .ncg-header-cta,
html[data-ncg-theme="high-contrast"] .rec-btn,
html[data-ncg-theme="high-contrast"] .ncg-btn-main { background: #FFFF00 !important; color: #000000 !important; border: 2px solid #FFFFFF !important; }
html[data-ncg-theme="high-contrast"] .ncg-header-cta:hover, html[data-ncg-theme="high-contrast"] .ncg-header-cta:focus-visible,
html[data-ncg-theme="high-contrast"] .rec-btn:hover, html[data-ncg-theme="high-contrast"] .rec-btn:focus-visible,
html[data-ncg-theme="high-contrast"] .ncg-btn-main:hover, html[data-ncg-theme="high-contrast"] .ncg-btn-main:focus-visible { background: #FFFFFF !important; color: #000000 !important; }

/* ==========================================================================
   CONTACT FORM: the parent hardcodes pine/copper (+ !important) here.
   Re-assert the tokens, matching the parent's selectors and specificity.
   ========================================================================== */
.ncg-form-group label { color: var(--ncg-color-heading) !important; }
.ncg-form-group input,
.ncg-form-group textarea {
    background-color: var(--ncg-color-bg-surface) !important;
    color: var(--ncg-color-body) !important;
    border: 2px solid var(--ncg-color-border) !important;
}
.ncg-form-group input::placeholder,
.ncg-form-group textarea::placeholder { color: var(--ncg-color-muted) !important; }
.ncg-form-group input:focus,
.ncg-form-group textarea:focus {
    border-color: var(--ncg-focus) !important;
    box-shadow: 0 0 0 3px var(--ndedi-focus-glow) !important;
}
.ncg-submit-btn { background-color: var(--ncg-color-accent) !important; color: var(--ncg-on-accent) !important; }
.ncg-submit-btn:hover, .ncg-submit-btn:focus-visible { background-color: var(--ncg-chrome) !important; color: var(--ncg-on-chrome) !important; }
html[data-ncg-theme="high-contrast"] .ncg-submit-btn { background-color: #FFFF00 !important; color: #000 !important; }

/* ==========================================================================
   HEADER: light mode keeps the parent's paper header; the text wordmark
   (used until a transparent logo is uploaded) is set in the display face.
   Dark mode: the parent paints a pine backdrop (#16211B) and a light-copper
   hover (#E4BE97); recolor both to this brand's chrome and chrome accent.
   ========================================================================== */
.site-header .site-title a {
    font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 1.35rem;
    letter-spacing: -0.01em; color: var(--ncg-color-primary); text-decoration: none;
}
.site-header .site-title a:hover, .site-header .site-title a:focus-visible { color: var(--ncg-accent-text); background: none; }
.site-header .site-description { margin: 2px 0 0; font-size: .85rem; color: var(--ncg-color-muted); }
.ncg-header-cta { background: var(--ncg-color-accent); color: var(--ncg-on-accent); }
.ncg-header-cta:hover,
.ncg-header-cta:focus-visible { background: var(--ncg-chrome); color: var(--ncg-on-chrome); }
/* Light mode: the parent colors the hovered / active menu item with the plain
   accent, a button color that fails as text on paper; use the text-safe accent
   for the label and keep the accent for the underline. */
.site-header .site-navigation ul.menu > li > a:hover,
.site-header .site-navigation ul.menu > li > a:focus-visible,
.site-header .site-navigation ul.menu > li.current-menu-item > a,
.site-footer .site-navigation ul.menu > li > a:hover,
.site-footer .site-navigation ul.menu > li > a:focus-visible,
.site-footer .site-navigation ul.menu > li.current-menu-item > a {
    color: var(--ncg-accent-text);
    border-bottom-color: var(--ncg-color-accent);
}
.site-header .site-navigation ul.menu > li > a:focus-visible,
.site-footer .site-navigation ul.menu > li > a:focus-visible { outline-color: var(--ncg-focus); }
/* The parent caps .site-header at the content width, so in dark mode its
   chrome backdrop would sit as a box on the page ground; extend the backdrop
   edge to edge (box-shadow spread, clipped vertically) so the band runs full
   width like the hero and the footer. */
html[data-ncg-theme="dark"] .site-header { background-color: var(--ncg-chrome); box-shadow: 0 0 0 100vmax var(--ncg-chrome); clip-path: inset(0 -100vmax); }
html[data-ncg-theme="high-contrast"] .site-header { box-shadow: 0 0 0 100vmax #000; clip-path: inset(0 -100vmax); }
html[data-ncg-theme="dark"] .site-header .site-title a { color: var(--ncg-on-chrome); }
html[data-ncg-theme="dark"] .site-header .site-navigation ul.menu > li > a:hover,
html[data-ncg-theme="dark"] .site-header .site-navigation ul.menu > li > a:focus-visible,
html[data-ncg-theme="dark"] .site-header .site-navigation ul.menu > li.current-menu-item > a,
html[data-ncg-theme="dark"] .site-footer .site-navigation ul.menu > li > a:hover,
html[data-ncg-theme="dark"] .site-footer .site-navigation ul.menu > li > a:focus-visible,
html[data-ncg-theme="dark"] .site-footer .site-navigation ul.menu > li.current-menu-item > a {
    color: var(--ncg-chrome-accent);
    border-bottom-color: var(--ncg-chrome-accent);
}
html[data-ncg-theme="dark"] .site-header .site-navigation ul.menu > li > a:focus-visible,
html[data-ncg-theme="dark"] .site-footer .site-navigation ul.menu > li > a:focus-visible { outline-color: var(--ncg-chrome-accent); }
html[data-ncg-theme="dark"] .ncg-header-cta:focus-visible { outline-color: var(--ncg-chrome-accent); }

/* ==========================================================================
   LOGO: two real images in header.php, ndedi-logo.png on the light header and
   ndedi-logo-white.png on the dark and high-contrast headers. Only one is ever
   displayed, so a screen reader meets one link with one name. Under forced
   colors the system chooses the ground, so the reverse lockup follows the
   user's dark preference instead of the site toggle.
   ========================================================================== */
.ndedi-logo-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 4px; }
.ndedi-logo-link:hover, .ndedi-logo-link:focus { background: none; }
.ndedi-logo-link:focus-visible { outline: 3px solid var(--ncg-focus); outline-offset: 4px; }
/* The lockup is about four times as wide as it is tall; 80px keeps its words
   legible. The parent caps the header at 1140px from 1200px up, where the 80px
   lockup (327px) beside the menu and CTA only fits on one row with the menu links
   and gaps a little tighter. Between the phone layout and 1200px the parent's
   narrower caps (960px, 720px) would squeeze the menu into several lines, so the
   header spans the window instead and settles into two tidy rows: lockup, then
   menu and CTA. */
@media (min-width: 1200px) {
    .site-header.ndedi-header { column-gap: 28px; }
    .ndedi-header .site-header-end { gap: 20px; }
    .ndedi-header .site-navigation ul.menu > li > a { padding-inline: 10px; }
}
@media (min-width: 861px) and (max-width: 1199px) {
    .site-header.ndedi-header:not(.dynamic-header) { max-width: none; padding-inline: 32px; }
}
.ndedi-logo { display: block; height: 80px; width: auto; max-width: 100%; }
.ndedi-logo-reverse { display: none; }
html[data-ncg-theme="dark"] .ndedi-logo-light,
html[data-ncg-theme="high-contrast"] .ndedi-logo-light { display: none; }
html[data-ncg-theme="dark"] .ndedi-logo-reverse,
html[data-ncg-theme="high-contrast"] .ndedi-logo-reverse { display: block; }
@media (forced-colors: active) and (prefers-color-scheme: dark) { .ndedi-logo-light { display: none; } .ndedi-logo-reverse { display: block; } }
@media (max-width: 600px) { .ndedi-logo { height: 64px; } }

/* ==========================================================================
   FOOTER: grouped 4-column, on the mode-stable dark chrome (always dark;
   forced black in high-contrast). Text is on-chrome in every mode.
   ========================================================================== */
.ndedi-footer { background: var(--ncg-chrome); color: var(--ncg-on-chrome); padding: 56px 0 0; }
#site-footer.ndedi-footer { max-width: none; width: 100%; }
.ndedi-footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 40px;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
}
.ndedi-footer-head {
    font-family: 'Playfair Display', Georgia, serif; font-size: .8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; color: var(--ncg-on-chrome); opacity: .7; margin: 0 0 16px;
}
.ndedi-footer-col ul { list-style: none; margin: 0; padding: 0; }
.ndedi-footer-col li { margin-bottom: 11px; }
.ndedi-footer-col a, .ndedi-footer-parent a { color: var(--ncg-on-chrome); text-decoration: none; opacity: .92; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.ndedi-footer-col a:hover, .ndedi-footer-col a:focus-visible,
.ndedi-footer-parent a:hover, .ndedi-footer-parent a:focus-visible { opacity: 1; color: var(--ncg-chrome-accent); border-bottom-color: currentColor; background: none; }
.ndedi-footer a:focus-visible { outline-color: var(--ncg-chrome-accent) !important; }
.ndedi-footer-wordmark { font-family: 'Playfair Display', Georgia, serif; font-size: 1.35rem; line-height: 1.25; color: var(--ncg-on-chrome); margin: 0 0 10px; letter-spacing: -.01em; }
.ndedi-footer-tagline { color: var(--ncg-on-chrome); opacity: .85; line-height: 1.6; margin: 0 0 14px; max-width: 38ch; }
.ndedi-footer-parent { color: var(--ncg-on-chrome); opacity: .8; font-size: .9rem; margin: 0; line-height: 1.6; }
.ndedi-footer .site-footer-legal { max-width: 1200px; margin: 48px auto 0; padding: 20px 40px; border-top: 1px solid rgba(255,255,255,.16); text-align: center; }
.ndedi-footer .site-footer-legal p { margin: 0 0 4px; font-size: .82rem; color: var(--ncg-on-chrome); opacity: .8; }
.ndedi-footer .footer-formulation { font-style: italic; }
html[data-ncg-theme="high-contrast"] .ndedi-footer .site-footer-legal { border-top-color: #fff; }
html[data-ncg-theme="high-contrast"] .ndedi-footer-head,
html[data-ncg-theme="high-contrast"] .ndedi-footer-tagline,
html[data-ncg-theme="high-contrast"] .ndedi-footer-parent,
html[data-ncg-theme="high-contrast"] .ndedi-footer-col a,
html[data-ncg-theme="high-contrast"] .ndedi-footer .site-footer-legal p { opacity: 1; color: #fff; }
html[data-ncg-theme="high-contrast"] .ndedi-footer-col a:hover,
html[data-ncg-theme="high-contrast"] .ndedi-footer-col a:focus-visible { color: #FFFF00; }

@media (max-width: 900px) { .ndedi-footer-inner { grid-template-columns: 1fr 1fr; } .ndedi-footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .ndedi-footer-inner { grid-template-columns: 1fr; padding: 0 24px; } .ndedi-footer .site-footer-legal { padding: 20px 24px; } }

/* ==========================================================================
   SMOOTH FLOW: the hero's edge veils come from the parent's ncg-veil.css
   (the template hero carries .ncg-split-header-v2); the header bar is named
   as the surface the top veil dissolves from in dark and high-contrast, where
   the parent would name NCG's pine. The footer fades in from the page ground.
   ========================================================================== */
html[data-ncg-theme="dark"] :is(.ncg-split-header-v2, .ncg-hero-banner, .rec-hero) { --ncg-veil-top: var(--ncg-chrome); --ncg-veil-chrome: var(--ncg-hero-1); }
:is(.ncg-split-header-v2, .ncg-hero-banner, .rec-hero) { --ncg-veil-chrome: var(--ncg-hero-1); }
.ndedi-footer { position: relative; }
.ndedi-footer::before {
    content: ""; position: absolute; left: 0; right: 0; top: -56px; height: 56px;
    background: linear-gradient(to bottom, rgba(0,0,0,0), var(--ncg-chrome));
    pointer-events: none;
}

/* ==========================================================================
   MOBILE HEADER: centered, breathing room (desktop header unchanged).
   ========================================================================== */
@media (max-width: 860px) {
    .site-header { flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 24px 16px 20px; }
    .site-header .site-branding { display: flex; flex-direction: column; align-items: center; width: 100%; }
    .site-header-end { flex-direction: column; align-items: center; gap: 18px; width: 100%; }
    .site-header .site-navigation { width: 100%; }
    .site-header .site-navigation ul.menu { justify-content: center; align-items: center; gap: 4px 8px; }
    .site-header .site-navigation ul.menu > li > a { font-size: 1.05rem; padding: 10px 14px; display: inline-block; }
    .site-header { border-bottom: 1px solid var(--ncg-color-border); }
    .ncg-header-cta { align-self: center; }
}
