/* =====================================================================
   TroutRiver skin — weather.mswain.com
   ---------------------------------------------------------------------
   DESIGN TOKENS
   To match hilliardairpark.com exactly, paste its palette values here —
   everything below derives from these variables.
   ===================================================================== */
:root {
  /* palette: river at dusk */
  --bg:        #0d1a21;   /* page background */
  --panel:     #14252e;   /* card / panel surface */
  --panel-2:   #0f1f27;   /* recessed surface (table stripes, selects) */
  --edge:      #23404d;   /* borders, hairlines */
  --ink:       #e9f0f2;   /* primary text */
  --muted:     #93a9b1;   /* secondary text */
  --amber:     #f0a43c;   /* accent: sun / data highlights */
  --teal:      #47a8a0;   /* accent: river / links */

  /* type */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-data:    "IBM Plex Mono", ui-monospace, monospace;

  --radius: 10px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ================= top bar ================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--edge);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  background: var(--teal); color: var(--bg);
  border-radius: 6px; padding: 4px 7px; letter-spacing: 0.5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.4px; }
.brand-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }

.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); padding: 6px 10px; border-radius: 6px;
}
.topnav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }

/* ================= hero ================= */
.hero { padding: 34px 0 10px; }

.metar-line {
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.metar-line .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.hero-grid {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.hero-temp { font-family: var(--font-data); line-height: 1; }
.hero-temp-value { font-size: clamp(64px, 10vw, 108px); font-weight: 600; letter-spacing: -2px; }
.hero-temp-unit { font-size: clamp(24px, 3vw, 36px); color: var(--muted); margin-left: 6px; }
.hero-feels { margin-top: 8px; color: var(--muted); }
.hero-feels strong { color: var(--ink); font-family: var(--font-data); font-weight: 500; }

.hero-river {
  text-align: right;
  border-right: 3px solid var(--teal);
  padding-right: 16px;
}
.river-label {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--teal);
}
.river-value { font-family: var(--font-data); font-size: clamp(36px, 5vw, 52px); font-weight: 600; line-height: 1.1; }
.river-unit { font-size: 0.45em; color: var(--muted); margin-left: 4px; }
.river-sub { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.readout-strip {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.readout {
  padding: 12px 14px;
  border-right: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 2px;
}
.readout:last-child { border-right: none; }
.readout .k {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
}
.readout .v { font-family: var(--font-data); font-size: 16px; font-weight: 500; }
.readout .v small { color: var(--muted); font-size: 12px; }

/* ================= cards ================= */
.card-row {
  display: grid; gap: 18px; margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.card-row.two-up { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column;
}
.card-title {
  margin: 0 0 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: 1.4px; text-transform: uppercase;
}
.card-foot { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.media-frame {
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--edge);
  background: var(--panel-2);
}
.media-frame img { width: 100%; height: auto; }

.cel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; }
.cel-head {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--amber);
  margin-bottom: 8px;
}
.cel-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 0; border-bottom: 1px dotted var(--edge);
  font-size: 14px;
}
.cel-row .k { color: var(--muted); }
.cel-row .v { font-family: var(--font-data); }

/* ================= panels (charts, reports, stats) ================= */
.panel {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.section-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  letter-spacing: 1.6px; text-transform: uppercase;
}
.panel > .section-title { margin-bottom: 16px; }
.panel-link { font-size: 14px; }

.seg {
  display: inline-flex; gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: 8px; padding: 3px;
}
.seg-btn {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  background: transparent; color: var(--muted);
  border: 0; border-radius: 6px;
  padding: 6px 16px; cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: var(--amber); color: var(--bg); }

.chart-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
.chart-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--panel-2);
  cursor: zoom-in;
}
.is-hidden { display: none; }

/* chart lightbox */
.zoom-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 12, 16, 0.9);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.zoom-backdrop img {
  max-width: 96vw; max-height: 92vh;
  width: auto; height: auto;
  border: 1px solid var(--edge); border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

/* ================= reports ================= */
.report-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.report-pick { display: flex; flex-direction: column; gap: 6px; }
.report-pick span {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
}
.report-pick select {
  font-family: var(--font-data); font-size: 14px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 12px; min-width: 200px;
}
.report-link { margin-left: auto; font-size: 14px; }

/* ================= hi/lo table ================= */
.table-scroll { overflow-x: auto; }
.hilo { width: 100%; border-collapse: collapse; font-size: 14px; }
.hilo th, .hilo td { padding: 9px 12px; text-align: right; white-space: nowrap; }
.hilo thead th {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--edge);
}
.hilo tbody th { text-align: left; font-weight: 500; color: var(--muted); }
.hilo tbody tr:nth-child(even) { background: var(--panel-2); }
.hilo td { font-family: var(--font-data); }
.hilo td b { color: var(--amber); font-weight: 500; }
.hilo td i { color: var(--teal); font-style: normal; margin-left: 10px; }
.table-key { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.table-key b { color: var(--amber); font-weight: 500; }
.table-key i { color: var(--teal); font-style: normal; }

/* ================= spec lists (about / telemetry) ================= */
.spec { margin: 0; }
.spec > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px dotted var(--edge);
}
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-family: var(--font-data); font-size: 14px; text-align: right; }

/* ================= footer ================= */
.footer { margin-top: 40px; border-top: 1px solid var(--edge); }
.footer-inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; font-size: 13px; color: var(--muted);
}

/* ================= timelapse calendar ================= */
.tl-cal { flex: 1; }
.tl-status { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

.tl-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.tl-month {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: 1px; text-transform: uppercase;
}
.tl-nav { display: inline-flex; gap: 4px; }
.tl-nav button {
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  letter-spacing: 0.8px; text-transform: uppercase;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px;
  padding: 3px 10px; cursor: pointer; line-height: 1.4;
}
.tl-nav button:hover:not(:disabled) { border-color: var(--muted); }
.tl-nav button:disabled { color: var(--edge); cursor: default; }

.tl-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-family: var(--font-data); font-size: 13px;
}
.tl-table th {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  padding: 4px 0;
}
.tl-table td {
  text-align: center; padding: 5px 0;
  color: var(--muted);
  border-radius: 6px;
}
.tl-table td.day { color: var(--ink); }
.tl-table td.has-video { cursor: pointer; font-weight: 600; }
.tl-table td.has-video.local { background: var(--amber); color: var(--bg); }
.tl-table td.has-video.local:hover { filter: brightness(1.12); }
.tl-table td.has-video.archive { background: var(--teal); color: var(--bg); }
.tl-table td.has-video.archive:hover { filter: brightness(1.12); }
.tl-table td.today { outline: 2px solid var(--ink); outline-offset: -2px; }

.tl-legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-size: 12px; color: var(--muted); align-items: center;
}
.tl-legend .sw {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 3px; margin-right: 5px; vertical-align: middle;
}
.tl-legend .sw.local { background: var(--amber); }
.tl-legend .sw.archive { background: var(--teal); }

/* ================= video modal ================= */
.tl-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 12, 16, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tl-backdrop[hidden] { display: none; }
.tl-dialog {
  position: relative;
  max-width: min(1100px, 94vw); max-height: 92vh;
  background: #000;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.tl-dialog video { display: block; max-width: 100%; max-height: 84vh; width: auto; height: auto; }
.tl-caption {
  font-family: var(--font-data); font-size: 13px;
  color: var(--ink); background: var(--panel);
  padding: 8px 14px; text-align: center;
  border-top: 1px solid var(--edge);
}
.tl-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(13, 26, 33, 0.7); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px;
  font-size: 20px; line-height: 1; padding: 4px 10px;
  cursor: pointer;
}
.tl-close:hover { background: var(--panel); }

/* ================= small screens ================= */
@media (max-width: 640px) {
  .topnav { display: none; }
  .hero-river { border-right: none; border-left: 3px solid var(--teal); padding: 0 0 0 16px; text-align: left; }
  .report-link { margin-left: 0; }
}
