:root {
  --ink: #1c1a17;
  --paper: #f5f1e8;
  --line: #d8cfbd;
  --accent: #7a5c2e;
  --accent-soft: #b08d57;
  --green: #143a2b;
  --green-deep: #0e2b20;
  --sea: #2f4858;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

#topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--accent-soft);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

#breadcrumb {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

#breadcrumb a {
  color: var(--accent-soft);
  text-decoration: none;
  cursor: pointer;
}

#breadcrumb a:hover { text-decoration: underline; }

#breadcrumb .sep { opacity: 0.5; }
#breadcrumb .here { color: var(--paper); font-weight: 600; }

.contribute-link {
  background: var(--accent-soft);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.contribute-link:hover { background: #c8a56a; }

#layout {
  display: flex;
  height: calc(100% - 60px);
}

#panel {
  width: 360px;
  min-width: 300px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

#panel-inner { padding: 1.25rem 1.35rem 3rem; }

#place-name {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.15;
}

.blurb {
  margin: 0 0 1.25rem;
  color: #5b5346;
  font-size: 0.95rem;
  line-height: 1.5;
}

#map { flex: 1; }
.leaflet-control-attribution.map-credit-small{width:22px;height:22px;padding:0!important;overflow:hidden;border-radius:50%;background:#fff!important;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,.25);color:transparent;font-size:0}
.leaflet-control-attribution.map-credit-small a{display:none}
.leaflet-control-attribution.map-credit-small::after{content:'i';display:grid;width:22px;height:22px;place-items:center;color:#3f4b43;font:bold 14px Georgia,serif}
.discover-airport{display:grid!important;place-items:center;border:1px solid #28251f;border-radius:50%;background:#fff8df;color:#28251f;font-size:14px;line-height:20px;box-shadow:0 1px 3px rgba(0,0,0,.3)}

.node-item, .story-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.05s;
}

.node-item {
  padding: 0.3rem 0.6rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.node-item .name { font-weight: 500; }

.node-item:hover, .story-item:hover {
  border-color: var(--accent-soft);
}

.node-item:active, .story-item:active { transform: translateY(1px); }

.node-item .name { font-weight: 600; }
.node-item .arrow { float: right; color: var(--accent-soft); }

.featured-label {
  margin-top: 0;
  color: #75533d;
}

.featured-item {
  border: 2px solid #75533d;
  background: #f0e6d8;
  padding: 0.72rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.story-item .story-title { font-weight: 600; display: block; }
.story-item .story-meta {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0.5rem 0 0.75rem;
  font-weight: 600;
}

.story-body { line-height: 1.6; font-size: 0.95rem; }
.story-source {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #7a7161;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.source-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #ece3d2;
  color: #6b5f45;
  margin-right: 0.5rem;
}
.source-tag.facebook { background: #dbe4f0; color: #2e4a7a; }
.source-tag.book { background: #e8ddc2; color: #7a5c2e; }
.source-tag.oral { background: #e2ddd0; color: #6b5f45; }
.source-ref a { color: var(--accent); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 0.4rem;
}
.badge.documented { background: #d7e4d0; color: #33502a; }
.badge.held { background: #e8ddc2; color: #7a5c2e; }
.badge.legend { background: #e4d0d0; color: #7a2e2e; }

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

.empty-note {
  color: #7a7161;
  font-style: italic;
  line-height: 1.5;
}

.section-text {
  margin: 0 0 1.4rem;
  color: #3f3a30;
}

/* Monument filter chips */
.mon-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.6rem;
}
.mon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink);
  cursor: pointer;
}
.mon-chip .mon-dot { background: var(--dot); }
.mon-chip.off {
  opacity: 0.4;
  text-decoration: line-through;
}
.mon-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.mon-count {
  font-size: 0.72rem;
  color: #7a7161;
  margin: 0 0 0.5rem;
}
.place-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  margin: 0.35rem 0 0.65rem;
}
.place-tools input,
.place-tools select,
.place-tools button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.5rem 0.55rem;
}
.place-tools select { grid-column: 1 / -1; }
.place-tools button { cursor: pointer; font-weight: 600; }
.place-tools button:hover { border-color: var(--accent-soft); }
.mon-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 5px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.mon-item:hover { border-color: var(--accent-soft); }
.mon-item .mon-name { font-weight: 500; flex: 1; }
.mon-item .mon-type {
  max-width: 42%;
  text-align: right;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.place-photo {
  margin: 0.4rem 0 1rem;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 7px;
  overflow: hidden;
}
.place-photo img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}
.place-photo figcaption {
  padding: 0.45rem 0.6rem;
  font-size: 0.68rem;
  color: #6f6759;
}
.place-photo figcaption a { color: var(--accent); }
.place-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.65rem;
  margin: 0.5rem 0 1rem;
  padding: 0.7rem;
  background: #eee8db;
  border-radius: 6px;
  font-size: 0.78rem;
}
.place-facts dt { font-weight: 700; color: #625a4e; }
.place-facts dd { margin: 0; }
.place-description { white-space: pre-line; }
.record-warning {
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--accent-soft);
  background: #f1eadb;
  color: #5b5346;
  font-size: 0.8rem;
  line-height: 1.45;
}
.place-source a { color: var(--accent); font-weight: 600; }
.county-map-intro { margin-top: -0.25rem; }
.county-result {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
}

.leaflet-popup-content { margin: 10px 12px 12px; }
.map-dot-preview { width: 255px; color: var(--ink); line-height: 1.35; }
.map-dot-preview img {
  display: block;
  width: calc(100% + 24px);
  height: 145px;
  margin: -10px -12px 9px;
  object-fit: contain;
  background: #171914;
  border-radius: 12px 12px 0 0;
}
.map-dot-preview strong { display: block; font-size: 1rem; line-height: 1.2; }
.map-dot-kind { margin-top: 0.2rem; color: #6b5f4e; font-size: 0.76rem; }
.map-dot-photo-note {
  margin: -0.18rem 0 0.45rem;
  padding: 0.35rem 0.45rem;
  background: #f4eee2;
  color: #6b5f4e;
  font-size: 0.7rem;
}
.map-dot-height { margin-top: 0.28rem; color: var(--green-deep); font-size: 0.82rem; font-weight: 800; }
.map-dot-location-warning {
  margin-top: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-left: 3px solid #a45b32;
  background: #f5e8dc;
  color: #713a24;
  font-size: 0.75rem;
  font-weight: 800;
}
.map-dot-preview p { margin: 0.55rem 0; font-size: 0.8rem; }
.map-dot-record { margin-bottom: 0.6rem; color: #6b5f4e; font-size: 0.7rem; }
.map-dot-preview a {
  display: block;
  padding: 0.48rem 0.65rem;
  border-radius: 5px;
  background: var(--accent);
  color: #fffdf8;
  text-align: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}
.map-dot-preview .google-maps-link {
  margin-bottom: 0.42rem;
  background: var(--green);
}
.map-dot-preview .google-maps-link:hover { background: var(--green-deep); }
.map-dot-preview .photo-contribution-link {
  margin-bottom: 0.42rem;
  border: 1px solid var(--accent-soft);
  background: #fff8e8;
  color: var(--ink);
}
.map-dot-preview .photo-contribution-link:hover { background: #f0e2c4; }
.map-dot-preview a:hover { background: #8a6a36; }

/* distance from where you are now */
.locate-btn {
  display: block;
  width: 100%;
  border: 1px solid var(--accent-soft);
  background: #fffdf8;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  margin: 0 0 1.1rem;
  cursor: pointer;
}
.locate-btn:hover { background: #f3ead6; }
.locate-btn.on { background: #eaf1e6; border-color: #2f6b3f; color: #2f6b3f; }
.dist {
  display: inline-block;
  margin-left: 0.4rem;
  color: #2f6b3f;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

/* beg-for-stories call to action */
.stories-cta {
  border: 1px solid var(--accent-soft);
  background: #fbf6ea;
  border-radius: 8px;
  padding: 0.9rem 1rem 1rem;
  margin: 0.4rem 0 1.4rem;
}
.stories-cta strong { display: block; font-size: 1rem; margin-bottom: 0.3rem; }
.stories-cta p { margin: 0 0 0.8rem; font-size: 0.9rem; line-height: 1.5; color: #5b5346; }
.cta-add {
  display: inline-block;
  background: var(--accent);
  color: #fffdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  border-radius: 5px;
}
.cta-add:hover { background: #8a6a36; }

@media (max-width: 720px) {
  html, body { height: auto; }
  #topbar { flex-wrap: wrap; gap: 0.6rem 1rem; }
  #layout { flex-direction: column; height: auto; }
  #panel {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  #map {
    width: 100%;
    height: 70vh;
    flex: none;
  }
  .map-dot-preview { width: 220px; }
  .map-dot-preview img { height: 120px; }
}
