/* =============================================================================
 * css/berg_tal.css – Berg & Tal (Schritt 4, 27.11.2026)
 * Mobil-Ausführung: Bildkasten mit Mobil-SVG und 4er-Raster (referenz_mobil.html).
 * Dunkel = Farbattribute im SVG (includes/berg_tal.php); hell = Abschnitt „Helle Fassung“ unten
 * (html.light, überschreibt die Attribute, wechselt ohne Neuladen mit dem Theme).
 * ============================================================================= */

/* Bildbereich (Mobil-SVG + Raster): seit 29.11.2026 ohne eigenen Kasten, Silhouette direkt auf der Kachel */
.bt-mobil-bild {
    padding: 8px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #e5e9f2;
}
.bt-mobil-svg { line-height: 0; margin: 0 -12px; }   /* randlos über das Padding des Bildbereichs hinaus */
.bt-mobil-svg svg { max-width: 100%; height: auto; }   /* schmaler als angefordert: leicht verkleinern */

/* Handy-Pop-up Berg & Tal (M2 29.11.2026): Platz besser nutzen – ⓘ neben ✕ im Kopf (je 44 px Touch-Fläche),
   kleine Innenabstände, Gelände fast volle Breite, Raster enger. Desktop und Tablet-Karte unverändert. */
.card-modal-content .db-card.bt-vorlage { padding: 2px 6px 6px !important; }
.card-modal-content .bt-vorlage > .db-card-head.popup-header { align-items: center; min-height: 44px; margin: 0; padding-left: 8px; }
.card-modal-content .bt-vorlage .popup-actions { gap: 4px; }
.card-modal-content .bt-vorlage .popup-actions > .bt-kopf { margin: 0; display: flex; }
.card-modal-content .bt-vorlage .popup-actions .bt-info-knopf { margin: 0; }   /* 18 px + 2 × 13 px = 44 px */
.card-modal-content .bt-vorlage .popup-close { position: relative; margin-right: 4px; }   /* Platz für die Trefferfläche am Kartenrand */
.card-modal-content .bt-vorlage .popup-close::before { content: ''; position: absolute; inset: -5px; }   /* ab Innenkante (Rahmen 1 px): 36 px sichtbar, 44 px Trefferfläche */
.card-modal-content .bt-vorlage .bt-mobil-bild { padding: 4px 4px 6px; gap: 2px; }
/* Silhouette randlos bis an den Kartenrand (Karte 6 px + Bildbereich 4 px); Stationsliste behält ihr Padding */
.card-modal-content .bt-vorlage .bt-mobil-svg { margin: 0 -10px; }
/* Raster abgesetzt (30.11.2026): Grafik ↔ Trennlinie 6 px (gap 2 + 4), Linie ↔ Zelleninhalt 6 px (4 + Zelle 2);
   leere Alterszeilen entfallen (sonst je Reihe 12 px Lücke) → Pop-up nicht höher als vorher */
.card-modal-content .bt-vorlage .bt-raster { row-gap: 6px; margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(148, 163, 184, .12); }
.card-modal-content .bt-vorlage .bt-zelle { padding: 2px 0; }
.card-modal-content .bt-vorlage .bt-r-alter { line-height: 12px; }
.card-modal-content .bt-vorlage .bt-r-alter-leer { display: none; }

/* 4er-Raster unter dem Mobil-SVG */
.bt-raster {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 6px;
    text-align: center;
}
.bt-zelle { display: flex; flex-direction: column; gap: 1px; padding: 4px 0; border-radius: 8px; cursor: pointer; }
.bt-zelle-rohrmoos {
    border-radius: 8px;
    background: rgba(52, 211, 153, .08);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .5);
}
.bt-r-name {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.bt-r-neben { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.bt-r-alter { font-size: 10px; color: #8594ab; white-space: nowrap; }
/* Wind im Raster wie die Desktop-Windzeile (BT_F_WIND / html.light .bt-t-wind), Einheit klein und gedimmt */
.bt-r-neben.bt-r-wind { color: #93c5fd; font-weight: 600; }
.bt-r-neben.bt-r-wind-grau { color: #64748b; }
.bt-r-einheit { font-size: 9px; font-weight: 400; opacity: .75; }
/* Nummer: gleicher Kreis wie im Mobil-Bild (Ø 15 px) */
.bt-r-nr {
    width: 15px; height: 15px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; line-height: 1;
}
/* Punkte im Mobil-Bild (SVG) und Nummern im Raster: normal / grau (veraltet) / grün (Rohrmoos)
   (SVG-Farben als Attribute = dunkle Fassung, includes/berg_tal.php btSvgMobil) */
.bt-r-nr.bt-mp-normal { background: #7f93b8; color: #0b1222; }
.bt-r-nr.bt-mp-grau   { background: #475569; color: #e2e8f0; }
.bt-r-nr.bt-mp-gruen  { background: #34d399; color: #052e1f; }
.bt-svg .bt-mp-nr { pointer-events: none; }
.bt-svg .bt-mp-gruppe { cursor: pointer; outline: none; }
/* Hervorhebung Punkt ↔ Kachel (js/berg_tal.js, 1,5 s) und Tastaturfokus */
.bt-svg .bt-mp-gruppe.bt-hervor .bt-mp,
.bt-svg .bt-mp-gruppe:focus-visible .bt-mp { stroke: #60a5fa; stroke-width: 3; }
.bt-zelle.bt-hervor, .bt-zelle:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #60a5fa; }

/* =============================================================================
 * Startseite index.php (Berg & Tal 4.2)
 * ============================================================================= */

/* Mobil-Übersicht: Satbild, Radar, Karte, Berg & Tal in einer Reihe (ersetzt das frühere
   Inline-Raster mit 3 Spalten) */
.bt-mobil-reihe {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.bt-knopf-icon { width: 1.4rem; height: 1.4rem; }
/* Kachel „Karte“ als <button> (öffnet das Pop-up): Browser-Grundstil auf den der übrigen Kacheln zurücksetzen */
.bt-mobil-reihe button.mobile-btn { font: inherit; color: inherit; width: 100%; margin: 0; }
.bt-karte-icon { color: var(--teal); }
/* Name groß (z. B. „Berg & Tal“) ohne Umbruch und ohne Abschneiden: leicht kleiner als die Messwerte,
   ab ca. 400 px Breite 0,9rem, darunter mit der Breite kleiner (393 px → 14,1 px, 320 px → 11,5 px) */
.bt-mobil-reihe .mobile-btn-value { font-size: min(0.9rem, 3.6vw); text-overflow: clip; }
/* Unterzeile „LIVE“ in Grün wie der Live-Punkt im Seitenkopf (.header-live, --green-deep) */
.mobile-btn-label.tile-label--live {
    color: var(--green-deep);
    font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 0.25rem;
}
.tile-live-punkt {
    width: 5px; height: 5px; flex: none;
    border-radius: var(--radius-full);
    background: currentColor;
}

/* Karte unter dem Detail-Panel (Optik wie die übrigen Panels: .db-card) */
.bt-karte { margin-top: var(--space-xl); }
.bt-karte > .bt-kopf,
.bt-karte > .bt-bild,
.bt-vorlage > .bt-inhalt { grid-column: 1 / -1; }
.bt-kopf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.6rem;
}
.bt-titel { margin: 0; }
.bt-kopf > .bt-info-knopf:only-child { margin-left: auto; }   /* Modal: ⓘ allein im Kopf → rechts */
.bt-bild:empty { min-height: 300px; }             /* Platz halten bis zum ersten Laden */

/* ⓘ-Knopf: 18 px Symbol, Touch-Fläche 44 × 44 px; grau (Kopf hat seit 29.11.2026 keine Statuszeile mehr) */
.bt-info-knopf {
    width: 18px;
    height: 18px;
    padding: 13px;
    margin: -13px -13px -13px 2px;
    box-sizing: content-box;
    border: 0;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bt-info-knopf svg { width: 18px; height: 18px; }
html.light .bt-info-knopf { color: #64748b; }
.bt-info-knopf:focus-visible { outline: 2px solid #60a5fa; outline-offset: -10px; border-radius: 50%; }

/* Desktop-SVG: ohne inneren Rahmen und eigenen Himmel, direkt auf der Kachel (29.11.2026) */
.bt-rahmen { line-height: 0; }
.bt-rahmen svg { display: block; max-width: 100%; height: auto; }

/* Modal (Handy): Vorlage bleibt versteckt (.db-card setzt display:grid und würde hidden überstimmen);
   openCardModal setzt am Klon display:block per JS */
.bt-vorlage[hidden] { display: none; }
/* Statuszeile rechtsbündig über dem Bildkasten */
.bt-vorlage .bt-kopf { justify-content: flex-end; }

/* Info-Fenster */
.bt-info {
    max-width: min(440px, calc(100vw - 32px));
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 14px;
    background: var(--bg-card-solid);
    color: var(--text-primary);
    padding: 14px 20px 16px;
    font-size: 14px;
    line-height: 1.5;
}
.bt-info::backdrop { background: rgba(0, 0, 0, .55); }
.bt-info-kopf { display: flex; justify-content: space-between; align-items: center; }
.bt-info h2 { margin: 0; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: #60a5fa; }
.bt-info p { margin: 0.6rem 0 0; }
.bt-info-quellen { color: var(--text-secondary); font-size: 13px; }
.bt-info a { color: #60a5fa; }
html.light .bt-info a { color: #1d4ed8; }
.bt-info-zu {
    width: 44px;
    height: 44px;
    margin: -10px -14px -10px 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
}

/* =============================================================================
 * Helle Fassung (html.light): Himmel hell, Silhouetten hellblaugrau mit dunklerer Kante,
 * Schrift dunkel mit hellem Halo. Kontrast Text ≥ 4,5:1 gegen den Halo #f8fafc
 * (Wert #0f172a 17:1, Name #475569 7,2:1, Wind #1d4ed8 6,4:1, grau #5b6577 5,6:1,
 * Rohrmoos-Text #047857 5,2:1 – #059669 nur für Punkt/Lichthof, als Text nur 3,6:1).
 * CSS-Eigenschaften überschreiben die Farbattribute im SVG.
 * ============================================================================= */
html.light .bt-svg .bt-hinter   { fill: #dbe3ee; fill-opacity: 1; }   /* Dark: durchscheinend (includes/berg_tal.php) */
html.light .bt-svg .bt-kante    { stroke: #8496b0; }
html.light .bt-svg .bt-vorn-o   { stop-color: #c5d1e1; }
html.light .bt-svg .bt-vorn-u   { stop-color: #e2e8f0; }
html.light .bt-svg .bt-vorn     { stroke: #64748b; }
/* Sonne und Licht (includes/berg_tal.php btSonne, Stil BT_SONNE_STIL): 'kegel' = kurzer weicher Lichtkegel
   (Desktop + Handy), 'strahlen' = Linien; Sonne mit Lichthof, Desktop-Schein nur bei strahlen. Light: kräftigere Sonnenfarbe,
   Kegel Dark und Light .34 → 0 (Dark per Attribut im SVG); Linien Desktop und Handy gleich (Dark: Desktop .38, Handy .25). */
html.light .bt-svg .bt-sonne-kern { fill: #f59e0b; }
/* Lichthof Light: leichter Ring, dezent wie Dark (#f59e0b .30 ≈ 1,26:1; #d97706 .45 ≈ 1,64:1 war zu intensiv, #f59e0b .22 kaum sichtbar) */
html.light .bt-svg .bt-sonne-hof  { fill: #f59e0b; fill-opacity: .30; }
html.light .bt-svg .bt-kegel-s0 { stop-color: #f59e0b; stop-opacity: .34; }
html.light .bt-svg .bt-kegel-s1 { stop-color: #f59e0b; }
html.light .bt-svg .bt-licht-linie,
html.light .bt-svg .bt-licht-linie-m { stroke: #d97706; stroke-opacity: .18; }
html.light .bt-svg .bt-strich   { stroke: #64748b; }
html.light .bt-svg .bt-halo     { stroke: #f8fafc; }
html.light .bt-svg .bt-marke    { fill: #475569; }
html.light .bt-svg .bt-nord     { fill: #475569; }
html.light .bt-svg .bt-t-wert   { fill: #0f172a; }
html.light .bt-svg .bt-t-name   { fill: #475569; }
html.light .bt-svg .bt-t-wind   { fill: #1d4ed8; }
html.light .bt-svg .bt-t-grau   { fill: #5b6577; }
html.light .bt-svg .bt-t-gruen  { fill: #047857; }
html.light .bt-svg .bt-p        { fill: #94a3b8; stroke: #334155; }
html.light .bt-svg .bt-p-grau   { fill: #e2e8f0; stroke: #64748b; }
html.light .bt-svg .bt-p-gruen  { fill: #059669; }
/* Rahmen und Mobil-Bildkasten */
html.light .bt-mobil-bild { color: #0f172a; }
html.light .bt-r-neben { color: #475569; }
html.light .bt-r-alter { color: #5b6577; }
html.light .card-modal-content .bt-vorlage .bt-raster { border-top-color: rgba(100, 116, 139, .18); }
html.light .bt-r-neben.bt-r-wind { color: #1d4ed8; }
html.light .bt-r-neben.bt-r-wind-grau { color: #5b6577; }
html.light .bt-svg .bt-mp { stroke: #f8fafc; }
html.light .bt-svg .bt-mp-normal { fill: #64748b; }  html.light .bt-r-nr.bt-mp-normal { background: #64748b; color: #ffffff; }
html.light .bt-svg .bt-mp-grau   { fill: #cbd5e1; }  html.light .bt-r-nr.bt-mp-grau   { background: #cbd5e1; color: #334155; }
html.light .bt-svg .bt-mp-gruen  { fill: #059669; }  html.light .bt-r-nr.bt-mp-gruen  { background: #059669; color: #ffffff; }
html.light .bt-svg .bt-mp-nr { fill: #ffffff; }
html.light .bt-svg .bt-mp-gruppe:has(.bt-mp-grau) .bt-mp-nr { fill: #334155; }
html.light .bt-svg .bt-mp-gruppe.bt-hervor .bt-mp,
html.light .bt-svg .bt-mp-gruppe:focus-visible .bt-mp { stroke: #1d4ed8; }
html.light .bt-zelle.bt-hervor, html.light .bt-zelle:focus-visible { box-shadow: inset 0 0 0 2px #1d4ed8; }
html.light .bt-zelle-rohrmoos { background: rgba(5, 150, 105, .08); box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .5); }
