/* =====================================================================
   JGE Master Plan Map: front-end styles
   Editorial register: cream basemap, EB Garamond labels, Inter chrome.
   Mobile-first. Touch target minimum 44x44. No accent colour on links.
   ===================================================================== */

:root {
  --cream: #F5F1E8;
  --ink: #1C1917;
  --metadata: #57534E;
  --stroke: #8B7355;
  --hover: rgba(28, 25, 23, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ---------- chrome (header + footer bars over the map) ---------- */

.map-chrome {
  padding: 12px 16px;
  background: var(--cream);
  border-bottom: 1px solid rgba(28, 25, 23, 0.08);
  z-index: 2;
}

.map-chrome--bottom {
  border-top: 1px solid rgba(28, 25, 23, 0.08);
  border-bottom: none;
  font-size: 11px;
  color: var(--metadata);
  line-height: 1.4;
}

.map-chrome h1 {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
}

.map-chrome__byline {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--metadata);
}

.map-chrome a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-chrome--bottom a {
  color: var(--metadata);
}

/* ---------- map container ---------- */

#map {
  width: 100%;
  height: 100%;
  background: var(--cream);
}

.mapboxgl-canvas { outline: none; }

/* ---------- tooltip (desktop hover) ---------- */

#tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 12px;
  max-width: 280px;
  box-shadow: 2px 2px 0 rgba(28, 25, 23, 0.08);
  z-index: 3;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

#tooltip[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0);
}

#tooltip .tt-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  line-height: 1.1;
  margin: 0 0 4px;
}

#tooltip .tt-lede {
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 6px;
  color: var(--ink);
}

#tooltip .tt-meta {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--metadata);
  margin: 0;
}

#tooltip .tt-meta--under-construction {
  font-style: italic;
}

/* ---------- bottom sheet (mobile + tap-on-desktop) ---------- */

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60vh;
  background: var(--cream);
  border-top: 1px solid var(--ink);
  box-shadow: 0 -2px 12px rgba(28, 25, 23, 0.08);
  padding: 20px 20px 28px;
  transform: translateY(100%);
  transition: transform 180ms ease-out;
  z-index: 4;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet[aria-hidden="false"] {
  transform: translateY(0);
}

.bottom-sheet__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.bottom-sheet h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.bottom-sheet p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; }

.bottom-sheet .cta {
  display: inline-block;
  margin-top: 6px;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bottom-sheet .cta:hover, .bottom-sheet .cta:focus { background: var(--hover); }

/* ---------- responsive ---------- */

@media (min-width: 768px) {
  .map-chrome { padding: 16px 24px; }
  .map-chrome h1 { font-size: 26px; }
  .bottom-sheet { left: auto; right: 16px; bottom: 16px; max-width: 380px; max-height: 70vh; border-radius: 2px; border: 1px solid var(--ink); }
}

/* ---------- accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  #tooltip, .bottom-sheet { transition: none; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
