/* Hamilton Visitor Guide: "Hearth"
   Layout: a photo of Davis Street opens the page under a charcoal masthead with a stitched gold line.
   A striped band of fabric colors hands off to "Right now in Hamilton", a charcoal band over a faded
   landscape photo, with quick picks and the hour-by-hour chart as cream cards. Places sits on linen
   over a faint 1909 map of downtown; each card wears a category banner that overhangs its edges and
   folds back, with the place's photo (or its quilt block) faded behind it.
   Palette: charcoal and cream, with the red, gold, teal, sky, moss and navy of the Davis Street mural,
   a touch richer. Type: Fraunces for headings, Inter for reading. */

:root {
  /* Fabric colors. They stay the same in light and dark mode. The old names stay so every rule that
     used the mural colors picks up the new ones: "navy" is now the charcoal, "mustard" the gold. */
  --navy: #2A2C30;
  --mustard: #D3962F;
  --red: #B23A26;
  --teal: #23695F;
  --green: #4F6B3A;
  --sky: #86B6D6;
  --deep-blue: #2A3D70;
  --white: #FFFFFF;
  --cream: #FAF7F1;
  --gold-light: #EDBE62;

  /* Page roles, light mode */
  --paper: #E3DED5;
  --wash: #DCD5C8;
  --card: #FAF7F1;
  --ink: #25272B;
  --ink-2: #55585E;
  --line: #D3CCBF;
  --card-border: #85888F;
  --accent-text: #9A2F1E;
  --field: #2A2C30;
  --field-ink: #F4F1EA;
  --field-ink-2: #C9C6BF;
  --field-link: #EDBE62;
  --field-line: #45484E;
  --focus: #B23A26;
  --evening-bg: #F4D9D1;
  --evening-fg: #8E2A1A;
  --sunday-bg: #F3E3C2;
  --sunday-fg: #6A4810;
  --tag-bg: #ECE7DE;
  --open: #2E5A2C;
  --open-bg: #DDE8D7;
  --soon: #6A4810;
  --soon-bg: #F3E3C2;
  --shut: #55585E;
  --shut-bg: #E8E5DF;
  --chart-bar: #2A2C30;
  --chart-band: #F3E3C2;
  --chart-grid: #E2DCD0;

  --c-eat: #B23A26;
  --c-shop: #23695F;
  --c-do: #D3962F;
  --c-landmark: #86B6D6;
  --c-stay: #4F6B3A;
  --c-nearby: #2A3D70;
  --c-service: #5A6472;
  --quilt-bg: transparent;
  --quilt-b: #2A2C30;
  --quilt-c: #D3962F;

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-sm: 1rem;
  --fs-body: 1.0625rem;
  --fs-lg: 1.3rem;
  --fs-h3: 1.45rem;
  --fs-h2: clamp(1.85rem, 3.6vw, 2.5rem);

  --radius: 0px;
  --gap: clamp(16px, 2.4vw, 24px);
  /* How far a card's banner reaches past each side. */
  --ov: 10px;
  --shadow: 0 16px 32px rgb(37 39 43 / 0.24), 0 2px 6px rgb(37 39 43 / 0.18);
  --shadow-sm: 0 8px 20px rgb(37 39 43 / 0.14), 0 1px 3px rgb(37 39 43 / 0.16);
  /* A fine linen weave, laid over the page color. */
  --linen: repeating-linear-gradient(0deg, rgb(37 39 43 / 0.05) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgb(37 39 43 / 0.04) 0 1px, transparent 1px 4px);
  color-scheme: light;
}
/* TEMPORARY: index.html sets data-theme="light" on <html>, which holds the site in light mode on every device.
   Remove that attribute (and the color-scheme meta tag) to bring back automatic dark mode below. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1E1F22;
    --wash: #24262A;
    --card: #2B2D31;
    --ink: #F1EEE8;
    --ink-2: #C4C0B8;
    --line: #3E4146;
    --card-border: #6B6E75;
    --accent-text: #F28B80;
    --field: #17181A;
    --field-ink: #F1EEE8;
    --field-ink-2: #C4C0B8;
    --field-link: #EDBE62;
    --field-line: #34363A;
    --focus: #EDBE62;
    --evening-bg: #3B1C1A;
    --evening-fg: #F6A79E;
    --sunday-bg: #3A2C0E;
    --sunday-fg: #F2C76A;
    --tag-bg: #34363B;
    --open: #86D7A9;
    --open-bg: #133124;
    --soon: #F2C47B;
    --soon-bg: #382A10;
    --shut: #B7C1D0;
    --shut-bg: #34363B;
    --chart-bar: #C9C6BF;
    --chart-band: #3A3326;
    --chart-grid: #3A3C41;
    --c-eat: #F0857A;
    --c-shop: #5FC1BB;
    --c-do: #EDBE62;
    --c-landmark: #86B6D6;
    --c-stay: #8BC77A;
    --c-nearby: #8FB6EE;
    --quilt-bg: transparent;
    --quilt-b: #C9C6BF;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #1E1F22;
  --wash: #24262A;
  --card: #2B2D31;
  --ink: #F1EEE8;
  --ink-2: #C4C0B8;
  --line: #3E4146;
  --card-border: #6B6E75;
  --accent-text: #F28B80;
  --field: #17181A;
  --field-ink: #F1EEE8;
  --field-ink-2: #C4C0B8;
  --field-link: #EDBE62;
  --field-line: #34363A;
  --focus: #EDBE62;
  --evening-bg: #3B1C1A;
  --evening-fg: #F6A79E;
  --sunday-bg: #3A2C0E;
  --sunday-fg: #F2C76A;
  --tag-bg: #34363B;
  --open: #86D7A9;
  --open-bg: #133124;
  --soon: #F2C47B;
  --soon-bg: #382A10;
  --shut: #B7C1D0;
  --shut-bg: #34363B;
  --chart-bar: #C9C6BF;
  --chart-band: #3A3326;
  --chart-grid: #3A3C41;
  --c-eat: #F0857A;
  --c-shop: #5FC1BB;
  --c-do: #EDBE62;
  --c-landmark: #86B6D6;
  --c-stay: #8BC77A;
  --c-nearby: #8FB6EE;
  --quilt-bg: transparent;
  --quilt-b: #C9C6BF;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--linen), var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--mustard); color: var(--navy); }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { color: var(--accent-text); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2, .section-title { font-family: var(--f-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 50;
  background: var(--mustard); color: var(--navy); padding: 10px 14px; border-radius: 6px; font-weight: 700;
}
.skip:focus { top: 12px; }

.section-title { font-size: var(--fs-h2); }
.subhead { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lg); margin: 0 0 10px; }

/* A striped band of the fabric colors, where one part of the page hands off to the next. */
.geese { height: 10px; background: repeating-linear-gradient(90deg, var(--red) 0 60px, var(--mustard) 60px 120px, var(--teal) 120px 180px, var(--sky) 180px 240px, var(--green) 240px 300px); }

/* ---------- Masthead ---------- */
/* The masthead and the "Are you local?" strip under it are one block, pinned to the top of the screen
   until the Places section reaches it. From there app.js lets the page carry it away. Scrolling up
   brings the masthead back by itself ("peek"): the strip under it fades out and stays behind. */
.site-top { position: sticky; top: 0; z-index: 30; box-shadow: 0 6px 16px rgb(0 0 0 / 0.18); }
.site-top.is-sliding { transition: transform 0.2s ease; }
.site-top .local-bar { transition: opacity 0.2s ease, visibility 0.2s; }
.site-top.is-peek { box-shadow: none; }
.site-top.is-peek .masthead { box-shadow: 0 6px 16px rgb(0 0 0 / 0.18); }
.site-top.is-peek .local-bar { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .site-top.is-sliding, .site-top .local-bar { transition: none; } }
.masthead { background: var(--navy); color: var(--cream); padding-bottom: 7px; }
/* A dashed gold line under the masthead, like quilting stitches. */
.masthead::after { content: ""; display: block; margin-inline: 10px; border-top: 2px dashed var(--mustard); }
.masthead-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px 24px; flex-wrap: wrap; padding-block: 10px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; }
.topnav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.topnav a { color: #E4E1DA; text-decoration: none; padding-block: 10px; font-size: 0.95rem; font-weight: 500; }
.topnav a:hover { color: var(--gold-light); text-decoration: underline; text-decoration-color: var(--gold-light); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(400px, 62vh, 600px);
  display: flex; align-items: flex-end;
  background: var(--navy);
  color: var(--white);
}
.hero-photo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%;
  filter: saturate(0.85) sepia(0.12);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(42 44 48 / 0.93) 0%, rgb(42 44 48 / 0.7) 48%, rgb(42 44 48 / 0.18) 100%);
}
.hero-inner { padding-block: 32px 40px; }
.hero h1 { display: flex; flex-direction: column; gap: 0; }
.hero-greet { font-family: var(--f-display); font-style: italic; font-weight: 400; color: var(--gold-light); font-size: clamp(1.8rem, 3.6vw, 2.3rem); line-height: 1.1; }
.hero-town {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(3.8rem, 10vw, 7rem); line-height: 0.95; letter-spacing: -0.02em;
  color: var(--cream);
}
.hero-lede { margin-top: 20px; font-size: clamp(1.25rem, 2.4vw, 1.45rem); max-width: 28ch; line-height: 1.4; }
.hero-note { margin-top: 10px; font-size: var(--fs-body); color: #E4E1DA; max-width: 44ch; }
.hero-credit {
  position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: 8px;
  font-size: 0.8rem; color: #D5DEEE;
}
.hero-credit a { color: #D5DEEE; text-decoration-color: rgb(213 222 238 / 0.6); text-decoration-thickness: 1px; }

/* ---------- Intro: a short welcome in three paragraphs. Each photo is pressed against the edge of the
   page, alternating sides, and fades into the linen on the side toward the words. ---------- */
.intro { padding-block: clamp(52px, 7vw, 92px) clamp(28px, 4vw, 48px); overflow-x: clip; }
.intro-title { text-align: center; }
.intro-rows { margin-top: clamp(20px, 3vw, 36px); }
/* The rows stack like sheets as you scroll. Each one holds for a moment under the header; the next slides
   up over it, a little lower, so the edge of the one before still shows. The photo being covered fades
   back. app.js sets where each row holds (--stick: never so high that the bottom of its words is cut off)
   and how far it's covered (--cover). */
.intro-row {
  position: sticky; top: var(--stick, 0px); display: flex; align-items: center; min-height: clamp(380px, 36vw, 500px);
  background: var(--linen), var(--paper);
}
.intro-row + .intro-row { box-shadow: 0 -14px 22px -16px rgb(0 0 0 / 0.38); }
.intro-row .intro-photo { opacity: calc(1 - var(--cover, 0) * 0.7); transform: scale(calc(1 - var(--cover, 0) * 0.05)); transform-origin: 50% 0; }
.intro-row .intro-inner { opacity: calc(1 - var(--cover, 0) * 0.35); }
.intro-rows.is-flat .intro-row { position: relative; top: auto; }
@media (prefers-reduced-motion: reduce) { .intro-row .intro-photo { transform: none; } }
.intro-photo {
  --fade-in: linear-gradient(to right, #000 38%, transparent 96%);
  position: absolute; top: 0; left: 0; width: 60%; height: 100%;
  object-fit: cover; filter: saturate(0.88) sepia(0.1);
  -webkit-mask-image: var(--fade-in); mask-image: var(--fade-in);
}
.intro-row--flip .intro-photo { left: auto; right: 0; --fade-in: linear-gradient(to left, #000 38%, transparent 96%); }
.intro-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.intro-text { grid-column: 2; padding-block: 40px; font-size: clamp(1.1rem, 1.5vw, 1.2rem); line-height: 1.7; max-width: 34em; }
.intro-row--flip .intro-text { grid-column: 1; }
.intro-text p + p { margin-top: 14px; }
.intro-more { font-weight: 600; }
.intro-close {
  margin-top: clamp(28px, 4vw, 48px); text-align: center; text-wrap: balance;
  font-family: var(--f-display); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.35; color: var(--ink);
}
.intro-credits { margin-top: 28px; text-align: center; font-size: 0.8rem; color: var(--ink-2); }
.intro-credits a { color: var(--ink-2); text-decoration-thickness: 1px; }
/* On a phone each photo runs edge to edge above its words and fades into the page below, toward them. */
@media (max-width: 759px) {
  .intro-row { display: block; min-height: 0; }
  .intro-photo, .intro-row--flip .intro-photo {
    position: relative; width: 100%; height: 260px;
    --fade-in: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  .intro-inner { display: block; }
  .intro-text { margin-top: -36px; padding-block: 0 36px; }
}

/* ---------- Right now ---------- */
.now {
  padding-block: clamp(40px, 5.5vw, 64px); outline: none; color: var(--cream);
  background: linear-gradient(180deg, rgb(42 44 48 / 0.6) 0%, rgb(42 44 48 / 0.9) 100%), url("photos/cards/adam-ondi-ahman.jpg") center / cover no-repeat, var(--navy);
}
.now-grid { display: grid; gap: 28px clamp(24px, 4vw, 48px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 980px) { .now-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.clock-now { margin-top: 6px; color: #E4E1DA; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }

.picks { margin-top: 24px; display: grid; gap: 22px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: var(--ov); }
.picks .pick:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 479px) { .picks { grid-template-columns: minmax(0, 1fr); } }
/* A quick pick is a key you press: a solid block of its fabric color sitting on a darker edge. It
   rises a little under the pointer, sinks when pressed, and stays sunk, with a check, while its filter
   is on. The shape does the explaining, so there's no "tap here" label. */
.pick {
  --patch: var(--navy); --patch-ink: var(--cream);
  --edge: color-mix(in srgb, var(--patch) 58%, #000);
  --rise: 6px;
  position: relative; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: baseline; align-content: start;
  padding: 12px 16px 14px;
  color: var(--patch-ink); border: 0;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0) 60%) var(--patch);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.3),
    0 var(--rise) 0 var(--edge),
    0 calc(var(--rise) + 10px) 20px rgb(0 0 0 / 0.42);
  transform: translateY(0);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pick[data-pick="now"] { --patch: var(--teal); }
.pick[data-pick="after5"] { --patch: var(--red); }
.pick[data-pick="sunday"] { --patch: var(--mustard); --patch-ink: var(--ink); }
.pick[data-pick="stay"] { --patch: var(--green); }
.pick[data-pick="companions"] { --patch: var(--deep-blue); }
.pick:hover { --rise: 8px; transform: translateY(-2px); }
.pick:active { --rise: 1px; transform: translateY(5px); }
/* On: pushed in and held there. */
.pick[aria-pressed="true"] {
  --rise: 2px; transform: translateY(4px);
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.18), rgb(0 0 0 / 0) 45%) var(--patch);
  box-shadow: inset 0 3px 7px rgb(0 0 0 / 0.35), 0 var(--rise) 0 var(--edge), 0 4px 10px rgb(0 0 0 / 0.3);
}
.pick[aria-pressed="true"]:hover { transform: translateY(3px); }
.pick:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 4px; }
.pick-hint { grid-column: 1 / -1; margin-bottom: 6px; padding-right: 30px; font-weight: 600; font-size: 0.875rem; line-height: 1.3; opacity: 0.88; }
.pick-count { font-family: var(--f-display); font-weight: 600; font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pick-label { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.pick-check { display: none; position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; padding: 3px; border-radius: 50%; background: var(--white); color: var(--navy); }
.pick[aria-pressed="true"] .pick-check { display: block; }
@media (prefers-reduced-motion: reduce) { .pick { transition: none; } }

.clock-card {
  margin: 0 var(--ov); min-width: 0; color: var(--ink);
  background: var(--card); box-shadow: 0 14px 28px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.25);
  padding: 0 16px 10px;
}
.clock-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin: 0 calc(-16px - var(--ov)); padding: 8px calc(16px + var(--ov)); background: var(--red); color: var(--cream);
}
.clock-title { font-weight: 600; }
/* A small mustard tag in the corner says the bars are buttons. */
.chart-cta {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px;
  background: var(--mustard); color: var(--navy); font-size: 0.9rem; font-weight: 700; white-space: nowrap;
}
.chart-cta svg { width: 18px; height: 18px; }
/* The one-time nudge: a bar glows mustard while its tip says it can be tapped. */
.chart .bar.is-nudge { animation: bar-nudge 1.1s ease-in-out 3; }
@keyframes bar-nudge { 0%, 100% { fill: var(--chart-bar); } 50% { fill: var(--mustard); } }
.chart { position: relative; min-height: 230px; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-label { fill: var(--ink-2); font-size: 13px; font-family: var(--f-body); }
.chart .band { fill: var(--chart-band); }
.chart .band-label { fill: var(--ink-2); font-size: 13px; font-family: var(--f-body); }
.chart .bar { fill: var(--chart-bar); }
.chart .bar.is-now { fill: var(--mustard); }
.chart .bar.is-picked { fill: var(--red); stroke: var(--navy); stroke-width: 2; }
.chart .bar-hit { fill: transparent; cursor: pointer; outline: none; }
.chart .bar-hit:hover { fill: rgb(229 168 46 / 0.18); }
.chart .bar-hit:focus-visible { stroke: var(--focus); stroke-width: 3; }
.chart-hint { margin-top: 2px; font-size: 0.95rem; color: var(--ink-2); }
.hour-btn { background: none; border: 0; padding: 6px 2px; min-height: 36px; cursor: pointer; color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 0.2em; }
.hour-btn[aria-pressed="true"] { font-weight: 700; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .base-line { stroke: var(--ink-2); stroke-width: 1; }
.chart .now-line { stroke: var(--red); stroke-width: 2; }
.chart .now-label { fill: var(--accent-text); font-size: 13px; font-weight: 700; font-family: var(--f-body); }
.chart .five-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--navy); color: var(--white); font-size: 0.95rem;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%);
}
.chart-table { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.chart-table summary { cursor: pointer; padding-block: 8px; }
.chart-table ul { margin: 4px 0 8px; padding-left: 0; list-style: none; columns: 3; column-gap: 16px; }

/* ---------- Updates ---------- */
.updates { padding-block: 8px 36px; }
.updates-list {
  margin-top: 16px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.update {
  background: var(--card); box-shadow: var(--shadow-sm); padding: 16px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.update-meta { font-size: 0.95rem; color: var(--ink-2); }
.update-text { overflow-wrap: anywhere; }

/* ---------- "Are you local?": a thin mustard strip across the page that opens a panel for residents ---------- */
.local-bar { background: var(--mustard); border-bottom: 2px solid var(--navy); }
.local-btn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; color: var(--navy); }
.local-btn-row { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; min-height: 50px; padding-block: 8px; }
.local-q { font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.local-sub { font-size: var(--fs-sm); }
.local-chev { width: 26px; height: 26px; margin-left: auto; flex: none; transition: transform 160ms ease-out; }
.local-btn[aria-expanded="true"] .local-chev { transform: rotate(180deg); }
.local-btn:hover { background: #DDA548; }
.local-btn:hover .local-q { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.local-btn:focus-visible { outline: 3px solid var(--navy); outline-offset: -5px; }
/* On a phone the strip keeps to one line so the pinned block stays short. */
@media (max-width: 600px) { .local-sub { display: none; } .local-btn-row { min-height: 44px; padding-block: 6px; } }

.local-panel { padding-block: 16px 20px; background: var(--paper); border-bottom: 2px solid var(--navy); }
/* It hangs from the strip as a dropdown over the page, wherever the pinned header is. */
.site-top .local-panel { position: absolute; top: 100%; left: 0; right: 0; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 16px 30px rgb(0 0 0 / 0.28); }
.local-grid { display: grid; gap: 18px 36px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.local-block { min-width: 0; padding-top: 10px; border-top: 4px solid var(--mustard); }
.local-block .subhead { font-size: 1.1rem; margin-bottom: 6px; }
#local-groups-block { border-top-color: var(--teal); }
.local-block--biz { border-top-color: var(--green); }
.local-block:last-child { border-top-color: var(--red); }
/* On a phone the links come first and the services switch drops to the bottom. */
@media (max-width: 640px) { .local-block--services { order: 2; } }
.local-note { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: 8px; }
.local-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.local-links a { font-weight: 700; }
.local-links .muted { display: block; color: var(--ink-2); font-size: var(--fs-sm); }
.local-switch {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px 8px 10px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); font-weight: 700; text-align: left;
}
.local-switch-track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--line); transition: background 160ms ease-out; }
.local-switch-dot { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgb(11 18 38 / 0.35); transition: transform 160ms ease-out; }
.local-switch[aria-pressed="true"] .local-switch-track { background: var(--teal); }
.local-switch[aria-pressed="true"] .local-switch-dot { transform: translateX(20px); }
.card[data-cat="service"] { --cat: var(--c-service); }

/* ---------- Places ---------- */
.places {
  padding-block: clamp(40px, 5.5vw, 64px); outline: none;
  position: relative;
}
.scenery-zone {
  /* clip (not hidden) so the photo stops at the band without breaking position: sticky. */
  position: relative; isolation: isolate; overflow: clip;
  background: var(--paper);
}
.scenery-zone .worship { background: transparent; }
/* One photo of J.C. Penney Park fills the screen behind Places and Places of worship and stays put while they
   scroll over it. A flat, even wash of the linen texture sits on top, so the photo reads as a soft scene with
   no fades. The striped band under worship ends it. The layer is a full screen tall and pulls the content back
   up over itself with a negative margin. */
.places-scenery {
  position: sticky; top: 0; z-index: -1; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh;
  pointer-events: none; overflow: hidden;
}
.places-scenery img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; filter: saturate(0.8); }
.places-scenery::after { content: ""; position: absolute; inset: 0; background: var(--linen), color-mix(in srgb, var(--paper) 80%, transparent); }
.places-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field select, .field input {
  min-height: 50px; padding: 8px 12px;
  border: 1.5px solid var(--card-border); border-radius: var(--radius); background: var(--white);
}
/* The search box and its Tags menu share one frame. */
.search-row {
  position: relative; display: flex; align-items: stretch; min-width: 0;
  border: 1.5px solid var(--card-border); border-radius: var(--radius); background: var(--white);
}
.search-row:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.field .search-row input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; border-radius: var(--radius) 0 0 var(--radius); }
.field .search-row input:focus-visible { outline: none; }
.tagmenu { position: static; flex: none; }
.tagmenu-btn {
  list-style: none; cursor: pointer; height: 100%; min-height: 46px;
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-left: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.tagmenu-btn::-webkit-details-marker { display: none; }
.tagmenu-btn svg { width: 20px; height: 20px; }
.tagmenu-btn:hover, .tagmenu[open] .tagmenu-btn, .tagmenu.has-tags .tagmenu-btn { color: var(--ink); }
.tagmenu-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tagmenu-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--ink); color: var(--card); font-size: 0.85rem; font-weight: 700;
}
.tagmenu-panel {
  position: absolute; right: -2px; top: calc(100% + 6px); z-index: 20;
  width: min(300px, calc(100vw - 32px)); padding: 12px 14px 8px;
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(11 18 38 / 0.18);
}
.tagmenu-title { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 4px; }
.tag-list { display: grid; }
.field .tag-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; border-bottom: 1px solid var(--line); font-weight: 400; font-size: var(--fs-body); }
.field .tag-opt:last-child { border-bottom: 0; }
.tag-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.tag-n { color: var(--ink-2); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
#tag-clear { margin-top: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  min-height: 46px; padding: 8px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--white); border: 1.5px solid var(--card-border); border-radius: var(--radius); font-weight: 500;
}
.tab:hover { background: var(--tag-bg); }
.tab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
:root[data-theme="dark"] .tab[aria-pressed="true"] { background: var(--mustard); border-color: var(--mustard); color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab[aria-pressed="true"] { background: var(--mustard); border-color: var(--mustard); color: var(--navy); } }
.dot { width: 12px; height: 12px; border-radius: 0; background: var(--dot); display: inline-block; flex: none; transform: rotate(45deg); }
/* Sky is pale on white, so the Landmarks diamond gets a thin navy edge. */
.tab[data-cat="landmark"] .dot { box-shadow: inset 0 0 0 1.5px var(--navy); }

/* A chip wears its quick pick's patch color from the "Right now" buttons and carries an x to remove it. */
.fchip {
  --chip: var(--navy); --chip-ink: var(--white);
  min-height: 40px; padding: 6px 8px 6px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--chip); color: var(--chip-ink); border: 2px solid var(--chip); border-radius: var(--radius); font-weight: 700;
}
.fchip[data-pick-chip="now"] { --chip: var(--teal); }
.fchip[data-pick-chip="after5"] { --chip: var(--red); }
.fchip[data-pick-chip="sunday"] { --chip: var(--mustard); --chip-ink: var(--navy); }
.fchip[data-pick-chip="stay"] { --chip: var(--green); }
.fchip svg { width: 18px; height: 18px; flex: none; }
.fchip:hover { filter: brightness(1.12); }
:root[data-theme="dark"] { --filter-edge: var(--mustard); }
:root[data-theme="dark"] .fchip:not([data-pick-chip]) { --chip: var(--mustard); --chip-ink: var(--navy); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --filter-edge: var(--mustard); }
  :root:not([data-theme="light"]) .fchip:not([data-pick-chip]) { --chip: var(--mustard); --chip-ink: var(--navy); }
}
/* The search area: the search bar, and one filter line under it with the day, any filters that are on
   (each with an x), the categories and the count. It looks the same pinned or not, so it pins to the
   top of the screen with plain CSS, keeps up with every scroll, and lets go after the last card. While
   the header peeks back in, it sits just under it (--peek). */
.finder-sentinel { height: 1px; margin-top: 19px; }
.places { overflow-anchor: none; }
.finder {
  position: sticky; top: calc(var(--peek, 0px) + 8px); z-index: 15; scroll-margin-top: 16px;
  display: grid; gap: 10px; padding: 12px;
  background: var(--card); box-shadow: 0 8px 22px rgb(11 18 38 / 0.18);
}
.finder .field .search-row input { min-height: 46px; }
.filter-line { display: flex; align-items: center; gap: 14px; min-width: 0; }
.filter-scroll { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.filter-scroll::-webkit-scrollbar { display: none; }
/* When the line runs past the edge, it fades out there, so it's clear it scrolls. */
.filter-scroll.is-clipped { mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.day-pick { flex: none; display: flex; }
.day-pick select {
  min-height: 40px; padding: 6px 10px; cursor: pointer; font-weight: 600; field-sizing: content;
  border: 1.5px solid var(--card-border); border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.day-pick select.is-set { background: var(--navy); border-color: var(--navy); color: var(--white); }
.filter-chips { flex: none; display: flex; align-items: center; gap: 6px; }
.filter-chips:not([hidden]) { padding-right: 10px; border-right: 1px solid var(--line); }
.filter-scroll .tabs { flex: none; flex-wrap: nowrap; gap: 6px; }
.filter-scroll .tab { flex: none; min-height: 40px; padding: 6px 10px; gap: 7px; white-space: nowrap; }
.fchip { flex: none; white-space: nowrap; }
.count { flex: none; font-weight: 700; white-space: nowrap; }
.count-desc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* "Clear filters" hangs off the bottom edge of the floating bar, at the right, like a tab. */
.clear-btn {
  position: absolute; right: 14px; bottom: 0; transform: translateY(60%); z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px 6px 10px;
  border: 0; border-radius: var(--radius); background: var(--mustard); color: var(--navy);
  font: inherit; font-size: 0.9rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  box-shadow: 0 4px 10px rgb(11 18 38 / 0.22);
}
.clear-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.clear-btn:hover { background: color-mix(in srgb, var(--mustard) 85%, var(--white)); }
.clear-btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.clear-btn[hidden] { display: none; }
/* The saved-trip bubble sits top right too, so the bar leaves room for it. */
@media (max-width: 1340px) { body.has-trip .finder { padding-right: 70px; } }
@media (max-width: 639px) {
  .finder { top: calc(var(--peek, 0px) + 6px); padding: 8px; gap: 8px; }
  .clear-btn { right: 10px; }
  /* Filters that are on come first on a phone, so they're in view without swiping. */
  .filter-chips { order: -1; }
}
.text-btn {
  background: none; border: 0; padding: 10px 4px; cursor: pointer; font-weight: 700;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.2em;
}

.grid { margin-top: 18px; padding-inline: var(--ov); display: grid; gap: clamp(32px, 3.6vw, 44px) clamp(28px, 3vw, 36px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* ---------- Card ---------- */
/* Square, on a soft shadow. A banner in the category's color runs across the top, reaching a little
   past each side and folding back behind the card. The place's photo, or its quilt block, sits faded
   behind the top of the card; an opened card shows the photo in full. */
.card {
  --cat: var(--navy); --cat-ink: var(--cream);
  position: relative; isolation: isolate; min-width: 0;
  background: var(--card); box-shadow: var(--shadow);
  padding: 0 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-margin-top: var(--filter-h, 12px);
}
.card[data-cat="eat"] { --cat: var(--c-eat); }
.card[data-cat="shop"] { --cat: var(--c-shop); }
.card[data-cat="do"] { --cat: var(--c-do); --cat-ink: var(--ink); }
.card[data-cat="landmark"] { --cat: var(--c-landmark); --cat-ink: var(--ink); }
.card[data-cat="stay"] { --cat: var(--c-stay); }
.card[data-cat="nearby"] { --cat: var(--c-nearby); }

.card-bg {
  position: absolute; inset: 0 0 auto; height: 300px; z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 22%, transparent 92%); mask-image: linear-gradient(180deg, #000 22%, transparent 92%);
}
.card-bg img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.78; filter: sepia(0.08); }
.card-bg svg { display: block; width: 100%; height: 100%; opacity: 0.16; }
.card-bg .qbg { fill: var(--quilt-bg); }
.card-bg .qa { fill: var(--cat); }
.card-bg .qb { fill: var(--quilt-b); }
.card-bg .qc { fill: var(--quilt-c); }

/* The header opens the card. */
.card-head { position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.card-banner {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px;
  margin: 0 calc(-20px - var(--ov)) 84px; padding: 9px calc(18px + var(--ov));
  background: var(--cat); color: var(--cat-ink); font-size: 0.875rem; line-height: 1.3;
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.22);
}
.card:not(.has-photo) .card-banner { margin-bottom: 64px; }
.card-cat { font-weight: 600; }
.card-kind { text-align: right; }
/* Where the banner reaches past the card, it folds back behind it. */
.card-banner::before, .card-banner::after {
  content: ""; position: absolute; top: 100%; width: var(--ov); height: 8px;
  background: color-mix(in srgb, var(--cat) 62%, #000);
}
.card-banner::before { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.card-banner::after { right: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.card-title { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.12; }
.card-toggle { all: unset; cursor: pointer; border-radius: 2px; }
.card-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.card-head:hover .card-toggle { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.card-sub { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.35; }
/* Over a photo, the heading text gets a soft glow in the card's own color so it lifts off busy storefronts.
   Two tight layers keep the letter edges crisp; a wide one lightens the photo just around the words. */
.card.has-photo {
  --glow: 0 0 1px var(--card), 0 0 3px var(--card), 0 0 10px color-mix(in srgb, var(--card) 85%, transparent), 0 0 22px color-mix(in srgb, var(--card) 60%, transparent);
}
.card.has-photo .card-title,
.card.has-photo .card-sub,
.card.has-photo .status-sub,
.card.has-photo .status--unknown { text-shadow: var(--glow); }
.card.has-photo .card-sub,
.card.has-photo .status-sub { color: var(--ink); font-weight: 500; }
.card.has-photo .status--unknown { background: color-mix(in srgb, var(--card) 80%, transparent); }
.card-chevron {
  position: absolute; right: -6px; top: 52px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1.5px solid var(--navy); border-radius: 50%; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform 160ms ease-out;
}
.card-chevron svg { width: 22px; height: 22px; }
.card.is-open .card-chevron { transform: rotate(180deg); }

/* An opened card takes the whole row, with photos and reviews beside the details on wide screens. */
.card.is-open { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .card.is-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 32px; row-gap: 12px; align-items: start; }
  .card.is-open > * { grid-column: 1; }
  .card.is-open > .card-head, .card.is-open > .card-bg { grid-column: 1 / -1; grid-row: 1; }
  .card.is-open.has-photo > .extra, .card.is-open.has-media > .extra { grid-column: 2; grid-row: 2 / span 20; }
  .card.is-open:not(.has-photo):not(.has-media) > .more { grid-column: 2; grid-row: 2 / span 20; padding-top: 0; border-top: 0; }
}
.extra { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* On narrow screens the photos and reviews come right under the name you tapped. */
@media (max-width: 899px) {
  .card.is-open > .card-head { order: -2; }
  .card.is-open > .extra { order: -1; }
}
.extra-photo { margin: 0; }
.extra-photo img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 4px; border-bottom: 6px solid var(--cat); }
.extra-photo figcaption { margin-top: 6px; font-size: 0.9rem; color: var(--ink-2); }
/* Photos and videos (data/media.json): one at a time in a dark frame you swipe, with arrows and a count
   under it. Every picture fits whole inside the frame, so portraits aren't cropped. A video is its poster
   and a play button until tapped. */
.media { min-width: 0; }
.media-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; border-radius: 4px;
}
.media-track::-webkit-scrollbar { display: none; }
.media-track:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.media-slide { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.media-frame {
  position: relative; width: 100%; aspect-ratio: 3 / 2; min-height: 0; max-height: 340px; overflow: hidden;
  display: grid; place-items: center; background: var(--navy); border-bottom: 6px solid var(--cat);
}
.media-frame > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-play { all: unset; position: absolute; inset: 0; cursor: pointer; display: grid; place-items: center; }
.media-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-play-btn {
  position: relative; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 50%;
  background: rgb(20 20 22 / 0.72); color: var(--white); box-shadow: 0 4px 14px rgb(0 0 0 / 0.4);
}
.media-play-btn svg { width: 32px; height: 32px; margin-left: 4px; }
.media-play:hover .media-play-btn { background: var(--red); }
.media-play:focus-visible { outline: 3px solid var(--gold-light); outline-offset: -6px; }
.media-slide figcaption { margin-top: 6px; font-size: 0.9rem; color: var(--ink-2); }
.media-credit { font-size: 0.85rem; }
.media-bar { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.media-arrow {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--navy); border: 2px solid var(--navy); border-radius: 50%;
}
.media-arrow svg { width: 20px; height: 20px; }
.media-arrow.is-prev svg { transform: rotate(90deg); }
.media-arrow.is-next svg { transform: rotate(-90deg); }
.media-arrow:hover:not(:disabled) { background: var(--navy); color: var(--cream); }
.media-arrow:disabled { opacity: 0.35; cursor: default; }
.media-count { min-width: 3.5em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .media-frame { max-height: 260px; } }
/* Off-site links stay small and quiet: useful if someone wants them, not a reason to leave. */
/* Review links sit side by side at the very bottom of an opened card. */
.offsite { display: flex; gap: 8px; }
.offsite .link-btn { flex: 1 1 0; min-width: 0; max-width: 16rem; justify-content: center; text-align: center; line-height: 1.2; }
.offsite .link-btn svg { color: var(--accent-text); }

.status {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 5px 12px 5px 10px; border-radius: var(--radius); font-weight: 700; font-size: var(--fs-sm); line-height: 1.35;
  background: var(--shut-bg); color: var(--shut);
}
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; align-self: flex-start; margin-top: 0.42em; }
.status--open { background: var(--open-bg); color: var(--open); }
.status--soon { background: var(--soon-bg); color: var(--soon); }
.status--info, .status--any { background: var(--tag-bg); color: var(--ink); }
.status--unknown { background: transparent; border: 2px dashed var(--line); color: var(--ink-2); font-weight: 400; }
.status--unknown::before { background: transparent; border: 1.5px solid currentColor; width: 9px; height: 9px; }
.status-group { display: flex; flex-direction: column; gap: 4px; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Small solid tags in the mural colors: teal like the "Open right now" button, mustard as a heads-up. */
.soon-tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; line-height: 1.3; letter-spacing: 0.01em; white-space: nowrap;
}
.soon-tag--opening { background: var(--teal); color: var(--white); }
.soon-tag--closing { background: var(--mustard); color: var(--navy); }
.status-sub { color: var(--ink-2); font-size: var(--fs-sm); }

.card-blurb { overflow-wrap: break-word; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 0.95rem; padding: 3px 10px; border-radius: 4px; background: var(--tag-bg); color: var(--ink); }
.badge--evening { background: var(--evening-bg); color: var(--evening-fg); font-weight: 700; }
.badge--sunday { background: var(--sunday-bg); color: var(--sunday-fg); font-weight: 700; }

.facts { margin: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.fact { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; }
.fact svg { width: 20px; height: 20px; margin-top: 2px; color: var(--ink-2); }
.fact a, .fact span { overflow-wrap: anywhere; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--navy); border-radius: var(--radius); background: transparent;
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.link-btn:hover { background: var(--tag-bg); color: var(--ink); }
.link-btn svg { width: 20px; height: 20px; flex: none; }
.link-btn--posts, .link-btn--primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.link-btn--posts:hover, .link-btn--primary:hover { background: var(--navy); color: var(--gold-light); }
:root[data-theme="dark"] .link-btn--posts, :root[data-theme="dark"] .link-btn--primary { background: var(--mustard); border-color: var(--mustard); color: var(--navy); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .link-btn--posts, :root:not([data-theme="light"]) .link-btn--primary { background: var(--mustard); border-color: var(--mustard); color: var(--navy); }
}
.link-btn--primary { align-self: flex-start; }

.more { border-top: 2px dashed var(--line); padding-top: 4px; font-size: var(--fs-sm); }
.more summary { cursor: pointer; padding-block: 8px; color: var(--ink); font-weight: 600; }
.hours-table { border-collapse: collapse; width: 100%; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { text-align: left; padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.hours-table th { font-weight: 400; width: 6.5em; color: var(--ink-2); }
.hours-table tr.is-today th, .hours-table tr.is-today td { font-weight: 700; color: var(--ink); }
.hours-table .kitchen { display: block; color: var(--ink-2); font-weight: 400; }
.src-list { margin: 4px 0 6px; padding-left: 1.1em; color: var(--ink-2); }
.src-list li + li { margin-top: 2px; }
.more p + p, .more p + ul { margin-top: 6px; }
.more .muted { color: var(--ink-2); }

.empty { margin-top: 16px; padding: 24px; border: 2px dashed var(--card-border); border-radius: var(--radius); background: var(--card); }
.empty h3 { font-family: var(--f-display); font-weight: 400; font-size: var(--fs-lg); }
.empty p { margin-top: 8px; color: var(--ink-2); }
.empty ul { margin: 10px 0 0; padding-left: 1.2em; }

/* ---------- Plan ---------- */
.plan { padding-block: clamp(32px, 5vw, 56px); }
.section-lede { margin-top: 8px; max-width: 46em; color: var(--ink-2); }
/* Carousels (Travel tips, Around the calendar): one row of cards you can swipe, with arrows and dots.
   Three show at a time on a wide screen, two on a tablet, and one plus a peek of the next on a phone. */
.carousel-head { display: flex; align-items: end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.carousel-nav { display: flex; gap: 8px; }
.carousel-arrow {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--navy); border: 2px solid var(--navy); border-radius: 50%;
}
.carousel-arrow svg { width: 22px; height: 22px; }
.carousel-arrow.is-prev svg { transform: rotate(90deg); }
.carousel-arrow.is-next svg { transform: rotate(-90deg); }
.carousel-arrow:hover:not(:disabled) { background: var(--navy); color: var(--cream); }
.carousel-arrow:disabled { opacity: 0.35; cursor: default; }
.carousel {
  --gap: 18px; position: relative; margin-top: 20px; padding: 6px 4px 16px;
  display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.slide {
  --edge: var(--mustard);
  flex: 0 0 calc((100% - 2 * var(--gap)) / 3); scroll-snap-align: start;
  display: flex; flex-direction: column; padding: 16px 20px 18px;
  background: var(--card); box-shadow: var(--shadow-sm); border-top: 5px solid var(--edge);
}
.slide:nth-child(5n+2) { --edge: var(--red); }
.slide:nth-child(5n+3) { --edge: var(--teal); }
.slide:nth-child(5n+4) { --edge: var(--sky); }
.slide:nth-child(5n+5) { --edge: var(--green); }
.tip h3 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; }
.tip p { margin-top: 6px; }
.tip .tip-src { margin-top: auto; padding-top: 10px; font-size: 0.95rem; color: var(--ink-2); }
.carousel-dots { margin-top: 4px; display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; }
.carousel-dot { width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; background: none; border: 0; padding: 0; }
.carousel-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); border: 1.5px solid var(--card-border); transition: background 0.2s, transform 0.2s; }
.carousel-dot.is-on::before { background: var(--navy); border-color: var(--navy); }
.carousel-dot[aria-current="true"]::before { transform: scale(1.25); }
@media (max-width: 899px) { .slide { flex-basis: calc((100% - var(--gap)) / 2); } }
@media (max-width: 599px) { .slide { flex-basis: 86%; } .carousel-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .carousel-dot::before { transition: none; } }

/* ---------- Places of worship: posted times on the side, then every congregation by town ---------- */
.worship { padding-block: clamp(32px, 5vw, 56px); background: var(--wash); outline: none; }
/* Closed to start: just a centered "Places of worship" button. It opens downward and outward from the middle. */
.worship:not(.is-open) { padding-block: clamp(22px, 3.5vw, 36px); }
.worship-head { margin: 0; text-align: center; }
.worship-toggle {
  all: unset; box-sizing: border-box; cursor: pointer; max-width: 100%; padding: 8px 18px;
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
}
.worship-toggle .section-title { display: block; }
.worship-toggle-sub { font-family: var(--f-body); font-size: 1rem; font-weight: 400; color: var(--ink-2); text-wrap: balance; }
.worship-toggle-icon {
  margin-top: 4px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 2px solid var(--navy); border-radius: 50%; color: var(--navy); background: var(--card);
  transition: transform 0.35s ease, background 0.2s ease, color 0.2s ease;
}
.worship-toggle-icon svg { width: 22px; height: 22px; }
.worship-toggle:hover .worship-toggle-icon { background: var(--navy); color: var(--cream); }
.worship-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.worship.is-open .worship-toggle-icon { transform: rotate(180deg); }
.worship-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.worship-inner {
  min-height: 0; overflow: hidden; opacity: 0; clip-path: inset(0 50% 0 50%);
  transition: clip-path 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}
.worship.is-open .worship-body { grid-template-rows: 1fr; }
.worship.is-open .worship-inner { opacity: 1; clip-path: inset(0 0 0 0); }
.worship.is-open .worship-inner > :first-child { margin-top: 18px; }
.worship.is-settled .worship-inner { overflow: visible; clip-path: none; }
@media (prefers-reduced-motion: reduce) { .worship-body, .worship-inner, .worship-toggle-icon { transition: none; } }
.worship-grid { margin-top: 22px; display: grid; gap: 28px clamp(24px, 4vw, 40px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 980px) {
  .worship-grid { grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); }
  .worship-list { grid-column: 1; grid-row: 1; }
  .worship-side { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--peek, 0px) + 16px); }
  /* The pinned box scrolls on its own, so its last times never sit below the screen. */
  .worship-times-card[open] { max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
}
.worship-times-card {
  background: var(--card); border-top: 8px solid var(--mustard); box-shadow: var(--shadow-sm);
  padding: 14px 16px 6px;
}
.worship-times-summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; min-height: 44px; }
.worship-times-summary::-webkit-details-marker { display: none; }
.worship-times-summary .subhead { margin: 0; }
.worship-times-count { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.worship-times-summary svg { width: 22px; height: 22px; margin-left: auto; align-self: center; flex: none; transition: transform 160ms ease-out; }
.worship-times-card[open] .worship-times-summary svg { transform: rotate(180deg); }
.worship-times-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.worship-times-sub { color: var(--ink-2); font-size: var(--fs-sm); }
.worship-times { list-style: none; margin: 8px 0 0; padding: 0; }
.worship-times > li { border-top: 1px solid var(--line); }
.wt-block summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 4px;
}
.wt-block summary::-webkit-details-marker { display: none; }
.wt-block summary:hover { background: var(--tag-bg); }
.wt-block summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.wt-when { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wt-n { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.wt-block summary svg { width: 20px; height: 20px; margin-left: auto; flex: none; transition: transform 160ms ease-out; }
.wt-block[open] summary svg { transform: rotate(180deg); }
.wt-block[open] summary { background: var(--sunday-bg); }
.wt-list { list-style: none; margin: 0; padding: 6px 4px 12px 14px; display: grid; gap: 8px; border-left: 4px solid var(--mustard); margin-left: 4px; }
.wt-list a { font-weight: 700; }
.wt-meta { display: block; color: var(--ink-2); font-size: var(--fs-sm); }
.worship-list { min-width: 0; }
.w-towns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
/* Town toggles: tap to show or hide a town. A check and navy fill mark the ones that are on. */
.w-town {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 12px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); font-weight: 700;
}
.w-town:hover { background: var(--tag-bg); }
.w-town svg { display: none; width: 18px; height: 18px; flex: none; }
.w-town[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.w-town[aria-pressed="true"] svg { display: block; }
.w-town[aria-pressed="true"] .w-towns-n { color: #C9C6BF; }
.w-towns-n { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.w-towns-empty { color: var(--ink-2); margin: -10px 0 20px; }
.w-area { scroll-margin-top: 16px; }
.w-area + .w-area { margin-top: 30px; }
.w-area-title {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
  font-family: var(--f-display); font-weight: 400; font-size: var(--fs-h3); line-height: 1.2;
  padding-bottom: 8px; border-bottom: 3px solid var(--card-border);
}
.w-area-drive { font-family: var(--f-body); font-size: var(--fs-sm); color: var(--ink-2); }
.w-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.w-item {
  min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; scroll-margin-top: 16px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.w-item:target { outline: 4px solid var(--mustard); outline-offset: 2px; }
.w-name { font-size: 1.15rem; line-height: 1.25; }
.w-faith { margin-top: -6px; color: var(--ink-2); font-size: var(--fs-sm); }
.w-note { font-size: var(--fs-sm); font-weight: 700; }
.w-times { margin: 0; padding: 8px 10px; display: grid; gap: 4px; background: var(--sunday-bg); border-radius: 4px; }
.w-times div { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 8px; }
.w-times dt { font-weight: 700; }
.w-times dd { margin: 0; }
.w-none { color: var(--ink-2); font-size: var(--fs-sm); }
.w-src { margin-top: -2px; font-size: 0.9rem; color: var(--ink-2); }
.worship-notes { margin-top: 30px; max-width: 48em; display: grid; gap: 10px; color: var(--ink-2); }
.w-note-src, .w-credit { font-size: 0.9rem; }
.w-more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--red);
  text-decoration-thickness: 2px; text-underline-offset: 0.2em;
}
.w-more summary::-webkit-details-marker { display: none; }
.w-more summary svg { width: 20px; height: 20px; flex: none; transition: transform 160ms ease-out; }
.w-more[open] summary svg { transform: rotate(180deg); }
.w-more summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.w-more-body { display: grid; gap: 10px; margin-top: 6px; padding-left: 14px; border-left: 4px solid var(--mustard); }
.now-worship { margin-top: 18px; color: #E4E1DA; }
.now-worship a { font-weight: 600; color: var(--cream); text-decoration-color: var(--gold-light); }

/* ---------- History: Hamilton's story, told as Threads of History ---------- */
.history { padding-block: clamp(32px, 5vw, 56px); }

/* ---------- Threads of History: tap a subject, follow it through the area ----------
   One thread: its moments on the left, its pictures on the right. Two threads: no pictures, and the
   two run side by side on one shared timeline, with the year down the middle. Each thread wears a
   fabric color. Its line is solid between the key moments around here and stitched (dashed) through
   the lead-up and aftermath. Moments with a card to visit carry a pin. */
.sub-title { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.15; }
.threads { margin-top: 24px; padding: 22px clamp(14px, 3vw, 28px) 12px; background: var(--card); box-shadow: var(--shadow-sm); border-top: 5px solid var(--navy); }
.threads-lede { margin-top: 6px; color: var(--ink-2); max-width: 46em; }
.thread-tabs { margin-top: 14px; }
.thread-hint { margin-top: 10px; font-size: 0.92rem; color: var(--ink-2); }
[data-tone="teal"] { --thread: var(--teal); }
[data-tone="blue"] { --thread: var(--deep-blue); }
[data-tone="red"] { --thread: var(--red); }
[data-tone="green"] { --thread: var(--green); }
[data-tone="gold"] { --thread: var(--mustard); --thread-ink: var(--navy); }
[data-tone="sky"] { --thread: var(--sky); --thread-ink: var(--navy); }
[data-tone="charcoal"] { --thread: var(--navy); }
/* Overview: the year-by-year history. A gray thread, and every entry plain (no tinted key cards). */
[data-tone="overview"] { --thread: var(--ink-2); }
[data-tone="overview"] .tm[data-key="true"] { --pt: 4px; }
[data-tone="overview"] .tm[data-key="true"] > .tm-body, .pc[data-tone="overview"][data-key="true"] > .tm-body { background: none; padding-inline: 0 2px; }
[data-tone="overview"] [data-key="true"] .tm-when { font-size: 1.1rem; }
:root[data-theme="dark"] [data-tone="blue"] { --thread: #4A5A8C; }
:root[data-theme="dark"] [data-tone="charcoal"] { --thread: #8A8D93; --thread-ink: var(--navy); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-tone="blue"] { --thread: #4A5A8C; }
  :root:not([data-theme="light"]) [data-tone="charcoal"] { --thread: #8A8D93; --thread-ink: var(--navy); }
}
.thread-tab .dot { --dot: var(--thread); }
.thread-tabs .thread-tab[aria-pressed="true"][data-tone] { background: var(--thread); border-color: var(--thread); color: var(--thread-ink, var(--white)); }
.thread-tab[aria-pressed="true"] .dot { --dot: currentColor; }
.thread-side { margin-left: 2px; padding: 1px 6px; border: 1px solid currentColor; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.thread-panel { margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.thread-head { position: relative; }
.thread-title { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lg); line-height: 1.2; }
.thread-lede { margin-top: 4px; max-width: 42em; }
.thread-places {
  margin-top: 12px; min-height: 42px; padding: 6px 14px 6px 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); color: var(--ink); border: 2px solid var(--thread); border-radius: var(--radius); font-weight: 700;
}
.thread-places svg { width: 20px; height: 20px; color: var(--thread); }
.thread-places:hover { background: color-mix(in srgb, var(--thread) 14%, var(--white)); }
.thread-noplaces { margin-top: 10px; font-size: 0.92rem; color: var(--ink-2); }
.thread-close { position: absolute; top: -6px; right: -6px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; background: none; border: 0; color: var(--ink-2); }
.thread-close svg { width: 20px; height: 20px; }
.thread-close:hover { color: var(--ink); background: var(--tag-bg); }

/* One thread */
.thread-solo { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "media" "line"; gap: 18px 40px; }
.thread-solo > .thread-head { grid-area: head; }
.thread-solo > .thread-line { grid-area: line; }
.thread-solo > .thread-media { grid-area: media; }
@media (min-width: 900px) {
  .thread-solo.has-media { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "head media" "line media"; grid-template-rows: auto 1fr; }
  .thread-solo > .thread-media { align-self: start; position: sticky; top: calc(var(--peek, 0px) + 16px); display: grid; gap: 18px; }
}
.thread-line { list-style: none; margin: 4px 0 0; padding: 0; }
.thread-fig { margin: 0; }
.thread-fig img { display: block; width: 100%; height: auto; background: var(--tag-bg); box-shadow: var(--shadow-sm); }
.thread-fig figcaption { margin-top: 8px; font-size: 0.92rem; color: var(--ink-2); }
.thread-credit { font-size: 0.85rem; }
@media (max-width: 899px) {
  .thread-media { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 4px; }
  .thread-fig { flex: 0 0 min(78%, 340px); scroll-snap-align: start; }
  .thread-fig:only-child { flex-basis: min(100%, 420px); }
  .thread-fig img { height: 220px; object-fit: contain; }
}

/* A moment: a knot on the thread, the line above and below it, and the words beside it. */
.tm, .pc { position: relative; --pt: 4px; --knot: calc(var(--pt) + 0.62em); }
.tm { padding: 0 0 12px 36px; }
.tm[data-key="true"] { --pt: 14px; }
.tm::before, .tm::after, .pc::before, .pc::after { content: ""; position: absolute; left: 9px; border-left: 3px solid var(--thread); }
.tm::before, .pc::before { top: 0; height: var(--knot); }
.tm::after, .pc::after { top: var(--knot); bottom: 0; }
[data-top="none"]::before, [data-bottom="none"]::after { display: none; }
[data-top="dashed"]::before, [data-bottom="dashed"]::after { border-left-style: dashed; }
.tm-knot {
  position: absolute; z-index: 1; left: 3px; top: calc(var(--knot) - 7.5px); width: 15px; height: 15px;
  background: var(--card); border: 3px solid var(--thread); transform: rotate(45deg);
}
[data-key="true"] > .tm-knot { background: var(--thread); }
.tm-knot.is-pin { left: -2px; top: calc(var(--knot) - 10px); width: 25px; height: 25px; background: none; border: 0; transform: none; color: var(--thread); filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.35)); }
.tm-knot.is-pin svg { display: block; width: 100%; height: 100%; }
.tm-body { padding: var(--pt) 0 4px; }
[data-key="true"] > .tm-body { padding: var(--pt) 16px 12px; background: color-mix(in srgb, var(--thread) 11%, var(--card)); }
.tm-tag { display: none; }
.tm-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.tm-when { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
[data-key="true"] .tm-when { font-size: var(--fs-lg); }
.tm-where { font-size: 0.92rem; font-weight: 700; color: var(--ink-2); }
.tm-text { margin-top: 2px; }
[data-key="false"] .tm-text { color: var(--ink-2); }
.tm-pin { margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 0.95rem; }
.tm-pin svg { width: 19px; height: 19px; flex: none; color: var(--thread); }
/* Sources fold away under a small "Source" toggle. */
.tm-src { margin-top: 4px; font-size: 0.9rem; }
.tm-src summary { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; cursor: pointer; color: var(--ink-2); font-weight: 600; list-style: none; }
.tm-src summary::-webkit-details-marker { display: none; }
.tm-src summary::before { content: ""; border-left: 6px solid currentColor; border-block: 4.5px solid transparent; transition: transform 0.15s ease; }
.tm-src[open] summary::before { transform: rotate(90deg); }
.tm-src summary:hover { color: var(--ink); }
.tm-src ul { list-style: none; margin: 0 0 6px; padding: 0 0 0 13px; }
.tm-src li + li { margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .tm-src summary::before { transition: none; } }

/* Two threads, one timeline: thread A's line runs down the right side of its column, thread B's down
   the left side of its own, and the year sits between them. */
.pair-heads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 64px; }
.pair-heads .thread-head { padding: 12px 40px 0 0; border-top: 4px solid var(--thread); }
.pair-labels {
  position: sticky; top: var(--peek, 0px); z-index: 3; margin: 20px 0 6px; padding: 8px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  background: var(--card); box-shadow: 0 8px 8px -8px rgb(0 0 0 / 0.25);
}
.pair-labels span { padding: 3px 10px; font-weight: 700; font-size: 0.9rem; background: var(--thread); color: var(--thread-ink, var(--white)); }
.pair-labels span:first-child { grid-column: 1; justify-self: end; }
.pair-labels span:last-child { grid-column: 3; justify-self: start; }
.pair-rows { list-style: none; margin: 0; padding: 0; }
.pair-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); }
.pair-year { grid-column: 2; grid-row: 1; padding-top: 9px; text-align: center; font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pc { --pt: 12px; grid-row: 1; padding-bottom: 12px; }
.pc-a { grid-column: 1; padding-right: 36px; }
.pc-b { grid-column: 3; padding-left: 36px; }
.pc-a::before, .pc-a::after { left: auto; right: 9px; }
.pc-a > .tm-knot { left: auto; right: 3px; }
.pc-a > .tm-knot.is-pin { right: -2px; }
.pc[data-key="false"] > .tm-body { padding: var(--pt) 2px 4px; }
/* The years a thread doesn't cover: diagonal stripes in its color, labeled where they begin. */
.pc[data-out] { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--thread) 24%, transparent) 0 2px, transparent 2px 10px) fixed; } /* fixed keeps the stripes seamless from row to row */
.pc-a[data-out] { text-align: right; }
.pc-out-label {
  display: inline-block; margin: 10px 12px 0; padding: 3px 9px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--thread) 50%, transparent);
  font-size: 0.85rem; font-weight: 600; color: var(--ink-2);
}
.pair-note { margin-top: 18px; padding: 8px 12px; background: var(--tag-bg); font-size: 0.95rem; }
@media (max-width: 759px) {
  /* On a phone the two threads merge into one list in date order, each moment edged in its thread's color. */
  .pair-heads { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pair-labels { display: none; }
  .pair-row { display: block; }
  .pair-year { display: none; }
  .pc-a, .pc-b { padding: 0 0 12px; }
  .pc[data-empty="true"] { display: none; }
  .pc::before, .pc::after, .pc > .tm-knot { display: none; }
  .pc > .tm-body, .pc[data-key="false"] > .tm-body { padding: 8px 12px 6px; border-left: 4px solid var(--thread); }
  .pc[data-key="false"] > .tm-body { border-left-style: dashed; }
  .pc .tm-tag { display: block; margin-bottom: 2px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
}
@media (max-width: 600px) {
  /* Two even columns of thread buttons on a phone, so they don't wrap into a ragged pile. */
  .thread-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .thread-tabs .tab { min-height: 46px; padding: 6px 10px; gap: 8px; font-size: 0.95rem; line-height: 1.2; text-align: left; }
  .thread-tabs .tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tm[data-key="true"] > .tm-body { padding-inline: 12px; }
}

/* ---------- Calendar ---------- */
.calendar { padding-block: clamp(32px, 5vw, 56px); background: var(--wash); }
.event-when { font-family: var(--f-display); font-weight: 600; color: var(--accent-text); font-size: var(--fs-lg); line-height: 1.25; }
.event-name { margin-top: 4px; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.event-detail { margin-top: 6px; color: var(--ink-2); }
/* Events whose dates aren't set yet sit together at the end, their "Check dates" in a quieter color. */
.event.is-later .event-when { color: var(--ink-2); font-style: italic; }

/* ---------- About: a whole field of navy ---------- */
.about { padding-block: clamp(36px, 5vw, 60px); background: var(--field); color: var(--field-ink); }
.about a { color: var(--field-link); text-decoration-color: var(--mustard); }
.about a:hover { color: var(--white); }
/* Everything past the first paragraph folds into one dropdown, so the long sources list doesn't fill the page. */
.about-more { margin-top: 22px; border-top: 1px solid rgb(255 255 255 / 0.18); }
.about-more-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding-block: 10px; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; color: var(--field-ink);
}
.about-more-summary::-webkit-details-marker { display: none; }
.about-more-summary svg {
  width: 36px; height: 36px; padding: 6px; flex: none; border: 2px solid var(--mustard); border-radius: 50%; color: var(--mustard);
  transition: transform 160ms ease-out, background 0.2s ease, color 0.2s ease;
}
.about-more-summary:hover svg { background: var(--mustard); color: var(--navy); }
.about-more[open] .about-more-summary svg { transform: rotate(180deg); }
.about-more-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.about-more .about-grid { padding-bottom: 8px; }
.about-more .about-grid > div:first-child > p:first-child { margin-top: 4px; }
.about-grid { display: grid; gap: 28px 56px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.about-grid > div { min-width: 0; }
.about p { margin-top: 12px; max-width: 38em; }
.about .subhead { margin-top: 26px; }
.about-grid > div:last-child .subhead { margin-top: 0; }
.checked { color: var(--field-ink-2); }
.source-list { margin: 0; padding-left: 1.1em; font-size: var(--fs-sm); display: grid; gap: 5px; }
.source-list .muted { color: var(--field-ink-2); }
.about ::selection { background: var(--mustard); color: var(--navy); }

.footer { padding-block: 22px; background: var(--field); color: var(--field-ink); border-top: 0; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-size: var(--fs-sm); }

/* ---------- Trip: card button, floating bubble, slide-out list ---------- */
/* Add to trip only shows on an opened card, so scrolling the list stays calm. */
.card:not(.is-open) .trip-btn { display: none; }
.trip-btn { background: var(--mustard); border-color: var(--mustard); color: var(--navy); }
.trip-btn:hover { background: #DDA548; color: var(--navy); }
.trip-btn[aria-pressed="true"] { background: var(--card); border-color: var(--teal); color: var(--teal); }
.trip-btn[aria-pressed="true"]:hover { background: var(--tag-bg); }

.trip-bubble {
  position: fixed; z-index: 40;
  top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px);
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--navy); color: var(--white); border: 3px solid var(--white);
  box-shadow: 0 6px 18px rgb(11 18 38 / 0.32);
}
.trip-bubble svg { width: 28px; height: 28px; }
.trip-bubble:hover { background: #3A3D42; }
.trip-bubble:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.trip-count {
  position: absolute; left: -6px; top: -6px; min-width: 26px; height: 26px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 13px;
  background: var(--mustard); color: var(--navy); font-weight: 700; font-size: 0.95rem; border: 2px solid var(--white);
}
.trip-bubble.is-bumped { animation: bubble-bump 520ms ease-out; }
@keyframes bubble-bump { 0% { transform: scale(1); } 35% { transform: scale(1.2); } 100% { transform: scale(1); } }
/* Keep the masthead links clear of the bubble. */
body.has-trip .masthead-row { padding-right: max(84px, env(safe-area-inset-right, 0px)); }

.trip-toast {
  --cat: var(--mustard);
  position: fixed; z-index: 41; pointer-events: none; overflow: hidden;
  /* Lined up with the bubble: same top band, just to its left. */
  top: calc(env(safe-area-inset-top, 0px) + 12px + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px + 58px + 8px);
  height: 34px; display: flex; align-items: center; padding: 0 12px 0 20px; border-radius: var(--radius);
  background: var(--navy); color: var(--white); font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  box-shadow: 0 4px 12px rgb(11 18 38 / 0.28);
  opacity: 0; transform: translateX(10px); transition: opacity 160ms ease-out, transform 160ms ease-out;
}
.trip-toast::before {
  content: ""; position: absolute; left: 0; top: 0; width: 17px; height: 17px;
  background: linear-gradient(135deg, var(--cat) 50%, transparent 50%);
}
.trip-toast.is-on { opacity: 1; transform: none; }

.trip-panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(440px, 100%); height: 100%; max-height: 100%; max-width: 100%;
  border: 0; border-left: 1.5px solid var(--card-border); border-radius: 0;
  background: var(--card); color: var(--ink);
}
.trip-panel[open] { display: flex; flex-direction: column; animation: trip-in 220ms ease-out; }
@keyframes trip-in { from { transform: translateX(100%); } to { transform: none; } }
.trip-panel::backdrop { background: rgb(11 18 38 / 0.5); }
.trip-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(18px, env(safe-area-inset-right, 0px)) 12px 18px;
  border-bottom: 2px solid var(--line);
}
.trip-head h2 { font-size: var(--fs-h2); }
.trip-sub { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
.trip-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 18px; overscroll-behavior: contain; }
.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trip-num {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mustard); color: var(--navy); font-family: var(--f-display); font-size: 1rem;
}
.trip-name { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.2; text-decoration: none; }
.trip-name:hover { text-decoration: underline; text-decoration-color: var(--red); }
.trip-meta { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
.trip-status { font-size: var(--fs-sm); font-weight: 700; margin-top: 4px; }
.trip-tools { display: flex; gap: 4px; }
.trip-tool {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  background: none; border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.trip-tool:hover:not(:disabled) { border-color: var(--card-border); }
.trip-tool:disabled { opacity: 0.35; cursor: default; }
.trip-tool svg { width: 20px; height: 20px; }
.trip-tool .flip { transform: rotate(180deg); }
.trip-empty { padding: 28px 4px; color: var(--ink-2); }
.trip-empty-title { font-family: var(--f-display); font-size: var(--fs-lg); color: var(--ink); margin-bottom: 6px; }
.trip-foot {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 14px 18px calc(env(safe-area-inset-bottom, 0px) + 14px); border-top: 2px solid var(--line); background: var(--wash);
}
.trip-send { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.trip-send .link-btn { flex: 1 1 160px; justify-content: center; align-self: stretch; text-align: center; }
.trip-print { display: none; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100% - 24px)); max-height: min(860px, calc(100% - 24px));
  padding: 0; border: 1.5px solid var(--card-border); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.dialog::backdrop { background: rgb(11 18 38 / 0.6); }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px 18px; border-bottom: 2px solid var(--line);
}
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog-note { color: var(--ink-2); font-size: var(--fs-sm); }
.fb-saved { display: grid; gap: 10px; }
.fb-saved .update { padding: 12px; }
.fb-wrap { display: flex; justify-content: center; }
.fb-wrap iframe { border: 0; width: 100%; max-width: 500px; background: var(--wash); border-radius: 4px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  background: none; border: 1.5px solid var(--card-border); border-radius: var(--radius); cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Forms: corrections, listings, the email list ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.turnstile-slot:empty { display: none; }
.guide-form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 4px; }
.form-field label, .form-choice legend { font-weight: 700; }
.form-field .opt { font-weight: 400; color: var(--ink-2); }
.form-hint { color: var(--ink-2); font-size: var(--fs-sm); }
.guide-form input:not([type=radio]):not(.hp), .guide-form textarea, .signup input[type=email] {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--card-border); border-radius: var(--radius);
}
.guide-form textarea { resize: vertical; min-height: 0; line-height: 1.45; }
.guide-form :is(input, textarea):focus-visible, .signup input:focus-visible { outline: 3px solid var(--mustard); outline-offset: 1px; border-color: var(--navy); }
.guide-form [aria-invalid="true"], .signup [aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.form-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.form-choice legend { width: 100%; margin-bottom: 6px; }
.form-choice label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.form-choice input { width: 20px; height: 20px; accent-color: var(--navy); }
.form-place { padding: 10px 12px; background: var(--wash); border-left: 4px solid var(--mustard); }
.form-actions { display: flex; }
.form-status:empty { display: none; }
.form-status { font-weight: 700; }
.form-status.is-bad { color: var(--red); }
.form-note, .form-switch { color: var(--ink-2); font-size: var(--fs-sm); }
.form-switch .text-btn { padding-block: 6px; }
.form-done { display: grid; justify-items: start; gap: 10px; padding-block: 6px 4px; }
.form-done svg { width: 40px; height: 40px; padding: 7px; border-radius: 50%; background: var(--green); color: var(--white); }
.form-done-title { font-family: var(--f-display); font-weight: 600; font-size: var(--fs-lg); }
.form-dialog .dialog-body { overflow-y: auto; }
.report-btn { display: block; margin-top: 8px; padding-inline: 0; font-size: var(--fs-sm); }

/* The email sign-up, under the calendar. */
.signup {
  margin-top: 28px; padding: 20px; display: grid; gap: 14px 32px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  background: var(--card); border-top: 6px solid var(--mustard); box-shadow: 0 2px 10px rgb(11 18 38 / 0.08);
}
.signup-text p { margin-top: 6px; color: var(--ink-2); }
.signup-form { display: grid; gap: 10px; }
.signup-row { display: flex; gap: 8px; }
.signup-row input { flex: 1 1 auto; min-width: 0; }
.signup-row .link-btn { flex: none; align-self: stretch; justify-content: center; }

/* On About's dark background, the two form buttons are outlined in mustard. */
.about-forms { margin-top: 18px; padding: 16px 0 4px; border-top: 1px solid var(--field-line); }
.about-forms > p:first-child { margin-top: 0; }
.about-form-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.about .link-btn { border-color: var(--mustard); color: var(--field-ink); }
.about .link-btn:hover { background: var(--mustard); color: var(--navy); }
.about .link-btn:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .masthead-row { padding-block: 8px; }
  .masthead-row { row-gap: 0; }
  .topnav { width: 100%; gap: 0 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: none; font-size: 0.95rem; padding-block: 6px 8px; }
  .topnav a[href="#now"] { display: none; }
  .hero { min-height: 440px; }
  .hero-photo { object-position: 62% 40%; }
  .hero-inner { padding-block: 24px 34px; }
  /* On a phone the words run full width, so the hero darkens from the bottom instead of the left. */
  .hero::before { background: linear-gradient(180deg, rgb(42 44 48 / 0.15) 10%, rgb(42 44 48 / 0.75) 52%, rgb(42 44 48 / 0.95) 100%); }
  .pick { padding: 10px 14px 12px; }
  .pick-count { font-size: 2.1rem; }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .trip-toast { transition: none; }
}

@media print {
  .places-scenery { display: none; }
  .about-more > :not(summary) { display: block !important; }
  .about-more-summary { display: none; }
  /* Printing the trip shows only the trip. */
  body.printing-trip > :not(#trip-print) { display: none !important; }
  body.printing-trip #trip-print { display: block; color: #000; font-family: var(--f-body); font-size: 12pt; }
  #trip-print h1 { font-family: var(--f-display); font-weight: 400; font-size: 26pt; margin: 0 0 4pt; }
  #trip-print .tp-meta { color: #333; margin-bottom: 14pt; }
  #trip-print .tp-list { margin: 0; padding-left: 22pt; }
  #trip-print .tp-list li { break-inside: avoid; padding: 8pt 0 10pt; border-bottom: 1px solid #bbb; }
  #trip-print h2 { font-family: var(--f-display); font-weight: 400; font-size: 15pt; margin: 0 0 2pt; }
  #trip-print .tp-kind { color: #333; margin-bottom: 4pt; }
  #trip-print p { margin: 1pt 0; }
  #trip-print .tp-foot { margin-top: 14pt; color: #333; }
  .trip-bubble, .trip-toast { display: none !important; }
  .site-top { position: static; box-shadow: none; transform: none !important; }
  .worship-body { grid-template-rows: 1fr !important; }
  .worship-inner { opacity: 1 !important; clip-path: none !important; overflow: visible !important; }
  .worship-toggle-icon, .worship-toggle-sub { display: none !important; }
  .carousel-nav, .carousel-dots { display: none !important; }
  .carousel { display: block !important; overflow: visible !important; }
  .slide { break-inside: avoid; margin-bottom: 12pt; box-shadow: none; }
  .masthead nav, .local-bar, .picks, .finder, .signup, .report-btn, .about-forms, .links, .clock-card, .updates, .footer, .skip, .geese, .hero-photo, .hero::before, .intro-photo, .thread-tabs { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { min-height: 0; background: none; color: #000; }
  .hero-town { color: #000; text-shadow: none; }
  .places, .calendar, .about { background: none; color: #000; }
  .card { break-inside: avoid; }
  .card-chevron, .extra { display: none !important; }
  .more { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10pt; }
}
