/* features/weather.css — Besitzer: Feature "weather" (Hero-Widget + Profil-Karte).
   Nur Klassen mit eigenem Präfix (.weather-…) bzw. innerhalb der eigenen Container;
   Farben über die CSS-Variablen aus style.css (:root), damit Dark Mode greift. */

/* hidden-Attribut gewinnt immer (z. B. gegen .btn/.flex-Anzeige). */
.hero-widget[data-widget="weather"][hidden],
.weather-card [hidden],
.profile-card[data-card="weather"] [hidden] { display: none !important; }

/* ===== Hero-Widget ===== */
.weather-card { padding: 20px 22px; }
.weather-top { display: flex; align-items: flex-start; gap: 14px; }
.weather-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
}
.weather-card.is-rain .weather-ico { color: var(--ink-2); }
.weather-main { flex: 1 1 auto; min-width: 0; }
.weather-head {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.weather-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.weather-refresh { flex: 0 0 auto; display: inline-grid; place-items: center; color: var(--muted); }
.weather-refresh:hover { color: var(--ink); }
.weather-card.is-loading .weather-refresh svg { animation: weather-spin 0.9s linear infinite; }
@keyframes weather-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .weather-card.is-loading .weather-refresh svg { animation: none; }
}

/* Warnungen (Hitze/Frost/Wind/Gewitter) */
.weather-warn {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weather-warn-item {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.weather-warn-item.hot,
.weather-warn-item.alert { background: var(--debt-soft); border-color: transparent; color: var(--debt); }

/* Regen-Zeitleiste (SVG, gestreckt auf volle Breite; Beschriftung als HTML darunter) */
.weather-tl:empty { display: none; }
.weather-tl { margin-top: 16px; }
.weather-chart { display: block; width: 100%; height: 40px; overflow: visible; }
.weather-bar { fill: var(--line); }
.weather-bar.wet { fill: var(--muted); }
.weather-win { fill: var(--good-soft); stroke: var(--good); stroke-width: 1; vector-effect: non-scaling-stroke; }
.weather-now { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 2 2; }
.weather-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ===== Profil-Karte ===== */
.weather-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.weather-current-text { min-width: 0; overflow-wrap: anywhere; }
.profile-card .weather-current .btn { margin-top: 0; }
.weather-search { display: flex; gap: 10px; align-items: flex-start; }
.weather-search .profile-field { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.profile-card .weather-search .btn { margin-top: 0; flex: 0 0 auto; }
.weather-msg { margin: 10px 0 0; min-height: 0; }
.weather-msg:empty { display: none; }
.profile-card .weather-msg.modal-hint { margin: 10px 0 0; }
.weather-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weather-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.weather-result:hover { border-color: var(--ink-2); background: var(--card); }
.weather-result:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.weather-result svg { flex: 0 0 auto; color: var(--muted); }
.weather-result span { min-width: 0; overflow-wrap: anywhere; }
.profile-card .weather-geo { margin-top: 14px; }

@media (max-width: 560px) {
  .weather-card { padding: 16px; }
  .weather-top { gap: 12px; }
  .weather-ico { width: 38px; height: 38px; border-radius: 11px; }
  .weather-head { font-size: 16px; }
  .weather-search { flex-direction: column; align-items: stretch; }
  .profile-card .weather-geo { width: 100%; }
}
