/* ==========================================================================
   Whitley County Fiscal Court — design system
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand-900: #0b2540;
  --brand-800: #10365b;
  --brand-700: #164a78;
  --brand-600: #1d5e94;
  --brand-500: #2b7ab8;
  --brand-100: #dcebf7;
  --brand-050: #f0f6fc;

  /* Brand as *foreground* — links, icons, small headings sitting on a page
     surface. Kept separate from the numbered ramp above because those double as
     dark backgrounds (buttons, hero, footer) and so cannot be lightened for
     dark mode without wrecking them. */
  --brand-fg:        #1a5687;
  --brand-fg-strong: #113f66;

  --gold-700: #8a6414;
  --gold-600: #a97c1c;
  --gold-500: #c8971f;
  --gold-100: #f7ecd0;

  --green-700: #1d6b4f;
  --green-100: #dcf1e8;
  --red-700:   #a32222;
  --red-100:   #fbe4e4;

  /* Neutrals */
  --ink:        #14202e;
  --ink-2:      #3d4c5c;
  --ink-3:      #62707f;
  --line:       #dfe5ec;
  /* Control boundaries need 3:1 of their own (WCAG 1.4.11); --line is a
     divider colour and is far too faint to outline an input. */
  --field-border: #7d8896;
  --line-2:     #eef2f6;
  --surface:    #ffffff;
  --surface-2:  #f5f8fb;
  --surface-3:  #eaf0f6;

  --shadow-1: 0 1px 2px rgba(16, 38, 62, .06), 0 1px 3px rgba(16, 38, 62, .08);
  --shadow-2: 0 4px 12px rgba(16, 38, 62, .08), 0 2px 4px rgba(16, 38, 62, .06);
  --shadow-3: 0 12px 32px rgba(16, 38, 62, .12), 0 4px 8px rgba(16, 38, 62, .06);

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --wrap: 1180px;
  --gap: clamp(1rem, 2.5vw, 2rem);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--brand-500);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-100: #16374f;
    --brand-050: #12293c;
    --gold-100:  #3b3016;
    --green-100: #16362c;
    --red-100:   #3a1f1f;

    /* The -700 accents are tuned for white backgrounds; on dark surfaces they
       fall to roughly 2:1. Lift them so badge text, notice icons, and form
       error messages stay legible. */
    --gold-700:  #f2c96b;
    --green-700: #6ddaa8;
    --red-700:   #ff9b9b;

    --brand-fg:        #93c5f0;
    --brand-fg-strong: #bedcf7;

    --ink:       #e6edf5;
    --ink-2:     #b3c1d1;
    --ink-3:     #8b9bad;
    --line:      #2b3a4c;
    --field-border: #5f6f80;
    --line-2:    #223040;
    --surface:   #101923;
    --surface-2: #16222f;
    --surface-3: #1d2c3c;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 4px 12px rgba(0,0,0,.45);
    --shadow-3: 0 12px 32px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand-100: #16374f;
  --brand-050: #12293c;
  --gold-100:  #3b3016;
  --green-100: #16362c;
  --red-100:   #3a1f1f;

  /* Keep in step with the prefers-color-scheme block above. */
  --gold-700:  #f2c96b;
  --green-700: #6ddaa8;
  --red-700:   #ff9b9b;

  --brand-fg:        #93c5f0;
  --brand-fg-strong: #bedcf7;

  --ink:       #e6edf5;
  --ink-2:     #b3c1d1;
  --ink-3:     #8b9bad;
  --line:      #2b3a4c;
  --field-border: #5f6f80;
  --line-2:    #223040;
  --surface:   #101923;
  --surface-2: #16222f;
  --surface-3: #1d2c3c;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,.45);
  --shadow-3: 0 12px 32px rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-fg); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-fg-strong); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm);
}
/* Forced-colors modes (Windows High Contrast) discard box-shadow, which would
   leave the focus ring above with no visible indicator at all. Put a real
   outline back, and let the OS pick the colour. */
@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid Highlight; outline-offset: 2px;
  }
  .wc-form [aria-invalid="true"] { border-color: Mark; }
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-family: var(--font-serif); font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); letter-spacing: -.02em; }
h2 { font-family: var(--font-serif); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li + li { margin-top: .3rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: .5rem; top: -100%; z-index: 200;
  background: var(--brand-700); color: #fff; padding: .7rem 1.1rem;
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: .5rem; color: #fff; }

/* ---------- Utility bar ---------- */
.utility {
  background: var(--brand-900);
  color: #cfe0ef;
  font-size: .82rem;
}
.utility__inner {
  display: flex; align-items: center; gap: 1rem;
  justify-content: space-between; min-height: 40px; flex-wrap: wrap;
}
.utility a { color: #cfe0ef; text-decoration: none; }
.utility a:hover { color: #fff; text-decoration: underline; }
.utility__contact { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.utility__contact span, .utility__contact a { display: inline-flex; align-items: center; gap: .4rem; }
.utility__actions { display: flex; align-items: center; gap: .5rem; }

.theme-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.25); color: #cfe0ef;
  border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0;
}
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: inherit; }
.brand__seal { width: 54px; height: 54px; object-fit: contain; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.05rem, .9rem + .6vw, 1.35rem); color: var(--ink); letter-spacing: -.01em;
}
.brand__sub { font-size: .74rem; text-transform: uppercase; letter-spacing: .11em; color: var(--ink-3); font-weight: 600; }

.nav-toggle {
  display: none; align-items: center; gap: .5rem;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-sm); padding: .55rem .8rem; font: inherit; font-weight: 600; cursor: pointer;
}

.primary-nav > ul {
  display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0;
}
.primary-nav li { margin: 0; position: relative; }
.primary-nav a, .primary-nav .nav-parent {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .93rem;
  background: none; border: 0; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.primary-nav a:hover, .primary-nav .nav-parent:hover { background: var(--surface-3); color: var(--brand-fg-strong); }
.primary-nav a[aria-current="page"], .primary-nav li.is-active > a, .primary-nav li.is-active > .nav-parent {
  color: var(--brand-fg-strong); background: var(--brand-050);
  box-shadow: inset 0 -2px 0 var(--brand-600);
}
.nav-parent svg { transition: transform .15s ease; }
.nav-parent[aria-expanded="true"] svg { transform: rotate(180deg); }

.submenu {
  position: absolute; top: calc(100% + .3rem); left: 0; z-index: 60;
  min-width: 250px; padding: .4rem; margin: 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
  display: none;
}
.submenu.is-open { display: block; }
.submenu li { margin: 0; }
.submenu a {
  display: block; width: 100%; padding: .5rem .7rem; font-weight: 500; font-size: .9rem;
  border-radius: var(--radius-sm);
}
.submenu--cols { min-width: 460px; column-count: 2; column-gap: .4rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600) 55%, var(--brand-700));
}
/* Photo sits above the base gradient; the ::after wash sits above the photo.
   Both use z-index:-1, so DOM order decides which paints on top. */
.hero__bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -1;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  /* The wash is what guarantees text contrast over an unpredictable photo, so
     it is set from the worst case: a near-white area of the image sitting under
     the weakest (top) part of the gradient. */
  background: linear-gradient(180deg, rgba(11,37,64,.84) 0%, rgba(11,37,64,.92) 100%);
}
.hero__inner { padding: clamp(2.5rem, 6vw, 5rem) 0; max-width: 42rem; position: relative; z-index: 1; }
.hero h1 { color: #fff; margin-bottom: .6rem; }
.hero__eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  /* Lighter than --gold-500: at 12.5px this counts as normal-size text and so
     needs 4.5:1 against the brightest part of the photo behind it. */
  text-transform: uppercase; color: #ecc978; margin-bottom: .9rem;
}
.hero__lede { font-size: clamp(1rem, .95rem + .35vw, 1.15rem); color: #dae7f2; margin-bottom: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Page header (interior) ---------- */
.page-head {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-700));
  color: #fff; padding: clamp(1.75rem, 4vw, 2.75rem) 0;
}
.page-head h1 { color: #fff; margin-bottom: .35rem; }
.page-head p { color: #cfe0ef; margin: 0; max-width: 55ch; }

.breadcrumb { font-size: .85rem; margin-bottom: .8rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: .4rem; color: #a9c4dc; }
.breadcrumb li + li::before { content: "/"; color: #6f92b4; }
.breadcrumb a { color: #cfe0ef; text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: #fff; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
/* Inline SVGs carry no intrinsic size — constrain them or they fill the button. */
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--primary { background: var(--gold-500); color: #21180a; border-color: var(--gold-500); }
.btn--primary:hover { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.btn--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.45); }
.btn--ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn--solid { background: var(--brand-700); color: #fff; border-color: var(--brand-700); }
.btn--solid:hover { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn--outline { background: var(--surface); color: var(--brand-fg-strong); border-color: var(--line); }
.btn--outline:hover { background: var(--surface-3); border-color: var(--brand-600); color: var(--brand-fg-strong); }
.btn--sm { padding: .45rem .8rem; font-size: .86rem; }

/* ---------- Sections & cards ---------- */
main { display: block; }
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section--tint { background: var(--surface-3); }
.section__head { margin-bottom: 1.75rem; max-width: 60ch; }
.section__head p { color: var(--ink-2); margin: 0; }
.section__head h2 { margin-bottom: .35rem; }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-1);
}
.card h3 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }
.card--link { text-decoration: none; color: inherit; display: block; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
.card--link:hover { box-shadow: var(--shadow-2); border-color: var(--brand-500); transform: translateY(-2px); color: inherit; }
.card--link:hover h3 { color: var(--brand-fg-strong); }
.card__icon {
  width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: .8rem;
  border-radius: var(--radius-sm); background: var(--brand-050); color: var(--brand-fg);
}
.card__icon svg { width: 22px; height: 22px; }
.card__meta { font-size: .85rem; color: var(--ink-3); margin: 0; }

/* Quick action cards on the home page */
.quick-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.quick {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold-500);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-1); transition: box-shadow .15s ease, transform .15s ease;
}
.quick:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); color: inherit; }
.quick:hover .quick__title { color: var(--brand-fg-strong); }
.quick svg { width: 26px; height: 26px; flex: none; color: var(--brand-fg); margin-top: .1rem; }
.quick__title { font-weight: 700; display: block; margin-bottom: .1rem; }
.quick__desc { font-size: .87rem; color: var(--ink-3); }

/* ---------- Person / official cards ---------- */
.person {
  display: flex; gap: 1.1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-1);
}
.person__photo {
  width: 92px; height: 112px; object-fit: cover; flex: none;
  border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line);
}
.person__body { min-width: 0; }
.person__role {
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-fg); display: block; margin-bottom: .15rem;
}
.person__name { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; font-family: var(--font-serif); }
.person__detail { font-size: .89rem; color: var(--ink-2); margin: 0; }
.person__detail a { text-decoration: none; }
.person__detail a:hover { text-decoration: underline; }

/* Compact staff chips (administration org view) */
.staff-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.staff {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; text-align: center; box-shadow: var(--shadow-1);
}
.staff img {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto .7rem;
  border: 3px solid var(--surface-3); background: var(--surface-3);
}
.staff__name { font-weight: 700; font-size: .97rem; }
.staff__role { font-size: .82rem; color: var(--ink-3); }

/* ---------- Contact / info blocks ---------- */
.info-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-1);
}
.info-panel h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-size: .8rem; margin-bottom: .8rem; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.info-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list li:first-child { padding-top: 0; }
.info-list svg { width: 18px; height: 18px; color: var(--brand-fg); flex: none; margin-top: .22rem; }
.info-list a { text-decoration: none; font-weight: 600; }
.info-list a:hover { text-decoration: underline; }
.info-list dt, .info-list .lbl { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }

.phone-table { font-size: .95rem; }
.phone-table tr { border-bottom: 1px solid var(--line-2); }
.phone-table tr:last-child { border-bottom: 0; }
.phone-table th, .phone-table td { text-align: left; padding: .65rem .5rem; vertical-align: baseline; }
.phone-table th { font-weight: 600; color: var(--ink); width: 55%; }
.phone-table td { text-align: right; white-space: nowrap; }
.phone-table td a { text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.phone-table td a:hover { text-decoration: underline; }
/* On narrow phones the nowrap number plus a long office name overflows the
   viewport, so stack the two cells instead. */
@media (max-width: 460px) {
  .phone-table th, .phone-table td { display: block; width: auto; padding: .35rem .25rem; }
  .phone-table th { padding-top: .7rem; padding-bottom: 0; }
  .phone-table td { text-align: left; padding-bottom: .7rem; white-space: normal; }
}

/* ---------- Layout with sidebar ---------- */
.with-aside { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .with-aside { grid-template-columns: minmax(0, 1fr) 320px; }
  .with-aside--left { grid-template-columns: 280px minmax(0, 1fr); }
}
.aside { display: grid; gap: 1.1rem; }
@media (min-width: 900px) { .aside { position: sticky; top: 5.5rem; } }

.sidenav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.sidenav h3 {
  margin: 0; padding: .85rem 1.1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.sidenav ul { list-style: none; margin: 0; padding: .4rem; }
.sidenav li { margin: 0; }
.sidenav a {
  display: block; padding: .5rem .7rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink-2); font-size: .91rem; font-weight: 500;
}
.sidenav a:hover { background: var(--surface-3); color: var(--brand-fg-strong); }
.sidenav a[aria-current="page"] { background: var(--brand-050); color: var(--brand-fg-strong); font-weight: 700; }

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius); padding: 1rem 1.15rem; border: 1px solid var(--line);
  background: var(--surface); display: flex; gap: .8rem; align-items: flex-start;
}
.notice svg { width: 20px; height: 20px; flex: none; margin-top: .2rem; }
.notice p:last-child { margin-bottom: 0; }
.notice__title { font-weight: 700; margin: 0 0 .2rem; }
.notice--alert { background: var(--gold-100); border-color: var(--gold-500); }
.notice--alert svg { color: var(--gold-700); }
.notice--info { background: var(--brand-050); border-color: var(--brand-500); }
.notice--info svg { color: var(--brand-fg); }
.notice--warn { background: var(--red-100); border-color: var(--red-700); }
.notice--warn svg { color: var(--red-700); }

.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.badge--special { background: var(--red-100); color: var(--red-700); }
.badge--video { background: var(--green-100); color: var(--green-700); }
.badge--pdf { background: var(--brand-100); color: var(--brand-fg-strong); }

/* ---------- Document archive ---------- */
.doc-toolbar {
  display: grid; gap: .8rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow-1); margin-bottom: 1.5rem;
}
@media (min-width: 720px) { .doc-toolbar { grid-template-columns: 1fr auto auto; align-items: end; } }
.field { display: grid; gap: .3rem; }
.field label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.field input, .field select {
  font: inherit; padding: .6rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--field-border); background: var(--surface); color: var(--ink); min-height: 44px;
}
.field input:focus, .field select:focus { border-color: var(--brand-500); }
.search-field { position: relative; }
.search-field input { padding-left: 2.4rem; width: 100%; }
.search-field svg { position: absolute; left: .7rem; bottom: .78rem; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }

.doc-count { font-size: .88rem; color: var(--ink-3); margin-bottom: .8rem; }
.doc-group { margin-bottom: 1.75rem; }
.doc-group__title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--brand-fg-strong); padding-bottom: .5rem; border-bottom: 2px solid var(--brand-100); margin-bottom: .3rem;
}
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { margin: 0; border-bottom: 1px solid var(--line-2); }
.doc-list li:last-child { border-bottom: 0; }
.doc-link {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .5rem;
  text-decoration: none; color: var(--ink); border-radius: var(--radius-sm);
}
.doc-link:hover { background: var(--surface-3); color: var(--brand-fg-strong); }
.doc-link svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); }
.doc-link:hover svg { color: var(--brand-fg); }
.doc-link__title { flex: 1; min-width: 0; font-weight: 500; }
.doc-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-3); }

/* ---------- Link directory ---------- */
.link-card {
  display: grid; gap: 1rem; grid-template-columns: 140px minmax(0, 1fr); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--shadow-1);
}
@media (max-width: 560px) { .link-card { grid-template-columns: 1fr; } }
.link-card img { border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.link-card h3 { margin-bottom: .3rem; }
.link-card h3 a { text-decoration: none; }
.link-card h3 a:hover { text-decoration: underline; }
.link-card p { font-size: .92rem; color: var(--ink-2); margin-bottom: 0; }

.logo-links { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.logo-link {
  display: grid; place-items: center; padding: .9rem; min-height: 90px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink-2); font-size: .85rem; font-weight: 600; text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.logo-link:hover { border-color: var(--brand-500); box-shadow: var(--shadow-2); color: var(--brand-fg-strong); }
.logo-link img { max-height: 54px; width: auto; object-fit: contain; }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { padding: .7rem .85rem; font-size: .84rem; color: var(--ink-2); }

/* ---------- Prose ---------- */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose > :first-child { margin-top: 0; }
.lede { font-size: 1.1rem; color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-900); color: #b9cee0; padding: 2.5rem 0 0; margin-top: auto; }
.site-footer a { color: #d6e5f2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); padding-bottom: 2rem; }
.footer-brand { display: flex; gap: .9rem; align-items: flex-start; }
.footer-brand img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.footer-brand strong { color: #fff; font-family: var(--font-serif); font-size: 1.1rem; display: block; }
.footer-col h2 { color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.footer-col li { margin: 0 0 .45rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14); padding: 1.1rem 0 1.5rem;
  font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
body { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Responsive nav ---------- */
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-3); max-height: calc(100vh - 100%); overflow-y: auto;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem; }
  .primary-nav > ul > li { border-bottom: 1px solid var(--line-2); }
  .primary-nav > ul > li:last-child { border-bottom: 0; }
  .primary-nav a, .primary-nav .nav-parent { width: 100%; justify-content: space-between; padding: .8rem .7rem; font-size: 1rem; }
  .submenu {
    position: static; display: none; box-shadow: none; border: 0; min-width: 0;
    padding: 0 0 .5rem .7rem; border-left: 2px solid var(--brand-100); margin-left: .7rem;
    background: transparent; column-count: 1 !important;
  }
  .submenu.is-open { display: block; }
  .site-header__inner { position: relative; }
  .utility__contact { display: none; }
}
@media (max-width: 560px) {
  .person { flex-direction: column; }
  .person__photo { width: 100px; height: 122px; }
  .footer-bottom { flex-direction: column; }
}

/* Very narrow phones: keep the masthead on one line rather than letting the
   county name and its subtitle each wrap. */
@media (max-width: 400px) {
  .brand { gap: .6rem; }
  .brand__seal { width: 42px; height: 42px; }
  .brand__name { font-size: 1.02rem; white-space: nowrap; }
  .brand__sub { font-size: .62rem; letter-spacing: .07em; white-space: nowrap; }
  .nav-toggle { padding: .5rem .6rem; }
}

/* ---------- Contact form ---------- */
.wc-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.75rem); box-shadow: var(--shadow-1);
  display: grid; gap: 1.15rem; margin-bottom: 1.5rem;
}
.form-row { display: grid; gap: 1.15rem; align-items: start; }
@media (min-width: 620px) { .form-row { grid-template-columns: 1fr 1fr; } }
/* Without this, a field with no hint text stretches its input to match the
   height of a neighbouring field that has one. */
.wc-form .field { align-content: start; }

/* Long-form labels read better in sentence case than the small-caps used on
   the compact archive toolbar. */
.wc-form .field label {
  text-transform: none; letter-spacing: normal;
  font-size: .95rem; font-weight: 600; color: var(--ink);
}
.wc-form .field textarea {
  font: inherit; padding: .6rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--field-border); background: var(--surface); color: var(--ink);
  resize: vertical; min-height: 9rem; width: 100%;
}
.wc-form .field textarea:focus { border-color: var(--brand-500); }
.req { color: var(--red-700); font-weight: 700; }
.field-optional { color: var(--ink-3); font-weight: 400; font-size: .87rem; }
.field-hint { font-size: .84rem; color: var(--ink-3); margin: 0; }
.field-err { font-size: .87rem; font-weight: 600; color: var(--red-700); margin: 0; }
.field-err::before { content: "⚠ "; }
/* Uses an inset shadow so it thickens the field edge without competing with the
   focus ring, and restates the focus ring at higher specificity — otherwise this
   rule (0,2,0) outranks :focus-visible (0,1,0) and an invalid field shows no
   focus indicator at all. */
.wc-form [aria-invalid="true"] { border-color: var(--red-700); box-shadow: inset 0 0 0 1px var(--red-700); }
.wc-form [aria-invalid="true"]:focus-visible { box-shadow: var(--focus); }

/* Off-screen rather than display:none — plenty of bots skip hidden fields but
   still fill ones that are merely positioned away. */
.hp-field {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.form-summary {
  border: 1px solid var(--red-700); background: var(--red-100);
  border-radius: var(--radius); padding: 1rem 1.15rem;
}
.form-summary__title { font-weight: 700; margin: 0 0 .4rem; color: var(--red-700); }
.form-summary ul { margin: 0; padding-left: 1.2rem; }
.form-summary a { color: var(--red-700); font-weight: 600; }

/* Hidden until the URL fragment selects one, so the submission result shows
   without JavaScript. display:none also keeps the unselected banners out of the
   accessibility tree, which the hidden attribute would have done. */
.form-status {
  display: none; gap: .8rem; align-items: flex-start;
  border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  scroll-margin-top: 6rem;   /* clear the sticky header when jumped to */
}
.form-status:target { display: flex; }
.form-status svg { width: 20px; height: 20px; flex: none; margin-top: .2rem; }
.form-status p:last-child { margin-bottom: 0; }
.form-status--ok { background: var(--green-100); border-color: var(--green-700); }
.form-status--ok svg { color: var(--green-700); }
.form-status--error { background: var(--red-100); border-color: var(--red-700); }
.form-status--error svg { color: var(--red-700); }

.form-privacy {
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .87rem; color: var(--ink-3); margin: 0;
  padding-top: .35rem; border-top: 1px solid var(--line-2);
}
.form-privacy svg { width: 17px; height: 17px; flex: none; margin-top: .18rem; }

.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-actions__note { font-size: .85rem; color: var(--ink-3); }
.wc-form button[disabled] { opacity: .6; cursor: progress; }

/* ---------- Print ---------- */
@media print {
  .utility, .site-header, .site-footer, .doc-toolbar, .skip-link, .aside,
  .wc-form, .form-status, .hp-field { display: none !important; }
  body { background: #fff; color: #000; }
  .page-head { background: none; color: #000; padding: 0 0 1rem; }
  .page-head h1, .page-head p { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
