/* The Weeki Wachee Dive Guide (/weeki-wachee-dive-guide/): the
   kicker + h1 + lede head (the story head), then one idea per screen: the
   Hospital Hole explainer (the cross-section beside its hairline legend, the
   science two columns), the 360° player, the tide planner (the map with the
   flow drawn on a canvas over it), the dive-day table.

   Two things here are truthful, not theme tokens: the cross-section's scene
   colors (components/hospital-hole-diagram.js) and their legend swatches
   below, and the particle colors on the map (in the page script), which sit
   on the always-light map render. */

.guide-head { padding-top: clamp(2rem, 6vw, 4rem); padding-bottom: 0; }
.guide-head h1 { margin-bottom: 1rem; }

/* ===== Hospital Hole ===== */

/* The cross-section beside its legend and lede; stacked on phones */
.hole-figure {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin: var(--lg) 0 var(--xl);
}

.hole-svg { border: var(--hair); }
.hh-svg { width: 100%; height: auto; }

.hole-legend { margin-top: 0; }
.hole-legend li { padding: 0.8rem 0; }
.hole-legend li span:first-child { display: flex; align-items: center; gap: 0.6rem; }
.hole-aside .lede { margin-top: var(--md); }

/* The legend swatches mirror the scene's fills */
.sw { flex: none; width: 0.9rem; height: 0.9rem; }
.sw-murk  { background: #86a89e; }
.sw-clear { background: #56bdaf; }
.sw-dark  { background: #0b120c; }
.sw-rim   { background: #c2ad84; }
.sw-floor { background: #6f6048; }

/* The science, two columns; the safety note sits under a hairline */
.hole-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lg) clamp(2rem, 5vw, 5rem);
}

.hole-grid p { color: var(--text-2); }
.hole-safety { grid-column: 1 / -1; padding-top: var(--lg); border-top: var(--hair); }
.hole-safety p { color: var(--text); }

.hole-sources { margin-top: var(--xl); }
.hole-sources summary { cursor: pointer; font-weight: var(--regular); color: var(--text); }
.hole-sources ul { margin: var(--sm) 0 0; padding-left: 1.1rem; }

@media (max-width: 820px) {
  .hole-figure, .hole-grid { grid-template-columns: 1fr; }
}

/* ===== The 360° dive ===== */

.dive-vr .lede { margin-bottom: var(--lg); }
.vr-figure figcaption { text-align: center; margin-top: var(--sm); }

/* ===== The tide planner ===== */

.planner .lede { margin-bottom: var(--lg); }

/* Controls: the date stepper and the time-of-day slider on one line */
.tides-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--md) var(--lg);
  flex-wrap: wrap;
}

.tides-controls .field { margin-bottom: 0; }
.tides-controls .field-label { display: flex; justify-content: space-between; gap: var(--sm); }
.tides-controls output { font-size: var(--body); letter-spacing: 0; text-transform: none; color: var(--text); }

.date-group { display: flex; align-items: center; gap: var(--xs); }
.day-btn { border: var(--hair); }
.day-btn:disabled { opacity: 0.35; pointer-events: none; }
#tide-date { width: auto; }

.time-field { flex: 1; min-width: min(100%, 280px); }

input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); }

/* The map and the flow overlay */
.mapwrap {
  position: relative;
  margin: var(--md) 0 0;
  aspect-ratio: 2050 / 1121;
  border: var(--hair);
  overflow: hidden;
}

.mapwrap img { width: 100%; height: auto; }

.mapwrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Landmark markers: the div is the dot, centered on the spot; the label chip
   floats above it (positioned on its own for phones) */
.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--sea);
  border: 2px solid var(--white);
  pointer-events: none;
}

.map-marker.coral { background: var(--coral); }

.map-marker span {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.55rem;
  background: var(--white);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: var(--bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The one-line readout: mono, in the text color */
.tides-readout {
  margin-top: var(--sm);
  font-family: var(--mono);
  font-size: var(--small);
  color: var(--text);
}

/* The reach-lag dial under the note */
.lag-cal { max-width: 30rem; margin-top: var(--md); }
.lag-cal .field-label { display: flex; justify-content: space-between; gap: var(--sm); }
.lag-cal output { font-size: var(--small); letter-spacing: 0; text-transform: none; color: var(--text); }

@media (max-width: 860px) {
  .tides-controls { flex-direction: column; align-items: stretch; }
  .date-group { justify-content: space-between; }
  #tide-date { flex: 1; text-align: center; }
  .map-marker { width: 0.7rem; height: 0.7rem; }
  .map-marker span { font-size: 0.55rem; padding: 0.15rem 0.4rem; }
  /* Hospital Hole sits near the right edge: right-align its label to the dot */
  .map-marker.coral span { left: auto; right: -0.5rem; transform: none; }
}

/* ===== The dive-day table ===== */

.dive-days .lede { margin-bottom: var(--lg); }

.dive-controls {
  display: flex;
  align-items: center;
  gap: var(--sm);
  flex-wrap: wrap;
  margin-bottom: var(--sm);
}

.dive-controls .field-label { margin: 0; }
.dive-pills { display: flex; gap: var(--xs); flex-wrap: wrap; }
.dive-pill { background: transparent; cursor: pointer; transition: color var(--fast), border-color var(--fast), background var(--fast); }
.dive-pill:hover { color: var(--accent); border-color: var(--accent); }
.dive-pill.solid { background: var(--accent); color: var(--on-accent); }
.dive-check { margin: 0 0 0 auto; font-size: var(--small); }

.dive-table { border-top: var(--hair); }

/* A day: the date beside its two bands, a hairline under each */
.dive-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--sm);
  align-items: center;
  width: 100%;
  padding: 0.5rem 0;
  border: none;
  border-bottom: var(--hair);
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

button.dive-row:hover .dive-date b { color: var(--accent); }
.dive-row.is-sunday .dive-date b { color: var(--accent); font-weight: var(--bold); }

/* The hour axis rides along: sticky inside .dive-table, so it pins under the
   site header only while the table is on screen. z-index because the day rows
   come later in the DOM and their absolutely-positioned bands would otherwise
   paint over it. --bg reads as the page behind it. */
.dive-head-row {
  position: sticky;
  top: var(--header-h);
  z-index: 1;
  background: var(--bg);
  cursor: default;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: var(--tiny);
}

.dive-date { display: flex; flex-direction: column; line-height: 1.25; }
.dive-date b { font-size: var(--small); font-weight: var(--regular); }
.dive-date span { font-family: var(--mono); font-size: var(--tiny); color: var(--text-2); }

.dive-bands { position: relative; display: flex; flex-direction: column; gap: 3px; }
.dive-band { display: block; position: relative; height: 0.65rem; }

/* the colored span within a band, trimmed by the dive length */
.dive-fill { position: absolute; top: 0; bottom: 0; left: 0; }

/* faint hour gridlines over the bands (8 hours across) */
.dive-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0 calc(100% / 8 - 1px), var(--border) calc(100% / 8 - 1px) calc(100% / 8));
  opacity: 0.6;
}

.dive-hours { position: relative; height: 1rem; }
.dive-hours i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; white-space: nowrap; }

#dive-more { margin-top: var(--md); }

.dive-legend {
  display: flex;
  gap: var(--md);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--sm);
}

.dive-legend .dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: -1px; }

.dive-note { padding: var(--sm) 0; color: var(--text-2); font-size: var(--small); }

@media (max-width: 860px) {
  .dive-row { grid-template-columns: 3.4rem 1fr; gap: 0.5rem; }
  .dive-date b { font-size: var(--tiny); }
  .dive-date span { font-size: 0.62rem; }
}
