/* ----------------------------------------------------------
   1) Basis & Variablen
---------------------------------------------------------- */
:root {
  --font-family: Arial, Helvetica, sans-serif;

  --fs-base: 13px;    /* Grundgröße für fast alles */
  --fs-sm:   12px;    /* Kleinteilig (Footer, Hinweise) */
  --fs-lg:   16px;    /* Überschriften/Labels im UI */
  --fs-xl:   20px;    /* Haupttitel (Header-Zeile) */

  --lh: 1.45;
  --gap: 12px;

}

:root, *, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: var(--lh);
}

#_dash-loading,
._dash-loading {
  display: none !important;
}

/* ----------------------------------------------------------
   2) Typografie (Grundelemente)
---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  margin: 0 0 0.5em 0;
  line-height: 1.2;
}
h1 { font-size: var(--fs-xl); }
h2, h3, h4 { font-size: var(--fs-lg); }
p, li, span, div { font-size: var(--fs-base); }

.small { font-size: var(--fs-sm); }

/* ----------------------------------------------------------
   3) Medien & lange Inhalte
---------------------------------------------------------- */
img { max-width: 100%; height: auto; display: block; }
#frost-url { overflow-wrap: anywhere; word-break: break-word; }

/* ----------------------------------------------------------
   4) Layout-Grundgerüst
---------------------------------------------------------- */
#page-content { max-width: 100%; overflow-x: hidden; }
.home-grid { max-width: 100%; }
.home-grid > * { min-width: 0; max-width: 100%; }

/* ----------------------------------------------------------
   5) Header & Footer
---------------------------------------------------------- */
.home-grid [style*="background-color: #0076a6"] p {
  font-size: var(--fs-xl);
  font-weight: 600;
}

.home-grid [style*="background-color: #0076a6"] h1 {
font-size: var(--fs-xl);
font-weight: 600;
}

.home-grid [style*="background-color: #eee"] {
  font-size: var(--fs-sm);
}

/* ----------------------------------------------------------
   6) Form Controls (Dropdown, Radio, DatePicker, Buttons)
---------------------------------------------------------- */
select, input, button, textarea {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: var(--lh);
}

.rc-slider, .rc-checkbox, .rc-radio { font-size: var(--fs-base); }

.DateRangePicker, .DateRangePickerInput, .DateInput,
.DateInput_input {
  font-family: var(--font-family);
  font-size: var(--fs-base);
}

/* Buttons – übernehmen Textgröße global */
button, .button {
  font-size: var(--fs-base);
  line-height: var(--lh);
}

/* ----------------------------------------------------------
   7) Plotly (Achsen/Legende harmonisieren ohne Code-Änderung)
---------------------------------------------------------- */
.leaflet-tooltip.station-tooltip{
  font-size: 11px;            /* Textgröße */
  line-height: 1.25;          /* etwas dichter */
  padding: 6px 8px;           /* kompakter Padding */
  border-radius: 6px;
  max-width: none;            /* frühere max-width bitte entfernen */
}

.leaflet-tooltip.station-tooltip .tt-title{
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.leaflet-tooltip.station-tooltip div{
  font-size: inherit;         /* kein Hochskalieren durch andere Styles */
  line-height: inherit;
}

.leaflet-container .leaflet-marker-icon:focus,
.leaflet-container .leaflet-interactive:focus,
.leaflet-container svg path.leaflet-interactive:focus {
  outline: none !important;
}

/* ----------------------------------------------------------
   9) Kachel-/Box-Abstände außen (damit nix am Rand klebt)
---------------------------------------------------------- */
.home-grid {
  padding: var(--gap);
}

.home-grid > [style*="grid-area: header"],
.home-grid > [style*="grid-area: footer"] {
  position: relative;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  max-width: 100vw;
}

.box{
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

/* Überschriften in Boxen */
.box h1,
.box h2,
.box h3,
.box h4,
.box h5,
.box h6 {
  margin-top: 0;
  margin-bottom: 8px;
  line-height: 1.2;
}

.dash-graph{
  width: 100%;
}

.mini-table th, .mini-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e5e5;
  font-size: var(--fs-sm);
}
.mini-table th { text-align: left; font-weight: 600; }
.mini-table td:nth-child(2),
.mini-table td:nth-child(3) { width: 90px; }  /* schmale Spalten für Buttons */
.mini-table a { color: #0a74b9; text-decoration: none; }
.mini-table a:hover { text-decoration: underline; }

.station-dd [class*="multi-value-wrapper"],
.station-dd [class*="MultiValue"] {
  max-height: 105px;
  overflow-y: auto;
}

#sta-modal-close:focus, #sta-modal-backdrop:focus { outline: none; }

#help-open:focus,
#help-open:focus-visible { outline: 1px solid #fff; outline-offset: 0px; }

/* =========================
   Responsive Header
   ========================= */

.header-title,
.header-subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Breakpoint: Tablet/Mobile */
@media (max-width: 900px) {
  /* Header: Logo und Titel kleiner, damit nichts überlappt */
  .header-logo {
    width: 200px !important;
    margin: 12px 16px !important;
  }
  .header-title {
    font-size: 24px !important;
    text-shadow: none !important;
  }
  .header-subtitle {
    font-size: 12px !important;
    margin-top: 0 !important;
    display: none !important;
  }
}

/* Sehr schmale Geräte: Untertitel ausblenden */
@media (max-width: 520px) {
  .header-subtitle {
    display: none !important;
  }
}


/* =========================
   Responsive Home
   ========================= */

@media (max-width: 900px) {
  /* Root: von 2 Spalten auf 1 Spalte umstellen, Karte rausnehmen */
  .home-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "header"
      "row1"
      "right"
      "footer" !important;
  }

  /* Obere Doppelspalte auf 1 Spalte */
  .row1-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--gap);
  }

  /* Karte ausblenden */
  .map-card {
    display: none !important;
  }

  /* Rechte Spalte kann aufeinander stapeln, falls nötig */
  .right-grid {
    grid-template-rows: auto auto !important;
  }
}

@media (max-width: 900px) {
  .header-titlewrap {
    margin-right: 0 !important;   /* rechten Abstand entfernen */
    padding-right: 16px;
  }
}

/* Basis: nichts fürs Desktop ändern */
#station-metadata {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

/* ===========================================
   Mobile-Layout für Metadatenbox
   Text über Bild, Bild links
   =========================================== */
@media (max-width: 900px) {
  #station-metadata > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  #station-metadata .meta-media {
    align-self: stretch !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;      /* horizontal zentriert */
    align-items: center !important;
    margin-top: 8px !important;
  }

  #station-metadata .meta-media img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 250px !important;
    width: auto !important;
    height: auto !important;
  }
}
