:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.978 0.004 210);
  --surface-accent: oklch(0.952 0.014 20);
  --ink: oklch(0.108 0.004 250);
  --muted: oklch(0.36 0.006 250);
  --line: oklch(0.80 0.004 250);
  --hairline: oklch(0.91 0.003 250);
  --primary: oklch(0.45 0.165 356);
  --primary-dark: oklch(0.31 0.115 356);
  --primary-soft: oklch(0.93 0.03 356);
  --map-wash: oklch(0.90 0.028 194);
  --map-paper: oklch(0.965 0.008 70);
  --map-overlay: oklch(0.45 0.04 194 / 0.08);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Arial, Helvetica, sans-serif;
  --step--1: clamp(0.78rem, 0.74rem + 0.18vw, 0.89rem);
  --step-0: clamp(0.96rem, 0.91rem + 0.24vw, 1.08rem);
  --step-1: clamp(1.14rem, 1.05rem + 0.44vw, 1.38rem);
  --step-2: clamp(1.48rem, 1.28rem + 0.98vw, 2rem);
  --step-3: clamp(2.2rem, 1.62rem + 2.9vw, 4.1rem);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  text-rendering: optimizeLegibility;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page {
  min-height: 100vh;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(16px, 3vw, 36px);
  padding: 14px clamp(14px, 3vw, 34px) 12px;
  border-bottom: 4px double var(--ink);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.6vw, 18px);
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.wordmark-main {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.03em;
}

.wordmark-note {
  max-width: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.25;
  white-space: nowrap;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: clamp(9px, 1.7vw, 16px);
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
  white-space: nowrap;
}

.masthead-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.masthead-actions a:hover {
  border-bottom-color: var(--ink);
}

.submit-link,
.submit-button {
  background: var(--primary);
  color: var(--bg);
}

.submit-link {
  padding: 0 13px;
  border: 1px solid var(--primary);
}

.layout {
  display: grid;
  grid-template-columns: minmax(430px, 46vw) minmax(0, 1fr);
  min-height: calc(100vh - 79px);
}

.edition {
  border-right: 1px solid var(--ink);
  min-height: calc(100vh - 79px);
  display: flex;
  flex-direction: column;
}

.edition-kicker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
}

.edition-kicker span {
  padding: 8px 12px;
}

.edition-kicker span + span {
  border-left: 1px solid var(--ink);
  text-align: center;
}

.edition-kicker span:last-child {
  text-align: right;
}

.lede {
  padding: clamp(24px, 4vw, 42px) clamp(16px, 3vw, 28px) 20px;
  border-bottom: 1px solid var(--ink);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 14.8ch;
  margin-bottom: 16px;
  font-size: clamp(2.15rem, 1.38rem + 2.7vw, 3.85rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede p {
  max-width: 52ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.58;
  text-wrap: pretty;
}

.controls {
  padding: 16px clamp(14px, 3vw, 24px);
  border-bottom: 1px solid var(--ink);
}

.search-label,
.section-label {
  display: block;
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#searchInput {
  width: 100%;
  min-height: 45px;
  padding: 0 11px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  outline: none;
}

#searchInput::placeholder {
  color: var(--muted);
  opacity: 1;
}

#searchInput:focus {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 13px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.category-button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--step--1);
}

.category-button:hover,
.category-button[aria-pressed="true"] {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--bg);
}

.list {
  flex: 1;
  overflow: auto;
}

.place-card {
  width: 100%;
  padding: 15px clamp(14px, 3vw, 24px) 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}

.place-card:hover,
.place-card.is-active {
  background: var(--surface);
}

.place-card.is-active {
  outline: 1px solid var(--primary);
  outline-offset: -1px;
  background: var(--surface-accent);
}

.place-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.place-name {
  margin: 0 0 4px;
  font-size: var(--step-1);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.badge {
  padding-top: 3px;
  color: var(--primary-dark);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.place-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--step--1);
}

.place-desc {
  max-width: 58ch;
  margin: 0;
  color: var(--ink);
  font-size: var(--step-0);
  line-height: 1.44;
}

.place-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
}

.place-links a {
  color: var(--ink);
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.empty {
  margin: 0;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.5;
}

.submission-note {
  padding: clamp(22px, 4vw, 34px) clamp(16px, 3vw, 28px);
  border-top: 4px double var(--ink);
  background: var(--surface);
}

.submission-note h2 {
  max-width: 16ch;
  margin-bottom: 10px;
  font-size: var(--step-2);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.submission-note p:not(.section-label) {
  max-width: 58ch;
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.55;
}

.submit-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0 15px;
  border: 1px solid var(--primary);
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 800;
  text-decoration: none;
}

.submit-button:hover,
.submit-link:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.map-column {
  position: sticky;
  top: 79px;
  height: calc(100vh - 79px);
  background: var(--map-wash);
}

#map {
  position: absolute;
  inset: 0;
  background: var(--map-wash);
}

#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background:
    linear-gradient(0deg, oklch(1 0 0 / 0.16), oklch(1 0 0 / 0.16)),
    linear-gradient(90deg, var(--map-overlay), transparent 38%);
  mix-blend-mode: multiply;
}

#map .leaflet-tile {
  filter: grayscale(0.68) sepia(0.2) saturate(0.9) hue-rotate(154deg) contrast(1.06)
    brightness(1.02);
}

.place-marker {
  display: grid;
  place-items: center;
  width: 22px !important;
  height: 22px !important;
  margin-left: -11px !important;
  margin-top: -11px !important;
  border: 2px solid var(--bg);
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.place-marker::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--bg);
}

.place-marker.is-active {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dark);
}

.map-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  max-width: min(380px, calc(100% - 28px));
  padding: 9px 11px;
  border: 1px solid var(--ink);
  background: var(--map-paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 700;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  padding: 13px clamp(14px, 3vw, 34px);
  border-top: 4px double var(--ink);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step--1);
  line-height: 1.45;
}

.site-footer p {
  margin: 0;
}

.footer-heart {
  color: var(--primary);
}

.footer-attribution {
  text-align: right;
}

.site-footer a,
.text-page a {
  color: var(--ink);
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.text-page {
  max-width: 860px;
  min-height: calc(100vh - 79px);
  padding: clamp(28px, 5vw, 58px) clamp(16px, 5vw, 58px);
}

.text-page h1 {
  max-width: 11ch;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.text-section {
  max-width: 68ch;
  padding: 18px 0;
  border-top: 1px solid var(--ink);
}

.text-section h2 {
  margin-bottom: 8px;
  font-size: var(--step-1);
  line-height: 1.1;
}

.text-section p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.58;
  text-wrap: pretty;
}

.leaflet-control-attribution,
.leaflet-control-zoom a {
  font-family: var(--sans);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 0;
  box-shadow: none;
}

.leaflet-popup-content-wrapper {
  border: 1px solid var(--ink);
  background: var(--map-paper);
}

.leaflet-popup-content {
  margin: 12px;
  min-width: 190px;
  font-family: var(--serif);
}

.popup-title {
  margin: 0 0 5px;
  font-size: 1.02rem;
  font-weight: 700;
}

.popup-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
}

.popup-link {
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 800;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
}

@media (max-width: 940px) {
  .masthead {
    position: static;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .map-column {
    position: relative;
    top: auto;
    height: min(42vh, 390px);
    min-height: 280px;
    border-bottom: 1px solid var(--ink);
    grid-row: 1;
  }

  .edition {
    min-height: auto;
    border-right: 0;
    grid-row: 2;
  }

  .list {
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .masthead {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .wordmark {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .wordmark-note {
    white-space: normal;
  }

  .masthead-actions {
    width: 100%;
    justify-content: space-between;
  }

  .masthead-actions a {
    min-height: 44px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-attribution {
    text-align: left;
  }

  .edition-kicker {
    grid-template-columns: 1fr;
  }

  .edition-kicker span + span {
    border-left: 0;
    border-top: 1px solid var(--ink);
    text-align: left;
  }

  .edition-kicker span:last-child {
    text-align: left;
  }

  h1 {
    max-width: 13ch;
    font-size: clamp(2rem, 12vw, 3.15rem);
    line-height: 0.97;
  }
}

@media (max-width: 430px) {
  .map-column {
    height: 34vh;
    min-height: 250px;
  }

  .lede {
    padding-top: 22px;
  }

  .place-topline {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .badge {
    padding-top: 0;
  }
}

@media (pointer: coarse) {
  .category-button,
  .place-card,
  .submit-button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
