/* Gather brand colour system — "forest floor and new growth". */
:root {
  --forest-floor: #0a0f09; /* app background */
  --shadow-moss: #1a2e10; /* card backgrounds, surfaces */
  --deep-canopy: #2d5016; /* primary accent, CTAs */
  --new-growth: #6aaa40; /* active items, spot pins */
  --morning-light: #a8d878; /* primary text on dark */
  --pale-grass: #d4e8c8; /* wordmark, headings on dark */
  --photo-paper: #f4f0eb; /* light surfaces */
  --golden-hour: #c8b478; /* epic tier, accents */
  --open-sky: #7ab8c8; /* rare tier, links */
  --undergrowth: #3a5030; /* borders, dividers, secondary text */

  --bg: var(--forest-floor);
  --surface: var(--shadow-moss);
  --text: var(--morning-light);
  --heading: var(--pale-grass);
  --muted: #7e9a6d;
  --line: var(--undergrowth);

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 4px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--heading);
  letter-spacing: -0.01em;
  margin: 0;
}

/* Eyebrows / labels — tracked wide, sentence case, never shouting. */
.eyebrow {
  font-family: var(--ui);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--new-growth);
  text-transform: uppercase;
  margin: 6px 0 0;
}

/* ---------- Sign-in gate ---------- */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 32px 28px;
  box-shadow: var(--shadow);
}
.logo { margin-bottom: 16px; }
.gate-card .wordmark { font-size: 40px; line-height: 1; }
.gate-sub {
  font-family: var(--serif);
  margin: 18px 0 30px;
  color: var(--text);
  font-size: 16px;
}
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  background: var(--photo-paper);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.btn-google:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.btn-google:active { transform: translateY(1px); }
.gate-msg { margin: 16px 0 0; min-height: 18px; font-size: 14px; color: var(--golden-hour); }
.byline {
  margin: 28px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  background: rgba(10, 15, 9, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-word {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--heading);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.btn-ghost {
  padding: 7px 13px;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-ghost:hover { background: var(--surface); border-color: var(--new-growth); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 22px;
  max-width: 1400px;
  margin: 0 auto;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-photo {
  position: relative;
  cursor: zoom-in;
  background: var(--forest-floor);
  aspect-ratio: 3 / 2;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }

.card-meta { padding: 13px 15px 15px; }
.card-cap {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.4;
  color: var(--heading);
  margin: 0 0 11px;
}
.card-cap.placeholder { color: var(--muted); }

/* Location row inside the box: the map thumbnail beside the data strip.
   Clicking the thumbnail opens a larger, readable map in the lightbox. */
.card-loc { display: flex; align-items: center; gap: 13px; }
.map-thumb {
  flex: none;
  width: 124px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--new-growth);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--forest-floor);
  cursor: zoom-in;
}
.map-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Contact-sheet data strip — monospace, like darkroom metadata. */
.card-data {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.card-data .place { color: var(--morning-light); }
.card-data .coord { color: var(--new-growth); }
.card-data .credit { color: var(--undergrowth); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-family: var(--serif); }
.foot {
  text-align: center;
  padding: 30px 20px 44px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 4, 0.94);
  backdrop-filter: blur(4px);
}
.lb-figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lb-figure img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lb-cap { display: block; margin-top: 14px; }
.lb-caption { display: block; font-family: var(--serif); color: var(--heading); font-size: 16px; }
.lb-meta { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 1;
  color: var(--text);
  background: rgba(26, 46, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.lb-close:hover { background: var(--surface); }

/* ---------- Interactive map ---------- */
.map { width: 100%; height: calc(100dvh - 54px); }
.pin {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  transition: transform 0.08s ease;
}
.pin:hover { transform: scale(1.1); }

.maplibregl-popup-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 0 6px; }
.pin-pop { width: 240px; max-width: 100%; }
.pin-pop img { width: 100%; border-radius: var(--radius); cursor: zoom-in; display: block; }
.pin-pop .pin-cap { font-family: var(--serif); color: var(--heading); font-size: 14px; margin-top: 7px; }
.pin-pop .pin-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; }

.maplibregl-ctrl-group { background: var(--surface); border: 1px solid var(--line); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-attrib { background: rgba(10, 15, 9, 0.72) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted); }

@media (max-width: 600px) {
  .who { display: none; }
}

[hidden] { display: none !important; }
