/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --sand:        #f5f0e8;
  --sand-dark:   #ede6d8;
  --charcoal:    #1e1e1e;
  --charcoal-mid:#3a3530;
  --stone:       #8a8075;
  --red:         #d42b1f;
  --red-light:   #f5e6e4;
  --terracotta:  #d42b1f;
  --terra-light: #f5e6e4;
  --sage:        #7a8c72;
  --white:       #ffffff;
  --border:      #d8cfc4;
  --rule:        #d8cfc4;

  --font-display:'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:   'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-ui:     'Helvetica Neue', Helvetica, Arial, sans-serif;

  --header-h:    48px;
  --radius:      0px;
  --transition:  0.18s ease;
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-display);
  background: var(--sand);
  color: var(--charcoal);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
img { display: block; width: 100%; }

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--sand);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.header-property {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}
.header-back {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity var(--transition);
}
.header-back:hover { opacity: 1; text-decoration: none; }

/* ─── TOC PAGE ───────────────────────────────────────────────────────────── */
.toc-view {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}
.page-eyebrow {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.toc-item:hover { background: var(--sand-dark); }
.toc-item:hover .toc-arrow { opacity: 1; }
.toc-n {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  color: var(--stone);
  min-width: 34px;
  letter-spacing: 0.04em;
  padding-top: 2px;
  flex-shrink: 0;
}
.toc-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--charcoal);
}
.toc-arrow {
  font-size: 16px;
  color: var(--stone);
  opacity: 0.45;
  transition: opacity var(--transition);
  padding-left: 12px;
}

/* ─── CATEGORY VIEW ──────────────────────────────────────────────────────── */
.cat-view {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--sand);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
.cat-view.open { transform: translateX(0); }

.cat-view-bar {
  display: flex;
  align-items: center;
  background: var(--sand-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 40px;
  overflow: hidden;
}

/* Horizontal category scroll strip */
.cat-strip {
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
  height: 100%;
}
.cat-strip::-webkit-scrollbar { display: none; }

.cat-strip-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--stone);
  padding: 0 14px;
  height: 100%;
  border: none;
  background: none;
  border-right: 1px solid var(--border);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.cat-strip-btn:hover { color: var(--charcoal); background: var(--sand); }
.cat-strip-btn.active {
  color: var(--charcoal);
  font-weight: 600;
  background: var(--sand);
  box-shadow: inset 0 -2px 0 var(--red);
}

/* Guide / Map toggle */
.cat-view-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  height: 100%;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.cat-tab {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  padding: 0 0 1px;
  border: none;
  background: none;
  transition: color var(--transition);
}
.cat-tab:hover { color: var(--charcoal); }
.cat-tab.active {
  color: var(--charcoal);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

/* ─── CONTENT PANEL ──────────────────────────────────────────────────────── */
.content-panel {
  flex: 1;
  padding: 32px 24px 48px;
  overflow-y: auto;
  height: 100%;
}

.category-header {
  margin-bottom: 28px;
}
.category-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--charcoal);
  margin-bottom: 12px;
}
.category-rule {
  width: 32px;
  height: 2px;
  background: var(--red);
  margin-bottom: 14px;
}
.category-header p {
  font-size: 13px;
  color: var(--stone);
  font-weight: 400;
  line-height: 1.7;
  max-width: 520px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.subcategory-section { margin-bottom: 44px; }
.subcategory-section:last-child { margin-bottom: 0; }
.subcategory-header {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--red);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.subcategory-header::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--red);
  flex-shrink: 0;
  border-radius: 50%;
}

/* ─── FLOATING BACK PILL ─────────────────────────────────────────────────── */
.back-pill {
  position: fixed;
  bottom: 28px;
  left: 20px;
  z-index: 200;
  padding: 9px 18px;
  background: var(--sand);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal-mid);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.09);
}
.back-pill.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-pill:hover { background: var(--sand-dark); }

/* ─── PLACE CARD ─────────────────────────────────────────────────────────── */
.place-card {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition);
}
.place-card:hover { border-color: var(--terracotta); }
.place-card.highlighted { border-color: var(--terracotta); background: #fdf8f5; }

.card-image-wrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--sand-dark);
  position: relative;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}
.card-image-wrap.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
}
.card-image-placeholder {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ── Carousel ────────────────────────────────────────────────────────────── */
.carousel-wrap { position: relative; }
.carousel-track { width: 100%; height: 100%; }
.carousel-slide { display: none; width: 100%; height: 100%; }
.carousel-slide.active { display: block; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide img.portrait,
.card-image-wrap > img.portrait {
  object-fit: contain;
  background: var(--sand);
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.82);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
  padding: 0 0 2px;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-wrap:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: rgba(255,255,255,0.97); }
.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90%;
  gap: 5px;
  z-index: 2;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.carousel-dot.active { background: #fff; transform: scale(1.3); }

.card-body { padding: 18px 20px 16px; }
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 12px;
}
.card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.3;
}
.card-drive {
  font-size: 11px;
  color: var(--stone);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}
.card-description {
  font-size: 13px;
  color: var(--charcoal-mid);
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: 12px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.card-link {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-link:hover { text-decoration: underline; }

/* Hiking extras */
.hike-stats { display: flex; gap: 16px; margin-bottom: 10px; }
.hike-stat { display: flex; flex-direction: column; gap: 1px; }
.hike-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
}
.hike-stat-value { font-size: 13px; font-weight: 500; color: var(--charcoal); }
.hike-difficulty-easy     { color: var(--sage); }
.hike-difficulty-moderate { color: var(--terracotta); }
.hike-difficulty-strenuous{ color: #9b3a2a; }
.hike-map-embed {
  width: 100%;
  height: 200px;
  border: 0;
  display: block;
  background: var(--sand-dark);
  margin-top: 4px;
}

/* ─── MAP VIEW ───────────────────────────────────────────────────────────── */
.map-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.map-view.active { display: flex; }

#map { flex: 0 0 58%; width: 100%; min-height: 280px; }

.map-filter-strip {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.map-filter-strip::-webkit-scrollbar { display: none; }
.map-filter-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border: 1px solid var(--border);
  color: var(--stone);
  background: var(--white);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.map-filter-btn:hover  { border-color: var(--terracotta); color: var(--terracotta); }
.map-filter-btn.active { background: var(--terracotta); border-color: var(--terracotta); color: var(--white); }

/* ─── CONDENSED LIST (map mode) ──────────────────────────────────────────── */
.condensed-list {
  flex: 1;
  overflow-y: auto;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.condensed-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  border-left: 2px solid transparent;
}
.condensed-card:hover { background: var(--sand); }
.condensed-card.active { background: var(--terra-light); border-left-color: var(--terracotta); }
.ccard-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ccard-body { flex: 1; min-width: 0; }
.ccard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ccard-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccard-drive { font-size: 10px; color: var(--stone); white-space: nowrap; flex-shrink: 0; }
.ccard-bottom { margin-top: 1px; }
.ccard-cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
}
.condensed-empty { font-size: 12px; color: var(--stone); padding: 16px; }

/* ─── MAP LABELS ─────────────────────────────────────────────────────────── */
.map-label-tag {
  position: absolute;
  background: rgba(255,255,255,0.93);
  color: var(--charcoal);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border: 1px solid rgba(0,0,0,0.13);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.map-label-home {
  background: var(--charcoal);
  color: var(--sand);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,28,26,0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  font-size: 20px;
  color: var(--stone);
  padding: 12px 16px;
  background: var(--white);
  z-index: 1;
  line-height: 1;
}
.modal-close:hover { color: var(--charcoal); }
.modal-content { padding: 0 28px 28px; }
.modal-image {
  width: calc(100% + 56px);
  margin: 0 -28px 20px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.modal-category-tag {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 6px;
}
.modal-name { font-size: 22px; font-weight: 400; margin-bottom: 12px; line-height: 1.2; }
.modal-description {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--charcoal-mid);
  margin-bottom: 20px;
}
.modal-details {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-detail-row { display: flex; gap: 12px; font-size: 12px; }
.modal-detail-label {
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--stone);
  width: 64px;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.modal-detail-value { color: var(--charcoal); }
.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.modal-link-btn {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid var(--border);
  color: var(--charcoal);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal-link-btn:hover {
  background: var(--charcoal);
  color: var(--white);
  border-color: var(--charcoal);
  text-decoration: none;
}
.modal-link-btn.primary {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--white);
}
.modal-link-btn.primary:hover { background: #a84e2f; border-color: #a84e2f; }
