/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111;
  --bg2: #1a1a1a;
  --bg3: #222;
  --border: #333;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #e8a020;
  --accent2: #4a9eda;
  --radius: 8px;
  --nav-h: 52px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 48px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.site-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.header-sub {
  margin-top: 8px;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */
.map-section {
  position: relative;
  height: 400px;
  border-bottom: 1px solid var(--border);
}
#map { width: 100%; height: 100%; }
.map-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Day Navigation ───────────────────────────────────────────────────────── */
.day-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  overflow: hidden;
}
.day-nav-inner {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
  align-items: center;
}
.day-nav-inner::-webkit-scrollbar { display: none; }

.nav-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  transition: all .2s;
  white-space: nowrap;
}
.nav-chip:hover { color: var(--text); border-color: #555; }
.nav-chip.active { background: var(--accent); color: #000; border-color: var(--accent); }
.nav-chip.section-singapur { border-color: #2a4a6a; }
.nav-chip.section-singapur.active { background: var(--accent2); color: #fff; border-color: var(--accent2); }

/* ── Day Sections ─────────────────────────────────────────────────────────── */
.day-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px;
  border-bottom: 1px solid var(--border);
}
.day-section:last-child { border-bottom: none; }

.day-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}
.day-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  color: #fff;
}
.day-date {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg3);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.day-location {
  font-size: 13px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.day-location::before { content: "📍"; font-size: 12px; }

.day-bullets {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 24px;
}
.day-bullets li {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.day-bullets li::before { content: "–"; color: var(--accent); }

/* Strava / externe Links */
.day-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all .2s;
}
.ext-link:hover { color: var(--text); border-color: #555; }
.ext-link.strava { border-color: #fc5200; color: #fc5200; }
.ext-link.strava:hover { background: #fc5200; color: #fff; }
.ext-link.garmin { border-color: #007dc5; color: #007dc5; }
.ext-link.garmin:hover { background: #007dc5; color: #fff; }

/* ── Photo Grid ───────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
}

.photo-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg3);
}
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  display: block;
}
.photo-item:hover img { transform: scale(1.04); }

/* Video items */
.photo-item.is-video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  pointer-events: none;
  z-index: 1;
}
.photo-item.is-video .video-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: #1a1a1a; /* visible while frame loads */
}

/* Garmin / Strava screenshots section */
.dive-section {
  margin-top: 24px;
  margin-bottom: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.dive-section-title {
  font-size: 13px;
  color: #007dc5;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* ── Dive Cards (FIT data) ────────────────────────────────────────────────── */
.dive-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.dive-card {
  background: #0d1f2d;
  border: 1px solid #1a4060;
  border-radius: var(--radius);
  overflow: hidden;
}
.dive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 6px;
}
.dive-num {
  font-size: 12px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dive-time {
  font-size: 12px;
  color: var(--text-muted);
}
.dive-profile {
  padding: 0 10px;
}
.depth-svg {
  width: 100%;
  height: auto;
  display: block;
}
.dive-stats {
  display: flex;
  justify-content: space-around;
  padding: 8px 10px 10px;
  border-top: 1px solid #1a4060;
}
.dive-stat { text-align: center; }
.ds-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #7dd3fc;
}
.ds-lbl {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.dive-meta {
  padding: 8px 14px 10px;
  border-top: 1px solid #1a4060;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dive-meta-name {
  font-size: 14px;
  font-weight: 600;
  color: #e8e8e8;
}
.dive-meta-site {
  font-size: 13px;
  color: var(--text-muted);
}
.padi-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: #444;
  transition: color .2s;
}
.padi-link:hover { color: var(--accent2); }
.dive-screenshot {
  width: 100%;
  display: block;
  cursor: pointer;
  border-top: 1px solid #1a4060;
  transition: opacity .2s;
}
.dive-screenshot:hover { opacity: .85; }

/* Hike card – green theme */
.hike-card {
  background: #0d1f0d;
  border-color: #1e4a1e;
}
.hike-card .dive-card-header { border-color: #1e4a1e; }
.hike-card .dive-num { color: #b8e08a; }
.hike-card .dive-stats { border-color: #1e4a1e; }
.hike-card .ds-val { color: #b8e08a; }
.hike-card .dive-screenshot { border-color: #1e4a1e; }

/* wider cells for stats screenshots (non-square content) */
.photo-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.photo-grid--wide .photo-item {
  aspect-ratio: 16/9;
}

/* ── Section Separator ────────────────────────────────────────────────────── */
.section-break {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 32px 24px 0;
  max-width: 1400px;
  margin: 0 auto;
}
.section-break-line { flex: 1; height: 1px; background: var(--border); }
.section-break-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lb-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
}
.lb-backdrop.active { display: block; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.active { display: flex; }

.lb-media-wrap {
  max-width: 92vw;
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img, .lb-video {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: var(--radius);
  object-fit: contain;
  display: none;
}
.lb-img.active, .lb-video.active { display: block; }

.lb-caption {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.lb-btn {
  position: fixed;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 1002;
}
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-close { top: 16px; right: 16px; font-size: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ── Leaflet dark override ────────────────────────────────────────────────── */
.leaflet-container { background: #1a1a2e !important; }
.leaflet-tile { filter: brightness(.85) saturate(.9); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
