/* ============================================
   brand.css -- Butler County Health Department
   Brand config layer. Sits between mainstyle.css and custom.css.
   Colors, fonts, and brand-level overrides only.
   Do NOT put component or page-specific styles here.
   Load order: mainstyle.css -> brand.css -> custom.css (plan row 33, 2026-09-28)
   ============================================ */

/* --- Brand Colors ---
   Brief section 3 palette (BCHD_Website_Brief.docx), confirmed in plan Task 05.
   The comps carry their colors as inline styles, so these tokens are the reference set for
   new work (build rows, forms, CMS-driven blocks). They do not repaint the lifted markup. */
:root {
  --brand-primary:      #13316E;   /* Department Navy: header bar, footer, H1/H2, primary buttons (12.41:1 on white) */
  --brand-action:       #0B5E8F;   /* Action Blue: body links, focus rings, active nav, secondary buttons (6.97:1 on white) */
  --brand-text:         #1F2933;   /* Body text (14.76:1 on white) */
  --brand-tint:         #F4F6FA;   /* Background tint: alternating bands, table headers, callouts */
  --brand-alert:        #8A2B0F;   /* Alert Rust: health alerts and urgent notices ONLY, never decorative */
  --brand-muted:        #5A6472;   /* Muted: timestamps, breadcrumb separators, helper text, footer secondary (6.00:1) */
  --brand-bg:           #FFFFFF;   /* Surface: primary page background */

  /* Comp-derived (in the approved DesignCode comps, not in the brief table) */
  --brand-primary-deep: #0E2450;   /* dark hero bands + footer ground */
  --brand-primary-mid:  #164A85;   /* hero gradient end stop */
  --brand-on-dark:      #FFFFFF;   /* text on dark bands */
  --brand-on-dark-soft: #B9C6DE;   /* footer body text on --brand-primary-deep */
  --brand-border:       #E3E8F1;   /* hairline borders (header rule, cards) */
}

/* --- Brand Fonts ---
   Public Sans (brief section 3). Served by the Google Fonts link in each page head
   (weights 400-800; the comps use 800 on 118 elements). The brief asks for self-hosted WOFF2
   (F8); Clay deferred that 2026-09-28, so this block declares no font faces. If it comes back, the
   faces go in this block and the Google link comes out of every page head in the same pass.
   body font-family is set in custom.css (comp verbatim); not restated here. */

/* --- Orphan / Widow Prevention (base standard v2.21.0+) --- */
/* Required on every site. Never remove. Never hand-patch with <br>. */
h1, h2, h3, h4, h5, .display, .eyebrow { text-wrap: balance; }
p, li, blockquote, figcaption, .blurb, .lead { text-wrap: pretty; }

/* --- Dark bands (E-25) ---
   This file sets NO heading color. Every page H1 (and the homepage CTA H2) sits on a dark band
   with no color of its own and inherits white from the band; measured on all 14 pages
   2026-09-28. A blanket h1-h6 color here would make all 15 of them invisible.
   The comps have no band class, so the hooks below key on the dark ground the comps actually
   write inline: background #0E2450 (solid, or as a gradient stop) on a section.
   Rule 1: the band declares its own on-dark color. The comps' own inline color wins where it
   exists; this covers the bands that set none (the homepage CTA band). Rule 2: headings on a
   dark band inherit that color, so a future heading rule cannot reach them. Keep BOTH.
   The footer already declares its own color inline (#B9C6DE), so it only needs rule 2. */
section[style*="background:#0E2450" i],
section[style*="background:linear-gradient"][style*="#0E2450" i] {
  color: var(--brand-on-dark);
}
section[style*="background:#0E2450" i] :is(h1, h2, h3, h4, h5, h6),
section[style*="background:linear-gradient"][style*="#0E2450" i] :is(h1, h2, h3, h4, h5, h6),
footer :is(h1, h2, h3, h4, h5, h6) {
  color: inherit;
}

/* --- Link hover companion (3F Group G) ---
   custom.css carries the comps' global a:hover (navy), verbatim from compose. Navy on a navy,
   blue or rust ground disappears, so every brand-colored surface keeps a legible hover here.
   Higher specificity than the global, so load order does not matter. Anchors that carry an
   inline color are unaffected either way (inline beats :hover); their hovers are the .hv-N
   classes in custom.css. */
section[style*="background:#0E2450" i] a:hover,
section[style*="background:linear-gradient"][style*="#0E2450" i] a:hover,
footer a:hover,
[style*="background:#13316E" i] a:hover,
[style*="background:#0B5E8F" i] a:hover,
[style*="background:#8A2B0F" i] a:hover {
  color: var(--brand-on-dark);
}

/* --- Focus (brief section 3: focus rings are Action Blue; WCAG 2.4.7 / 2.4.11, 3:1) --- */
:focus-visible {
  outline: 3px solid var(--brand-action);
  outline-offset: 2px;
}
section[style*="background:#0E2450" i] :focus-visible,
section[style*="background:linear-gradient"][style*="#0E2450" i] :focus-visible,
footer :focus-visible,
[style*="background:#13316E" i] :focus-visible,
[style*="background:#0B5E8F" i] :focus-visible,
[style*="background:#8A2B0F" i] :focus-visible {
  outline-color: var(--brand-on-dark);
}
