/* Tide station pages — builds on /landing/site.css theme variables. */
.tide-today {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
  margin: 8px 0 32px;
}
.tide-now {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tide-big { font-size: 40px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.tide-sub { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.tide-next { margin-top: 14px; color: var(--text-primary); font-size: 15px; }
.tide-next b { color: var(--accent); }

.tide-curve {
  flex: 1 1 420px;
  min-width: 300px;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.tc-lbl { fill: var(--text-secondary); font-size: 12px; font-family: inherit; }

.tide-cal { width: 100%; border-collapse: collapse; margin: 4px 0 24px; }
.tide-cal th[scope="row"] {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px 12px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 120px;
  border-top: 1px solid var(--border);
}
.tide-cal td { padding: 12px 0; border-top: 1px solid var(--border); }
.tide-ev {
  display: inline-block;
  margin: 0 18px 6px 0;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
}
.tide-ev.hi b { color: #58A6FF; }
.tide-ev.lo b { color: #8B949E; }

.tide-source { color: var(--text-secondary); font-size: 12px; margin-top: 8px; }
.tide-app { color: var(--text-secondary); font-size: 14px; }

/* Index / stations list */
.tide-filter {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  margin: 8px 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
}
.tide-list { width: 100%; border-collapse: collapse; }
.tide-list th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.tide-list td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 15px; }
.tide-list a { color: var(--accent); text-decoration: none; }
.tide-list a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .tide-cal th[scope="row"] { width: 88px; font-size: 13px; }
  .tide-big { font-size: 32px; }
}

/* Monthly tide calendar grid — mirrors the in-app TideCalendarCell. */
.cal-title { font-weight: 700; color: var(--text-primary); margin: 4px 0 10px; font-size: 16px; }
.tide-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 0 0 24px;
}
.cal-h {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding-bottom: 2px;
}
.cal-pad { min-height: 0; }
.cal-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 4px 5px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-cell.today { border-color: var(--accent); background: rgba(88, 166, 255, 0.08); }
.cal-day { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.cal-cell.today .cal-day { color: var(--accent); }
.cal-spark { width: 100%; height: 34px; display: block; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.2; }
.cal-ev { font-size: 10px; font-weight: 600; }
.cal-ev.hi { color: #58A6FF; }
.cal-ev.lo { color: #8B949E; }

@media (max-width: 640px) {
  .tide-calendar { gap: 3px; }
  .cal-cell { min-height: 58px; padding: 3px; }
  .cal-h { font-size: 10px; }
  .cal-spark { height: 26px; }
  .cal-ev { font-size: 8px; }
}

/* Phase 2: moon phase, negative tides, flood/low finder. */
.cal-moon { margin-left: 3px; font-size: 10px; }
.cal-ev.neg { color: #E5484D; font-weight: 700; }
.cal-cell.has-neg { box-shadow: inset 0 -2px 0 rgba(229, 72, 77, 0.5); }

.tide-neg-note {
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}
.tide-neg-note b { color: #E5484D; }

.tide-finder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0 14px;
  font-size: 14px;
  color: var(--text-secondary);
}
.tide-finder .tf-title { font-weight: 700; color: var(--text-primary); }
.tide-finder label { color: var(--text-secondary); }
.tide-finder input {
  width: 68px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
}
.tf-count { color: var(--accent); font-weight: 600; }

/* Finder highlights on the calendar cells. */
.cal-cell.hit-flood { border-color: #34C759; box-shadow: inset 0 0 0 1px #34C759; }
.cal-cell.hit-low { background: rgba(229, 72, 77, 0.12); border-color: #E5484D; }
/* A day matching BOTH filters gets the tide-split outline: top half blue
   (cleared the flood line), bottom half red (dropped below the low line).
   Masked gradient ring on a pseudo-element so it follows the rounded corners. */
.cal-cell.hit-flood.hit-low {
  position: relative;
  border-color: transparent;
  box-shadow: none;
}
.cal-cell.hit-flood.hit-low::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  padding: 2px;
  background: linear-gradient(to bottom, #58A6FF 0 50%, #E5484D 50% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Solunar "best fishing times" table. */
.sol-intro { color: var(--text-secondary); font-size: 14px; max-width: 640px; }
.sol-table { width: 100%; border-collapse: collapse; margin: 4px 0 24px; }
.sol-table th { text-align: left; color: var(--text-secondary); font-size: 13px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sol-table td, .sol-table th[scope="row"] { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.sol-table th[scope="row"] { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.sol-moon { font-size: 12px; }
.sol-major { color: var(--text-primary); }
.sol-minor { color: var(--text-secondary); }
.sol-score {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 700;
  color: #0D1117;
  background: var(--accent);
  opacity: calc(0.35 + var(--p, 50) / 100 * 0.65);
}
@media (max-width: 620px) {
  .sol-table td, .sol-table th { padding: 8px; font-size: 13px; }
}

/* Live "current conditions" card (client-fetched from nearest station). */
.wx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 0 28px;
}
.wx-head { font-weight: 700; color: var(--text-primary); font-size: 15px; margin-bottom: 12px; }
.wx-src { color: var(--text-secondary); font-weight: 400; font-size: 13px; }
.wx-grid { display: flex; flex-wrap: wrap; gap: 22px; }
.wx-tile { display: flex; flex-direction: column; }
.wx-v { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.wx-l { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* Breadcrumbs (Tides › State › Station) — hub/spoke navigation. */
.crumbs {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crumbs a { color: var(--accent, #4FC3F7); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .crumb-sep { color: var(--text-secondary); opacity: 0.6; }
.crumbs [aria-current="page"] { color: var(--text-primary); }

/* National hub — grid of state cards linking to each state hub. */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 28px;
}
.state-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.state-card:hover { border-color: var(--accent, #4FC3F7); transform: translateY(-2px); }
.sc-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.sc-meta { font-size: 13px; color: var(--text-secondary); }

/* Data-driven station summary — the unique-prose SEO line under the H1. */
.tide-summary {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 22px;
  max-width: 760px;
}

/* Nearest-NWLON provenance line (distance + avg tidal-time offset). */
.tide-nwlon {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 22px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 760px;
}

/* Hover tooltips for the tide curve + calendar (shared floating element). */
.tide-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  display: none;
  max-width: 220px;
  padding: 7px 11px;
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
}
.tide-tip b { display: block; font-size: 14px; font-weight: 700; }
.tide-tip span { display: block; color: var(--text-secondary); font-size: 12px; }

/* Main curve crosshair (positioned by JS). */
.tide-curve { touch-action: none; }
.tc-hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.tc-cursor { display: none; stroke: #58A6FF; stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
.tc-dot { display: none; fill: #fff; stroke: #58A6FF; stroke-width: 2; }
.cal-cell[data-tip] { cursor: default; }

/* Mini satellite locator map (upper-right, floats; stacks on mobile). */
.tide-map-wrap { position: relative; float: right; width: 300px; margin: 2px 0 16px 22px; }
.tide-map-title {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.72);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.tide-map-title img { width: 15px; height: 15px; display: block; }
.tide-map {
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0D1117;
}
.tide-map-cta {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  color: var(--accent, #4FC3F7);
  text-decoration: none;
}
.tide-map-cta:hover { text-decoration: underline; }
.leaflet-container { background: #0D1117; font: inherit; }
@media (max-width: 720px) {
  .tide-map-wrap { float: none; width: 100%; margin: 0 0 18px; }
}

/* Flood-tide highlight note — the mirror of .tide-neg-note (blue = high). */
.tide-flood-note {
  background: rgba(88, 166, 255, 0.09);
  border: 1px solid rgba(88, 166, 255, 0.32);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.tide-flood-note b { color: var(--text-primary); }

/* Product-style tide-pin glyph markers (self-contained SVG replica of the
   app's LiveTidePin — the round shape is baked into the SVG <circle>, so it
   never depends on this CSS loading). */
.tm-pin-wrap { background: none; border: 0; }
.tm-pin-svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }

/* Dark-theme the Leaflet chrome so the widget reads as TidalMap, not a stock map. */
.leaflet-bar { border: 1px solid #30363d; }
.leaflet-bar a, .leaflet-bar a:hover {
  background: #161b22;
  color: #c9d1d9;
  border-bottom-color: #30363d;
}
.leaflet-bar a:hover { background: #21262d; }
.leaflet-control-attribution {
  background: rgba(13, 17, 23, 0.75) !important;
  color: #8b949e !important;
}
.leaflet-control-attribution a { color: #58a6ff !important; }
.leaflet-tooltip {
  background: #161b22;
  color: #e6edf3;
  border: 1px solid #30363d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.leaflet-tooltip-top::before { border-top-color: #30363d; }
