/* ==========================================================================
   Accessibility Governance Record: "Record" palette layer (agr-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 palette.
   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/agr/ 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:    #23312C; /* Deep Norwood Pine, the publisher's brand ink */
    --ncg-color-secondary:  #4E625B; /* slate green, a touch cooler than NCG's */
    --ncg-color-accent:     #C89B7B; /* copper, as NCG */
    --ncg-on-accent:        #23312C; /* text that sits ON the accent */
    /* Accent that sits ON the dark chrome (heroes, CTA band, footer). */
    --ncg-chrome-accent:    #C89B7B;
    /* 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:      #8A5A38;
    --ncg-focus:            #8A5A38; /* 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:   #F9F8F4; /* warm off-white, as NCG */
    --ncg-color-bg-surface: #FFFFFF;
    --ncg-color-border:     #767676; /* 3:1 boundary on paper and white */
    --ncg-link:             #23312C;

    /* mode-stable chrome: pine into deep teal */
    --ncg-hero-1:   #23312C;
    --ncg-hero-2:   #1F3A3D;
    --ncg-hero-3:   #1A2B3A;
    --ncg-chrome:   #1B2724;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #5F8F86; /* verdigris: card numbers, accent borders, the second voice */
    --agr-hover-tint: rgba(138, 90, 56, 0.10);
    --agr-focus-glow: rgba(138, 90, 56, 0.25);
}
/* ---- Dark ------------------------------------------------------------- */
html[data-ncg-theme="dark"] {
    --ncg-color-primary:    #8FBFA8;
    --ncg-color-secondary:  #A8B8B0;
    --ncg-color-accent:     #E3B98C;
    --ncg-on-accent:        #23312C;
    --ncg-chrome-accent:    #E3B98C;
    --ncg-accent-text:      #E3B98C;
    --ncg-focus:            #E3B98C;
    --ncg-color-heading:    #FAFAFA;
    --ncg-color-body:       #E4E4E4;
    --ncg-color-muted:      #B7B7B7;
    --ncg-color-bg-paper:   #1A1F1D;
    --ncg-color-bg-surface: #23282A;
    --ncg-color-border:     #6E7A75; /* raised from the parent's #5A5A5A, which is 2.4:1 on this ground */
    --ncg-link:             #9FCDB8;
    --ncg-hero-1:   #121816;
    --ncg-hero-2:   #16262A;
    --ncg-hero-3:   #121D27;
    --ncg-chrome:   #121816;
    --ncg-on-chrome: #FFFFFF;
    --ncg-accent-2: #8CC2B8;
}

/* ---- 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;
    --agr-hover-tint: transparent;
    --agr-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, .agr-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(--agr-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(--agr-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, agr-logo.png on the light header and
   agr-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.
   ========================================================================== */
.agr-logo-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 4px; }
.agr-logo-link:hover, .agr-logo-link:focus { background: none; }
.agr-logo-link:focus-visible { outline: 3px solid var(--ncg-focus); outline-offset: 4px; }
/* 96px on desktop and 72px on phones so the three-line wordmark reads
   comfortably; measured with the menu and CTA still on one row from 1280px up. */
.agr-logo { display: block; height: 96px; width: auto; max-width: 100%; }
.agr-logo-reverse { display: none; }
html[data-ncg-theme="dark"] .agr-logo-light,
html[data-ncg-theme="high-contrast"] .agr-logo-light { display: none; }
html[data-ncg-theme="dark"] .agr-logo-reverse,
html[data-ncg-theme="high-contrast"] .agr-logo-reverse { display: block; }
@media (forced-colors: active) and (prefers-color-scheme: dark) { .agr-logo-light { display: none; } .agr-logo-reverse { display: block; } }
@media (max-width: 600px) { .agr-logo { height: 72px; } }

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

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