:root {
  --bg: #f5efe5;
  --paper: #fffaf2;
  --paper-strong: #ffffff;
  --ink: #171c18;
  --muted: #656a62;
  --soft: #e9ded0;
  --line: #d8ccbb;
  --accent: #4d735e;
  --accent-strong: #315743;
  --accent-soft: #e0eadf;
  --warning: #94672f;
  --warning-soft: #f2e2c8;
  --shadow: 0 18px 45px rgba(36, 31, 24, 0.08);
  --radius: 8px;
  --radius-small: 6px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(77, 115, 94, 0.42);
  outline-offset: 3px;
}

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--max) + 40px);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.site-header {
  padding: 28px 0 20px;
}

.nav {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.nav-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.brand,
.nav-link {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-small);
  text-decoration: none;
  font-weight: 760;
}

.brand {
  gap: 10px;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent-strong);
  font-size: 0.68rem;
}

.nav-link {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 36px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.hero-copy {
  max-width: 800px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.91;
  letter-spacing: 0;
}

.hero-title,
.option-title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 760;
}

.title-gradient-walnut {
  color: #6b3f21;
  background: linear-gradient(104deg, #6b3f21 0%, #a76730 38%, #d49a50 60%, #315743 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-outline-cedar {
  color: #7a4a25;
  text-shadow: 0 2px 0 rgba(255, 250, 242, 0.9), 0 10px 22px rgba(73, 44, 24, 0.16);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #7a4a25;
}

.title-editorial-walnut {
  color: #704222;
  text-shadow: 0 1px 0 #f3dfc0;
}

.title-gradient-copper {
  color: #8a4d24;
  background: linear-gradient(96deg, #8a4d24 0%, #b96933 34%, #e0ad63 58%, #0f7670 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-outline-moss {
  color: #315743;
  text-shadow: 0 8px 18px rgba(49, 87, 67, 0.16);
  -webkit-text-fill-color: #fff8ee;
  -webkit-text-stroke: 1.5px #315743;
}

.title-woodcut {
  color: #5d351d;
  text-shadow: 2px 2px 0 #e3be82, 5px 7px 0 rgba(125, 78, 38, 0.12);
}

.title-options-page {
  padding-top: 34px;
  padding-bottom: 70px;
}

.options-intro {
  max-width: 760px;
  margin-bottom: 32px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.title-option {
  display: grid;
  gap: 12px;
  min-height: 250px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--paper);
}

.option-title {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.9rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.option-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.option-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--paper-strong);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.24rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.subtitle {
  max-width: 720px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1.1rem;
}

.stat-line,
.result-count {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 780;
}

.hero-panel {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
  text-transform: uppercase;
}

.hero-panel strong {
  font-size: 1.6rem;
  line-height: 1.1;
}

.hero-panel span:last-child {
  color: var(--muted);
}

.map-section,
.directory-section,
.method-section {
  padding: 34px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.region-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.segmented-button,
.clear-button,
.active-city button,
.empty-state button,
.program-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 760;
}

.segmented-button[aria-pressed="true"],
.program-link {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 390px;
  background: #e8e1d8;
}

.leaflet-tile-pane {
  filter: saturate(0.64) sepia(0.04) brightness(1.03) contrast(0.95);
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  font-size: 0.68rem;
}

.city-dot {
  display: grid;
  place-items: center;
  border: 2px solid #fff8ee;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 8px 22px rgba(25, 40, 31, 0.28);
  font-size: 0.78rem;
  font-weight: 840;
}

.leaflet-marker-icon:focus-visible .city-dot,
.leaflet-marker-icon:hover .city-dot {
  transform: scale(1.08);
}

.active-city {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid rgba(77, 115, 94, 0.24);
  border-radius: 999px;
  padding: 6px 7px 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 760;
}

.active-city button {
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  font-size: 0.82rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--paper-strong);
  color: var(--ink);
}

.field input,
.field select {
  min-height: 46px;
  padding: 0 12px;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
}

.clear-button {
  min-height: 46px;
  background: var(--ink);
  color: #fff;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.program-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(36, 31, 24, 0.06);
}

.program-card-header {
  padding: 18px 18px 0;
}

.program-location {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.tag-row,
.stage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tag,
.stage,
.unverified {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.tag.primary {
  border-color: rgba(77, 115, 94, 0.24);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.program-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.terms {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 690;
}

.note {
  margin: 0;
  color: var(--muted);
}

.unverified {
  width: fit-content;
  border-color: rgba(148, 103, 47, 0.32);
  background: var(--warning-soft);
  color: var(--warning);
}

.program-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.program-type {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--paper);
}

.empty-state p {
  color: var(--muted);
}

.method-section {
  max-width: 780px;
  border-top: 1px solid var(--line);
  margin-top: 38px;
  padding-top: 28px;
}

.method-section p {
  color: var(--muted);
}

.method-section a {
  color: var(--accent-strong);
  font-weight: 760;
}

.listing-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  align-items: start;
  border-top: 1px solid var(--line);
  margin-top: 38px;
  padding-top: 28px;
}

.listing-copy {
  max-width: 440px;
}

.listing-copy p:last-child {
  color: var(--muted);
}

.listing-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.wide {
  grid-column: 1 / -1;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 620;
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-strong);
}

.form-action {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.form-action p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 46px;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--muted);
  font-weight: 720;
}

.legal-page {
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.legal-home {
  display: flex;
  width: fit-content;
  margin-bottom: 48px;
}

.legal-page h1 {
  margin-bottom: 24px;
  font-size: clamp(2.4rem, 8vw, 5rem);
}

.legal-copy {
  display: grid;
  gap: 18px;
  color: var(--muted);
}

.legal-copy p {
  margin-bottom: 0;
}

.legal-copy h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.legal-copy a {
  color: var(--accent-strong);
  font-weight: 760;
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 360px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .clear-button {
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .site-header,
  main,
  .site-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-header {
    padding-top: 18px;
  }

  .nav {
    margin-bottom: 30px;
  }

  .nav-links {
    display: none;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.45rem, 11vw, 3.05rem);
    line-height: 0.96;
    overflow-wrap: break-word;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .option-title {
    font-size: 2.7rem;
  }

  .subtitle,
  .stat-line {
    max-width: 340px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .region-toggle {
    justify-content: start;
  }

  .segmented-button {
    min-height: 44px;
  }

  #map {
    height: 440px;
    min-height: 360px;
  }

  .filters,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .program-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .listing-form {
    grid-template-columns: 1fr;
  }

  .legal-page {
    width: min(100% - 28px, 780px);
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    max-width: 180px;
  }

  .region-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
