/* =========================================================
   tides-embed.css – Gezeiten-Styles im Look der Agentur am Meer
   Autor: ChatGPT
   Hinweis: defensiv gestaltet, damit auch unbekannte Markup-Strukturen
   (Tabellen/Listen/Absätze) sauber gerendert werden.
   ========================================================= */

:root{
  /* Markenfarben / Grundwerte */
  --brand: #006e9c;
  --brand-ink: #0b4a6f;
  --bg: #eef4f6;
  --card: #ffffff;
  --text: #222222;
  --muted: #667085;
  --line: #ecf0f4;
  --chip-bg: #e6f4ff;
  --chip-ink: #0b4a6f;

  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.06);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Basis / Reset light */
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: transparent; /* im iFrame ggf. hintergrund durchsichtig */
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

img { max-width: 100%; height: auto; display: block; }

/* Seite/Wrapper – wenn die Seite eine eigene Hülle hat, profitiert sie davon */
.container, .wrap, .gezeiten, .tides {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
}

/* Überschriften */
h1, h2, h3 {
  margin: 0 0 .75rem 0;
  color: var(--brand-ink);
  font-weight: 800;
  letter-spacing: -0.2px;
}
h1 { font-size: clamp(24px, 3.6vw, 32px); }
h2 { font-size: clamp(20px, 3vw, 26px); }
h3 { font-size: clamp(18px, 2.6vw, 22px); }

p { margin: .5rem 0 .9rem; }
.muted { color: var(--muted); }

/* Chips/Badges z. B. für Standort/Datum */
.chip {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--chip-ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .92rem;
}

/* Karten-/Box-Stil (optional um Tabellen legen) */
.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Links & Buttons */
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}
button:hover, .btn:hover { filter: brightness(.95); }

/* Formulare (falls vorhanden) */
input[type="date"], select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font: inherit;
  color: var(--text);
}

/* Tabellen-Layout (Generisch) */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;            /* für runde Ecken am Tabellenrahmen */
  box-shadow: var(--shadow);
}

thead th {
  background: #f3f8fb;
  color: var(--brand-ink);
  text-align: left;
  font-weight: 700;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;            /* Header bleibt sichtbar bei langen Tabellen */
  top: 0;
  z-index: 1;
}

tbody td, tbody th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:nth-child(odd) { background: #fafcff; }

/* Zahlenspalten / Zeiten schmaler & nicht umbrechen */
td.num, td.time, th.num, th.time { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Statusfarben z. B. für Hochwasser/Niedrigwasser */
.badge { padding: 2px 8px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.badge.high, .high { color: #0b6f3b; background: #e8f6ef; }
.badge.low,  .low  { color: #b35300; background: #fff1e6; }

/* Aktuelle Zeile hervorheben (z. B. "jetzt" / heutiger Tag) */
tr.today, tr.current, tr.now {
  background: #f0fbff !important;
  box-shadow: inset 0 0 0 9999px rgba(0,162,255,.06);
}

/* Karten-Kopfzeilen für Gezeiten-Blöcke */
.tides-head, .gezeiten-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}

/* Hilfsleiste für Datum/Ort */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

/* Inhaltsabstände reduzieren, wenn die gezeiten.php selbst Container hat */
.container, .wrap {
  box-shadow: none;
  border: 0;
}

/* Typische Textdetails */
small { color: var(--muted); }

/* Responsives Verhalten */
@media (max-width: 820px) {
  body { line-height: 1.5; }

  thead th, tbody td {
    padding: 10px;
  }

  /* Optional: große Tabellen scrollbar machen statt zu quetschen */
  .table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
  }
  .table-scroll > table {
    border: 0;       /* Doppelrahmen vermeiden */
    box-shadow: none;
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  h1 { font-size: 22px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }

  /* Tabellenränder noch kompakter */
  thead th { padding: 10px; }
  tbody td { padding: 8px 10px; }
}

/* Druckansicht – klare Tabelle ohne Schatten/Farben */
@media print {
  :root{
    --bg:#fff; --card:#fff; --text:#000; --muted:#444; --line:#ccc;
  }
  html, body { background: #fff !important; color: #000 !important; }
  .box, table { box-shadow: none !important; border-color: var(--line) !important; }
  thead th { background: #f3f3f3 !important; color: #000 !important; }
  .badge, .chip { border: 1px solid var(--line); background: #fff !important; color: #000 !important; }
}
