/* Freebituaries base styles. Tenants override the tokens in theme.css. */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --fg: #1d232b;
  --muted: #5a6470;
  --line: #e4ded3;
  --accent: #1f4e79;
  --accent-fg: #ffffff;
  --hero-bg: #1f2a3a;
  --hero-fg: #ffffff;
  --stripe: linear-gradient(90deg, var(--accent) 0 25%, #2e6b46 25% 50%, #c9a24a 50% 75%, #6b7480 75%);
  /* Brand band: a flat stripe by default; a tenant with a tartan sets --band to its woven tile. */
  --band: var(--stripe);
  --band-height: 6px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --radius: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; } /* 18px base for an older, mobile audience */
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; font-weight: 600; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid #c9a24a; outline-offset: 2px; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; }
.site-header::after { content: ""; display: block; height: var(--band-height); background: var(--band); }
.header-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 560px; min-width: 0; }
.search select { flex: 0 1 auto; min-width: 0; max-width: 45%; }
.search input, .search select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--fg); min-height: 44px; }
.search input { flex: 1; min-width: 0; }
.towns { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.towns a { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--fg); background: var(--bg); font-size: .9rem; }
.towns a:hover { border-color: var(--accent); }

/* Hero carousel */
.hero { position: relative; background: var(--hero-bg); color: var(--hero-fg); overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--band-height); background: var(--band); z-index: 1; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 360px; }
.slide-bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(24px) brightness(.45); }
.slide-inner { position: relative; display: flex; gap: 28px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; color: inherit; text-decoration: none; }
.slide .portrait { width: 200px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.4); flex: none; background: #2b3647; }
.slide h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0 0 8px; }
.slide .dates, .slide .place { margin: 4px 0; font-size: 1.05rem; opacity: .92; }
.hero-controls { position: absolute; right: 16px; bottom: calc(var(--band-height) + 12px); z-index: 2; display: flex; gap: 8px; }
.hero-controls button { font: inherit; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.35); color: #fff; cursor: pointer; }
@media (max-width: 599px) {
  .slide-inner { flex-direction: column; text-align: center; gap: 16px; padding-bottom: 72px; }
  .slide .portrait { width: 160px; }
}

/* Yearbook grid */
.section-title { margin: 28px 0 12px; font-size: 1.5rem; }
.grid { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--fg); }
.tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--line); margin-bottom: 6px; }
.tile .name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.tile .dates, .tile .town { color: var(--muted); font-size: .85rem; }
.tile a:hover .name { color: var(--accent); text-decoration: underline; }
@media (max-width: 380px) { .grid { grid-template-columns: repeat(2, 1fr); } }

/* Obituary page */
.obit { display: grid; gap: 28px; grid-template-columns: minmax(0, 360px) 1fr; padding-top: 32px; padding-bottom: 48px; align-items: start; }
.obit .portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.obit h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 8px; }
.obit .dates { font-size: 1.15rem; margin: 0 0 4px; }
.obit .place { color: var(--muted); margin: 0 0 16px; }
.obit .snippet { font-size: 1.05rem; }
@media (max-width: 699px) { .obit { grid-template-columns: 1fr; } .obit .portrait { max-width: 320px; } }
.button, .share { display: inline-block; font: inherit; font-weight: 600; padding: 12px 20px; border-radius: var(--radius); min-height: 48px; cursor: pointer; }
.button { background: var(--accent); color: var(--accent-fg); text-decoration: none; border: 0; }
.share { background: transparent; color: var(--accent); border: 2px solid var(--accent); }

/* Town page / prose */
.also-check { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid #c9a24a; border-radius: var(--radius); padding: 4px 18px; margin: 0 0 24px; }
.also-check h2 { font-size: 1.15rem; }
.prose { max-width: 760px; padding-top: 16px; padding-bottom: 48px; }
#search-results { padding-top: 16px; }
#search-results .count { color: var(--muted); }

/* Footer */
.site-footer { background: var(--surface); color: var(--muted); font-size: .9rem; padding: 0 0 20px; }
.site-footer::before { content: ""; display: block; height: var(--band-height); background: var(--band); margin-bottom: 20px; }
.tartan-credit { font-size: .8rem; }
.site-footer p { margin: 4px 0; }
