/* =========================================================
   METEO WIDEN – KOPFBEREICH
   Desktop, Tablet, Mobile Landscape und Mobile Portrait
   ========================================================= */

/* ---------------------------------------------------------
   1. Grundlayout
   --------------------------------------------------------- */

:root {
  color-scheme: dark;

  --background: #0c141c;
  --card: #17232e;
  --card-light: #1d2d3a;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f7fa;
  --text-head: #7bfc88;
  --text-head2: #ceffd3;
  --muted: #aebdc8;
  --accent: #69c6ff;
  --radius: 28px;
}

html {
  background: var(--background);
}

body {
  margin: 0;

  background: radial-gradient(
    circle at top,
    #17344a 0,
    var(--background) 440px
  );

  color: var(--text);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.hero,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.hero {
  box-sizing: border-box;

  width: 100%;
  padding: 14px 18px;

  color: #ffffff;

  background: linear-gradient(
    135deg,
    rgba(18, 70, 105, 0.98),
    rgba(28, 49, 66, 0.98)
  );

  overflow: hidden;
}

/* ---------------------------------------------------------
   2. Titel und Aktualisierungszeit
   --------------------------------------------------------- */

.hero-top {
  grid-area: top;
  min-width: 0;
}

.hero h1 {
  margin: 0;

  color: #ffffff;

  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.updated {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.35em;

  margin-top: 7px;

  color: #b9c8d3;

  font-size: 1rem;
  line-height: 1.35;
}

.updated-label,
.updated-date {
  color: #b9c8d3;
}

.updated-time {
  color: #ffffff;
  font-weight: 700;
}

/* ---------------------------------------------------------
   3. Wettericon und Wetterzustand
   --------------------------------------------------------- */

.hero-weather-icon svg,
.hero-weather-icon canvas {
  display: block;

  width: 100% !important;
  height: 100% !important;

  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.25));
}

/* =========================================================
   HERO – DESKTOP
   ========================================================= */

.hero-main {
  position: relative;
  z-index: 1;

  display: grid;

  grid-template-columns: minmax(0, 1fr) 460px;

  grid-template-areas:
    "top    visual"
    "values visual";

  align-items: center;
  column-gap: 32px;
  row-gap: 6px;
}

.hero-weather-visual {
  grid-area: visual;

  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 28px;

  width: auto;
  padding: 0;
}

.hero-weather-icon {
  flex: 0 0 210px;

  width: 210px;
  height: 210px;

  margin: 0;
  padding: 0;
}

.hero-weather-visual .hero-condition {
  margin: 0;

  color: #e6eef5;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   4. Temperaturwerte
   --------------------------------------------------------- */

.hero-values {
  grid-area: values;
  min-width: 0;
}

.temperature {
  margin-top: 2px;

  color: #ffffff;

  font-size: clamp(4.5rem, 8vw, 7rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.06em;
  /* white-space: nowrap;  */
}

.smallgradcelsius {
  /*margin-left: 0.08em;*/

  font-size: 0.32em;
  font-weight: 400;
  letter-spacing: normal;
  /*vertical-align: middle;*/
  vertical-align: baseline;
}

.feels-like {
  margin-top: 2px;

  color: #f0f5f8;

  font-size: 1.08rem;
  line-height: 1.35;
}

.today-range {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;

  margin-top: 18px;

  color: #cbd7df;

  font-size: 0.98rem;
  line-height: 1.4;
}

.nowrap {
  white-space: nowrap;
}

.pressure-trend-arrow {
  display: inline-block;
  margin-left: 10px;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1;
}

.pressure-trend-arrow.rising {
  color: #ff6b6b;
}

.pressure-trend-arrow.falling {
  color: #63b3ff;
}

.pressure-trend-arrow.steady {
  color: #d9e1ea;
}

/* =========================================================
   TABLET UND SCHMALER DESKTOP
   ========================================================= */

@media (max-width: 900px) {
  .hero {
    padding: 22px;
  }

  .hero-main {
    grid-template-columns:
      minmax(220px, 1fr)
      minmax(230px, 300px);

    column-gap: 20px;
  }

  .hero-weather-visual {
    gap: 10px;
  }

  .hero-weather-icon {
    flex-basis: 170px;

    width: 170px;
    height: 170px;
  }

  .hero-condition {
    width: 105px;
    font-size: 1.05rem;
  }

  .temperature {
    font-size: clamp(4rem, 10vw, 5.7rem);
  }
}

/* =========================================================
   HANDY LANDSCAPE
   Breiter als hoch, aber mit geringer Bildschirmhöhe
   ========================================================= */

@media (max-width: 900px) and (orientation: landscape) {
  .hero {
    padding: 14px 20px;
  }

  .hero-main {
    grid-template-columns:
      minmax(260px, 1fr)
      minmax(230px, 310px);

    grid-template-areas:
      "top    visual"
      "values visual";

    column-gap: 20px;
    row-gap: 6px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .updated {
    margin-top: 4px;
    font-size: 0.9rem;
  }

  .hero-weather-visual {
    gap: 8px;
  }

  .hero-weather-icon {
    flex-basis: 135px;

    width: 135px;
    height: 135px;
  }

  .hero-condition {
    width: 105px;
    font-size: 0.96rem;
  }

  .temperature {
    margin-top: 0;

    font-size: clamp(3.6rem, 10vw, 5.2rem);
  }

  .feels-like {
    margin-top: 8px;
    padding-bottom: 10px;
    font-size: 0.95rem;
  }

  .today-range {
    margin-top: 13px;
    font-size: 0.86rem;
  }
}

/* =========================================================
   HANDY PORTRAIT
   ========================================================= */

@media (max-width: 600px) and (orientation: portrait) {
  .hero {
    padding: 18px;
  }

  .hero-main {
    grid-template-columns: minmax(0, 1fr);

    .hero-temperature-trend.rising {
      color: #ff3b30;
    }

    .hero-temperature-trend.falling {
      color: #ff3b30;
    }

    grid-template-areas:
      "top"
      "visual"
      "values";

    row-gap: 14px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .updated {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .hero-weather-visual {
    justify-content: space-between;
    gap: 12px;

    width: 100%;
  }

  .hero-weather-icon {
    flex: 0 0 min(46vw, 165px);

    width: min(46vw, 165px);
    height: min(46vw, 165px);
  }

  .hero-weather-visual .hero-condition {
    flex: 1 1 0;
    width: auto;
    min-width: 0;

    font-size: 1.05rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
  }

  .temperature {
    margin-top: 0;

    font-size: clamp(4.4rem, 22vw, 6rem);
  }

  .feels-like {
    margin-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem;
  }

  .today-range {
    flex-direction: column;
    gap: 2px;

    margin-top: 15px;
    font-size: 0.93rem;
  }
}

/* =========================================================
   SEHR SCHMALE HANDYS
   ========================================================= */

@media (max-width: 380px) and (orientation: portrait) {
  .hero {
    padding: 15px;
  }

  .hero-weather-icon {
    flex-basis: 135px;

    width: 135px;
    height: 135px;
  }

  .hero-condition {
    font-size: 0.96rem;
  }

  .temperature {
    font-size: 4.2rem;
  }

  .today-range {
    font-size: 0.86rem;
  }

  .feels-like {
    margin-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem;
  }
}

/* =========================================================
   HERO-HÖHE ENDGÜLTIG KORRIGIEREN
   ========================================================= */

.hero {
  height: auto !important;
  min-height: 0 !important;
}

.hero-main {
  height: auto !important;
  min-height: 0 !important;
}

.hero-top,
.hero-values,
.hero-weather-visual,
.hero-weather-icon {
  min-height: 0 !important;
}

.hero-temperature-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

/* .hero-temperature-trend {
  height: 18px;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
} */

.hero-temperature-trend.rising {
  color: #ff3b30;
}

.hero-temperature-trend.falling {
  color: #ff3b30;
}

/* =========================================================
   DASHBOARD UND WETTERKARTEN
   ========================================================= */

.dashboard {
  box-sizing: border-box;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  box-sizing: border-box;
  min-width: 0;
  padding: 20px;

  color: var(--text);

  background: linear-gradient(145deg, var(--card-light), var(--card));
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.icon {
  flex: 0 0 36px;
  width: 36px;

  font-size: 1.6rem;
  line-height: 1;
  text-align: center;
}

.card h2 {
  margin: 0;

  color: var(--muted);

  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.value {
  color: var(--text-head2);

  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
}

.detail {
  margin-top: 12px;

  color: var(--muted);

  font-size: 0.96rem;
  line-height: 1.45;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;

  margin-top: 8px;
  padding-top: 8px;

  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.detail-row span:last-child {
  color: var(--text);
  text-align: right;
}

.detail-row span.pressure-trend-arrow {
  display: inline-block;
  margin-left: 8px;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1;
}

.detail-row span.pressure-trend-arrow.rising {
  color: #ff6b6b;
}

.detail-row span.pressure-trend-arrow.falling {
  color: #63b3ff;
}

.detail-row span.pressure-trend-arrow.steady {
  color: #f2c94c;
}

.wind-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.wind-arrow {
  display: flex;
  flex: 0 0 62px;
  align-items: center;
  justify-content: center;

  width: 62px;
  height: 62px;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;

  background: rgba(105, 198, 255, 0.08);
  color: var(--accent);

  font-size: 2.7rem;
  line-height: 1;
}

.wind-direction {
  margin-top: 5px;

  color: var(--muted);

  font-size: 0.95rem;
}

.wide {
  grid-column: 1 / -1;
}

.webcam {
  display: block;
  width: 100%;
  height: auto;

  margin-top: 5px;

  border-radius: 16px;
  background: #0a1117;
}

.footer {
  margin-top: 18px;

  color: #7f919e;

  font-size: 0.85rem;
  text-align: center;
}

.timelapse-frame {
  display: block;
  width: 100%;
  height: 780px;

  border: 0;
  border-radius: 16px;

  background: #000000;
}

/* =========================================================
     WETTERKARTEN – TABLET
     ========================================================= */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
     WETTERKARTEN – HANDY
     ========================================================= */

@media (max-width: 600px) {
  .dashboard {
    padding: 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 11px;
  }

  .wide {
    grid-column: auto;
  }

  .card {
    padding: 17px;
  }

  .timelapse-frame {
    height: 500px;
  }
}

/* ---------------------------------------------------------
   Dynamische Farbe der Hero-Temperatur
   --------------------------------------------------------- */

.temperature.temp-neutral {
  color: #ffffff;
}
.temperature.temp-freezing {
  color: #9bdcff;
}
.temperature.temp-cold {
  color: #63c7ff;
}
.temperature.temp-mild {
  color: #53d6c7;
}
.temperature.temp-warm {
  color: #ffd45e;
}
.temperature.temp-hot {
  color: #ff9d4d;
}
.temperature.temp-very-hot {
  color: #ff6860;
}
