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

   The sister Index to NDEDI, built for blind and low-vision readers as well as
   researchers and policymakers. Warm paper instead of stark white (glare and
   photophobia), charcoal ink, a deep SLATE-TEAL chrome (NDEDI's is ink navy, so
   the two Indexes are never mistaken for each other), one amber accent, and an
   electric cobalt focus ring that never blends into the chrome or the amber.
   Dark mode avoids pure black and pure white (halation for astigmatism and
   cataracts); high contrast is the plugins' black / white / yellow in every
   brand. Hairline dividers replace drop shadows (see TACTILE below).

   Contrast, checked at generation (README.md has the table): body and link
   text 4.5:1 or better, UI boundaries and focus 3:1 or better, text on the
   accent 4.5:1 or better, in light and dark. 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/nbedi/ 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:    #13434E; /* deep slate-teal, the Index's brand ink */
    --ncg-color-secondary:  #3E5A62; /* slate */
    --ncg-color-accent:     #F5B041; /* amber: button ground with charcoal text */
    --ncg-on-accent:        #14171A; /* text that sits ON the accent */
    --ncg-chrome-accent:    #F5B041; /* the accent ON the dark chrome */
    /* 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:      #8A4B08; /* deep ochre */
    --ncg-focus:            #005FCC; /* electric cobalt: 5.6:1 on paper */
    --ncg-color-heading:    #0B0D0F;
    --ncg-color-body:       #14171A; /* charcoal ink, 17:1 on paper */
    --ncg-color-muted:      #4A4F55;
    --ncg-color-bg-paper:   #F1EDE6; /* soft stone: the page ground behind the reading area */
    --ncg-color-bg-surface: #FAF8F5; /* warm alabaster: the reading area, cards and tables, never stark white */
    --ncg-color-border:     #6F767D; /* 3:1 boundary on alabaster and stone */
    --ncg-link:             #13434E;

    /* mode-stable chrome: slate-teal deepening to night */
    --ncg-hero-1:   #13434E;
    --ncg-hero-2:   #0F3A44;
    --ncg-hero-3:   #0B2B33;
    --ncg-chrome:   #0F2D35;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #005FCC; /* cobalt: card numbers, accent borders, the second voice */
    --nbedi-hairline: #88909A; /* 3:1 on alabaster: a fine rule a low-vision reader can still find */
    --nbedi-hover-tint: rgba(138, 75, 8, 0.10);
    --nbedi-focus-glow: rgba(0, 95, 204, 0.25);
}
/* ---- Dark: low-vision comfort (no pure black, no pure white) ---------- */
html[data-ncg-theme="dark"] {
    --ncg-color-primary:    #8FD0DB;
    --ncg-color-secondary:  #B4C7CC;
    --ncg-color-accent:     #F5B041;
    --ncg-on-accent:        #14171A;
    --ncg-chrome-accent:    #F5B041;
    --ncg-accent-text:      #F5B041;
    --ncg-focus:            #7FB2FF;
    --ncg-color-heading:    #FAF8F5;
    --ncg-color-body:       #F2EFE9; /* soft ivory */
    --ncg-color-muted:      #B9B4AA;
    --ncg-color-bg-paper:   #121417; /* obsidian slate */
    --ncg-color-bg-surface: #1E2227;
    --ncg-color-border:     #737B85;
    --ncg-link:             #8FD0DB;
    --ncg-hero-1:   #0B2B33;
    --ncg-hero-2:   #0F3A44;
    --ncg-hero-3:   #0A242B;
    --ncg-chrome:   #0B1F25;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #7FB2FF;
    --nbedi-hairline: #646C75; /* 3:1 on the dark surface */
}

/* ---- 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;
    --nbedi-hairline: #FFFFFF;
    --nbedi-hover-tint: transparent;
    --nbedi-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, .nbedi-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(--nbedi-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(--nbedi-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); }
/* The text wordmark wraps to two lines on phones; the parent's title line
   box (40px type around 21.6px words) leaves a gap that reads as two items. */
.site-header .site-title { font-size: 1.35rem; line-height: 1.25; margin: 0; }
.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, nbedi-logo.png on the light header and
   nbedi-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.
   ========================================================================== */
.nbedi-logo-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 4px; }
.nbedi-logo-link:hover, .nbedi-logo-link:focus { background: none; }
.nbedi-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.nbedi-header { column-gap: 28px; }
    .nbedi-header .site-header-end { gap: 20px; }
    .nbedi-header .site-navigation ul.menu > li > a { padding-inline: 10px; }
}
@media (min-width: 861px) and (max-width: 1199px) {
    .site-header.nbedi-header:not(.dynamic-header) { max-width: none; padding-inline: 32px; }
}
.nbedi-logo { display: block; height: 80px; width: auto; max-width: 100%; }
.nbedi-logo-reverse { display: none; }
html[data-ncg-theme="dark"] .nbedi-logo-light,
html[data-ncg-theme="high-contrast"] .nbedi-logo-light { display: none; }
html[data-ncg-theme="dark"] .nbedi-logo-reverse,
html[data-ncg-theme="high-contrast"] .nbedi-logo-reverse { display: block; }
@media (forced-colors: active) and (prefers-color-scheme: dark) { .nbedi-logo-light { display: none; } .nbedi-logo-reverse { display: block; } }
@media (max-width: 600px) { .nbedi-logo { height: 64px; } }
/* The parent paints Novara's white logo over any Customizer logo in dark and
   high-contrast modes. header.php never prints the Customizer logo, but if a
   plugin or a later edit does, it must not turn into Novara's. */
html[data-ncg-theme] .site-header .custom-logo-link { background: none !important; }
html[data-ncg-theme] .site-header .custom-logo { visibility: visible !important; }

/* ==========================================================================
   FOOTER: grouped 4-column, on the mode-stable dark chrome (always dark;
   forced black in high-contrast). Text is on-chrome in every mode.
   ========================================================================== */
.nbedi-footer { background: var(--ncg-chrome); color: var(--ncg-on-chrome); padding: 56px 0 0; }
#site-footer.nbedi-footer { max-width: none; width: 100%; }
.nbedi-footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 40px;
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
}
.nbedi-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;
}
.nbedi-footer-col ul { list-style: none; margin: 0; padding: 0; }
.nbedi-footer-col li { margin-bottom: 11px; }
.nbedi-footer-col a, .nbedi-footer-parent a { color: var(--ncg-on-chrome); text-decoration: none; opacity: .92; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.nbedi-footer-col a:hover, .nbedi-footer-col a:focus-visible,
.nbedi-footer-parent a:hover, .nbedi-footer-parent a:focus-visible { opacity: 1; color: var(--ncg-chrome-accent); border-bottom-color: currentColor; background: none; }
.nbedi-footer a:focus-visible { outline-color: var(--ncg-chrome-accent) !important; }
.nbedi-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; }
.nbedi-footer-tagline { color: var(--ncg-on-chrome); opacity: .85; line-height: 1.6; margin: 0 0 14px; max-width: 38ch; }
.nbedi-footer-parent { color: var(--ncg-on-chrome); opacity: .8; font-size: .9rem; margin: 0; line-height: 1.6; }
.nbedi-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; }
.nbedi-footer .site-footer-legal p { margin: 0 0 4px; font-size: .82rem; color: var(--ncg-on-chrome); opacity: .8; }
.nbedi-footer .footer-formulation { font-style: italic; }
html[data-ncg-theme="high-contrast"] .nbedi-footer .site-footer-legal { border-top-color: #fff; }
html[data-ncg-theme="high-contrast"] .nbedi-footer-head,
html[data-ncg-theme="high-contrast"] .nbedi-footer-tagline,
html[data-ncg-theme="high-contrast"] .nbedi-footer-parent,
html[data-ncg-theme="high-contrast"] .nbedi-footer-col a,
html[data-ncg-theme="high-contrast"] .nbedi-footer .site-footer-legal p { opacity: 1; color: #fff; }
html[data-ncg-theme="high-contrast"] .nbedi-footer-col a:hover,
html[data-ncg-theme="high-contrast"] .nbedi-footer-col a:focus-visible { color: #FFFF00; }

@media (max-width: 900px) { .nbedi-footer-inner { grid-template-columns: 1fr 1fr; } .nbedi-footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .nbedi-footer-inner { grid-template-columns: 1fr; padding: 0 24px; } .nbedi-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); }
.nbedi-footer { position: relative; }
.nbedi-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; }
}

/* ==========================================================================
   TACTILE: structure from crisp hairlines, not soft shadows. A blurred shadow
   vanishes for many low-vision readers and smears at 200 to 400 percent zoom;
   a 1px rule keeps every card, table and timeline edge findable. The page
   templates draw their dividers with --rec-hairline (a faint mix of the border
   color); here it is the solid hairline instead. "body .rec-main" outranks the
   templates' own ".rec-main" rule wherever it prints, and loses to their
   high-contrast rule, which already makes every hairline white. Controls keep
   their 3:1 --ncg-color-border; the hairline is for dividers only.
   ========================================================================== */
body .rec-main { --rec-hairline: var(--nbedi-hairline); }
body .rec-door:hover, body .rec-door:focus-visible { box-shadow: none; }
hr { border: 0; border-top: 1px solid var(--nbedi-hairline); }

/* A thicker focus ring with an offset, so keyboard focus never blends into the
   slate-teal chrome or the amber buttons (3px ring, 2px gap). */
:focus-visible { outline-width: 3px !important; outline-style: solid !important; outline-offset: 2px !important; }
