/* sun.css — Sonnen-/Mondseiten (/sun/ und /sun/<stadt>/).
   Nur Seiten-Layout: Kopf, Geo-Zeile, Fakten-Karten, 7-Tage-Tabelle,
   Stadt-Raster der Landing. Die Sonnenbahn/Mondphase bringt ihre eigene
   Darstellung mit (components/sun-path.css) — hier steht nichts dazu.
   Farben ausschliesslich ueber Tokens, damit Hell/Dunkel automatisch passt. */

.sun-page { padding-block: 22px 40px; }

/* ---------- Rücklink-Pille (Detailseite) ---------- */
.sun-pill { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--accent-ink); text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent);
  padding: 6px 14px; border-radius: var(--radius-pill); }
.sun-pill:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.sun-pill__ic { font-size: 16px; line-height: 1; margin-top: -1px; }

/* ---------- Kopf ---------- */
.sun-head { margin-bottom: 22px; }
.sun-kicker {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent); padding: 5px 13px; border-radius: var(--radius-pill); margin: 0 0 12px;
}
.sun-h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin: 0 0 10px; color: var(--text); }
.sun-lede { max-width: 62ch; color: var(--muted); font-size: 16px; line-height: 1.55; margin: 0; }

/* Geo-Zeile: Land · Region · Koordinaten · Zeitzone */
.sun-geo {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}
.sun-geo b { color: var(--text); font-weight: 600; }

/* ---------- Abschnitt ---------- */
.sun-sec { margin-top: 30px; }
.sun-sec__t { font-size: 19px; margin: 0 0 14px; color: var(--text); }
.sun-sec__lead { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: -6px 0 14px; max-width: 60ch; }

/* Wrapper der Sonnenbahn/Mondphase — die Komponente rendert hinein. */
.sun-viz { border-radius: 12px; overflow: hidden; }
.sun-viz:empty { min-height: 200px; background: var(--bg-elev); border: 1px solid var(--line); }

/* ---------- Fakten-Karten ---------- */
.sun-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.sun-card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 18px;
}
.sun-card__t {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
.sun-dl { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.sun-dl__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sun-dl dt { font-size: 13px; color: var(--muted); }
.sun-dl dd {
  margin: 0; font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}

/* ---------- 7-Tage-Tabelle ---------- */
.sun-week { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sun-week th, .sun-week td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.sun-week th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.sun-week td { font-size: 14px; color: var(--text); }
.sun-week td:first-child { font-weight: 600; }
.sun-week td:not(:first-child) { font-family: var(--font-mono); }
.sun-week tr.is-today td { background: var(--accent-soft-bg); }
.sun-week tbody tr:last-child td { border-bottom: 0; }

/* ---------- Querverweis + Fussnote ---------- */
.sun-links { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.sun-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  border: 1px solid var(--accent-soft-border); background: var(--accent-soft-bg);
  padding: 9px 14px; border-radius: var(--radius-pill);
}
.sun-link:hover { border-color: var(--accent); }
.sun-note { margin-top: 22px; font-size: 12px; color: var(--muted); }

/* ---------- Landing: SVG-Weltkarte (Tag/Nacht) ---------- */
.sun-mapsec { margin-top: 24px; }
.sun-map { position: relative; margin: 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev);
  padding: 10px; overflow: hidden; }
.sun-map__svg { width: 100%; height: auto; display: block; }
.sun-map__land { fill: rgba(14, 98, 136, .22); stroke: var(--bg-elev); stroke-width: 0.4; }
:root:not([data-theme="light"]) .sun-map__land,
:root[data-theme="dark"] .sun-map__land { fill: rgba(161, 218, 238, .20); }
/* Nachtfläche + Terminatorlinie */
.sun-map__night { fill: rgba(18, 32, 66, .40); pointer-events: none; }
:root:not([data-theme="light"]) .sun-map__night,
:root[data-theme="dark"] .sun-map__night { fill: rgba(0, 0, 0, .42); }
.sun-map__term { fill: none; stroke: rgba(255, 206, 122, .65); stroke-width: 1.1; stroke-dasharray: 3 3; pointer-events: none; }
.sun-map__subsolar { fill: #ffd23f; stroke: rgba(255, 210, 63, .5); stroke-width: 4; paint-order: stroke; pointer-events: none; }
.sun-map__dot { fill: var(--accent); fill-opacity: .95; stroke: var(--surface); stroke-width: 1.2;
  cursor: pointer; transition: r .12s ease; }
.sun-map a:hover .sun-map__dot, .sun-map__dot.is-hover { r: 5.5; fill-opacity: 1; }
.sun-map a:focus-visible .sun-map__dot { outline: 2px solid var(--accent); }
.sun-map__tip { position: absolute; transform: translate(-50%, -100%); margin-top: -8px;
  pointer-events: none; z-index: 3; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); padding: 7px 11px; display: flex; flex-direction: column; gap: 1px; }
.sun-map__tip b { font-size: 13px; color: var(--text); }
.sun-map__tip span { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Landing: Suchfeld ---------- */
.sun-search { position: relative; max-width: 420px; margin: 26px 0 4px; }
.sun-search__ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.sun-search input { width: 100%; box-sizing: border-box; padding: 11px 14px 11px 38px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.sun-search input:focus { outline: none; border-color: var(--accent); }
.sun-search input::placeholder { color: var(--muted); }
.sun-search-none { color: var(--muted); font-size: 14px; padding: 8px 2px; }

/* ---- Trefferliste der Ortssuche (sun-index.js) ----
   Steht im Fluss unter dem Feld, nicht als Überlagerung: die Liste kann acht
   Zeilen lang werden und soll auf dem Telefon die Seite schieben statt die
   Kacheln zu verdecken. Solange sie offen ist, blendet das JS das Kachelraster
   aus — es gibt also nie zwei Listen gleichzeitig. */
.sun-results { max-width: 520px; margin: 8px 0 4px; border: 1px solid var(--line);
    border-radius: 12px; overflow: hidden; background: var(--bg-elev); }
.sun-results[hidden] { display: none; }
.sun-res { display: flex; align-items: center; gap: 14px; justify-content: space-between;
    padding: 10px 14px; text-decoration: none; color: inherit;
    border-top: 1px solid var(--line); }
.sun-res:first-child { border-top: none; }
.sun-res:hover, .sun-res.is-on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sun-res:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sun-res__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sun-res__n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sun-res__s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sun-res__t { display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
    flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.sun-res__lbl { color: var(--muted); font-size: 11px; font-weight: 400; text-transform: uppercase;
    letter-spacing: .04em; }
.sun-res__msg { color: var(--muted); font-size: 14px; padding: 12px 14px; margin: 0; }

/* Überschrift über dem kuratierten Kachelraster — trennt es sichtbar von den
   Suchtreffern darüber. */
.sun-list__t { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 0 0;
    text-transform: uppercase; letter-spacing: .05em; }


/* ---------- Landing: Stadt-Raster ---------- */
.sun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 20px; }
.sun-city {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 16px; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.sun-city:hover { border-color: var(--accent); transform: translateY(-2px); }
.sun-city__n { font-size: 16px; font-weight: 600; color: var(--text); }
.sun-city__m { font-size: 12px; color: var(--muted); }
/* „Sonnenaufgang HH:MM" — von sun-index.js nachgefuellt. */
.sun-city__t {
  margin-top: 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent);
  min-height: 1em; font-variant-numeric: tabular-nums;
}
.sun-group { margin-top: 26px; }
.sun-group__t { font-size: 15px; color: var(--text); margin: 0 0 4px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ---------- Datumssteuerung ---------- */
.sun-datebar { display: flex; align-items: stretch; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sun-datenav, .sun-datebtn {
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 600;
}
.sun-datenav { width: 40px; font-size: 20px; line-height: 1; }
.sun-datebtn { padding: 0 16px; font-size: 13px; }
.sun-datenav:hover, .sun-datebtn:hover { border-color: var(--accent); color: var(--accent); }
.sun-datepick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--bg-elev); border-radius: var(--radius-sm); padding: 0 12px; }
.sun-datepick__l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.sun-datepick input { border: 0; background: transparent; color: var(--text); font: inherit;
  padding: 9px 0; font-variant-numeric: tabular-nums; color-scheme: light dark; }
.sun-day-title { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* ---------- Live-Status ---------- */
.sun-live { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 16px;
  padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--bg-elev); font-size: 13.5px; }
.sun-live b { color: var(--text); font-weight: 700; }
.sun-live span { color: var(--muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sun-live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sun-live.is-day .sun-live__dot { background: #f4a932; box-shadow: 0 0 8px 1px rgba(244,169,50,.6); }
.sun-live.is-tw .sun-live__dot { background: #a86ad4; }
.sun-live.is-night .sun-live__dot { background: #5ab4e6; }

/* ---------- Jahresverlauf ---------- */
.sun-year { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev);
  padding: 12px 14px; }
.sun-yr-svg { width: 100%; height: auto; display: block; }
.sun-yr-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.sun-yr-grid { stroke: var(--line); stroke-width: 1; }
.sun-yr-mo { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.sun-yr-today { stroke: var(--text); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .55; }
.sun-yr-dot { stroke: var(--surface); stroke-width: 2; }
.sun-yr-dot.max { fill: #f4a932; }
.sun-yr-dot.min { fill: #5ab4e6; }
.sun-yr-dot.eq  { fill: #7bc47f; }
.sun-yr-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px;
  font-size: 13px; color: var(--muted); }
.sun-yr-legend b { color: var(--text); font-weight: 600; }
.sun-yr-k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.sun-yr-k.max { background: #f4a932; } .sun-yr-k.min { background: #5ab4e6; } .sun-yr-k.eq { background: #7bc47f; }

/* ---------- Zeitzone & Zeitumstellung (5-Jahres-Übersicht) ---------- */
.sun-tz { padding: 16px 18px; }
.sun-tz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; }
.sun-tz-headL { display: flex; align-items: baseline; gap: 10px; }
.sun-tz-off { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; }
.sun-tz-abbr { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.sun-tz-status { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); }
.sun-tz-status.is-summer { color: #a05a00; background: rgba(244,169,50,.20); border-color: rgba(244,169,50,.45); }
.sun-tz-status.is-standard { color: #2a6f97; background: rgba(90,180,230,.18); border-color: rgba(90,180,230,.42); }
:root:not([data-theme="light"]) .sun-tz-status.is-summer,
:root[data-theme="dark"] .sun-tz-status.is-summer { color: #ffce7a; }
:root:not([data-theme="light"]) .sun-tz-status.is-standard,
:root[data-theme="dark"] .sun-tz-status.is-standard { color: #9dd3ee; }
.sun-tz-status.is-none { color: var(--muted); }

.sun-tz-axisrow, .sun-tz-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.sun-tz-axis { display: grid; grid-template-columns: repeat(12, 1fr); }
.sun-tz-axis span { text-align: center; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.sun-tz-axisrow { margin-bottom: 4px; }
.sun-tz-row { margin-bottom: 9px; align-items: start; }
.sun-tz-row .sun-tz-y { font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 1px; }
.sun-tz-row.is-current .sun-tz-y { color: var(--accent); font-weight: 700; }
.sun-tz-bar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; height: 16px;
  border-radius: 5px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.sun-tz-m { background: rgba(90,180,230,.30); }         /* Normalzeit (kühl) */
.sun-tz-m.is-dst { background: rgba(244,169,50,.62); }  /* Sommerzeit (warm) */
.sun-tz-row.is-current .sun-tz-bar { box-shadow: 0 0 0 1.5px var(--accent); }
.sun-tz-tr { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px;
  font-family: var(--font-mono); font-size: 11px; }
.sun-tz-chip { color: var(--muted); font-variant-numeric: tabular-nums; }
.sun-tz-chip.up { color: #b06d00; } .sun-tz-chip.down { color: #2a6f97; }
:root:not([data-theme="light"]) .sun-tz-chip.up, :root[data-theme="dark"] .sun-tz-chip.up { color: #ffce7a; }
:root:not([data-theme="light"]) .sun-tz-chip.down, :root[data-theme="dark"] .sun-tz-chip.down { color: #9dd3ee; }
.sun-tz-legend { display: flex; gap: 18px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sun-tz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sun-tz-sw { width: 12px; height: 12px; border-radius: 3px; background: rgba(90,180,230,.30); }
.sun-tz-sw.is-dst { background: rgba(244,169,50,.62); }

@media (max-width: 560px) {
  .sun-tz-axisrow, .sun-tz-row { grid-template-columns: 38px 1fr; gap: 8px; }
  .sun-tz-axis span { font-size: 8px; }
}

/* ---------- Mondkalender ---------- */
.sun-moon-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sun-moon-cal { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); padding: 14px 16px; }
.sun-cal-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; }
.sun-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sun-cal-wd { text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--muted); padding-bottom: 4px; }
.sun-cal-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 5px; border-radius: 7px; }
.sun-cal-cell.is-empty { visibility: hidden; }
.sun-cal-cell.is-today { background: var(--accent-soft-bg); }
.sun-cal-cell.is-sel { outline: 1.5px solid var(--accent); }
.sun-cal-moon { width: 22px; height: 22px; display: block; }
.sun-cal-d { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sun-cal-cell.is-today .sun-cal-d { color: var(--text); font-weight: 700; }

@media (max-width: 640px) {
  .sun-moon-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sun-dl dd { font-size: 13px; }
  .sun-week th, .sun-week td { padding: 9px 8px; }
  .sun-cal-moon { width: 18px; height: 18px; }
}
