/* Church and State — a register of the UK's derelict churches.
   Aesthetic direction: archival heritage broadsheet. Carved-serif
   display (Fraunces), literary body serif (Newsreader), mono micro-
   labels (IBM Plex Mono). Vellum paper, warm-black ink, verdigris as
   dominant accent, madder sparingly for emphasis and at-risk. */

:root {
  /* Paper — a bound-volume cream pushed slightly warmer than standard
     newsprint, with a deeper card tone and a hairline rule colour. */
  --paper: #EFE8D5;
  --paper-deep: #E1D6B8;
  --paper-rule: #C4B695;
  --bone: #F7F2E5;   /* lightest highlight — chapel plaster */

  /* Ink — four tones on the page. Warmer than pure black, to read as
     printer's ink on vellum rather than screen-grey. */
  --ink: #1B1612;
  --ink-soft: #3E372D;
  --ink-mute: #6B6252;
  --ink-faint: #988D7A;

  /* Two historical accents, both craft pigments.
       Verdigris — oxidised copper, the weathervane on the steeple.
       Madder   — the historical printing red used for at-risk + emphasis.
     Verdigris is dominant; madder is a single strong note, never used
     in large fields. */
  --verdigris: #2E6951;
  --verdigris-deep: #1E4A38;
  --verdigris-soft: #5C8B77;
  --madder: #7A1F1E;
  --madder-soft: #A4463B;

  /* Link colour — inherit verdigris; no Guardian blue as identity.
     We keep a cool ink-blue for hover states where underline dotting
     isn't enough, but it's never used for headings. */
  --link: var(--verdigris);
  --link-hover: #1E4A38;

  /* Status palette — disciplined to the two-accent family.
     Rescued / preserved are tints of verdigris (living, renewed).
     At-risk is madder (alarm). Repurposed is a soft madder. Closed
     and lost are stones — no alarm, no renewal. */
  --status-at-risk: var(--madder);
  --status-rescued: var(--verdigris);
  --status-preserved: var(--verdigris-soft);
  --status-repurposed: var(--madder-soft);
  --status-closed: #8C826D;
  --status-demolished: #5E584C;

  /* Type stack.
     Display: Fraunces, a contemporary soft-carved serif with opsz
       (optical size) and SOFT axes — gives carved-stone character at
       display sizes, with roundness pulled back for headings.
     Body: Newsreader, a literary serif built for long-form reading.
     Mono: IBM Plex Mono, for numbers, counters and micro-labels. */
  --display: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --body: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  /* UI labels — Plex Mono. Reads as index-card / field-notes /
     typewriter rather than a generic sans. */
  --ui: 'IBM Plex Mono', 'JetBrains Mono', 'Menlo', 'Courier New', monospace;
  --mono: 'IBM Plex Mono', 'JetBrains Mono', 'Menlo', 'Courier New', monospace;

  /* Variation shortcuts — these let us call for carved display feel
     (high opsz, tight SOFT) vs. reading body feel (lower opsz). */
  --display-carved: "opsz" 128, "SOFT" 0;
  --display-warm:   "opsz" 96,  "SOFT" 40;
}

* { box-sizing: border-box; }

/* ----- Page-load reveal ----------------------------------------------
   One orchestrated entrance — masthead settles first, the rule draws
   across, the subnav appears, then the main stage. After this, the
   page is quiet: no hover jitter, no scroll-linked fireworks. */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes ruleGrow {
  from { transform: scaleX(0); transform-origin: left center; }
  to   { transform: none; }
}
@keyframes ornamentFade {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.masthead,
.rule-band::before, .rule-band::after,
.rule-band .ornament,
.subnav, main.shell, .detail, .long, footer.foot {
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}
.masthead                { animation: revealUp 680ms   60ms; }
.rule-band::before       { animation: ruleGrow 780ms  260ms; }
.rule-band::after        { animation: ruleGrow 780ms  320ms; }
.rule-band .ornament     { animation: ornamentFade 520ms 900ms; }
.subnav                  { animation: revealUp 540ms  380ms; }
main.shell, .long        { animation: revealUp 720ms  480ms; }
.detail                  { animation: revealUp 720ms  280ms; }
footer.foot              { animation: revealUp 540ms  640ms; }
@media (prefers-reduced-motion: reduce) {
  .masthead, .rule-band::before, .rule-band::after,
  .rule-band .ornament, .subnav, main.shell, .detail, .long, footer.foot {
    animation: none;
  }
}

html, body {
  overflow-x: clip;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}
html { background: var(--paper); }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "onum" 1, "liga" 1;
  /* One atmospheric layer: a fine noise grain for paper tooth.
     Printed-feeling, but not competing with text. */
  background-image:
    radial-gradient(rgba(27, 22, 18, 0.03) 1px, transparent 1px),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 3px 3px, 220px 220px;
}

:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 2px;
  border-radius: 2px;
}
.masthead .title a:focus-visible { outline-color: var(--verdigris); }

/* ----- Masthead ----- */
.masthead {
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--paper-rule);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 40px;
  max-width: 1480px;
  margin: 0 auto;
}
.masthead .title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 7.2vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  /* Carved Fraunces — high optical size, zero SOFT rounding = stone */
  font-variation-settings: "opsz" 144, "SOFT" 0, "wght" 520;
}
.masthead .title a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms;
}
.masthead .title a:hover { color: var(--verdigris); }
.masthead .title a:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 4px;
}
.masthead .title .and {
  font-weight: 300;
  font-style: italic;
  color: var(--verdigris);
  /* Italic Fraunces looks more flowing at slightly warmer SOFT */
  font-variation-settings: "opsz" 144, "SOFT" 60, "wght" 380;
}
.masthead .dek {
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 44ch;
  line-height: 1.5;
  margin: 0;
}
.masthead .dek em {
  font-style: italic;
  color: var(--ink);
}
.masthead .dek a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--verdigris-soft);
  transition: border-color 180ms;
}
.masthead .dek a:hover { border-bottom-color: var(--link); }
.masthead .stat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
  line-height: 1.3;
}
.masthead .stat .big {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 48px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
  font-variation-settings: "opsz" 96, "SOFT" 20, "wght" 420;
  font-feature-settings: "onum" 1;
}
.masthead .stat .stat-sub {
  display: block;
  margin-top: 8px;
  font-family: var(--body);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

/* Rule band — two hairlines, verdigris + madder, with an ornament
   centred on the seam. The pairing of craft pigments — weathervane
   green and printer's red — is the one-note identity bar for the
   whole product. */
.rule-band {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 48px;
  position: relative;
  display: grid;
  grid-template-columns: 3fr 1fr;
  align-items: center;
}
.rule-band::before,
.rule-band::after {
  content: '';
  display: block;
  height: 2px;
}
.rule-band::before { background: var(--verdigris); }
.rule-band::after  { background: var(--madder); }
.rule-band .ornament {
  position: absolute;
  top: 50%;
  left: 75%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--paper);
  color: var(--verdigris);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 18px/1 var(--display);
  font-variation-settings: "opsz" 48, "SOFT" 100;
}
@media (max-width: 960px) {
  .rule-band .ornament { display: none; }
}

/* ----- Subnav ----- */
.subnav {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 48px 0;
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--paper-rule);
  font-family: var(--ui);
  overflow-x: auto;
}
.subnav {
  font-family: var(--mono);
}
.subnav a {
  display: inline-block;
  padding: 10px 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 120ms, border-color 120ms;
  white-space: nowrap;
}
.subnav a:hover { color: var(--ink); }
.subnav a.active {
  color: var(--ink);
  border-bottom-color: var(--link);
}

/* ----- Layout ----- */
main.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 48px 48px;
  display: grid;
  grid-template-columns: 300px 1fr 340px;
  gap: 32px;
  align-items: start;
}

/* ----- Left: finder sidebar ----- */
.finder {
  position: sticky;
  top: 20px;
  font-family: var(--ui);
}
.finder .label {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 10px;
}
.finder .kicker {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--madder);
  margin: 0 0 8px;
}
.finder .intro {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  line-height: 1.5;
}
.finder form { display: flex; flex-direction: column; gap: 8px; }
.finder input[type=text] {
  font: 400 16px/1.3 var(--body);
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--paper-rule);
  background: transparent;
  color: var(--ink);
  transition: border-color 150ms;
  width: 100%;
  min-width: 0;
}
.finder input[type=text]:focus {
  outline: none;
  border-bottom-color: var(--link);
}
.finder input[type=text]::placeholder {
  color: var(--ink-mute);
  font-style: italic;
}
.finder .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.finder button {
  font: 700 12px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 16px;
  border: none;
  cursor: pointer;
  transition: transform 120ms, background 120ms;
}
.finder button[type=submit] {
  background: var(--link);
  color: var(--paper);
  flex: 1;
}
.finder button[type=submit]:hover { background: var(--ink); }
.finder button.ghost {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--paper-rule);
}
.finder button.ghost:hover { color: var(--ink); border-color: var(--ink); }

.finder .geoloc {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
  gap: 6px;
  font: 400 13px/1 var(--body);
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.finder .geoloc:hover { color: var(--link); }
.finder .geoloc .icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}
.finder .geoloc .icon::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: currentColor;
  border-radius: 50%;
}

/* Filter drawer — wraps status + denomination chips. On desktop the
   drawer is always open and the summary is hidden; on mobile it
   collapses to a single tap-target so the map gets to the top of the
   column faster. */
.finder .filter-drawer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-rule);
}
.finder .filter-drawer > summary {
  display: none;             /* desktop: chips already shown */
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  background: var(--bone);
  border: 1px solid var(--paper-rule);
  font-family: var(--mono);
  user-select: none;
}
.finder .filter-drawer > summary::-webkit-details-marker { display: none; }
.finder .filter-drawer > summary::after {
  content: '⌄';
  float: right;
  font-family: var(--display);
  font-size: 16px;
  color: var(--verdigris);
  transition: transform 200ms;
}
.finder .filter-drawer[open] > summary::after { transform: rotate(180deg); }
.finder .filter-drawer .filter-summary-label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.finder .filter-drawer .filter-summary-hint {
  display: block;
  margin-top: 2px;
  font-family: var(--body);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0;
  text-transform: none;
}

/* Filter blocks — status + denomination. Each is a list of chips that
   click TO filter. A selected chip carries .chip-on; tapping it again
   clears the filter. Default state has no chip selected = all visible. */
.finder .filter-block {
  margin-top: 18px;
}
.finder .filter-block:first-of-type { margin-top: 0; }
.finder .chip-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.finder .chip-list li {
  font: 400 13px/1.35 var(--body);
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  padding: 5px 8px 5px 9px;
  user-select: none;
  border-left: 2px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
  outline-offset: -2px;
}
.finder .chip-list li:hover { color: var(--ink); background: var(--bone); }
.finder .chip-list li.chip-on {
  background: var(--bone);
  border-left-color: var(--verdigris);
  color: var(--ink);
}
.finder .chip-list li.chip-on .count,
.finder .chip-list li.chip-on .dcount { color: var(--verdigris-deep); }
.finder .chip-list .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transform: translateY(1px);
}
.finder .chip-list .count,
.finder .chip-list .dcount {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.finder .chip-list--denom li {
  /* Denomination labels are wider than statuses; let them wrap. */
  align-items: flex-start;
}
.finder .chip-list--denom .dlabel {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.35;
}

.finder .tips {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dotted var(--paper-rule);
  font: italic 400 13px/1.5 var(--body);
  color: var(--ink-mute);
}

/* ----- Middle: map stage ----- */
.stage {
  position: relative;
}
.stage .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 20px;
}
.stage .kicker {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 4px;
}
.stage .head-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
  flex: 1 1 auto;
  min-width: 0;
}
.stage .head-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Map as designed artefact — framed like a plate in a heritage atlas.
   The stage wrapper holds the frame and any overlays (cartouche,
   compass, corner markers); #map itself is the Leaflet canvas. */
/* Map stage — a single ivy hairline with four corner brackets. The
   frame is the whole device, so keep it quiet. */
.map-stage {
  position: relative;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--verdigris);
}
/* Corner marks removed — the hairline border carries the frame. */
.map-stage .corner-tr,
.map-stage .corner-bl { display: none; }

/* Cartouche — top-left title plate with a quiet editorial label.
   Sits on top of the map tiles without blocking interaction in its
   middle third. */
/* Cartouche — a single editorial plate in the top-right, with a
   one-pixel paper-rule border. The ivy accent lives in the name,
   not the frame. */
/* Cartouche — a printed plate caption, top-right. Reads as a label
   tipped onto a guidebook engraving. */
.map-stage .cartouche {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 450;
  padding: 12px 18px 14px;
  background: rgba(239, 232, 213, 0.96);
  border-top: 2px solid var(--verdigris);
  border-bottom: 1px solid var(--paper-rule);
  pointer-events: none;
  max-width: 280px;
  text-align: right;
}
.map-stage .cartouche .eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--madder);
  display: block;
  margin-bottom: 6px;
}
.map-stage .cartouche .name {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  display: block;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 420;
}
.map-stage .cartouche .subname {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-style: italic;
  color: var(--ink-mute);
  margin-top: 6px;
  line-height: 1.35;
}

/* Compass rose — inked engraving in a corner. SVG inline for
   performance and theming via currentColor. */
.map-stage .compass {
  position: absolute;
  bottom: 44px;
  left: 28px;
  z-index: 400;
  width: 76px;
  height: 76px;
  color: var(--verdigris);
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(242, 236, 221, 0.92) 50%, rgba(242, 236, 221, 0) 75%);
  border-radius: 50%;
  padding: 4px;
}

@media (max-width: 720px) {
  .map-stage .cartouche { max-width: 180px; padding: 7px 10px; }
  .map-stage .cartouche .name { font-size: 14px; }
  .map-stage .compass { width: 52px; height: 52px; bottom: 18px; right: 18px; }
}

#map {
  width: 100%;
  height: 560px;
  background: #d7ceb6;
  position: relative;
}
/* Push the OSM raster tiles further into the atlas / engraving
   register — heavy sepia and grayscale, a touch of contrast and a
   tiny blur make the labels feel letterpress. The frame does the
   rest of the work. */
.leaflet-tile {
  filter:
    grayscale(0.72)
    sepia(0.38)
    contrast(0.88)
    brightness(1.04)
    saturate(0.7);
}
/* Gentle multiply on the tile pane only — lets the parchment paper
   warm the map from behind. Keep markers and controls in normal blend
   so the status colours stay true. */
.leaflet-tile-pane { mix-blend-mode: multiply; }
.leaflet-container {
  font-family: var(--ui) !important;
  background: var(--paper-deep) !important;
}
.leaflet-control-attribution {
  font-family: var(--ui) !important;
  font-size: 10px !important;
  background: rgba(244, 239, 230, 0.85) !important;
  color: var(--ink-mute) !important;
}
.leaflet-control-attribution a { color: var(--link) !important; }
.leaflet-control-zoom a {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border: 1px solid var(--paper-rule) !important;
  font-family: var(--display) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

/* Cluster bubbles — three sizes. Palette-matched to the rest of the
   register: ivy-deep ink on parchment, with a hairline ivy border. */
.cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(242, 236, 221, 0.94);
  border: 1.5px solid var(--verdigris);
  box-shadow: 0 2px 6px rgba(20, 19, 17, 0.2);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 13px;
  color: var(--verdigris-deep);
  transition: transform 140ms;
}
.cluster:hover { transform: scale(1.06); }
.cluster.cluster-md {
  width: 46px;
  height: 46px;
  font-size: 14px;
  border-width: 2px;
}
.cluster.cluster-lg {
  width: 54px;
  height: 54px;
  font-size: 15px;
  border-width: 2px;
  background: rgba(236, 224, 199, 0.96);
}

/* Cluster tint by dominant status — the map shows where risk and
   renewal concentrate without reading the legend. */
.cluster.tone-at-risk {
  border-color: var(--madder);
  color: var(--madder);
  background: rgba(246, 232, 221, 0.95);
}
.cluster.tone-rescued,
.cluster.tone-preserved {
  border-color: var(--verdigris);
  color: var(--verdigris-deep);
}
.cluster.tone-repurposed {
  border-color: var(--madder-soft);
  color: var(--madder);
}
.cluster.tone-closed,
.cluster.tone-demolished {
  border-color: var(--ink-mute);
  color: var(--ink-mute);
}
.cluster.tone-mixed {
  border-color: var(--ink-soft);
  color: var(--ink-soft);
}
.leaflet-cluster-anim .cluster {
  transition: transform 200ms ease-out;
}
/* Nix markercluster's default colour sprites — we render our own */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large,
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div { background: transparent !important; color: transparent !important; }

/* Custom marker */
.chmark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--status-at-risk);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink), 0 2px 4px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 160ms ease;
}
.chmark.status-rescued { background: var(--status-rescued); }
.chmark.status-preserved { background: var(--status-preserved); }
.chmark.status-repurposed { background: var(--status-repurposed); }
.chmark.status-closed { background: var(--status-closed); }
.chmark.status-demolished { background: var(--status-demolished); }
.chmark.is-active {
  transform: scale(1.35);
  box-shadow: 0 0 0 2px var(--verdigris), 0 0 0 4px var(--paper), 0 4px 10px rgba(20,19,17,0.35);
}
.chmark-me {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--link);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--link), 0 0 14px rgba(5, 41, 98, 0.45);
  animation: mePulse 2.4s ease-in-out infinite;
}
@keyframes mePulse {
  0%, 100% { box-shadow: 0 0 0 1.5px var(--link), 0 0 8px rgba(5, 41, 98, 0.45); }
  50% { box-shadow: 0 0 0 1.5px var(--link), 0 0 18px rgba(5, 41, 98, 0.7); }
}

.stage .hint {
  font: 12px/1.5 var(--body);
  color: var(--ink-soft);
  margin-top: 14px;
  border-top: 1px solid var(--paper-rule);
  padding-top: 12px;
  max-width: 62ch;
}
.stage .hint strong {
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

/* ----- Right: reading panel ----- */
.reading-panel {
  position: sticky;
  top: 20px;
  font-family: var(--ui);
  min-height: 300px;
}
.reading-panel .eyebrow {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.reading-panel .panel-rule {
  height: 3px;
  background: var(--ink);
  margin: 0 0 14px;
}

.reading-panel .idle-state {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.reading-panel .idle-state em { color: var(--ink); font-style: italic; }

/* Active-filters bar — lozenges above the result list, one per
   filter dimension that's currently on. Each lozenge is a tappable
   pill that clears its filter; "Clear all" appears once two or more
   are active. */
.reading-panel .active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.reading-panel .active-filters[hidden] { display: none; }
.reading-panel .lozenge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  background: var(--bone);
  border: 1px solid var(--verdigris);
  color: var(--ink);
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}
.reading-panel .lozenge:hover {
  background: var(--paper-deep);
  border-color: var(--verdigris-deep);
}
.reading-panel .lozenge .lozenge-eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.reading-panel .lozenge .lozenge-label {
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  /* Soften the truncation on long denomination strings */
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reading-panel .lozenge .lozenge-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  transition: background 140ms, color 140ms;
}
.reading-panel .lozenge:hover .lozenge-x {
  background: var(--madder);
  color: var(--paper);
}
/* The "Clear all" pill is monochrome, no eyebrow, sits at the end. */
.reading-panel .lozenge-clear-all {
  background: transparent;
  border-color: var(--paper-rule);
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 12px;
}
.reading-panel .lozenge-clear-all:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.reading-panel .result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.reading-panel .result-hint {
  font: italic 13px/1.5 var(--body);
  color: var(--ink-mute);
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--paper-rule);
  margin-bottom: 6px;
}
.reading-panel .result {
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-rule);
  cursor: pointer;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: baseline;
}
.reading-panel .result:last-child { border-bottom: none; }
.reading-panel .result:hover .result-name { color: var(--link); }
.reading-panel .result .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  align-self: center;
}
.reading-panel .result .result-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink);
  transition: color 120ms;
}
.reading-panel .result .result-place {
  display: block;
  font-family: var(--body);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-mute);
  margin-top: 2px;
}
.reading-panel .result .result-status {
  display: block;
  margin-top: 5px;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.reading-panel .result .result-dist {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  white-space: nowrap;
  align-self: center;
}

/* ----- Building detail — the full story for one church ----- */
.detail {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 0 56px;
  border-top: 1px solid var(--paper-rule);
}
.detail[hidden] { display: none; }
.detail .body {
  max-width: 1480px;
  padding: 32px 48px 0;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 56px;
}

/* Hero image — full-width, spans above the two-column body.
   Silhouette fallback uses the same aspect ratio so the layout is stable
   whether or not we have a photograph yet. */
.detail .hero {
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 48px;
  background: transparent;
}
.detail .hero img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  background: var(--paper-deep);
}
.detail .hero figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 10px 4px 0;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}
.detail .hero figcaption .caption {
  flex: 1 1 60%;
  min-width: 0;
  font-family: var(--body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}
.detail .hero figcaption .credit {
  flex: 0 0 auto;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
}
.detail .hero figcaption a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-mute);
}
.detail .hero figcaption a:hover { color: var(--ink); }

.detail .long .kicker {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--madder);
  margin: 0 0 12px;
}
.detail .long h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 12px;
  font-variation-settings: "opsz" 144, "SOFT" 0, "wght" 500;
}
.detail .long .place-line {
  font-family: var(--body);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.detail .factline {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  padding: 18px 0;
  border-top: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
  font-family: var(--ui);
  margin-bottom: 24px;
}
.detail .factline .fact { display: flex; flex-direction: column; gap: 4px; }
.detail .factline .fact .key {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.detail .factline .fact .val {
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
}
.detail .factline .fact .val.status {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.detail .factline .fact .val.status .dot {
  width: 11px; height: 11px; border-radius: 50%;
}

.detail .long .summary {
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 62ch;
  margin: 0 0 28px;
}
/* Drop cap — the anchor of the broadsheet voice. Fraunces at a very
   carved optical size, verdigris ink, four lines tall. Subtle tuck
   to align with body baseline. */
.detail .long .summary::first-letter {
  font-family: var(--display);
  font-weight: 400;
  font-size: 4.6em;
  line-height: 0.82;
  float: left;
  margin: 10px 12px -4px 0;
  color: var(--verdigris);
  font-variation-settings: "opsz" 144, "SOFT" 0, "wght" 450;
}

/* ----- Editorial panels within the detail body ----- */
/* All panels share one rhythm: generous space above, no visible
   separator. The section eyebrow does the work of announcing a new
   block. Everything sits in one column of 64ch. */
.detail .panel {
  margin: 40px 0 0;
  max-width: 64ch;
}
.detail .panel-context { max-width: 64ch; }
.detail .panel:first-of-type { margin-top: 16px; }
.detail .section-h {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 14px;
}
.detail .mini-h {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 22px 0 8px;
}
.detail .para {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 62ch;
}
/* Long-form NHLE listing description. Preserves the typewriter
   formatting of the original NHLE entry — the line breaks and
   indents are part of the document. Sits in a quiet bone panel so
   the reader knows it's a verbatim authority text, not editorial. */
.detail .listing-text {
  margin: 0 0 28px;
  padding: 22px 24px 18px;
  background: var(--bone);
  border-top: 2px solid var(--verdigris);
  border-bottom: 1px solid var(--paper-rule);
}
.detail .listing-text pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  max-height: 360px;
  overflow-y: auto;
  /* a soft thumb on the scroller */
  scrollbar-width: thin;
  scrollbar-color: var(--paper-rule) transparent;
}
.detail .listing-text pre::-webkit-scrollbar { width: 8px; }
.detail .listing-text pre::-webkit-scrollbar-thumb {
  background: var(--paper-rule);
  border-radius: 4px;
}
.detail .listing-text cite {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Pull-quote from the list entry — distinct from a voices blockquote:
   this is the heritage authority speaking, so it reads as plate-
   mounted text rather than a spoken quotation. */
.detail .pull {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(21px, 2.2vw, 25px);
  line-height: 1.3;
  color: var(--ink);
  padding: 16px 20px 18px;
  margin: 0 0 22px;
  background: var(--bone);
  border-top: 1px solid var(--verdigris);
  border-bottom: 1px solid var(--verdigris);
  font-variation-settings: "opsz" 72, "SOFT" 40, "wght" 400;
}
.detail .pull cite {
  display: block;
  margin-top: 10px;
  font-family: var(--ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.detail .also {
  font-family: var(--body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin: 10px 0 0;
}
.detail .also span + span::before { content: none; }

/* Timeline of fabric phases */
.detail .timeline {
  list-style: none;
  padding: 0;
  margin: 10px 0 16px;
  border-left: 2px solid var(--paper-rule);
}
.detail .timeline li {
  position: relative;
  padding: 6px 0 14px 24px;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}
.detail .timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verdigris-soft);
  border: 2px solid var(--paper);
}
.detail .timeline .when {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  margin-bottom: 2px;
}
.detail .timeline .what {
  display: block;
  color: var(--ink);
}

/* Interior features — elegant dotted-leader list */
.detail .features {
  list-style: none;
  padding: 0;
  margin: 6px 0 14px;
}
.detail .features li {
  padding: 10px 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  border-bottom: 1px dotted var(--paper-rule);
}
.detail .features li:last-child { border-bottom: none; }
.detail .features li::before {
  content: '§ ';
  font-family: var(--display);
  font-style: italic;
  color: var(--verdigris-soft);
  margin-right: 4px;
}

/* Hanging quote — the whole block pulls left of the column into the
   article's left margin, so the first quotation mark lands in the
   gutter. The left border disappears; a printed "¶" mark in the
   margin does the same job with more character. */
.detail blockquote {
  position: relative;
  margin: 32px 0 28px -32px;
  padding-left: 32px;
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.3;
  color: var(--ink);
  max-width: 36em;
  font-variation-settings: "opsz" 72, "SOFT" 100, "wght" 400;
}
.detail blockquote::before {
  content: '“';
  position: absolute;
  left: -6px;
  top: -0.2em;
  font-family: var(--display);
  font-size: 3em;
  line-height: 1;
  color: var(--verdigris);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 400;
}
.detail blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.detail .meta-row {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 10px 0 0;
}
.detail .meta-row strong {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Context grid — two-column key/value stats in a dense grid */
.detail .panel-context {
  max-width: 780px;
}
.detail .context-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--paper-rule);
  border-left: 1px solid var(--paper-rule);
}
.detail .context-grid > div {
  padding: 12px 16px;
  border-right: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
}
.detail .context-grid dt {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 4px;
}
.detail .context-grid dd {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.detail .context-grid .tk {
  font-style: italic;
  color: var(--ink-faint);
}

/* People list */
.detail .people {
  list-style: none;
  padding: 0;
  margin: 0;
}
.detail .people li {
  padding: 10px 0;
  border-bottom: 1px dotted var(--paper-rule);
}
.detail .people li:last-child { border-bottom: none; }
.detail .people .pname {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}
.detail .people .prole {
  display: block;
  font-family: var(--body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* Dispatches */
.detail .dispatches a {
  display: block;
  padding: 16px 18px;
  background: var(--paper-deep);
  border-left: 3px solid var(--link);
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms;
  margin-bottom: 8px;
}
.detail .dispatches a:hover { background: #ded3be; }
.detail .dispatches .article-kicker {
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--madder);
  display: block;
  margin-bottom: 8px;
}
.detail .dispatches .article-title {
  font: 500 18px/1.25 var(--display);
  display: block;
}
.detail .dispatches .article-byline {
  display: block;
  margin-top: 8px;
  font-family: var(--ui);
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
}

.detail .sidecar {
  font-family: var(--ui);
}
.detail .sidecar .chapel {
  width: 100%;
  aspect-ratio: 1 / 1.05;
  background: var(--paper-deep);
  border: 1px solid var(--paper-rule);
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
}
/* CSS silhouette: simple church-in-a-churchyard illustration, warms the
   card when we haven't seeded a photograph yet. */
.detail .sidecar .chapel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(180, 125, 44, 0.08), transparent 55%),
    radial-gradient(ellipse at 50% 85%, rgba(18,18,18,0.12), transparent 55%);
}
.detail .sidecar .chapel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.detail .sidecar .chapel .tag {
  position: absolute;
  top: 14px;
  left: 14px;
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--paper-rule);
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.detail .sidecar .chapel .tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* External link buttons — Street View, Wikipedia. Two-up row above
   the submit card. Reads as outbound exits, not editorial CTAs. */
.detail .sidecar .external-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.detail .sidecar .external-links:has(.ext-btn + .ext-btn) {
  grid-template-columns: 1fr 1fr;
}
.detail .sidecar .ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bone);
  border: 1px solid var(--paper-rule);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 140ms, border-color 140ms, color 140ms;
}
.detail .sidecar .ext-btn:hover {
  background: var(--paper-deep);
  border-color: var(--verdigris);
  color: var(--verdigris-deep);
}
.detail .sidecar .ext-btn .ext-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--verdigris);
  color: var(--verdigris-deep);
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  font-variation-settings: "opsz" 72, "SOFT" 100;
}

.detail .sidecar .submit-card {
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
}
.detail .sidecar .submit-card .label {
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 8px;
}
.detail .sidecar .submit-card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--paper);
}
.detail .sidecar .submit-card p {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(244, 239, 230, 0.82);
  margin: 0 0 16px;
}
.detail .sidecar .submit-card button {
  font: 700 12px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 16px;
  background: var(--bone);
  color: var(--ink);
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 120ms, color 120ms;
}
.detail .sidecar .submit-card button:hover {
  background: var(--paper);
}

.detail .sidecar .sources {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--paper-rule);
  font: italic 12px/1.5 var(--body);
  color: var(--ink-mute);
}
.detail .sidecar .sources a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted var(--link);
}
.detail .sidecar .sources a:hover { border-bottom-style: solid; }
.detail .sidecar .sources .nolink {
  color: var(--ink-mute);
  border-bottom: 1px dotted var(--paper-rule);
  padding-bottom: 1px;
}
.detail .sidecar .sources .prov {
  display: block;
  margin-top: 10px;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 11px;
}

/* ----- Submission modal ----- */
.submit-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.submit-modal.is-open { display: flex; }
.submit-modal .box {
  background: var(--paper);
  max-width: 520px;
  width: 100%;
  padding: 36px;
  border: 1px solid var(--ink);
  position: relative;
}
.submit-modal .box .close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 6px 10px;
}
.submit-modal .box .close:hover { color: var(--ink); }
.submit-modal .box .kicker {
  font: 700 10px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--madder);
  margin: 0 0 10px;
}
.submit-modal .box h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 8px;
}
.submit-modal .box .intro {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.submit-modal label {
  display: block;
  font: 700 11px/1 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 6px;
}
.submit-modal textarea,
.submit-modal input[type=text],
.submit-modal input[type=email] {
  width: 100%;
  font: 400 15px/1.4 var(--body);
  padding: 10px 12px;
  border: 1px solid var(--paper-rule);
  background: var(--paper-deep);
  color: var(--ink);
  margin-bottom: 16px;
  resize: vertical;
}
.submit-modal textarea:focus,
.submit-modal input:focus {
  outline: none;
  border-color: var(--link);
}
.submit-modal .small {
  font: italic 12px/1.45 var(--body);
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.submit-modal .submit-btn {
  font: 700 12px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 13px 20px;
  background: var(--link);
  color: var(--paper);
  border: none;
  cursor: pointer;
  width: 100%;
}
.submit-modal .submit-btn:hover { background: var(--ink); }
.submit-modal .sent {
  font-family: var(--body);
  font-size: 15px;
  color: var(--verdigris);
  margin: 16px 0 0;
}

/* ----- Footer ----- */
footer.foot {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 48px 56px;
  border-top: 1px solid var(--paper-rule);
  font: italic 13px/1.55 var(--body);
  color: var(--ink-mute);
}
footer.foot a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted var(--link);
}
footer.foot a:hover { border-bottom-style: solid; }

/* ----- Mobile ----- */
/* ----- Mobile (≤960px) -------------------------------------------------
   Reordered for a single-thumb scroll: search → map → results →
   collapsed filters. The filter drawer's summary becomes visible on
   mobile and tappable; it's still hidden on desktop where everything's
   already on screen. The detail sidecar follows the article instead
   of leading it. */
@media (max-width: 960px) {
  .masthead {
    grid-template-columns: 1fr;
    padding: 22px 20px 14px;
    gap: 12px;
  }
  .masthead .title { font-size: clamp(40px, 11vw, 56px); line-height: 0.92; }
  .masthead .dek { font-size: 14px; line-height: 1.45; }
  .masthead .stat { text-align: left; }
  .masthead .stat .big { font-size: 26px; display: inline-block; margin-right: 8px; }
  .masthead .stat .stat-sub { display: inline; font-size: 11px; }
  .masthead .stat .stat-sub::before { content: ' · '; color: var(--ink-mute); }
  .rule-band { padding: 0 20px; }
  .subnav { padding: 10px 20px 0; gap: 18px; }

  /* Reorder the main shell so the map is the third visible thing
     after the masthead + search field, not after the long filter
     column. .finder gets `display: contents` so its children become
     direct flex items of the shell and can be ordered individually. */
  main.shell {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 28px;
    gap: 18px;
  }
  .finder { display: contents; position: static; }
  .finder > .kicker { order: 1; margin: 0; }
  .finder > .intro  { order: 2; margin: 0; }
  .finder > #find-form { order: 3; }
  .finder > .filter-drawer { order: 4; }   /* sits with the search */
  .stage { order: 5; }
  .reading-panel { order: 6; position: static; }
  .finder > .tips { order: 7; }

  /* Collapsible drawer is the whole story on mobile — show the
     summary tap-target and let the browser handle open/close. */
  .finder .filter-drawer {
    border-top: none;
    padding-top: 0;
  }
  .finder .filter-drawer > summary {
    display: block;
  }
  /* Padding inside the drawer body so it doesn't kiss the summary */
  .finder .filter-drawer[open] > summary { margin-bottom: 14px; }

  #map { height: 56vh; min-height: 360px; }

  /* Compact the cartouche so it doesn't overlap the map's top-right
     zoom region as the map narrows. */
  .map-stage .cartouche {
    top: 14px; right: 14px;
    padding: 8px 12px 10px;
    max-width: 64%;
  }
  .map-stage .cartouche .name { font-size: 18px; }
  .map-stage .cartouche .subname { font-size: 10px; }

  .detail .body {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 24px;
  }
  /* Sidecar follows the article rather than leading it */
  .detail .sidecar { order: 2; }
  .detail .long    { order: 1; }
  .detail .hero { padding: 0; }
  .detail .hero img { max-height: 380px; }
  /* Stack caption and credit on mobile so neither has to truncate */
  .detail .hero figcaption {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 18px 0;
  }
  .detail .hero figcaption .credit {
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
  }

  /* Hanging-quote pull-back doesn't fit narrow columns gracefully —
     drop the negative margin on mobile. */
  .detail blockquote {
    margin-left: 0;
    padding-left: 18px;
  }
  .detail blockquote::before { left: -2px; font-size: 2.4em; }

  /* NHLE listing text has long lines; let it overflow-scroll and
     trim the panel so it doesn't fill the screen. */
  .detail .listing-text {
    padding: 16px 14px 14px;
  }
  .detail .listing-text pre {
    font-size: 12px;
    max-height: 280px;
  }

  footer.foot { padding: 20px; font-size: 12px; }
}

/* On the smallest devices, drop the masthead stat to a single tight
   line and tighten the subnav further. */
@media (max-width: 480px) {
  .masthead { padding: 18px 16px 12px; }
  .masthead .title { font-size: clamp(36px, 13vw, 48px); }
  .masthead .stat { font-size: 10px; }
  .masthead .stat .big { font-size: 22px; }
  main.shell { padding: 12px 14px 24px; gap: 14px; }
  #map { height: 60vh; min-height: 320px; }
  .map-stage .cartouche { top: 10px; right: 10px; padding: 6px 10px 8px; }
  .map-stage .cartouche .eyebrow { font-size: 8px; letter-spacing: 0.24em; }
  .map-stage .cartouche .name { font-size: 16px; }
  .map-stage .cartouche .subname { display: none; }
  .map-stage .compass { width: 48px; height: 48px; bottom: 28px; left: 14px; }
  .detail .sidecar .external-links {
    grid-template-columns: 1fr 1fr !important;
  }
}
