/* ===========================================================
   Jefferson County PAGenWeb — Clean theme
   Unified CSS  •  Updated: 2025-11-05
   Notes:
   - Accessible dropdown nav (submenu classes + ARIA)
   - Hero polish, gold rails, PDF cards, tooltips
   - Horizontal card layout variant
   - Research two-row chip layout
   - Consolidated tokens; removed duplicates & empty rules
   =========================================================== */

/* =========================
   RESET & BASE
   ========================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
img { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; }

:root{
  --bg:#FAFAF8;
  --ink:#2A2A2A;

  --accent:#16324F;
  --accent-2:#132C45;
  --accent-hover:#1f4872;

  --gold:#fbbf24;
  --gold-hover:#facc15;
  --gold-text:#0F172A;

  --muted:#6B7280;
  --card:#FFFFFF;
  --radius:14px;
  --shadow:0 4px 14px rgba(0,0,0,.06);

  --footer-gap:clamp(2rem,4vw,4rem);
  --soft-edge-height:clamp(12px,2.8vw,32px);

  --measure:72ch;
  --measure-hero:clamp(76ch,86vw,90ch);
  --page-max: 1100px;
}

body{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:16px; line-height:1.6;
  color:var(--ink); background:var(--bg);
}

a{ color:#0b5bd3; text-decoration: underline; }
a:focus,button:focus,input:focus{ outline:3px solid rgba(11,91,211,.25); outline-offset:2px; }
a:focus-visible,button:focus-visible,input:focus-visible{ outline:3px solid rgba(11,91,211,.35); outline-offset:2px; }
a:focus:not(:focus-visible),button:focus:not(:focus-visible),input:focus:not(:focus-visible){ outline:none; }

.container{ max-width:1100px; margin:0 auto; padding:0 1rem; }

.visually-hidden,.sr-only{
  position:absolute!important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; border:0;
}

/* Accessible Skip Link */
.skip-link{ position:absolute; left:-999px; width:1px; height:1px; overflow:hidden; }
.skip-link:focus{
  position:fixed;
  left:1rem; top:1rem; width:auto; height:auto; padding:.5rem .75rem;
  background:#fff; color:#000; border:2px solid #000; z-index:9999;
}

/* ===================
   HEADER & NAV
   =================== */
.site-header{
  background:#fff; position:sticky; top:0; z-index:50;
  border-bottom:4px solid var(--gold);
  box-shadow:0 2px 8px rgba(0,0,0,.05);
}
@media (max-width:720px){ .site-header{ border-bottom-width:3px; } }
body.scrolled .site-header{ background:rgba(255,255,255,.98); box-shadow:0 2px 10px rgba(0,0,0,.08); }
.header-inner{ padding:.75rem 0; }

.header-centered{ display:grid; gap:.75rem 1rem; align-items:center; }
.brand-block{ display:grid; grid-template-columns:1fr; justify-items:center; align-items:center; gap:.5rem; }
.brand-logo img{ height:64px; width:auto; }
@media (max-width:720px){ .brand-logo img{ height:52px; } }

.brand-text{
  font-family:'Merriweather',Georgia,serif; line-height:1.25; color:var(--accent);
  text-align:center; min-width:0;
}
.brand-text span{ display:block; }
.brand-text .line1{ font-weight:900; font-size:clamp(1.1rem,2.8vw,1.7rem); }
.brand-text .line2{ font-weight:700; font-size:clamp(1rem,2.2vw,1.3rem); }
.brand-text .line3{ font-weight:400; font-size:.95rem; color:var(--muted); letter-spacing:.2px; }

.nav-toggle{
  display:none; margin-left:auto; cursor:pointer;
  background:var(--accent); color:#fff; border:1px solid var(--accent);
  padding:.45rem .6rem; border-radius:.55rem;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  transition:background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.nav-toggle:hover,.nav-toggle:focus{ background:var(--accent-hover); border-color:var(--accent-hover); }
.nav-toggle .bar{ display:block; width:22px; height:2px; background:#fff; margin:4px 0; border-radius:2px; }
.nav-open .nav-toggle{ background:var(--accent-hover); border-color:var(--accent-hover); }

/* --- Main nav: top level --- */
.main-nav { position:relative; }
.main-nav > ul{
  list-style:none; margin:0; padding:0;
  display:flex; justify-content:center; align-items:center; gap:1rem;
}
.main-nav a,
.main-nav .submenu-toggle{
  color:var(--accent); text-decoration:none; font-weight:500;
  padding:.5rem .75rem; border-bottom:2px solid transparent; background:none; border:0; cursor:pointer;
  transition:color .2s ease, border-color .2s ease, background-color .2s ease;
}
.main-nav a:hover,.main-nav a:focus,
.main-nav .submenu-toggle:hover,.main-nav .submenu-toggle:focus{
  color:var(--gold); border-bottom-color:var(--gold);
}
.main-nav a.active{ color:var(--gold); border-bottom-color:var(--gold); font-weight:600; }

/* --- Submenus (accessible) --- */
.has-submenu{ position:relative; }

/* Base submenu: visually hidden via opacity/visibility; not display:none so keyboard focus works */
.submenu{
  position:absolute; left:0; top:100%;
  min-width:240px;
  list-style:none; margin:.25rem 0 0; padding:.35rem;
  background:#fff; border:1px solid rgba(22,50,79,.12); border-radius:10px;
  box-shadow:0 10px 24px rgba(22,50,79,.12);
  display:block;
  opacity:0; visibility:hidden; transform:translateY(-6px);
  transition:opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  z-index:20;
}
.submenu > li{ display:block; }
.submenu > li + li{ margin-top:.125rem; }
.submenu li a{ display:block; padding:.5rem .6rem; border-radius:8px; color:var(--accent); }
.submenu li a:hover,.submenu li a:focus{ background:#f5f7fb; color:var(--accent-2); }

/* Desktop: open on hover or when button indicates expanded */
@media (min-width:881px){
  .has-submenu:hover > .submenu,
  .has-submenu > .submenu-toggle[aria-expanded="true"] + .submenu{
    opacity:1; visibility:visible; transform:translateY(0);
  }
  .main-nav .submenu-toggle{ display:none; }
}

/* Mobile nav panel */
@media (max-width:880px){
  .nav-toggle{ display:none; justify-self:center; }
  .main-nav{
    position:static; background:#fff; border-bottom:1px solid #eee;
    max-height:none; opacity:1; visibility:visible; transform:none;
    z-index:60;
  }
  .nav-enhanced .nav-toggle{ display:inline-block; }
  .nav-enhanced .main-nav{
    position:absolute; left:0; right:0; top:100%;
    overflow:hidden; max-height:0; opacity:0; visibility:hidden; transform:translateY(-6px);
    transition:max-height .35s ease, opacity .25s ease, transform .35s ease, visibility 0s linear .35s;
    box-shadow:none; background:#fff;
  }
  .nav-enhanced .main-nav.open{
    max-height:70vh; overflow:auto; -webkit-overflow-scrolling:touch;
    opacity:1; visibility:visible; transform:translateY(0);
    box-shadow:0 10px 20px rgba(0,0,0,.08);
  }
  .main-nav > ul{ flex-direction:column; gap:.25rem; padding:.5rem 1rem; align-items:stretch; }
  .main-nav a,
  .main-nav .submenu-toggle{ display:block; text-align:left; border-bottom:0; padding:.65rem .75rem; }

  .submenu{
    position:static; margin:0 0 .25rem; padding:.25rem .35rem;
    border:0; border-left:3px solid rgba(22,50,79,.12); border-radius:8px;
    box-shadow:none; opacity:1; visibility:visible; transform:none; display:block;
  }
  .nav-enhanced .submenu{ display:none; } /* collapsed until toggled */
  .nav-enhanced .submenu.is-open,
  .nav-enhanced .has-submenu > .submenu-toggle[aria-expanded="true"] + .submenu{ display:block; }

  .submenu-toggle{ display:none; }
  .nav-enhanced .submenu-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    padding:.6rem .7rem; margin:0; min-width:2.6rem; min-height:2.4rem; line-height:1;
    border:1px solid rgba(22,50,79,.28); border-radius:12px; background:#f5f7fb; color:var(--accent);
    -webkit-tap-highlight-color: rgba(22,50,79,.12);
  }
  .nav-enhanced .submenu-toggle:hover,
  .nav-enhanced .submenu-toggle:focus{ background:#eaf1f8; border-color:rgba(22,50,79,.4); }
  .nav-enhanced .submenu-toggle::after{ content:'\25BE'; font-size:1.05rem; color:var(--accent); }
  .nav-enhanced .submenu-toggle[aria-expanded="true"]{ background:var(--gold); border-color:var(--gold); color:var(--gold-text); }
  .nav-enhanced .submenu-toggle[aria-expanded="true"]::after{ content:'\25B4'; color:var(--gold-text); }
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  .main-nav{ transition:none!important; transform:none!important; }
  .submenu{ transition:none!important; transform:none!important; }
}
@media (min-width:768px){
  .brand-block{ grid-template-columns:auto 1fr auto; gap:1rem 1.25rem; }
  .brand-logo img{ height:80px; }
  .nav-toggle{ display:none; }
  .main-nav{ position:static; display:block; border:0; max-height:none; opacity:1; visibility:visible; transform:none; box-shadow:none; }
}

/* =========================
   HERO SECTION
   ========================= */

.hero{
  padding:3rem 0;
  background:linear-gradient(180deg,#fff,#f1f5f9);
  border-bottom:1px solid #e8eef6;
}
.hero .container{ display:grid; grid-template-columns:1fr; gap:1rem; }
.hero h1{ font-size:2rem; margin:.25rem 0; }
.hero .intro{ max-width:var(--measure-hero); color:#213547; }
.hero p{ margin:0 0 1rem; }

/* Global header search (home) */
.site-search{
  display:flex; justify-content:center; align-items:center; gap:0; width:100%; max-width:60rem;
  margin:.5rem auto .75rem; background:#fff; border-radius:10px; overflow:hidden;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.site-search input[type="search"]{
  flex:1 1 auto; min-width:0; width:100%; padding:.6rem .9rem;
  font-size:1rem; border:none; outline:none; color:#111; border-right:1px solid rgba(0,0,0,.08);
}
.site-search input::placeholder{ color:#666; }
.site-search select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  padding:.6rem .9rem; font-size:1rem; background:#fff; color:#111;
  border-left:1px solid rgba(0,0,0,.08); border-right:1px solid rgba(0,0,0,.08);
  padding-right:1.75rem;
}
.site-search button,.btn{
  padding:.65rem 1.1rem; border-radius:10px; border:0; background:var(--accent); color:#fff; cursor:pointer;
}

/* Hero blue variant (scoped to hero only) */
.hero--blue{
  background:linear-gradient(180deg,var(--accent) 0%,var(--accent-2) 90%);
  color:#fff; border-bottom:1px solid rgba(255,255,255,.15);
  padding-block:3rem 2.5rem;
}
.hero--blue h1,.hero--blue .intro{ color:#fff; }
.hero--blue a{
  color:#fbd34c;
  text-decoration:underline;
  text-decoration-color: rgba(255,255,255,.9);
}
.hero--blue a:hover,.hero--blue a:focus{
  color:#fff; text-decoration-color:#fff;
}
.hero--blue > .container{
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
  display: grid;
  justify-items: start;
}
.hero.hero--blue .muted{ color:rgba(255,255,255,.85); font-size:.95rem; letter-spacing:.01em; }
.hero.hero--blue p{ margin-bottom:1rem; }
.hero--blue .site-search{
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 6px 18px rgba(0,0,0,.18);
}
.hero--blue .site-search input[type="search"],
.hero--blue .site-search select{ background:#fff; color:#111; }
.hero--blue .site-search button{
  background:var(--gold); color:var(--accent); font-weight:700;
  border-radius:0 10px 10px 0; border:1px solid var(--gold); border-left:none;
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}
.hero--blue .site-search button:hover,
.hero--blue .site-search button:focus{
  background:#d3b03f; border-color:#d3b03f; color:var(--accent-2);
}

/* Photo hero (home) — single source of truth */
.hero--photo{
  position: relative;
  color: #fff;
  min-height: clamp(280px, 38vw, 480px);
  background-image:
    linear-gradient(180deg, rgba(22,50,79,.45), rgba(19,44,69,.45)),
    url("/images/courthouse.jpeg");
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
}
@media (min-width:1024px){
  .hero--photo{ background-position:center 20%; min-height:520px; }
}
.hero--photo .container{
  position: relative; z-index: 2;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.6rem 1rem 1.9rem;
  text-align: center;
}
.hero--photo h1{ font-size:clamp(1.8rem,2.3vw,2.3rem); font-weight:700; color:#fff; margin-bottom:.3rem; text-shadow:0 2px 6px rgba(0,0,0,.25); }
.hero--photo .subtitle{ font-size:clamp(1rem,1.3vw,1.1rem); font-weight:400; color:#f0f0f0; margin-bottom:.25rem; line-height:1.35; }
.hero--photo p{ color:#f8f8f8; max-width:820px; margin:0 auto .75rem; line-height:1.45; }
.hero-credit{
  position:absolute; right:.75rem; top:.6rem; color:rgba(255,255,255,.9); font-size:.8rem; font-style:italic;
  text-shadow:0 1px 3px rgba(0,0,0,.5); background:rgba(0,0,0,.35); padding:.25rem .5rem; border-radius:6px; z-index:3;
}
@media (max-width:520px){ .hero-credit{ display:none; } }

/* Gold emphasis inside heroes */
.hero--blue strong,.hero--blue b,
.hero--photo strong,.hero--photo b,
.hero strong,.hero b{
  color:#fbd34c; font-weight:800;
}

@media (max-width:640px){
  .site-search{ flex-wrap:wrap; border-radius:12px; }
  .site-search input[type="search"],
  .site-search select,
  .site-search button{
    width:100%; border:0; border-top:1px solid rgba(0,0,0,.06); border-radius:0;
  }
  .site-search input[type="search"]{ border-top:0; }
  .hero--blue .site-search button{
    border:0; border-top:1px solid rgba(255,255,255,.18);
    border-radius:0 0 12px 12px;
  }
}

/* --- Section Titles: gold rails --- */
.section-title {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  text-align: center; font-family: 'Merriweather', Georgia, serif; font-weight: 900;
  color: var(--accent); margin: 2.2rem auto 1.2rem; max-width: 95vw; position: relative;
}
.section-title span {
  display: inline-block; padding: 0 .9rem; background: var(--bg);
  line-height: 1.25; position: relative; z-index: 2; text-wrap: balance; hyphens: auto;
}
.section-title::before,
.section-title::after {
  content: ""; height: 2px; flex: 1 1 clamp(120px, 32%, 360px);
  background: linear-gradient(90deg, rgba(201,162,39,0) 0%, rgba(201,162,39,.8) 10%, rgba(201,162,39,.95) 40%, rgba(201,162,39,.95) 60%, rgba(201,162,39,.8) 90%, rgba(201,162,39,0) 100%);
  opacity: .95; transition: opacity .3s ease;
}
.section-title:hover::before,.section-title:hover::after { opacity: 1; }
@media (max-width:520px){
  .section-title { margin: 1.6rem auto 1rem; gap: .55rem; }
  .section-title span { padding: 0 .6rem; }
}

/* =========
   GRIDS & CARDS
   ========= */
.grid{ display:grid; gap:1.25rem; grid-template-columns:repeat(1,minmax(0,1fr)); list-style:none; padding:0; margin:0; }
.grid > li{ list-style:none; }
.grid > li::marker{ content:none; }
@media (min-width:520px){ .grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:860px){ .grid{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (min-width:1200px){ .grid{ grid-template-columns:repeat(4,minmax(0,1fr)); } }

.grid .alpha-divider{ grid-column:1 / -1; font-weight:800; color:var(--accent); opacity:.8; padding:.25rem .25rem; margin:.25rem 0; border-bottom:1px solid rgba(22,50,79,.12); }
.badge{ display:inline-block; background:#f5f7fb; color:#213547; border:1px solid rgba(22,50,79,.12); border-radius:999px; padding:.15rem .5rem; font-size:.85rem; }
.badge.badge--borough{ background:#e8f0ff; border-color:rgba(59,130,246,.35); color:#1e3a8a; }

.card{
  background:var(--card); border-radius:var(--radius); padding:1rem; display:flex; flex-direction:column; gap:.65rem; position:relative;
  border:1px solid rgba(22,50,79,.06);
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  opacity:0; transform:translateY(6px); animation:cardFadeIn .6s ease-out forwards;
  overflow: visible;
}
@keyframes cardFadeIn{ 0%{opacity:0;transform:translateY(6px);} 100%{opacity:1;transform:translateY(0);} }

.card h3{ margin:0; color:var(--accent); }
.card p{ margin:0 0 .25rem; color:#334155; }
.card a.card-link{ text-decoration:none; color:#0b5bd3; font-weight:600; margin-top:auto; }
.card a.card-link:hover,.card a.card-link:focus{ text-decoration:underline; }

/* Card hover/focus */
.card:hover{
  transform:translateY(-3px);
  border-color:rgba(22,50,79,.12);
  background:#fff;
  box-shadow:0 8px 18px rgba(22,50,79,.10),0 2px 6px rgba(22,50,79,.06);
}
.card:focus-within{
  outline:3px solid rgba(11,91,211,.28); outline-offset:3px;
  box-shadow:0 0 0 3px rgba(11,91,211,.20),0 10px 20px rgba(22,50,79,.12);
}

/* Card actions */
.card .actions{ margin-top:auto; display:flex; flex-wrap:wrap; gap:.65rem .7rem; align-items:center; }
.btn,
.card .actions .btn{ display:inline-flex; align-items:center; line-height:1.1; text-decoration:none !important; }

/* PDF cards */
.card.pdf-card{ position:relative; padding:1rem 1rem .9rem; }
.card.pdf-card .pdf-badge{
  position:absolute; top:.75rem; right:.75rem;
  display:inline-block; font-size:.72rem; font-weight:700; line-height:1;
  padding:.15rem .4rem; border-radius:6px;
  background:var(--gold); color:var(--gold-text);
}
.card-title,
.section[data-cat] .card > h3{
  margin:.1rem 0 0; font-size:1rem; line-height:1.35;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3;
  overflow:hidden; line-clamp:3;
}
.card-link{ display:block; text-decoration:none; }
.card-link:hover,.card-link:focus{ text-decoration:underline; text-underline-offset:2px; }
.card.pdf-card .meta{ margin-top:.5rem; font-size:.9rem; color:var(--muted); }
.card.pdf-card h3 .card-link{ margin-top:0 !important; }
.card.pdf-card .card-download{
  margin-top:.5rem; align-self:flex-start; display:inline-block; font-weight:700;
  text-decoration:underline; text-underline-offset:2px;
}
.card.pdf-card .card-link::before{ content:none !important; }
.card.pdf-card a[data-pdf]::after{ content:none !important; }

/* Horizontal card grid variant */
.grid.grid--h{ grid-template-columns:1fr; gap:1rem; }
.grid.grid--h > .card{
  display:grid; grid-template-columns:clamp(240px,28%,340px) 1fr;
  align-items:start; gap:1rem; padding:1rem 1.25rem;
}
.grid.grid--h > .card .card-left{ border-right:1px solid rgba(22,50,79,.10); padding-right:1rem; }
.grid.grid--h > .card .card-right{ padding-left:.5rem; }
@media (max-width:979px){
  .grid.grid--h > .card{ grid-template-columns:1fr; }
  .grid.grid--h > .card .card-left{ border-right:0; padding-right:0; }
  .grid.grid--h > .card .card-right{ padding-left:0; }
}
.grid.grid--h > .card p{ margin:.35rem 0 .5rem; }

/* Compact card */
.grid .card.card--compact{ padding:.9rem 1rem; gap:.4rem; }
.card.card--compact h3{ margin:0 0 .25rem; font-size:1.05rem; line-height:1.25; }
.card.card--compact p{ margin:.25rem 0 .5rem; font-size:.96rem; }
.card.card--compact .card-link{ font-weight:700; }
.section .grid.grid--compact{ gap:1rem 1.1rem; }
@media (min-width:900px){
  .section .grid.grid--compact{ grid-template-columns:repeat(4,minmax(220px,1fr)); }
}

/* =========================
   RESEARCH: Record Finder Table
   ========================= */
#record-finder .table-wrap{ position:relative; }
#record-finder .table{ width:100%; border-collapse:separate; border-spacing:0; background:#fff; }
#record-finder .table thead th{
  position:sticky; top:0; z-index:5; background:#fff;
  text-align:left; font-weight:700; color:var(--accent);
  padding:.75rem .9rem; border-bottom:1px solid rgba(22,50,79,.12);
  box-shadow:0 2px 0 rgba(22,50,79,.06);
}
#record-finder .table tbody td{
  padding:.65rem .9rem; vertical-align:top; border-bottom:1px solid rgba(22,50,79,.08);
}
#record-finder .table tbody tr:nth-child(odd){ background:rgba(22,50,79,.02); }
#record-finder .table tbody tr:hover{ background:rgba(251,191,36,.08); }

/* Tabular figures for date column */
#record-finder .table th:nth-child(2),
#record-finder .table td:nth-child(2){
  font-variant-numeric: tabular-nums; font-feature-settings:"tnum" 1;
  white-space:nowrap;
}

/* Responsive table -> cards */
@media (max-width:720px){
  #record-finder .table{ display:block; }
  #record-finder .table thead{ display:none; }
  #record-finder .table tbody{ display:block; }
  #record-finder .table tr{ display:block; background:#fff; border:1px solid rgba(22,50,79,.12);
    border-radius:12px; box-shadow:0 4px 14px rgba(0,0,0,.06); margin:.65rem 0; overflow:hidden; }
  #record-finder .table tr + tr{ margin-top:.85rem; }
  #record-finder .table tr + tr::before{ content:""; display:block; height:6px; opacity:.6;
    background:linear-gradient(90deg, transparent 0, rgba(22,50,79,.12) 12%, rgba(22,50,79,.12) 88%, transparent 100%); }
  #record-finder .table td{ display:block; padding:.65rem .85rem; border:0; }
  #record-finder .table td + td{ border-top:1px dashed rgba(22,50,79,.12); }
  #record-finder .table td::before{ display:block; font-weight:700; color:var(--muted); margin-bottom:.15rem; }
  #record-finder .table td:nth-child(1)::before{ content:"Record Type"; }
  #record-finder .table td:nth-child(2)::before{ content:"Dates (typical)"; }
  #record-finder .table td:nth-child(3)::before{ content:"Where"; }
  #record-finder .table td:nth-child(4)::before{ content:"Notes"; }
}

/* =========================
   Localities: Historic Hamlets / Ghost Towns
   ========================= */
#lost-places .place-search,
#historic-hamlets .place-search{ display:flex; gap:.5rem; align-items:center; margin:.25rem 0 1rem; }
#lost-places .place-search input[type="search"],
#historic-hamlets .place-search input[type="search"]{
  flex:1 1 auto; min-width:0; padding:.6rem .8rem; border:1px solid rgba(22,50,79,.18); border-radius:10px; font-size:1rem;
}
#lost-places .pill-count,
#historic-hamlets .pill-count{ font-size:.9rem; color:var(--muted); background:#f5f7fb; border:1px solid rgba(22,50,79,.12); border-radius:999px; padding:.35rem .55rem; }

#lost-places .places,
#historic-hamlets .places,
#ghost-towns .places{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; list-style:none; padding:0; margin:0; }
#lost-places .places > li,
#historic-hamlets .places > li,
#ghost-towns .places > li{ list-style:none; }
#lost-places .places > li::marker,
#historic-hamlets .places > li::marker,
#ghost-towns .places > li::marker{ content:none; }
#lost-places .place-link,
#historic-hamlets .place-link,
#ghost-towns .place-link{ display:block; color:inherit; text-decoration:none; }
#lost-places .alpha-divider,
#historic-hamlets .alpha-divider,
#ghost-towns .alpha-divider{ grid-column:1 / -1; font-weight:800; color:var(--accent); opacity:.75; padding:.25rem .25rem; margin:.5rem 0 .25rem; border-bottom:1px solid rgba(22,50,79,.12); }
#lost-places .place-card,
#historic-hamlets .place-card,
#ghost-towns .place-card{ background:#fff; border:1px solid rgba(22,50,79,.12); border-radius:12px; padding:.8rem 1rem; box-shadow:0 4px 14px rgba(0,0,0,.06); transition:transform .15s ease, box-shadow .15s ease; }
#lost-places .place-card:hover,
#historic-hamlets .place-card:hover,
#ghost-towns .place-card:hover{ transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.08); }
#lost-places .place-card.place-card--borough,
#historic-hamlets .place-card.place-card--borough,
#ghost-towns .place-card.place-card--borough{ border-color:rgba(59,130,246,.35); background:linear-gradient(180deg,#fff,rgba(232,240,255,.35)); }
#lost-places .place-card.place-card--borough:hover,
#historic-hamlets .place-card.place-card--borough:hover,
#ghost-towns .place-card.place-card--borough:hover{ box-shadow:0 10px 22px rgba(59,130,246,.18); }
#lost-places .place-name,
#historic-hamlets .place-name,
#ghost-towns .place-name{ margin:0 0 .2rem; font-size:1.05rem; color:var(--accent); }
#lost-places .place-name .variant,
#historic-hamlets .place-name .variant,
#ghost-towns .place-name .variant{ color:var(--muted); font-weight:500; }
#lost-places .meta,
#historic-hamlets .meta,
#ghost-towns .meta{ color:#334155; font-size:.95rem; }
#lost-places .badge,
#historic-hamlets .badge,
#ghost-towns .badge{ display:inline-block; background:#f5f7fb; color:#213547; border:1px solid rgba(22,50,79,.12); border-radius:999px; padding:.15rem .5rem; font-size:.85rem; margin-right:.35rem; }
#lost-places .badge.badge--type,
#historic-hamlets .badge.badge--type,
#ghost-towns .badge.badge--type{ background:#fff7ed; border-color:rgba(251,146,60,.35); color:#7c2d12; }
#lost-places .badge.badge--borough,
#historic-hamlets .badge.badge--borough,
#ghost-towns .badge.badge--borough{ background:#e8f0ff; border-color:rgba(59,130,246,.35); color:#1e3a8a; }
#lost-places .badge.badge--years,
#historic-hamlets .badge.badge--years,
#ghost-towns .badge.badge--years{ background:#eef2f7; border-color:rgba(22,50,79,.18); color:#1f2937; }
#lost-places .details,
#historic-hamlets .details,
#ghost-towns .details{ margin-top:.25rem; font-size:.92rem; color:#334155; }
#lost-places .details .label,
#historic-hamlets .details .label,
#ghost-towns .details .label{ color:var(--muted); font-weight:600; margin-right:.25rem; }
#lost-places .details .sep,
#historic-hamlets .details .sep,
#ghost-towns .details .sep{ color:#9aa3b2; margin:0 .4rem; }
#lost-places mark,
#historic-hamlets mark,
#ghost-towns mark{ background:#fff3bf; color:inherit; padding:0 .05em; border-radius:3px; }
#lost-places .empty,
#historic-hamlets .empty{ display:none; margin-top:.35rem; color:var(--muted); }
#lost-places .empty[aria-hidden="false"],
#historic-hamlets .empty[aria-hidden="false"]{ display:block; }
@media (max-width:860px){
  #lost-places .places,
  #historic-hamlets .places,
  #ghost-towns .places{ grid-template-columns:1fr; }
}
#lost-places-old{ display:none !important; }
.cards-compact .badge.badge--years{ display:inline-block; background:#eef2f7; border:1px solid rgba(22,50,79,.18); color:#1f2937; border-radius:999px; padding:.1rem .45rem; font-size:.8rem; margin-left:.35rem; vertical-align:middle; }

/* ===== Research page scoped styles ===== */
.page--research .pill-subnav{ display:flex; flex-wrap:wrap; gap:.4rem .5rem; margin:.75rem 0 0; }
.page--research .pill-subnav .pill{
  display:inline-block; padding:.32rem .6rem; border:1px solid var(--gold); border-radius:999px;
  background:#fff; color:var(--accent); font-size:.9rem; line-height:1.1; text-decoration:none;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
}
.page--research .pill-subnav .pill:hover,
.page--research .pill-subnav .pill:focus-visible{
  background:#fff6dc; border-color:#f5b514; text-decoration:none;
  outline:2px solid transparent; outline-offset:2px; box-shadow:0 0 0 2px rgba(245,181,20,.25);
}
.page--research .pill-subnav .pill[aria-current="page"]{ background:var(--gold); font-weight:700; color:#1a1a1a; }

/* Research hero: two-row auto-balanced chip layout */
@media (min-width:700px){
  .page--research .pill-subnav{
    display:grid; grid-auto-flow:column; grid-template-rows:repeat(2, auto);
    grid-auto-columns:1fr; gap:.4rem .6rem; align-items:start;
  }
  .page--research .pill-subnav .pill{ width:max-content; justify-self:center; }
}
@media (max-width:699.98px){
  .page--research .pill-subnav{ display:flex; flex-wrap:wrap; gap:.4rem .5rem; justify-content:center; }
}

/* Research hero search scope */
.page--research .hero .site-search{ display:flex; gap:.5rem; align-items:center; margin-top:.9rem; }
.page--research .hero .site-search input[type="search"]{ flex:1 1 420px; padding:.6rem .75rem; border:1px solid #d7dce3; border-radius:.6rem; }
.page--research .hero .site-search select{ padding:.55rem .6rem; border:1px solid #d7dce3; border-radius:.6rem; background:#fff; }
.page--research .hero .site-search button{ padding:.58rem .9rem; border-radius:.6rem; border:1px solid #d19b0c; background:var(--gold); color:#1a1a1a; font-weight:700; white-space:nowrap; }

.page--research .mini-toc{ display:flex; flex-wrap:wrap; gap:.35rem .45rem; margin-top:.75rem; }
.page--research .mini-toc a{
  display:inline-block; padding:.25rem .5rem; font-size:.85rem; line-height:1.1;
  border:1px solid #e6e6e6; border-radius:999px; color:var(--accent); text-decoration:none; background:#fff;
}
.page--research .mini-toc a:hover,
.page--research .mini-toc a:focus-visible{ border-color:#d7dce3; background:#f7fafc; text-decoration:none; }
@media (max-width:740px){
  .page--research .pill-subnav{ justify-content:center; }
  .page--research .hero .site-search{ flex-wrap:wrap; }
  .page--research .hero .site-search input[type="search"]{ flex:1 1 100%; }
}
/* === Post-hero spacing (consistent gap to first section) === */
:where(.hero, .hero--blue, .hero--photo){
  margin-bottom: clamp(1rem, 3vw, 2.5rem);
}

/* =========
   CONTENT SLICES
   ========= */

/* Record Start Dates */
.record-starts{ margin-top:.75rem; max-width:none; }
.record-starts.modern-grid{ display:grid; gap:1rem 1.25rem; justify-content:center; }
@media (min-width:480px){ .record-starts.modern-grid{ grid-template-columns:repeat(2,minmax(160px,1fr)); } }
@media (min-width:900px){
  .record-starts.modern-grid{
    grid-template-columns:repeat(3,minmax(200px,1fr));
    max-width:980px; margin-inline:auto; gap:1.1rem 1.4rem; justify-items:stretch;
  }
  .record-starts.modern-grid>:nth-child(7){ grid-column:2; }
  .record-starts.modern-grid>div{ min-height:56px; font-variant-numeric:tabular-nums; }
}
.record-starts.modern-grid div{
  display:flex; justify-content:space-between; align-items:center; background:#fff; border:1px solid rgba(0,0,0,.06);
  border-radius:12px; padding:.75rem 1rem; box-shadow:0 4px 10px rgba(22,50,79,.05); font-weight:600;
  transition:transform .18s ease, box-shadow .2s ease;
}
.record-starts.modern-grid div:hover{ transform:translateY(-2px); box-shadow:0 8px 16px rgba(22,50,79,.08); }
.modern-grid strong{ color:var(--accent); font-weight:700; font-size:1rem; }
.modern-grid span{ color:#334155; font-weight:600; }
@media (max-width:480px){
  .modern-grid div{ flex-direction:column; align-items:flex-start; gap:.2rem; }
  .modern-grid span{ font-size:.95rem; }
}

/* “Locality note” (mobile collapsible by JS if desired) */
.locality-note{
  border-left:3px solid var(--gold);
  padding:.25rem .5rem;
  background:linear-gradient(180deg, rgba(201,162,39,.06), transparent 60%);
  border-radius:8px;
}

/* =========
   FOOTER
   ========= */
.site-footer{
  padding:2.25rem 1rem 3rem; background:#0f2740; color:#f5f7fa; border-top:1px solid rgba(255,255,255,.15);
  margin-top:var(--footer-gap); position:relative; text-align:left; font-size:.95rem; line-height:1.5;
}
.site-footer::before{
  content:""; position:absolute; left:0; right:0; top:calc(-1 * var(--soft-edge-height)); height:var(--soft-edge-height); pointer-events:none;
  background:linear-gradient(to bottom,rgba(15,39,64,0) 0%,rgba(15,39,64,.06) 55%,rgba(15,39,64,.18) 100%);
}
/* === Footer link color correction === */
.site-footer a{
  color:#ffd36f;
  text-decoration:none;
  border-bottom:1px dashed rgba(201,162,39,.35);
  transition:color .2s ease, border-color .2s ease;
}
.site-footer a:hover,
.site-footer a:focus{
  color:#fff;
  border-bottom-color:transparent;
}

.footer-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:2rem; align-items:start; }
.footer-title{ font-family:'Merriweather',Georgia,serif; font-size:1.05rem; font-weight:700; margin-bottom:.75rem; color:#fff; }
.footer-title a{ color:#ffd36f; text-decoration:none; }
.footer-title a:hover{ text-decoration:underline; }
.footer-links{ display:flex; flex-wrap:wrap; gap:.65rem 1rem; margin:0 0 .75rem; }
.footer-links a{ color:#ffd36f; text-decoration:none; border-bottom:1px dashed rgba(201,162,39,.35); transition:color .2s ease, border-color .2s ease; }
.footer-links a:hover,.footer-links a:focus{ color:#fff; border-bottom-color:transparent; }
.footer-contacts-grid{ display:grid; gap:.9rem; }
.footer-contacts-grid .contact-card{ display:grid; row-gap:.125rem; padding-bottom:.5rem; margin-bottom:.5rem; border-bottom:1px solid rgba(255,255,255,.2); }
.footer-contacts-grid .contact-card:last-child{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.footer-contacts-grid .role strong{ color:#ffd36f; font-weight:700; }
.footer-contacts-grid .name{ color:#fff; font-weight:500; }
.footer-contacts-grid .email a{ color:#ffd36f; text-decoration:none; transition:color .25s ease, text-shadow .25s ease; }
.footer-contacts-grid .email a:hover,.footer-contacts-grid .email a:focus{ color:#fff; text-shadow:0 0 6px rgba(255,211,111,.4); }
.footer-note{ margin:.5rem 0 1rem; font-size:.9rem; color:rgba(255,255,255,.85); line-height:1.45; }
.footer-meta{ margin:0; font-size:.85rem; color:rgba(255,255,255,.75); }
@media (min-width:700px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
@media (min-width:990px){ .footer-grid{ grid-template-columns:1fr 1fr 1fr; } }
@media (min-width:1200px){ .footer-grid{ column-gap:2.5rem; } }

/* =========================
   FX / REDUCED MOTION
   ========================= */
[data-include]{ opacity:0; transition:opacity .35s ease-in .15s; }
[data-include].loaded{ opacity:1; }
body:not(.loaded) main{
  opacity:0; transform:translateY(8px);
  transition:opacity .45s ease-out .35s, transform .5s ease-out .35s;
}
body.loaded main{ opacity:1; transform:translateY(0); }
.page-404 main,.page-500 main{ opacity:1!important; transform:none!important; }
@media (prefers-reduced-motion:reduce){
  [data-include], body:not(.loaded) main{ transition:none!important; transform:none!important; opacity:1!important; }
  .card{ animation:none!important; opacity:1!important; transform:none!important; transition:none!important; }
}

/* ===========================
   ERROR PAGES (404/500)
   =========================== */
.page-404 #not-found, .page-500 #not-found{
  position:relative; z-index:2; padding:clamp(24px,4vw,48px) 16px; max-width:1100px; margin:0 auto; color:var(--ink);
}
.page-404 #not-found h1, .page-500 #not-found h1{ margin:.25rem 0 1rem; font-weight:900; color:var(--accent); text-shadow:none; }
.page-404 #not-found p, .page-500 #not-found p{ margin:0 0 1rem; color:#1e293b; }
.page-404 .nf-actions, .page-500 .nf-actions{ display:inline-flex; gap:.75rem; flex-wrap:wrap; margin:1rem 0; }
.page-404 .nf-btn, .page-500 .nf-btn{ display:inline-block; padding:.6rem 1rem; border-radius:10px; text-decoration:none; }
.page-404 .nf-primary, .page-500 .nf-primary{ background:var(--accent); color:#fff; }
.page-404 .nf-primary:hover, .page-404 .nf-primary:focus,
.page-500 .nf-primary:hover, .page-500 .nf-primary:focus{ filter:brightness(1.08); }
.page-404 .nf-secondary, .page-500 .nf-secondary{ background:#e9edf1; color:#0a2233; }
.page-404 .nf-secondary:hover, .page-404 .nf-secondary:focus,
.page-500 .nf-secondary:hover, .page-500 .nf-secondary:focus{ background:#dfe4e8; }
.page-404 .nf-form, .page-500 .nf-form{ display:flex; gap:.5rem; margin:1rem 0; flex-wrap:wrap; }
.page-404 .nf-input, .page-500 .nf-input{
  flex:1; width:min(700px,100%); padding:.6rem .8rem; border:1px solid #cbd5e1; border-radius:10px; background:#fff; color:var(--ink);
}
.page-404 .nf-form .nf-btn[type="submit"], .page-500 .nf-form .nf-btn[type="submit"]{
  background:var(--accent); color:#fff; border:none;
}
.page-404 .nf-form .nf-btn[type="submit"]:hover, .page-500 .nf-form .nf-btn[type="submit"]{ background:var(--accent-hover); }
.page-404 .nf-grid, .page-500 .nf-grid{
  display:grid; gap:1rem; margin-top:1rem; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}
.page-404 .nf-card, .page-500 .nf-card{
  background:#fff; color:#334155; border:1px solid rgba(0,0,0,.08); border-radius:10px; padding:1rem; text-decoration:none; display:block;
  transition:background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.page-404 .nf-card strong, .page-500 .nf-card strong{ color:var(--accent); }
.page-404 .nf-card:hover, .page-404 .nf-card:focus,
.page-500 .nf-card:hover, .page-500 .nf-card:focus{
  background:#f0f4f8; border-color:#b6c0cc; box-shadow:0 1px 4px rgba(0,0,0,.06); transform:translateY(-2px);
}
@media (prefers-color-scheme:dark){
  .page-404 #not-found, .page-500 #not-found{ color:#e5e7eb; }
  .page-404 .nf-input, .page-500 .nf-input{ border-color:#4b5563; background:#fff; color:#fff; }
  .page-404 .nf-card, .page-500 .nf-card{ background:#fff; color:#334155; border-color:rgba(0,0,0,.08); }
}

/* === Generic Accordions === */
details summary{
  cursor:pointer; font-weight:700; color:#C9A227; padding:.4rem 0; list-style:none; border-bottom:0;
}
details summary::-webkit-details-marker{ display:none; }
details summary::before{
  content:""; display:inline-block; width:0; height:0; margin-right:.25rem;
  border-left:5px solid transparent; border-right:5px solid transparent;
  border-top:6px solid var(--accent); transition:transform .2s ease; transform:rotate(0deg);
}
details[open] summary::before{ transform:rotate(180deg); }
details ul{ margin-left:1rem; margin-bottom:.5rem; line-height:1.6; list-style:none; padding-left:0; }
details ul li{ margin:.2rem 0; }
details p{ margin-left:.5rem; margin-bottom:.5rem; }

/* === State abbreviation badge === */
.state-flag{
  display:inline-grid; place-items:center; width:2.1ch; height:2.1ch; line-height:1; flex-shrink:0;
  font:700 .85rem ui-monospace,Menlo,Consolas,monospace; border-radius:6px;
  border:1px solid rgba(22,50,79,.25); background:linear-gradient(180deg,#fff 40%,#f2f4f7); color:var(--accent);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 1px 1px rgba(0,0,0,.05); margin-right:.2rem;
}
.state-flag[data-accent="gold"]{ border-color:var(--gold); background:linear-gradient(180deg,#fff 40%,#fdf5d2); }

/* === Neighboring States accordions (stack) === */
.stack details{
  border:1px solid rgba(22,50,79,.12); border-radius:14px; background:#fff; box-shadow:0 2px 8px rgba(22,50,79,.05);
  margin:.75rem 0; overflow:hidden;
}
.stack details[open]{ border-color:rgba(201,162,39,.45); }
.stack details summary{
  position:relative; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; padding:.85rem 1rem .85rem 2.15rem;
  list-style:none; font-family:"Merriweather",ui-serif,Georgia,serif; font-weight:900; color:var(--accent);
  cursor:pointer; transition:background .2s ease;
}
.stack details summary::-webkit-details-marker{ display:none; }
.stack details summary::before{
  content:""; position:absolute; left:12px; top:50%; width:12px; height:12px;
  border-right:2px solid #d8c480; border-bottom:2px solid #d8c480; transform:translateY(-50%) rotate(-45deg);
  transition:transform .25s ease;
}
.stack details[open] summary::before{ transform:translateY(-50%) rotate(45deg); }
.stack details[open] summary{ border-bottom:1px solid rgba(22,50,79,.08); background:linear-gradient(180deg,rgba(201,162,39,.07),transparent 60%); }
.stack .linklist{ padding:.6rem 1rem 1rem; }
.stack .linklist li{ margin:.3rem 0; }
.stack .linklist .meta{ display:block; margin:.1rem 0 0 1.2rem; font-size:.9rem; color:var(--muted); }

/* === Utilities === */
section{ scroll-margin-top: clamp(72px, 12vw, 112px); }
.linklist{ padding-left:1.05rem; margin:.25rem 0; }
.linklist li{ margin:.4rem 0; }
.linklist .meta{ display:block; font-size:.9rem; color:var(--muted); }
.linklist.tight li{ margin:.25rem 0; }
.badge{ display:inline-block; font-size:.8rem; padding:.15rem .4rem; border:1px solid rgba(22,50,79,.2); border-radius:999px; margin-left:.4rem; }
.micro{ font-size:.9rem; }
.muted{ color:var(--muted); }
.actions .btn.is-active{ outline:2px solid rgba(201,162,39,.25); box-shadow:0 0 0 2px rgba(201,162,39,.25) inset; }

/* ===========================================================
   HOME PAGE POLISH
   =========================================================== */
body.home .header-search, body.modern.home .header-search{ display:none!important; }
.hero-actions{ margin-top:.35rem; gap:.35rem; }

/* === “Types of Maps” mini-cards grid === */
.map-type-cards{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:1.25rem;
  max-width:1100px; margin:0 auto; padding:0 1rem;
}
.card.mini{
  background:#fff; border-radius:var(--radius); box-shadow:0 2px 8px rgba(0,0,0,.05);
  padding:1rem 1.25rem; transition:transform .18s ease, box-shadow .2s ease;
}
.card.mini:hover{ transform:translateY(-3px); box-shadow:0 6px 16px rgba(0,0,0,.08); }
.card.mini h3{ margin-top:0; font-size:1.05rem; color:var(--accent); }
.card.mini p{ font-size:.95rem; line-height:1.45; margin:.3rem 0; }
.card.mini .meta{ color:var(--muted); font-size:.85rem; margin-top:.4rem; }

/* ===========================================================
   Post Offices — Card Layout
   =========================================================== */
.po-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:1.1rem; }
.po-card{
  background:#fff; border:1px solid rgba(22,50,79,.10); border-radius:var(--radius,12px);
  padding:1rem 1.1rem; box-shadow:0 3px 10px rgba(22,50,79,.06);
  transition:box-shadow .18s ease, transform .18s ease;
}
.po-card:hover{ box-shadow:0 6px 18px rgba(22,50,79,.12); }
.po-card:focus{ outline:none; }
.po-card:focus-visible{ box-shadow:0 0 0 3px var(--gold,#C9A227), 0 6px 18px rgba(22,50,79,.12); }
.po-card__title{ margin:0 0 .15rem; font-size:1.05rem; color:var(--accent,#16324F); }
.po-location{ margin:0; color:var(--muted,#6B7280); }
.po-location a{ text-decoration:none; }
.po-location a:hover,.po-location a:focus{ text-decoration:underline; text-underline-offset:2px; }
.po-details{ list-style:none; margin:.6rem 0 0; padding:0; font-size:.95rem; line-height:1.45; }
.po-details li + li{ margin-top:.25rem; }
.po-years{ white-space:nowrap; }
.chip{ background:var(--gold,#C9A227); color:var(--gold-text,#0F172A); border-radius:999px; padding:.1rem .5rem; font-size:.8rem; vertical-align:middle; }
.chip--muted{ background:#e2e8f0; color:#334155; }
@media (max-width:480px){ .po-grid{ grid-template-columns:1fr; } }

/* Mobile vs. Desktop Sources display */
@media (max-width:720px){
  .po-sources .po-source-label{ display:inline; }
  .po-sources .info-tip{ display:none; }
}
@media (min-width:721px){
  .po-sources .po-source-label{ display:none; }
  .po-sources .info-tip{ display:inline-block; }
}

/* ===========================================================
   Tooltip utility
   =========================================================== */
.info-tip{ position:relative; display:inline-block; cursor:help; font-size:.95em; vertical-align:middle; }
.info-tip::after{
  content:attr(data-tip);
  position:absolute; bottom:100%; left:50%; transform:translate(-50%,-.4rem);
  background:#0f172a; color:#fff; font-size:.85rem; line-height:1.35;
  padding:.44rem .6rem; border-radius:.375rem; box-shadow:0 6px 16px rgba(0,0,0,.18);
  white-space:normal; max-width:46ch; opacity:0; pointer-events:none; z-index:20;
  transition:opacity .18s ease, transform .18s ease;
}
.info-tip:hover::after,.info-tip:focus::after{ opacity:1; transform:translate(-50%,-.2rem); }
@media (prefers-reduced-motion:reduce){ .info-tip::after{ transition:none; } }

/* Inline “book cite” dot */
.info-tip--cite{
  color: var(--gold); font-weight: 800; font-size: .85em; margin-left: .25rem; line-height: 1;
  position: relative; width: .9em; height: .9em; display: inline-block; vertical-align: -.05em;
  text-indent: -9999px; overflow: hidden; background: currentColor;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 99%, transparent 100%);
          mask: radial-gradient(circle at 50% 50%, #000 99%, transparent 100%);
}
.hero--blue .info-tip--cite{ color:#ffd86a; }
.info-tip--cite:focus-visible{ outline:2px solid rgba(251,191,36,.45); outline-offset:2px; }
.info-tip--cite::after{ max-width: 60ch; white-space: normal; }
@media (max-width:520px){
  .info-tip--cite::after{ left: 0; right: 0; transform: translateY(-.4rem); margin-inline: auto; }
}
@media print{
  .info-tip--cite{ color:inherit; font-weight:normal; }
  .info-tip--cite::after{ content:none !important; }
}

/* ===========================================================
   PDF Badge (for normal links)
   =========================================================== */
a[data-pdf]:not([data-no-badge])::after{
  content:" · PDF"; font-weight:700; font-size:.85rem; margin-left:.3rem; color:var(--accent);
  background:linear-gradient(180deg,#fdf5d2,#f6e38c); border:1px solid var(--gold); border-radius:8px;
  padding:.05rem .35rem; text-decoration:none; vertical-align:baseline; opacity:0; animation:pdfBadgeFade .45s ease-out forwards;
}
.hero--blue a[data-pdf]:not([data-no-badge])::after{
  color:var(--accent-2); background:#ffd86a; border-color:#ffd86a; text-shadow:0 1px 0 rgba(0,0,0,.12);
}
@keyframes pdfBadgeFade{ 0%{ opacity:0; transform:translateY(-2px); } 100%{ opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce){ a[data-pdf]:not([data-no-badge])::after{ animation:none; opacity:1; transform:none; } }
@media print{ a[data-pdf]::after{ content:none !important; } }

/* ============================
   Clamp Utilities
   ============================ */
.clamp{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:var(--clamp,3); overflow:hidden; line-clamp:var(--clamp,3); }
.clamp-2{ --clamp:2; } .clamp-3{ --clamp:3; } .clamp-4{ --clamp:4; } .clamp-5{ --clamp:5; }
.ellipsis{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }

/* ============================
   Townships hero parity & rail
   ============================ */
body.townships .header-search{ display:none !important; }
body.townships .hero--blue{ text-align:left; padding-block:2.6rem 2rem; }
body.townships .hero--blue .container{ max-width:var(--measure-hero); }
body.townships .hero--blue h1{ font-size:2rem; margin:0 0 .35rem; }
body.townships .hero--blue .intro{
  color:#fff; margin:0 0 1rem; line-height:1.55; max-width:var(--measure-hero);
}
body.townships .hero--blue .site-search{ margin:0 0 .6rem; max-width:60rem; }
body.townships .hero--blue .place-filter{ max-width:60rem; margin:.2rem 0 .55rem; }
body.townships .hero--blue .place-filter input[type="text"]{
  width:100%; padding:.65rem .85rem; border-radius:12px;
  border:1px solid rgba(255,255,255,.3);
  background:#fff; color:#111; font-size:1rem;
  box-shadow:0 4px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.6);
}
body.townships .hero--blue .place-filter input::placeholder{ color:#445b73; }
body.townships .hero--blue .hero-tip{ margin:.4rem 0 .5rem; font-size:.93rem; color:rgba(255,255,255,.85); line-height:1.45; max-width:var(--measure-hero); }
body.townships .hero--blue .hero-tip strong{ color:#fbd34c; font-weight:700; }
body.townships .hero--blue .hero-jumps{ margin-top:.35rem; color:rgba(255,255,255,.9); font-size:.95rem; }
body.townships .hero--blue .hero-jumps a{ color:#fbd34c; text-decoration:underline; text-underline-offset:2px; }
body.townships .hero--blue .hero-jumps a:hover, body.townships .hero--blue .hero-jumps a:focus{ color:#fff; text-decoration-color:#fff; }

/* ===========================================================
   CHURCHES — Filters & Cards
   =========================================================== */
#chip-denominations,#chip-townships,#chip-centuries{ display:flex; flex-wrap:wrap; gap:.5rem; margin:.5rem 0 1rem; }
#chip-denominations .chip[aria-pressed="true"],
#chip-townships .chip[aria-pressed="true"],
#chip-centuries .chip[aria-pressed="true"]{
  outline:2px solid rgba(201,162,39,.35); box-shadow:inset 0 0 0 2px var(--gold,#fbbf24); border-color: var(--gold,#fbbf24);
}
#chip-denominations .chip-all,#chip-townships .chip-all,#chip-centuries .chip-all{ font-weight:700; }
#church-count{ margin:.25rem 0 .75rem; color:var(--muted,#6B7280); font-weight:600; }
#church-results{ display:grid; gap:1rem; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }

.card.church-card{
  background:#fff; border:1px solid rgba(22,50,79,.10); border-radius:var(--radius,14px);
  padding:1rem; box-shadow:0 3px 10px rgba(22,50,79,.06);
  transition:box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card.church-card:hover{ transform:translateY(-2px); border-color:rgba(22,50,79,.16); box-shadow:0 6px 18px rgba(22,50,79,.12); }
.card.church-card .card-title{ margin:0 0 .25rem; font-size:1.05rem; line-height:1.3; }
.card.church-card .card-title .alt{ color:var(--muted,#6B7280); font-weight:500; font-size:.95em; }
.card.church-card .meta{
  color:var(--muted,#6B7280); font-size:.9rem; display:flex; flex-wrap:wrap; gap:.35rem .5rem; align-items:center;
}
.card.church-card .meta .badge{ background:#f8fafc; border:1px solid #e5e7eb; padding:.15rem .45rem; border-radius:.5rem; }
.card.church-card .meta .dot{ opacity:.6; }
.card.church-card .note{ margin:.5rem 0 0; color:#334155; }
.card.church-card details.sources{ margin-top:.5rem; }
.card.church-card .atlas.small{ margin-top:.35rem; font-size:.85rem; color:var(--accent,#16324F); }
@media (max-width:520px){ #church-results{ grid-template-columns:1fr; } }

/* ===== Cemeteries page ===== */
.page--cemeteries .jump-menu{ margin:.75rem 0 1rem; font-size:.95rem; color:#f8fafc; }
.page--cemeteries .jump-menu a{ text-decoration:none; padding:.15rem .35rem; border-radius:6px; color:#f0f0f0; }
.page--cemeteries .jump-menu a:hover,.page--cemeteries .jump-menu a:focus{ text-decoration:underline; color:#fff; }
.page--cemeteries .cem-list{ list-style:none; margin:0; padding:0; }
.page--cemeteries .cem-list li{ padding:.6rem 0; border-bottom:1px solid #e9edf2; }
.page--cemeteries .cem-list li:last-child{ border-bottom:0; }
.page--cemeteries .cem-name{ font-weight:700; color:var(--accent); }
.page--cemeteries .cem-tags{ display:inline-block; margin-left:.5rem; font-size:.85rem; color:var(--muted); }
.page--cemeteries .cem-meta{ display:block; margin-top:.2rem; font-size:.95rem; }
.page--cemeteries .cem-meta a{ text-decoration:none; }
.page--cemeteries .cem-meta a:hover{ text-decoration:underline; }
.page--cemeteries .cem-notes{ display:block; margin-top:.15rem; color:var(--muted); font-size:.9rem; }

/* ===== Community page ===== */
.page--community .filters{display:grid;gap:.75rem;grid-template-columns:1fr;align-items:end;margin-bottom:1rem;}
@media (min-width:840px){.page--community .filters{grid-template-columns:repeat(4,1fr);}}
.page--community .chipbar{display:flex;flex-wrap:wrap;gap:.5rem;}
.page--community .results-meta{display:flex;gap:1rem;align-items:center;justify-content:space-between;margin:.5rem 0 1rem;}
.page--community .cards{display:grid;gap:1rem;}
@media (min-width:720px){.page--community .cards{grid-template-columns:repeat(12,1fr);} .page--community .cards .card{grid-column:span 6;}}
@media (min-width:1100px){.page--community .cards .card{grid-column:span 4;}}
.page--community .card .chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.35rem 0 .25rem;}
.page--community .muted-note{font-size:.9rem;color:var(--muted);}
.page--community .subtle-rule{border-top:1px solid #e8eef6;margin:2rem 0;}
.page--community .mini-form{background:#fff;border:1px solid #e8eef6;border-radius:14px;padding:1rem;box-shadow:0 2px 8px rgba(0,0,0,.03);}
.page--community .mini-form h3{margin:.25rem 0 .75rem;}
.page--community .mini-form .btn{grid-column:1/-1;}
.page--community .success-banner{display:none;background:#e7f9ed;color:#185a2e;border:1px solid #b6e2bf;padding:.75rem;border-radius:10px;margin:.75rem 0;text-align:center;}
.page--community .policy{font-size:.92rem;color:#475569;}

/* ===== Contact page ===== */
.page--contact .cta-row{display:flex;flex-wrap:wrap;gap:.5rem 1rem;margin:.75rem 0 1rem;}
.page--contact .contact-form{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:1rem 1.25rem;max-width:980px;width:100%;align-items:start;}
@media (max-width:720px){.page--contact .contact-form{grid-template-columns:1fr;}}
.page--contact .contact-form label{display:block;font-weight:600;margin-bottom:.35rem;}
.page--contact .contact-form input[type="text"],
.page--contact .contact-form input[type="email"],
.page--contact .contact-form input[type="url"],
.page--contact .contact-form select,
.page--contact .contact-form textarea{width:100%;padding:.6rem .7rem;border:1px solid #e5e7eb;border-radius:10px;background:#fff;font:inherit;}
.page--contact .contact-form textarea{min-height:180px;resize:vertical;}
.page--contact .contact-form .full{grid-column:1/-1;}
.page--contact .contact-form .help{font-size:.9rem;color:#6b7280;margin-top:.25rem;}
.page--contact .contact-form .btn{justify-self:start;}
.page--contact .success-banner{display:none;background:#e7f9ed;color:#185a2e;border:1px solid #b6e2bf;padding:.9rem 1rem;border-radius:10px;margin:1rem 0;text-align:center;max-width:980px;}
.page--contact .closing-note{text-align:center;font-size:.95rem;color:#4b5563;border-top:1px solid #e5e7eb;margin:2rem auto 0;padding-top:1.5rem;max-width:750px;line-height:1.6;}
.page--contact .closing-note strong{color:var(--accent);}

/* ===== About page ===== */
.page--about .chip-row{display:flex;flex-wrap:wrap;gap:.5rem;}
.page--about .cards-grid{display:grid;gap:1rem;}
@media (min-width:720px){.page--about .cards-grid{grid-template-columns:repeat(2,minmax(240px,1fr));}}
.page--about .cards-grid .card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:1rem;box-shadow:0 2px 8px rgba(0,0,0,.03);}
.page--about .cards-grid .card .card-title{margin-bottom:.35rem;}
.page--about .cards-grid .card .meta{font-size:.95rem;color:#6b7280;}

/* === About layout (final, deduped) === */
.about-grid{
  display:grid;
  grid-template-columns:1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items:start;
  column-gap: clamp(1.25rem, 3vw, 2rem);
}
@media (min-width:820px){
  .about-grid{ grid-template-columns: minmax(320px,1fr) minmax(420px,1.15fr); }
}
.about-media{
  margin:0; width:100%; max-width:100%; overflow:hidden;
}
.about-media img{
  display:block; width:100%; max-width:100%;
  height:auto; object-fit:cover;
}
@media (min-width:820px){ .about-media img{ height:480px; } }
@media (min-width:1024px){ .about-media img{ height:520px; } }

/* Extra safety for reduced motion on hero cards */
@media (prefers-reduced-motion:reduce){
  .hero--photo, .hero--blue{ transition:none!important; }
}
