/* ============================================================================
   storm-detail.css — Detailseite eines einzelnen Wirbelsturms (/storms/<uid>/)

   Bewusst nah an earthquakes/event.php gebaut: gleicher Aufbau aus Hero,
   Zwei-Spalten-Grid (Fakten | Karte) und breiten Tabellenkarten darunter.
   Eigene Datei statt Erweiterung von earthquakes.css, weil beide Seiten
   unabhaengig voneinander weiterwachsen sollen.
   ========================================================================== */

.tc-shell { padding: 16px 0; }

.tc-back {
  display: inline-block;
  font-weight: 600;
  color: var(--brand-cyan);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.tc-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  margin: 12px 0 16px;
}
.tc-hero-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 96px; height: 96px;
  border-radius: 14px;
  color: #fff;
  /* Weisse Ziffer muss auch auf dem hellen Gelb der Kategorie 1 lesbar bleiben. */
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.tc-hero-cat {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
}
.tc-hero-catlabel {
  margin-top: 4px;
  font: 800 11px/1 var(--font-sans);
  letter-spacing: .12em;
  opacity: .85;
}
.tc-h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  margin: 0 0 4px;
}
.tc-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 14px;
}
.tc-dot { opacity: .5; }
.tc-local { font-size: 12px; font-style: italic; }
.tc-local:empty { display: none; }

.tc-status {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--badge-ink);
  font: 700 10px/1.5 var(--font-sans);
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* Aufgeloeste Stuerme sollen nicht wie eine laufende Warnung aussehen. */
.tc-status.is-dissipated,
.tc-status.is-post_tropical {
  /* Der Kopfbereich hat in BEIDEN Farbmodi dunklen Grund und weisse Schrift.
     Deshalb hier feste Werte statt --muted: das ist fuer helle Flaechen gedacht
     und ging auf dem Tuerkis unter. */
  background: rgba(8, 49, 69, .55);
  border-color: rgba(234, 247, 252, .40);
  color: rgba(255, 255, 255, .92);
}

.tc-share {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--accent-soft-border);
  background: var(--accent-soft-bg);
  color: var(--accent);
  font: 700 14px/1 inherit;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}
.tc-share:hover { background: var(--accent-soft-border); transform: translateY(-1px); }
.tc-share svg { display: block; }

/* ── Karten-Raster ───────────────────────────────────────────────────────── */
.tc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) { .tc-grid { grid-template-columns: 1fr; } }

.tc-card {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
}
.tc-card--wide { margin-top: 16px; }
.tc-card h2 {
  margin: 0 0 10px;
  font: 700 14px/1.2 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.tc-intro { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.tc-note  { margin: 10px 0 0;  font-size: 12px; color: var(--muted); }
.tc-updated { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ── Kennzahlen (Wind / Druck / Zugrichtung) ─────────────────────────────── */
.tc-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tc-kpi {
  flex: 1 1 140px; min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 65%, transparent);
  background:
    radial-gradient(120% 95% at 82% 0%, color-mix(in srgb, var(--c) 45%, transparent), transparent 78%),
    color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 22%, transparent);
}
.tc-kpi-head { display: flex; align-items: center; gap: 9px; }
.tc-kpi .ic {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 34%, transparent);
  color: var(--c);
}
.tc-kpi .ic svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tc-kpi-label {
  font: 800 10px/1.2 var(--font-sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tc-kpi-val {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
  color: var(--text);
}
.tc-kpi-val span { font-size: 13px; font-weight: 600; color: var(--muted); }
/* Die Zugrichtung ist ein ausgeschriebener Satz, keine Zahl — kleiner setzen. */
.tc-kpi-val--sm { font-size: 15px; font-weight: 700; line-height: 1.3; }

/* ── Fakten-Liste ────────────────────────────────────────────────────────── */
.tc-list { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 0; }
.tc-list dt, .tc-list dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.tc-list dt {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.tc-list dd { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; }
.tc-list dt:last-of-type, .tc-list dd:last-of-type { border-bottom: 0; }
.tc-list dt svg {
  width: 16px; height: 16px; flex: 0 0 auto; opacity: .85;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Locator-Karte ───────────────────────────────────────────────────────── */
.tc-map {
  flex: 1 1 auto;
  min-height: 340px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Tabellen ────────────────────────────────────────────────────────────── */
/* Eigener Scroll-Container: die Seite selbst darf nie horizontal scrollen. */
.tc-tablewrap { overflow-x: auto; }
.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.tc-table th, .tc-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.tc-table th { font-weight: 600; color: var(--muted); }
.tc-table small { color: var(--muted); }
.tc-table tbody tr:last-child th,
.tc-table tbody tr:last-child td { border-bottom: 0; }

.tc-catdot {
  display: inline-block;
  width: 9px; height: 9px;
  margin-left: 6px;
  border-radius: 50%;
  vertical-align: middle;
}
.tc-catpill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: #fff;
  font: 700 10.5px/1.5 var(--font-sans);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .38);
}

@media (max-width: 560px) {
  .tc-hero { grid-template-columns: 72px 1fr; gap: 14px; }
  .tc-hero-badge { width: 72px; height: 72px; }
  .tc-hero-cat { font-size: 30px; }
}

/* ============================================================================
   Verteiler-Seite /storms/ — bewusst ohne eigene Karte (die Live-Karte ist die
   Startseite). Teilt sich die Karten- und Tabellen-Bausteine oben.
   ========================================================================== */

.tc-index-head { margin: 8px 0 16px; }
.tc-lead {
  max-width: 62ch;
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* Aufforderung zur Karte — die wichtigste Handlung auf dieser Seite. */
.tc-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--accent-soft-border);
  border-radius: var(--radius);
  background: var(--accent-soft-bg);
  color: inherit;
  text-decoration: none;
  transition: background 160ms, transform 160ms;
}
.tc-cta:hover { background: var(--accent-soft-border); transform: translateY(-1px); }
.tc-cta-ic {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent);
}
.tc-cta-ic svg { width: 26px; height: 26px; }
.tc-cta-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-cta-body strong { font-size: 15px; }
.tc-cta-body span { font-size: 13px; color: var(--muted); }
.tc-cta-btn {
  flex: 0 0 auto;
  margin-left: auto;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .tc-cta { flex-wrap: wrap; }
  .tc-cta-btn { margin-left: 0; width: 100%; }
}

/* Kennzahlen-Reihe */
.tc-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.tc-stat {
  flex: 1 1 150px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.tc-stat-label {
  font: 800 10px/1.2 var(--font-sans);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.tc-stat-val {
  font-family: var(--font-display);
  font-weight: 800; font-size: 26px; line-height: 1.1;
  color: var(--text);
}
.tc-stat-val--sm { font-size: 18px; }
.tc-stat-meta { font-size: 12px; color: var(--muted); }

/* Sturm-Liste, nach Becken gruppiert */
.tc-basin-head {
  margin: 16px 0 8px;
  font: 700 11px/1 var(--font-sans);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.tc-basin-head:first-of-type { margin-top: 4px; }

.tc-storms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tc-storm {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
}
.tc-storm-main {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  color: inherit; text-decoration: none;
}
.tc-storm-main:hover { background: var(--menu-hover); }
.tc-storm-badge {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  color: #fff;
  font: 800 16px/1 var(--font-display);
  /* Weisse Ziffer auch auf dem hellen Gelb der Kategorie 1 lesbar. */
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.tc-storm-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tc-storm-name { font-weight: 700; font-size: 15px; }
.tc-storm-meta { font-size: 12px; color: var(--muted); }
.tc-storm-vals {
  margin-left: auto; text-align: right;
  display: flex; flex-direction: column; gap: 2px;
  white-space: nowrap;
}
.tc-storm-wind  { font-weight: 700; font-size: 15px; }
.tc-storm-press { font-size: 12px; color: var(--muted); }

.tc-storm-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.tc-storm-links a { color: var(--brand-cyan); font-weight: 600; }
.tc-storm-time { margin-left: auto; color: var(--muted); }

.tc-prose { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.tc-scale { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.tc-scale li { display: flex; align-items: center; gap: 7px; }
.tc-scale .tc-catdot { margin-left: 0; }

/* Zweiter Kopf-Link (Karte) — steht neben dem Zurueck-Link. */
.tc-back--map { margin-left: 16px; }

/* Die Erklaerkarten sind ein eigener Block, nicht die Fortsetzung der Liste —
   der groessere Abstand macht den Schnitt sichtbar. */
.tc-grid--explain { margin-top: 32px; }


/* ── Kategorien-Legende am Seitenende ────────────────────────────────────────
   Umbrechende Reihe statt Tabelle: acht kurze Eintraege, die auf dem Handy
   sonst eine sehr schmale Spalte ergaeben. */
.tc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 4px;
}
.tc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}
/* Der Punkt hat in der Quellen-Tabelle einen linken Abstand — hier stoert er. */
.tc-legend-item .tc-catdot { margin-left: 0; }


/* ── Lange Tabelle in sich scrollen lassen ───────────────────────────────────
   Die gemessene Zugbahn kann ueber hundert Zeilen haben. Statt die Seite
   endlos zu machen, scrollt nur die Tabelle — der Kopf bleibt dabei stehen. */
.tc-card--scroll .tc-tablewrap {
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tc-card--scroll .tc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  /* Undurchsichtig, sonst scrollen die Zeilen sichtbar darunter durch. */
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}
