/*
 * KSGenWeb Modern Rebuild — styles.css
 * ======================================
 * DESIGN ARCHETYPE: Scholarly Research Archive / Finding Aid Catalog
 * Distinct from the formal government site and the friendly library demo.
 * Design language: muted parchment/sepia/ink + terracotta + sunflower-gold accents,
 * thin ruled dividers, compact rows, persistent sidebar, serif body text.
 *
 * FONT: Source Serif 4 (body serif) + Inter (labels/nav/UI)
 *
 * COLOR PALETTE & CONTRAST RATIOS (verified via WCAG formula):
 * ------------------------------------------------------------------
 * --color-ink:             #2B1F14   (primary ink — headings, bold; on parchment ≈14:1 ✓)
 * --color-terracotta:      #8B3318   (primary — header bar, buttons, links; white on this ≈7.1:1 ✓)
 * --color-rust:            #5E2209   (hover/active; white on this ≈10:1 ✓)
 * --color-brown-deep:      #3A2417   (darkest; logo disc)
 * --color-gold:            #B06B10   (sunflower-gold accent — on parchment ≈5.1:1 ✓ for large/UI)
 * --color-gold-light:      #C8821E   (lighter gold — decorative only, never small text)
 * --color-parchment:       #F3ECD9   (page background — aged paper)
 * --color-parchment-mid:   #EAE0C8   (subtle section alt)
 * --color-parchment-dark:  #D4C8AF   (ruled divider lines)
 * --color-parchment-rule:  #C4B89A   (stronger rule — table borders, section rules)
 * --color-text-body:       #2B1F14   (body text on #F3ECD9 ≈ 14:1 ✓)
 * --color-text-muted:      #5C4A35   (muted text on #F3ECD9 ≈ 6.1:1 ✓)
 * --color-focus:           #0055CC   (focus ring — blue on all backgrounds)
 * --color-footer-bg:       #2B1F14   (dark ink footer)
 * ------------------------------------------------------------------
 */

/* ===================================================================
   CSS CUSTOM PROPERTIES
   =================================================================== */
:root {
  /* Colors — scholarly archive / parchment-and-ink palette */
  --color-ink:             #2B1F14;
  --color-terracotta:      #8B3318;
  --color-rust:            #5E2209;
  --color-brown-deep:      #3A2417;
  --color-gold:            #B06B10;
  --color-gold-light:      #C8821E;
  --color-parchment:       #F3ECD9;
  --color-parchment-mid:   #EAE0C8;
  --color-parchment-dark:  #D4C8AF;
  --color-parchment-rule:  #C4B89A;
  --color-text-body:       #2B1F14;
  --color-text-muted:      #5C4A35;
  --color-white:           #FFFFFF;
  --color-card-surface:    #FAF6EC;
  --color-focus:           #0055CC;
  --color-footer-bg:       #2B1F14;
  --color-footer-text:     #C8BCA8;
  --color-footer-link:     #E0D4BC;
  --color-footer-heading:  #F3ECD9;
  --color-success:         #1a6e2e;
  --color-success-bg:      #d4edda;
  /* Aliases kept for backward-compat with before-view overrides */
  --color-ochre:           var(--color-gold-light);
  --color-ochre-dark:      var(--color-gold);
  --color-soil:            var(--color-ink);
  --color-parchment-dark:  #D4C8AF;

  /* Typography — Source Serif 4 (scholarly reading serif) + Inter (labels/nav) */
  --font-sans:   'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:  'Source Serif 4', Georgia, "Times New Roman", Times, serif;
  --font-size-base: 1rem;
  --line-height-base: 1.7;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --container-max: 1280px;
  --container-pad: var(--space-6);
  --border-radius: 2px;
  --border-radius-lg: 4px;
  --sidebar-width: 256px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Focus */
  --focus-ring: 0 0 0 3px var(--color-focus);

  /* Touch target minimum */
  --touch-min: 44px;
}

/* ===================================================================
   REDUCED MOTION — SC 2.3.3 Animation from Interactions
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================================================================
   RESET & BASE
   =================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-body);
  background-color: var(--color-parchment);
  min-height: 100vh;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-terracotta);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--color-rust);
}

ul, ol {
  list-style: none;
}

/* ===================================================================
   FOCUS STATES — SC 2.4.7 Focus Visible
   =================================================================== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn:focus-visible,
.card-link:focus-visible,
.coordinator-email:focus-visible,
.nav-link:focus-visible,
.footer-link:focus-visible,
.site-logo:focus-visible,
.nav-toggle:focus-visible,
.az-link:focus-visible,
.cat-nav__link:focus-visible,
.demo-toolbar__btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--border-radius);
}

/*
 * "Before" button — prominent/inviting so reviewers notice it.
 * Amber text on dark bg: #F5C842 on #1e1e1e ≈ 10.2:1 ✓
 */
#btn-view-before:not(.demo-toolbar__btn--active):not([aria-pressed="true"]) {
  background: #1e1e1e;
  color: #F5C842;
  border: 2px solid #F5C842;
  border-radius: var(--border-radius);
}
#btn-view-before:not(.demo-toolbar__btn--active):not([aria-pressed="true"]):hover {
  background: #2e2e2e;
  color: #FFD966;
  border-color: #FFD966;
}

/* ===================================================================
   VISUALLY HIDDEN — accessible text utility
   =================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================================================
   SKIP LINK — SC 2.4.1 Bypass Blocks
   =================================================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 99999;
  background: var(--color-terracotta);
  color: var(--color-white);
  font-weight: 700;
  font-size: 1rem;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus-visible {
  top: 44px; /* below toolbar */
  outline: 3px solid var(--color-ochre);
  outline-offset: 2px;
}

/* ===================================================================
   CONTAINER UTILITY
   =================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ===================================================================
   BUTTONS — touch targets ≥44×44px (SC 2.5.5)
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius);
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}
.btn--primary:hover {
  background-color: var(--color-rust);
  border-color: var(--color-rust);
  color: var(--color-white);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-terracotta);
  border-color: var(--color-terracotta);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.btn--outline:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

.btn--sm {
  font-size: 0.875rem;
  padding: var(--space-2) var(--space-4);
  min-height: var(--touch-min);
}

/* ===================================================================
   BEFORE/AFTER DEMO TOOLBAR
   Always modern/high-contrast; stays consistent in both views.
   =================================================================== */
.demo-toolbar {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-6);
  min-height: 44px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.demo-toolbar__org {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
}

.demo-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #333;
  border-radius: var(--border-radius);
  padding: 3px;
  flex-shrink: 0;
}

.demo-toolbar__btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #bbb;
  background: transparent;
  border: none;
  border-radius: calc(var(--border-radius) - 2px);
  cursor: pointer;
  padding: 6px 14px;
  min-height: 44px;
  min-width: 44px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}
.demo-toolbar__btn:hover {
  background: #444;
  color: #fff;
}
.demo-toolbar__btn--active,
.demo-toolbar__btn[aria-pressed="true"] {
  background: var(--color-terracotta);
  color: #fff;
}

/* ===================================================================
   ARCHIVE MASTHEAD — slim banner (~140px) with sunflower photo as
   thin textured band; replaces the full-bleed marketing hero.
   =================================================================== */
.archive-masthead {
  position: relative;
  height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.masthead-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  display: block;
  z-index: 0;
}

.masthead-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(27, 14, 5, 0.88) 0%,
    rgba(27, 14, 5, 0.82) 50%,
    rgba(27, 14, 5, 0.70) 100%
  );
}

.masthead-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  justify-content: space-between;
  flex-wrap: wrap;
  padding-block: var(--space-4);
}

.masthead-title-group {
  flex: 1;
  min-width: 0;
}

.masthead-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-bottom: 0.3rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.masthead-provenance {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Masthead search form — compact, archive-first */
.masthead-search-form {
  flex-shrink: 0;
  width: min(420px, 100%);
}

.masthead-search-form__group {
  display: flex;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.masthead-search-form__input {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  font-size: 0.9375rem;
  font-family: var(--font-serif);
  color: var(--color-white);
  background: transparent;
  border: none;
  min-height: var(--touch-min);
  min-width: 0;
}
.masthead-search-form__input::placeholder {
  color: rgba(255,255,255,0.55);
}
.masthead-search-form__input:focus-visible {
  outline: 3px solid var(--color-gold-light);
  outline-offset: 0;
  z-index: 1;
  position: relative;
}

.masthead-search-form__btn {
  border-radius: 0;
  padding-inline: var(--space-4);
  min-height: var(--touch-min);
  font-size: 0.8125rem;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.2);
  background: rgba(139,51,24,0.85);
  flex-shrink: 0;
}
.masthead-search-form__btn:hover {
  background: var(--color-terracotta);
}

@media (max-width: 680px) {
  .archive-masthead {
    height: auto;
    min-height: 120px;
  }
  .masthead-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding-block: var(--space-4);
  }
  .masthead-search-form {
    width: 100%;
  }
}

/* ===================================================================
   ARCHIVE METADATA STRIP — record counts, last updated, citation
   =================================================================== */
.archive-meta-strip {
  background: var(--color-parchment-mid);
  border: 1px solid var(--color-parchment-rule);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.archive-meta-strip__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-4);
}

.meta-stat {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.meta-stat strong {
  color: var(--color-ink);
}

.meta-divider {
  color: var(--color-parchment-rule);
  line-height: 1;
  flex-shrink: 0;
}

.meta-stat--cite {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-text-muted);
  font-style: normal;
}
.meta-stat--cite em {
  font-style: italic;
}
.meta-stat--cite svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ===================================================================
   SIDEBAR COUNTY FINDER — compact, utilitarian
   =================================================================== */
.sidebar-panel--finder {
  border-left: 3px solid var(--color-gold);
}

.sidebar-finder {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.finder-label-sidebar {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-1);
}

.finder-select--sidebar {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  font-family: var(--font-serif);
  color: var(--color-text-body);
  background-color: var(--color-white);
  border: 1px solid var(--color-parchment-rule);
  border-radius: var(--border-radius);
  min-height: var(--touch-min);
  cursor: pointer;
  appearance: auto;
}
.finder-select--sidebar:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.finder-btn--sidebar {
  width: 100%;
  font-size: 0.875rem;
  min-height: var(--touch-min);
  padding-block: var(--space-2);
}

.county-result-panel--sidebar {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-body);
  background: var(--color-parchment-mid);
  border: 1px solid var(--color-parchment-rule);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--border-radius);
  padding: var(--space-2) var(--space-3);
}


/* ===================================================================
   WCAG PASS BADGE — "after" view only
   =================================================================== */
.wcag-badge {
  display: none; /* hidden by default; shown by html[data-view="after"] rule below */
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 8000;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 2px solid var(--color-success);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: var(--space-2) var(--space-4);
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

html[data-view="after"] .wcag-badge {
  display: flex;
}

/* ===================================================================
   ADA SCAN FAILURE PANEL — "before" view only
   =================================================================== */
.ada-scan {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 8001;
  background: #fff8f8;
  border: 2px solid #cc0000;
  border-radius: 4px;
  padding: 1rem;
  max-width: 340px;
  font-size: 0.75rem;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  color: #1a1a1a;
  font-family: Arial, sans-serif;
}

html[data-view="before"] .ada-scan {
  display: block;
}

.ada-scan__header {
  font-weight: bold;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #1a1a1a;
}

.ada-scan__list {
  list-style: disc;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ada-scan__list li {
  list-style: disc;
  color: #1a1a1a;
}

.ada-scan__list strong {
  color: #cc0000;
}

/* ===================================================================
   SITE HEADER — compact archive nav bar
   =================================================================== */
/* Top utility bar */
.header-top-bar {
  background-color: var(--color-ink);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-top-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-2);
  min-height: 36px;
}

.header-top-bar__tagline {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.3;
}

.header-top-bar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.header-top-bar__link {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-min);
  padding: var(--space-1) 0;
}
.header-top-bar__link:hover {
  color: var(--color-ochre);
  text-decoration: underline;
}

/* Main header bar */
.header-main-bar {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  border-bottom: 2px solid var(--color-rust);
}

.site-header {
  position: sticky;
  top: 44px; /* height of .demo-toolbar */
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 60px;
  padding-block: var(--space-3);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-white);
  flex-shrink: 0;
  min-height: var(--touch-min);
  border-radius: var(--border-radius);
}
.site-logo:hover {
  color: var(--color-ochre);
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
/* logo-ks: white on terracotta #8B3318 = 8.13:1 ✓ (was #C8821E = 2.57:1) */
.logo-ks {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--color-white);
  font-family: var(--font-sans);
}
.logo-genweb {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-white);
  opacity: 0.9;
}
/* logo-subtitle: 0.75 opacity → ~5.29:1 on terracotta ✓ (was 0.65 = 4.38:1) */
.logo-subtitle {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Masthead search */
.masthead-search {
  flex: 1;
  max-width: 500px;
  margin-left: auto;
}

.masthead-search__group {
  display: flex;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.masthead-search__input {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--color-soil);
  background-color: var(--color-white);
  border: 2px solid transparent;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  min-height: var(--touch-min);
}
.masthead-search__input:focus-visible {
  outline: 3px solid var(--color-ochre);
  outline-offset: 0;
  border-color: var(--color-ochre);
  z-index: 1;
  position: relative;
}
.masthead-search__input::placeholder {
  color: #888;
}

.masthead-search__btn {
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  padding-inline: var(--space-4);
  min-height: var(--touch-min);
  font-size: 0.875rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--border-radius);
  color: var(--color-white);
  cursor: pointer;
  padding: var(--space-2);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.nav-toggle:hover {
  background-color: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}

/* Primary navigation bar (below masthead) */
.primary-nav-bar {
  background-color: var(--color-ink);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-3) var(--space-4);
  min-height: var(--touch-min);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.nav-link:hover {
  background-color: rgba(255,255,255,0.07);
  color: var(--color-gold-light);
  border-bottom-color: var(--color-gold-light);
}

.ext-icon {
  display: inline;
  vertical-align: middle;
}

/* ===================================================================
   BREADCRUMB — SC 2.4.8 Location
   =================================================================== */
.breadcrumb-bar {
  background-color: var(--color-parchment-mid);
  border-bottom: 1px solid var(--color-parchment-rule);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  list-style: none;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: '›';
  margin-right: var(--space-2);
  color: var(--color-parchment-dark);
  font-size: 1rem;
  line-height: 1;
}

.breadcrumb__link {
  color: var(--color-terracotta);
  text-decoration: none;
  font-size: 0.8125rem;
}
.breadcrumb__link:hover {
  text-decoration: underline;
}

/* ===================================================================
   SEARCH HERO — kept for before-view degraded rendering only.
   The after view uses .archive-masthead instead.
   =================================================================== */
.search-hero {
  position: relative;
  overflow: hidden;
  min-height: 80px;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* The real sunflower photograph */
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  z-index: 0;
}

/* Overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(30,15,5,0.82);
}

.search-hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-block: var(--space-6);
}

.anniversary-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-gold);
  color: var(--color-white);
  padding: var(--space-1) var(--space-4);
  border-radius: 2px;
  font-weight: 700;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  width: fit-content;
  margin-bottom: var(--space-3);
}

.search-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-white);
  margin-bottom: var(--space-2);
}

.search-hero__desc {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
  max-width: 480px;
}

/* County finder — legacy; now in sidebar for after view */
.county-finder {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4) var(--space-5);
}

.county-finder__heading {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.finder-controls {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: flex-end;
}

.finder-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 180px;
}

.finder-label {
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: rgba(255,255,255,0.92);
}

.finder-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: 0.9375rem;
  font-family: var(--font-serif);
  color: var(--color-text-body);
  background-color: var(--color-white);
  border: 1px solid var(--color-parchment-rule);
  border-radius: var(--border-radius);
  min-height: var(--touch-min);
  cursor: pointer;
  appearance: auto;
}
.finder-select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.county-result-panel {
  display: none;
  margin-top: var(--space-3);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-left: 3px solid var(--color-gold-light);
  border-radius: var(--border-radius);
  padding: var(--space-2) var(--space-3);
  color: var(--color-white);
  font-size: 0.875rem;
  line-height: 1.5;
}
.county-result-panel.is-visible {
  display: block;
}

/* ===================================================================
   ARCHIVE BODY — two-column layout: persistent sidebar + main
   =================================================================== */
.archive-body {
  padding-block: var(--space-6) var(--space-12);
}

.archive-body__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .archive-body__inner {
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

/* ===================================================================
   SIDEBAR — persistent, utilitarian catalog nav
   =================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-parchment-rule);
  background: var(--color-card-surface);
}

@media (min-width: 900px) {
  .sidebar {
    position: sticky;
    top: calc(44px + 60px + 36px + 44px); /* toolbar + header-main + header-top + nav */
    max-height: calc(100vh - 184px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-parchment-dark) transparent;
  }
}

/* Each sidebar panel is separated only by a ruled border — no cards, no shadow */
.sidebar-panel {
  background-color: var(--color-card-surface);
  border: none;
  border-bottom: 1px solid var(--color-parchment-rule);
  border-radius: 0;
  overflow: hidden;
}
.sidebar-panel:last-child {
  border-bottom: none;
}

.sidebar-panel__heading {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-white);
  background-color: var(--color-ink);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-panel__meta {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-parchment-rule);
  background-color: var(--color-parchment-mid);
}

.sidebar-panel__body {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  padding: var(--space-3);
}

.sidebar-panel--volunteer {
  border-left: 2px solid var(--color-gold);
}

.sidebar-cta {
  margin: 0 var(--space-3) var(--space-3);
  font-size: 0.8125rem;
}

/* A–Z County Index — tight ruled rows */
.az-index {
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.az-group {
  border-bottom: 1px solid var(--color-parchment-dark);
  padding-bottom: var(--space-2);
}
.az-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.az-letter {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.az-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--space-2);
}

.az-link {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  color: var(--color-terracotta);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.az-link:hover {
  color: var(--color-rust);
  text-decoration: underline;
}

/* Category navigation — compact ruled list */
.cat-nav {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.cat-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  color: var(--color-text-body);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
  border-bottom: 1px solid var(--color-parchment-dark);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.cat-nav__link:last-child {
  border-bottom: none;
}
.cat-nav__link:hover {
  background-color: var(--color-parchment-mid);
  color: var(--color-rust);
}
.cat-nav__link svg {
  flex-shrink: 0;
  color: var(--color-gold);
  opacity: 0.8;
}

/* ===================================================================
   MAIN CONTENT AREA — ruled sections, no drop-shadow cards
   =================================================================== */
.main-content-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Content sections: flat, ruled, archival — no rounded cards */
.content-section {
  border: 1px solid var(--color-parchment-rule);
  border-radius: 0;
  background-color: var(--color-card-surface);
  overflow: hidden;
}

/* Section heading: ink-colored rule, sans-serif label */
.content-section__heading {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-white);
  background-color: var(--color-ink);
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.content-section__heading svg {
  opacity: 0.65;
}

.content-section__intro {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-parchment-rule);
  background-color: var(--color-parchment-mid);
}

.content-section__more {
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--color-parchment-rule);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  background-color: var(--color-parchment-mid);
}

/* ===================================================================
   RECORD LIST — compact ruled rows; catalog/finding-aid style
   =================================================================== */
.record-list {
  display: flex;
  flex-direction: column;
}

.record-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-parchment-rule);
  transition: background-color var(--transition-fast);
}
.record-row:last-child {
  border-bottom: none;
}
.record-row:hover {
  background-color: var(--color-parchment-mid);
}

.record-row__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: 3px;
}

.record-row__date {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Record type badge — square, utilitarian, no pill shape */
.record-row__type {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 2px;
  width: fit-content;
  color: var(--color-white);
}
.record-row__type--cemetery  { background: #4a5e32; }
.record-row__type--vital     { background: var(--color-terracotta); }
.record-row__type--census    { background: #2c4a66; }
.record-row__type--book      { background: #6b4214; }
.record-row__type--military  { background: #3a2e5a; }

.record-row__title {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-1);
}
.record-row__title a {
  color: var(--color-ink);
  text-decoration: none;
}
.record-row__title a:hover {
  color: var(--color-rust);
  text-decoration: underline;
}

.record-row__desc {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-2);
}

.record-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* Tags: flat, small, utilitarian — no pill shape */
.tag {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-parchment-mid);
  border: 1px solid var(--color-parchment-rule);
  border-radius: 1px;
  padding: 1px 6px;
  letter-spacing: 0.03em;
}

/* ===================================================================
   ARCHIVE TABLE — scholarly finding-aid style
   =================================================================== */
.archive-table-wrap {
  overflow-x: auto;
  padding: 0 var(--space-4) var(--space-4);
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.archive-table__caption {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-align: left;
  padding: var(--space-3) 0 var(--space-2);
  caption-side: top;
  letter-spacing: 0.03em;
}

.archive-table thead th {
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-parchment-rule);
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
  background: var(--color-parchment-mid);
}

.archive-table tbody tr {
  border-bottom: 1px solid var(--color-parchment-rule);
  transition: background-color var(--transition-fast);
}
.archive-table tbody tr:last-child {
  border-bottom: none;
}
.archive-table tbody tr:hover {
  background-color: var(--color-parchment-mid);
}

.archive-table tbody td {
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-serif);
  color: var(--color-text-body);
  vertical-align: middle;
}

.table-link {
  color: var(--color-terracotta);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.table-link:hover {
  color: var(--color-rust);
}

/* ===================================================================
   RESOURCE LIST — compact ruled rows, text-dense
   =================================================================== */
.resource-list {
  display: flex;
  flex-direction: column;
}

.resource-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-parchment-rule);
  align-items: flex-start;
  transition: background-color var(--transition-fast);
}
.resource-row:last-child {
  border-bottom: none;
}
.resource-row:hover {
  background-color: var(--color-parchment-mid);
}

/* Icon: small, muted, restrained */
.resource-row__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  opacity: 0.75;
  margin-top: 2px;
}

.resource-row__title {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.resource-row__title a {
  color: var(--color-ink);
  text-decoration: none;
}
.resource-row__title a:hover {
  color: var(--color-rust);
  text-decoration: underline;
}

.resource-row__desc {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===================================================================
   CONTACT / COORDINATOR SECTION — compact, institutional
   =================================================================== */
.coordinator-list {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--color-parchment-rule);
}

.coordinator-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: var(--space-4);
  row-gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-parchment-rule);
  background: var(--color-card-surface);
}
.coordinator-card:last-child {
  border-bottom: none;
}

.coordinator-role-badge {
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
  background-color: var(--color-terracotta);
  padding: 2px 6px;
  border-radius: 1px;
  width: fit-content;
  white-space: nowrap;
  grid-column: 1;
}
.coordinator-role-badge--asst {
  background-color: var(--color-text-muted);
}

.coordinator-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  grid-column: 1;
}

.coordinator-location {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  grid-column: 1;
}

.coordinator-email {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  white-space: nowrap;
  min-height: var(--touch-min);
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
}

.volunteer-cta {
  background-color: var(--color-parchment-mid);
  border-top: 1px solid var(--color-parchment-rule);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.volunteer-cta-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
}

.volunteer-cta p {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 540px;
}

/* ===================================================================
   INLINE UTILITY
   =================================================================== */
.inline-link {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-terracotta);
  font-weight: 600;
}
.inline-link:hover {
  color: var(--color-rust);
}

/* ===================================================================
   SITE FOOTER
   =================================================================== */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-12);
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.site-logo--footer {
  color: var(--color-footer-link);
  margin-bottom: var(--space-3);
}
.site-logo--footer:hover {
  color: var(--color-ochre);
}
.site-logo--footer .logo-ks {
  color: var(--color-gold-light);
}
.site-logo--footer .logo-genweb {
  color: var(--color-footer-link);
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--color-footer-text);
  margin-top: var(--space-2);
}

.footer-nav-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-footer-heading);
  margin-bottom: var(--space-4);
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-footer-link);
  font-size: 0.9375rem;
  text-decoration: none;
  padding: var(--space-1) 0;
  min-height: var(--touch-min);
}
.footer-link:hover {
  color: var(--color-ochre);
  text-decoration: underline;
}

.footer-legal {
  background-color: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-block: var(--space-6);
}

.copyright {
  font-size: 0.875rem;
  color: var(--color-footer-text);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.demo-notice {
  font-size: 0.875rem;
  color: var(--color-footer-text);
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-3);
}
.demo-notice strong {
  color: var(--color-ochre);
}
.demo-notice .footer-link {
  color: var(--color-ochre);
  font-size: 0.875rem;
  min-height: auto;
}

/* ===================================================================
   DEMO TOAST — accessible, auto-dismissing
   =================================================================== */
.demo-toast-region {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: min(380px, calc(100vw - 2 * var(--space-6)));
  pointer-events: none;
}

.demo-toast {
  background-color: var(--color-rust);
  color: var(--color-white);
  border-left: 4px solid var(--color-ochre);
  border-radius: var(--border-radius);
  padding: var(--space-4) var(--space-5);
  font-size: 0.9375rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.demo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.demo-toast.is-hiding {
  opacity: 0;
  transform: translateY(12px);
}
.demo-toast strong {
  color: var(--color-ochre);
  display: block;
  margin-bottom: var(--space-1);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ===================================================================
   RESPONSIVE — MOBILE NAVIGATION
   =================================================================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav-bar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
  }
  .primary-nav-bar.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    overflow-x: visible;
  }
  .nav-link {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-bottom-width: 1px;
    border-left: none;
  }

  .header-inner {
    position: relative;
  }

  .header-top-bar__tagline {
    display: none;
  }

  .record-row {
    grid-template-columns: 1fr;
  }
  .record-row__meta {
    flex-direction: row;
    align-items: center;
  }

  .archive-body__inner {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  .coordinator-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .coordinator-email {
    grid-column: 1;
    grid-row: auto;
    align-self: auto;
  }

  .finder-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .finder-btn {
    width: 100%;
  }

  .demo-toolbar {
    padding: var(--space-2) var(--space-4);
    gap: var(--space-2);
  }
  .demo-toolbar__org {
    font-size: 0.6875rem;
    max-width: 120px;
  }
  .demo-toolbar__btn {
    font-size: 0.6875rem;
    padding: 5px 10px;
  }

  .demo-toast-region {
    bottom: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }
}

/* ===================================================================
   RESPONSIVE — TABLET+
   =================================================================== */
@media (min-width: 640px) {
  :root {
    --container-pad: var(--space-8);
  }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */
@media print {
  .demo-toolbar,
  .site-header,
  .breadcrumb-bar,
  .nav-toggle,
  .search-hero,
  .archive-masthead,
  .archive-meta-strip,
  .site-footer,
  .ada-scan,
  .wcag-badge,
  .demo-toast-region {
    display: none !important;
  }
  .skip-link { display: none; }
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }
}

/* ===================================================================
   AFTER-ONLY ELEMENTS — hide in "before" view
   The modern header, nav, main, footer carry .after-only
   =================================================================== */
.after-only {
  display: block; /* shown by default (after view is default) */
}

html[data-view="before"] .after-only {
  display: none !important;
}

/* ===================================================================
   MASTHEAD TYPOGRAPHY ENHANCEMENT (after view)
   =================================================================== */
.masthead-title {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.masthead-provenance {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ===================================================================
   BEFORE PAGE — faithful 1996-era ksgenweb.org recreation
   Only visible when data-view="before"
   =================================================================== */
.before-page {
  display: none; /* hidden by default, shown in before view */
}

html[data-view="before"] .before-page {
  display: block;
}

/* ===================================================================
   ===================================================================
   BEFORE VIEW — html[data-view="before"]
   Intentional early-2000s USGenWeb-style degraded design.
   Demonstrates WCAG failures for sales demo contrast.
   ===================================================================
   =================================================================== */

/* ===================================================================
   BEFORE PAGE STRUCTURAL STYLES
   =================================================================== */

/* Tiled crosshatch-ish background (SVG data URI, no external image) */
html[data-view="before"] body {
  background-color: #b0a890;
  /* Simulate a tiled tan/beige pattern like the real ksgenweb.org bg */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23b0a890'/%3E%3Crect x='0' y='0' width='4' height='4' fill='%23a89878' opacity='0.5'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23a89878' opacity='0.5'/%3E%3C/svg%3E");
  color: #222222;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  line-height: 1.4;
}

/* Narrow fixed-width centered column — not responsive (intentional WCAG fail) */
.bp-inner {
  width: 760px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Logo bar at top */
.bp-logobar {
  background-color: #d4c8a0;
  border-bottom: 3px solid #888060;
  padding: 8px 0;
}

.bp-logobar .bp-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bp-usgenweb-btn {
  flex-shrink: 0;
  display: block;
}

.bp-sunflower {
  flex-shrink: 0;
  display: block;
}

.bp-title-block {
  flex: 1;
  text-align: center;
}

.bp-title-main {
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  font-weight: bold;
  color: #000066;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.bp-title-sub {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: #333355;
  margin-top: 2px;
}

/* 20th Anniversary badge */
.bp-anniv-badge {
  background: #000080;
  color: #ffdd00;
  border: 3px double #ffaa00;
  border-radius: 50%;
  width: 68px;
  height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
  font-family: Arial, sans-serif;
}

.bp-anniv-top {
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  color: #ffdd00;
}

.bp-anniv-mid {
  font-size: 7px;
  font-weight: bold;
  color: #ffdd00;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.bp-anniv-bot {
  font-size: 6px;
  color: #ffcc00;
  line-height: 1.2;
}

/* Gold horizontal divider bars */
.bp-gold-bar {
  height: 8px;
  background: linear-gradient(to right, #888840, #e8d840, #f8f040, #e8d840, #c8b820, #888840);
  border-top: 1px solid #aaa840;
  border-bottom: 1px solid #aaa840;
  margin: 0;
}

.bp-gold-bar-inner {
  height: 6px;
  background: linear-gradient(to right, #888840, #e8d840, #f8f040, #e8d840, #c8b820, #888840);
  border-top: 1px solid #aaa840;
  border-bottom: 1px solid #aaa840;
  margin: 10px 0;
}

/* Welcome banner */
.bp-welcome-banner {
  font-family: "Times New Roman", Times, serif;
  font-size: 24px;
  font-weight: bold;
  color: #000066;
  text-align: center;
  padding: 16px 0 10px;
  text-decoration: none;
}

/* Hosting change notice */
.bp-notice-box {
  background-color: #ffffc0;
  border: 2px solid #cc0000;
  color: #880000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  padding: 8px 12px;
  margin: 8px 0 12px;
  line-height: 1.5;
}

/* Kansas state logo/shape row */
.bp-ks-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 10px 0;
}

.bp-ks-shape {
  display: block;
  flex-shrink: 0;
}

/* Navigation sections */
.bp-nav-section {
  margin: 6px 0;
}

.bp-nav-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #000066;
  background-color: #c8c0a0;
  border-left: 4px solid #000080;
  padding: 3px 8px;
  margin-bottom: 6px;
}

.bp-nav-list {
  list-style: disc;
  margin: 0;
  padding-left: 24px;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  color: #333;
  line-height: 1.7;
}

.bp-link-list {
  list-style: disc;
  margin: 0;
  padding-left: 24px;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  color: #222;
  line-height: 1.7;
  columns: 2;
  column-gap: 20px;
}

.bp-link {
  color: #0000cc;
  text-decoration: underline;
  font-family: "Times New Roman", Times, serif;
}

.bp-link:hover {
  color: #800080;
}

/* Coordinator section */
.bp-coord-section {
  margin: 6px 0;
}

.bp-coord-text {
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  color: #222;
  margin: 4px 0 6px 16px;
  line-height: 1.6;
}

/* Old footer: visitor counter + best-viewed notice */
.bp-old-footer {
  text-align: center;
  padding: 12px 0 16px;
}

.bp-counter {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  color: #333;
  background: #ddd8c0;
  border: 2px inset #888;
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 8px;
}

.bp-counter-label {
  font-family: Arial, sans-serif;
  font-size: 10px;
  color: #555;
}

.bp-counter-digits {
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  font-size: 14px;
  color: #003300;
  letter-spacing: 1px;
}

.bp-bestviewed {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  color: #555;
  line-height: 1.7;
  margin: 8px 0;
}

.bp-bottom-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

/* ===================================================================
   BEFORE VIEW — legacy CSS overrides for the demo toolbar
   (toolbar itself stays modern/accessible; .after-only elements hidden)
   =================================================================== */

/* Narrow fixed centered column — not responsive */
html[data-view="before"] .container {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 8px;
}

/* Hide modern toolbar search/utility bar */
html[data-view="before"] .header-top-bar {
  background: #888880;
  border-bottom: 1px solid #666;
}
html[data-view="before"] .header-top-bar__tagline {
  color: #ccc;
  font-family: Arial, sans-serif;
  font-size: 10px;
}
html[data-view="before"] .header-top-bar__link {
  color: #00c;
  font-size: 10px;
  font-family: Arial, sans-serif;
}

/* Before: header — flat gray, no gradient */
html[data-view="before"] .header-main-bar {
  background: #aaaaaa;
  border-bottom: 2px solid #666;
}

html[data-view="before"] .site-header {
  box-shadow: none;
  top: 44px;
}

/* Logo — before style: plain text, no visual */
html[data-view="before"] .logo-mark {
  display: none;
}
html[data-view="before"] .site-logo {
  color: #000080;
  font-size: 16px;
  font-weight: bold;
  font-family: "Times New Roman", Times, serif;
}
html[data-view="before"] .logo-ks {
  color: #000080;
  font-size: 16px;
}
html[data-view="before"] .logo-genweb {
  color: #000080;
  font-size: 14px;
  opacity: 1;
}
html[data-view="before"] .logo-subtitle {
  color: #666;
  font-size: 9px;
}
html[data-view="before"] .archive-masthead {
  display: none;
}
html[data-view="before"] .nav-toggle {
  display: none !important;
}

/* Before: nav bar */
html[data-view="before"] .primary-nav-bar {
  background: #999990;
  border-top: 1px solid #666;
  display: block !important; /* always show in before */
}
html[data-view="before"] .nav-list {
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
}
html[data-view="before"] .nav-link {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000080;
  background: none;
  border: none;
  padding: 4px 8px;
  text-decoration: underline;
  min-height: 24px;
}
html[data-view="before"] .nav-link:hover {
  background: #bbb;
  color: #550000;
  border: none;
}

/* Before: breadcrumb */
html[data-view="before"] .breadcrumb-bar {
  background: #b8b8b0;
  border-bottom: 1px solid #888;
}
html[data-view="before"] .breadcrumb__link,
html[data-view="before"] .breadcrumb__item {
  color: #0000cc;
  font-size: 10px;
  font-family: Arial, sans-serif;
}

/* Before: search hero — flat, cramped */
html[data-view="before"] .search-hero {
  background: #b5b5ad;
  padding-block: 12px;
  overflow: visible;
  min-height: 0;
}
html[data-view="before"] .search-hero::after {
  display: none;
}
/* Hide photo hero elements in before view */
html[data-view="before"] .hero-photo,
html[data-view="before"] .hero-overlay {
  display: none;
}
html[data-view="before"] .search-hero__inner {
  grid-template-columns: 1fr;
  gap: 8px;
  padding-block: 0;
}
html[data-view="before"] .anniversary-badge {
  background: #888;
  color: #eee;
  font-size: 9px;
  border-radius: 0;
}
html[data-view="before"] .search-hero__title {
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  color: #000066;
  margin-bottom: 4px;
}
html[data-view="before"] .search-hero__desc {
  font-size: 11px;
  color: #555;
}

/* Before: county finder — box look */
html[data-view="before"] .county-finder {
  background: #c0c0b8;
  border: 2px inset #888;
  border-radius: 0;
  backdrop-filter: none;
  padding: 8px;
}
html[data-view="before"] .county-finder__heading {
  font-size: 13px;
  color: #000066;
  font-family: "Times New Roman", Times, serif;
}
html[data-view="before"] .finder-label {
  color: #444;
  font-size: 10px;
  font-family: Arial, sans-serif;
}
html[data-view="before"] .finder-select {
  border: 1px solid #888;
  border-radius: 0;
  font-size: 11px;
  padding: 2px 4px;
  min-height: 22px;
}
html[data-view="before"] .finder-btn {
  min-height: 22px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 0;
  background: #999;
  color: #fff;
  border: 1px outset #aaa;
}
html[data-view="before"] .county-result-panel {
  background: #d0d0c8;
  border: 1px solid #888;
  border-left: 1px solid #888;
  border-radius: 0;
  color: #333;
  font-size: 11px;
}

/* Before: archive body */
html[data-view="before"] .archive-body {
  padding-block: 8px;
}
html[data-view="before"] .archive-body__inner {
  grid-template-columns: 160px 1fr;
  gap: 8px;
}
@media (max-width: 900px) {
  html[data-view="before"] .archive-body__inner {
    grid-template-columns: 160px 1fr;
  }
}

/* Before: sidebar — flat bordered table look */
html[data-view="before"] .sidebar {
  position: static;
  max-height: none;
  overflow: visible;
}
html[data-view="before"] .sidebar-panel {
  border: 1px solid #888;
  border-radius: 0;
  background: #c8c8c0;
  margin-bottom: 8px;
}
html[data-view="before"] .sidebar-panel__heading {
  background: #888880;
  color: #fff;
  font-size: 10px;
  font-family: Arial, sans-serif;
  padding: 3px 6px;
  letter-spacing: 0;
  text-transform: none;
}
html[data-view="before"] .sidebar-panel__meta {
  font-size: 9px;
  color: #666;
  background: #bbb;
  padding: 2px 6px;
}
html[data-view="before"] .sidebar-panel__body {
  font-size: 10px;
  color: #555;
  padding: 4px 6px;
}
html[data-view="before"] .sidebar-cta {
  margin: 0 6px 6px;
  font-size: 10px;
  padding: 2px 6px;
  min-height: 22px;
  border-radius: 0;
  background: #aaa;
  color: #000080;
  border: 1px outset #999;
}

html[data-view="before"] .az-index {
  padding: 4px 6px;
  gap: 4px;
}
html[data-view="before"] .az-group {
  padding-bottom: 4px;
  border-bottom: 1px dotted #888;
}
html[data-view="before"] .az-letter {
  font-size: 9px;
  color: #666;
  margin-bottom: 2px;
}
html[data-view="before"] .az-link {
  font-size: 10px;
  color: #0000cc;
  text-decoration: underline;
  min-height: 0;
  display: inline-block;
  padding: 1px 0;
}
html[data-view="before"] .az-link:hover {
  color: #800080;
}

html[data-view="before"] .cat-nav__link {
  font-size: 10px;
  color: #0000cc;
  padding: 2px 6px;
  min-height: 20px;
  border-bottom: 1px dotted #aaa;
  text-decoration: underline;
}
html[data-view="before"] .cat-nav__link:hover {
  background: #b8b8b0;
  color: #800080;
}
html[data-view="before"] .cat-nav__link svg {
  display: none;
}

/* Before: content sections — bordered box look */
html[data-view="before"] .content-section {
  border: 1px solid #888;
  border-radius: 0;
  background: #c8c8c0;
  margin-bottom: 8px;
}
html[data-view="before"] .content-section__heading {
  background: #888880;
  font-size: 11px;
  font-family: Arial, sans-serif;
  padding: 3px 8px;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
}
html[data-view="before"] .content-section__heading svg {
  display: none;
}
html[data-view="before"] .content-section__intro {
  font-size: 10px;
  color: #555;
  background: #bbb;
  padding: 4px 8px;
}
html[data-view="before"] .content-section__more {
  font-size: 10px;
  background: #bbb;
  padding: 3px 8px;
}

/* Before: record rows */
html[data-view="before"] .record-row {
  grid-template-columns: 80px 1fr;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px dotted #888;
}
html[data-view="before"] .record-row:hover {
  background: #bbb;
}
html[data-view="before"] .record-row__date {
  font-size: 9px;
  color: #666;
}
html[data-view="before"] .record-row__type {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 0;
  background: #888 !important;
  color: #eee;
}
html[data-view="before"] .record-row__title {
  font-size: 11px;
  font-family: "Times New Roman", Times, serif;
  margin-bottom: 2px;
}
html[data-view="before"] .record-row__title a {
  color: #0000cc;
  text-decoration: underline;
}
html[data-view="before"] .record-row__title a:hover {
  color: #800080;
}
html[data-view="before"] .record-row__desc {
  font-size: 10px;
  color: #555;
  margin-bottom: 2px;
}
html[data-view="before"] .tag {
  font-size: 8px;
  background: #aaa;
  color: #444;
  border-radius: 0;
  border: 1px solid #888;
  padding: 1px 4px;
}

/* Before: archive table */
html[data-view="before"] .archive-table-wrap {
  padding: 4px 8px 8px;
}
html[data-view="before"] .archive-table {
  font-size: 10px;
  border: 1px solid #888;
}
html[data-view="before"] .archive-table__caption {
  font-size: 9px;
  color: #666;
}
html[data-view="before"] .archive-table thead th {
  background: #999;
  color: #eee;
  font-size: 9px;
  padding: 2px 6px;
  border: 1px solid #666;
}
html[data-view="before"] .archive-table tbody tr {
  border-bottom: 1px solid #aaa;
}
html[data-view="before"] .archive-table tbody tr:hover {
  background: #bbb;
}
html[data-view="before"] .archive-table tbody td {
  padding: 2px 6px;
  font-size: 10px;
  color: #444;
  border: 1px solid #aaa;
}
html[data-view="before"] .table-link {
  color: #0000cc;
  font-size: 10px;
}

/* Before: resource list */
html[data-view="before"] .resource-row {
  padding: 4px 8px;
  gap: 4px;
  border-bottom: 1px dotted #888;
}
html[data-view="before"] .resource-row:hover {
  background: #bbb;
}
html[data-view="before"] .resource-row__icon {
  display: none;
}
html[data-view="before"] .resource-row__title {
  font-size: 11px;
  font-family: "Times New Roman", Times, serif;
}
html[data-view="before"] .resource-row__title a {
  color: #0000cc;
  text-decoration: underline;
}
html[data-view="before"] .resource-row__title a:hover {
  color: #800080;
}
html[data-view="before"] .resource-row__desc {
  font-size: 10px;
  color: #555;
}

/* Before: coordinator cards */
html[data-view="before"] .coordinator-list {
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 6px 8px;
}
html[data-view="before"] .coordinator-card {
  border: 1px solid #888;
  border-radius: 0;
  background: #bbb;
  padding: 6px;
  gap: 2px;
}
html[data-view="before"] .coordinator-role-badge {
  background: #888;
  border-radius: 0;
  font-size: 8px;
}
html[data-view="before"] .coordinator-name {
  font-size: 12px;
  color: #000066;
  font-family: "Times New Roman", Times, serif;
}
html[data-view="before"] .coordinator-location {
  font-size: 10px;
  color: #555;
}
html[data-view="before"] .coordinator-email {
  min-height: 22px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 0;
  background: #aaa;
  color: #0000cc;
  border: 1px outset #999;
}
html[data-view="before"] .volunteer-cta {
  background: #bbb;
  padding: 6px 8px;
  border-top: 1px solid #888;
}
html[data-view="before"] .volunteer-cta-heading {
  font-size: 12px;
  color: #000066;
}
html[data-view="before"] .volunteer-cta p {
  font-size: 10px;
  color: #555;
}

/* Before: footer */
html[data-view="before"] .site-footer {
  background: #888880;
  border-top: 2px solid #666;
}
html[data-view="before"] .footer-tagline {
  font-size: 10px;
  color: #ccc;
}
html[data-view="before"] .footer-nav-heading {
  color: #ddd;
  font-size: 9px;
}
html[data-view="before"] .footer-link {
  color: #0000cc;
  text-decoration: underline;
  font-size: 10px;
}
html[data-view="before"] .footer-link:hover {
  color: #800080;
}
html[data-view="before"] .footer-legal {
  background: rgba(0,0,0,0.2);
}
html[data-view="before"] .copyright,
html[data-view="before"] .demo-notice {
  font-size: 9px;
  color: #bbb;
}
html[data-view="before"] .logo-mark--sm {
  display: none;
}
html[data-view="before"] .site-logo--footer .logo-ks,
html[data-view="before"] .site-logo--footer .logo-genweb {
  color: #ccc;
}

/* Before: remove focus outlines in .before-page — intentional WCAG 2.4.7 failure demo
   NOTE: The .demo-toolbar stays modern/accessible so we scope to .before-page only */
html[data-view="before"] .before-page *:focus,
html[data-view="before"] .before-page *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Before: "last updated" vibe */
html[data-view="before"] .footer-legal::after {
  content: "Page last updated: March 14, 2003 | Visitors since 2001: 00047,821 | Best viewed at 800×600 in Internet Explorer 6";
  display: block;
  font-size: 9px;
  color: #999;
  text-align: center;
  padding-top: 6px;
  font-family: Arial, sans-serif;
}

/* Before: hide modern overlay elements */
html[data-view="before"] .wcag-badge {
  display: none !important;
}

/* Buttons in before view — ugly, small tap targets */
html[data-view="before"] .btn {
  border-radius: 0;
  min-height: 22px;
  font-size: 10px;
  padding: 2px 8px;
  font-family: Arial, Helvetica, sans-serif;
}
html[data-view="before"] .btn--primary {
  background: #888;
  border-color: #666;
  color: #fff;
}
html[data-view="before"] .btn--outline {
  background: #aaa;
  border-color: #888;
  color: #0000cc;
}

/* ===================================================================
   END BEFORE VIEW
   =================================================================== */


/* ===== REAL BEFORE SITE (live iframe of the org's actual website) ===== */
.real-before-wrap { display: none; }
html[data-view="before"] .real-before-wrap {
  display: flex; flex-direction: column;
  position: fixed; top: 44px; left: 0; right: 0; bottom: 0;
  z-index: 7000; background: #fff;
}
.real-before-bar {
  display: flex; flex-wrap: wrap; gap: .4rem 1rem;
  align-items: center; justify-content: space-between;
  background: #111; color: #fff;
  font: 600 14px/1.45 system-ui, -apple-system, sans-serif;
  padding: .6rem 1rem;
}
.real-before-bar a { color: #ffd24a; text-decoration: underline; }
.real-before-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
/* In BEFORE view show ONLY: toolbar + the real-site iframe + the ADA scan panel. Hide everything else. */
html[data-view="before"] body > *:not(.demo-toolbar):not(.real-before-wrap):not(.ada-scan):not(script):not(style) {
  display: none !important;
}

/* =================================================================
   MOBILE OVERFLOW FIXES — ≤480px
   Prevent horizontal scroll at 360-414px viewports.
   Root cause: sidebar grid item expands 1fr track to content width
   because sidebar has nowrap text — fixed by min-width:0.
   ================================================================= */
html, body {
  overflow-x: hidden;
}

/* Prevent sidebar from expanding the grid 1fr track beyond viewport.
   Approach: set max-width on the sidebar relative to viewport,
   and use overflow-clip so it doesn't affect grid track sizing. */
@media (max-width: 768px) {
  .archive-body__inner {
    display: block; /* switch from grid to block so 1fr track sizing is irrelevant */
  }

  .sidebar {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
  }

  .sidebar-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .finder-field,
  .sidebar-finder,
  .sidebar-panel__heading,
  .sidebar-panel__body,
  .sidebar-panel__meta {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .finder-select--sidebar,
  .finder-btn--sidebar {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Wrap county index az-link items that have white-space:nowrap */
.az-link {
  white-space: normal;
  word-break: break-word;
}

/* Fix meta-stat cite bar: long citation text with nowrap overflows at mobile */
@media (max-width: 600px) {
  .meta-stat--cite {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .archive-meta-strip__inner {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .archive-meta-strip {
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  .demo-toolbar {
    padding: 0 0.625rem;
    gap: 0.5rem;
  }
  .demo-toolbar__org {
    max-width: 90px;
    font-size: 0.625rem;
  }
  .demo-toolbar__btn {
    padding: 4px 7px;
    font-size: 0.6875rem;
  }
}
