:root {
  color-scheme: light;
  --ink: #16201c;
  --muted: #5e6a63;
  --line: #dbe4de;
  --paper: #fbfbf7;
  --surface: #ffffff;
  --soft: #eef3ef;
  --accent: #166534;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.detail-main {
  width: min(1120px, calc(100vw - 48px));
}

.site-header {
  min-height: 38vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line);
}

.header-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.35rem, 6vw, 5.8rem);
  font-weight: 780;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
}

.lede {
  max-width: 700px;
  margin: 18px 0 0;
  color: #314139;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
}

.header-facts {
  display: grid;
  gap: 10px;
  min-width: 210px;
  margin: 0;
}

.header-facts div,
.detail-facts dl div,
.destination-card dl div {
  display: grid;
  gap: 2px;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 720;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 28px 0;
}

.map-panel,
.priority-panel,
.detail-facts,
.destination-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.map-panel {
  min-width: 0;
  padding: 18px;
}

.priority-panel {
  padding: 18px;
}

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

.real-map {
  position: relative;
  height: min(68vh, 680px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #cfd8d1;
  border-radius: 8px;
  background: #e7ece7;
}

.real-map.map-error {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #69451a;
  background: #f7f2e8;
  font-weight: 740;
  text-align: center;
}

.real-map.map-tile-error::after {
  content: "Some map tiles failed to load";
  position: absolute;
  z-index: 1000;
  top: 12px;
  right: 12px;
  max-width: min(260px, calc(100% - 24px));
  border: 1px solid #e7c680;
  border-radius: 8px;
  padding: 8px 10px;
  color: #5d3d13;
  background: #fff8e8;
  box-shadow: 0 8px 18px rgb(58 38 12 / 0.18);
  font-size: 0.82rem;
  font-weight: 760;
}

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

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 4px 14px rgb(18 29 24 / 0.18);
}

.leaflet-control-zoom a {
  color: #17221c;
}

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

.leaflet-rank-marker {
  background: transparent;
  border: 0;
}

.leaflet-rank-marker span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--pin);
  box-shadow: 0 3px 8px rgb(20 28 24 / 0.28);
  font-size: 0.82rem;
  font-weight: 900;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 12px 26px rgb(15 23 18 / 0.22);
}

.leaflet-popup-content {
  width: 260px;
  margin: 14px 16px;
}

.map-popup strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 1rem;
}

.map-popup p {
  margin: 7px 0;
  color: #425149;
}

.map-popup a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 760;
}

.map-tile-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding-left: 24px;
}

.priority-list li::marker {
  font-weight: 800;
}

.priority-list a {
  font-weight: 780;
}

.priority-list span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 28px;
}

.category-strip div {
  border-left: 5px solid var(--accent);
  background: var(--soft);
  border-radius: 8px;
  padding: 13px 14px;
}

.category-strip strong {
  display: block;
  font-size: 1.35rem;
}

.category-strip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.destination-grid {
  padding: 0 0 48px;
}

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

.destination-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  min-height: 310px;
  padding: 18px;
  border-top: 5px solid var(--accent);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.map-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 820;
}

.destination-card p {
  margin: 0;
}

.destination-card dl {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 12px;
  margin: 0;
}

.card-caveat {
  color: #69451a;
  font-size: 0.92rem;
}

.breadcrumb {
  padding: 26px 0 0;
  color: var(--muted);
  font-weight: 720;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(280px, 340px);
  gap: 28px clamp(32px, 5vw, 60px);
  align-items: start;
  padding: 28px 0 64px;
}

.detail-header {
  grid-column: 1;
  min-width: 0;
  max-width: 720px;
  overflow-wrap: break-word;
}

.detail-header h1 {
  max-width: 720px;
  font-size: clamp(2.65rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.detail-header .lede {
  max-width: 680px;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
}

.detail-facts {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  min-width: 0;
  overflow-wrap: break-word;
  padding: 18px;
  position: sticky;
  top: 22px;
}

.detail-facts dl {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.caveat {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.caveat p {
  margin: 6px 0 0;
  color: #69451a;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.note-body {
  grid-column: 1;
  min-width: 0;
  max-width: 720px;
  overflow-wrap: break-word;
}

.note-body > :first-child {
  margin-top: 0;
}

.note-body h2 {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.note-body h2:first-child {
  padding-top: 0;
  border-top: 0;
}

.note-body h3 {
  margin-top: 22px;
}

.note-body p,
.note-body ul {
  color: #2d3b34;
  font-size: 1.02rem;
}

.note-body li + li {
  margin-top: 6px;
}

.site-footer {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.not-found {
  min-height: 70vh;
  display: grid;
  align-content: center;
}

@media (max-width: 960px) {
  .site-header,
  .map-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-header,
  .detail-facts,
  .note-body {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .header-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .priority-panel,
  .detail-facts {
    position: static;
  }

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

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

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

@media (max-width: 640px) {
  main,
  .site-footer {
    width: min(100vw - 22px, 1180px);
  }

  .detail-main {
    width: min(100vw - 22px, 1120px);
  }

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

  .header-facts,
  .cards,
  .priority-list,
  .category-strip,
  .destination-card dl {
    grid-template-columns: 1fr;
  }

  .map-panel,
  .priority-panel,
  .detail-facts,
  .destination-card {
    padding: 14px;
  }

  .real-map {
    min-height: 460px;
  }
}
