/* Weather at the company's seat in the header (frontend/weather.js): one quiet line before the header actions and a panel with the
   details. Small type in the colours of the text (variables of frontend/theme.css, so light and dark both work); the weather symbols
   in soft weather colours and the warnings of the DWD in the colours of its warning levels. The values after the comma only stand in
   where an older frontend/theme.css lacks the variable. */
:root{
  /* Warning levels of the DWD (1 Wetterwarnung yellow, 2 Markantes Wetter orange, 3 Unwetter red, 4 Extremes Unwetter violet), as the
     DWD shows them; the mark „!“ on them in --dwd-mark. Used only for the warnings, never as a colour of the interface. */
  --dwd-1:#f2c200;--dwd-2:#f08c00;--dwd-3:#d7301f;--dwd-4:#8e1b5e;--dwd-mark:#1f1f23;--dwd-mark-4:#fff;
  /* Parts of the weather symbols (user wish 2026-10-19: a little colour): sun and lightning, moon, clouds, rain, snow, hail, fog,
     wind. Only for these symbols – they are pictures of the weather, not states of the interface. */
  --wx-sun:#e9a100;--wx-moon:#7d86a6;--wx-cloud:#8d959e;--wx-rain:#2f7fd1;--wx-snow:#45a6dd;--wx-hail:#5d8fbb;--wx-fog:#959ca4;--wx-wind:#5f8db5;
}
@media screen{
  :root[data-theme=dark]{--dwd-3:#e8452f;--dwd-4:#b8357f;
    --wx-sun:#f6bd3a;--wx-moon:#aab2cf;--wx-cloud:#a9b1ba;--wx-rain:#62a8f0;--wx-snow:#7cc3ee;--wx-hail:#8db6da;--wx-fog:#a9b0b8;--wx-wind:#8db3d6}
}

/* The line: the current weather, then today and the next two days (weather.js HEADER_DAYS) with room between them – fewer when the
   header is narrow, none on a phone (the current weather stays). It takes the free width of the header and stands at its right end,
   right before the header actions; it gives way before „← Zurück zu …“ does (flex-shrink is weighted by the width, so the factor has to
   be large), and days that do not fit wrap into the hidden second row, so a day is never cut in half. */
.weather{display:flex;justify-content:flex-end;flex:1 1000 auto;min-width:auto}
.weather-button{display:flex;align-items:center;gap:20px;min-width:0;height:34px;padding:0 10px;border:1px solid transparent;border-radius:var(--radius-sm,8px);
  background:none;color:var(--ink-soft);font-size:12px;line-height:1;white-space:nowrap;transition:background .15s,border-color .15s}
.weather-button:hover,.weather-button[aria-expanded=true]{background:var(--hover);border-color:var(--line-2,#d6d6d6)}
.weather-now{display:inline-flex;align-items:center;gap:6px;flex:none;color:var(--ink);font-size:13px}
.weather-days{display:flex;flex-wrap:wrap;align-content:flex-start;gap:0 20px;min-width:0;height:22px;overflow:hidden}
.weather-day{display:inline-flex;align-items:center;gap:5px;height:22px}
.weather-day .weather-min{margin-left:-1px}
/* Highest temperature in the main text colour, lowest in the secondary one (both readable on the header). */
.weather-max{color:var(--ink)}
.weather-min{color:var(--ink-soft)}
.weather.stale .weather-now,.weather.stale .weather-days{opacity:.65}
.weather-icon{flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.weather-icon-large{width:36px;height:36px;stroke-width:1.4}
/* Colours of the symbol parts; a cloud is filled, so it covers the sun or moon behind it. */
.weather-icon .wx-sun{stroke:var(--wx-sun)}
.weather-icon .wx-sun circle{fill:color-mix(in srgb,var(--wx-sun) 30%,transparent)}
.weather-icon .wx-moon{stroke:var(--wx-moon);fill:color-mix(in srgb,var(--wx-moon) 22%,transparent)}
.weather-icon .wx-cloud{stroke:var(--wx-cloud);fill:color-mix(in srgb,var(--wx-cloud) 16%,var(--surface,#fff))}
.weather-icon .wx-rain{stroke:var(--wx-rain);stroke-width:1.8}
.weather-icon .wx-snow{fill:var(--wx-snow);stroke:none}
.weather-icon .wx-hail{stroke:var(--wx-hail);fill:color-mix(in srgb,var(--wx-hail) 25%,transparent)}
.weather-icon .wx-bolt{stroke:var(--wx-sun);fill:var(--wx-sun)}
.weather-icon .wx-fog{stroke:var(--wx-fog)}
.weather-icon .wx-wind{stroke:var(--wx-wind)}
.weather-alert-badge{display:inline-flex}
.weather-alert-icon{color:var(--dwd-mark)}
.weather-alert-icon .weather-alert-fill{fill:var(--dwd-1);stroke:var(--dwd-1)}
.level-moderate .weather-alert-fill{fill:var(--dwd-2);stroke:var(--dwd-2)}
.level-severe .weather-alert-fill{fill:var(--dwd-3);stroke:var(--dwd-3)}
.level-extreme .weather-alert-fill{fill:var(--dwd-4);stroke:var(--dwd-4)}
.level-extreme .weather-alert-icon{color:var(--dwd-mark-4)}

/* The details below the header, right-aligned (positioned by the header, so they never leave the window). Their right edge is the one
   of the header actions: the margin of the header, at least the safe area of a phone (camera at the side in landscape, --safe-* of
   frontend/styles.css); they end above the home bar and scroll inside. Heights in dvh, the visible height. */
.weather-panel{position:absolute;top:calc(100% + 6px);right:max(32px,var(--safe-right));z-index:40;width:380px;
  max-height:calc(100dvh - var(--topbar) - var(--safe-top) - var(--safe-bottom) - 24px);overflow:auto;
  padding:16px 18px;background:var(--surface,#fff);border:1px solid var(--line);border-radius:var(--radius,12px);box-shadow:var(--shadow-2);color:var(--ink);
  font-size:12px;line-height:1.5}
.weather-panel:focus{outline:none}
.weather-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.weather-titles{min-width:0}
.weather-title{margin:0 0 2px;font-size:16px;letter-spacing:-.2px;overflow-wrap:anywhere}
.weather-close{margin:-6px -8px 0 0}
.weather-note{margin:4px 0 0;color:var(--muted);font-size:11px;overflow-wrap:anywhere}
.weather-message{margin:0 0 10px;padding:8px 10px;border:1px solid var(--warn-line,#ecdab8);border-radius:var(--radius-sm,8px);background:var(--warn-bg,#fff9eb);color:var(--warn-text,#876b35);font-size:12px}
.weather-current{padding:10px 0 12px;border-bottom:1px solid var(--line)}
.weather-current-head{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px}
.weather-current-temperature{font-size:24px;letter-spacing:-.4px}
.weather-current-name{color:var(--ink-soft);font-size:13px}
.weather-facts{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:8px;color:var(--ink-soft)}
.weather-fact{display:inline-flex;align-items:center;gap:4px}
.weather-wind-arrow{width:14px;height:14px}
.weather-alerts{padding:10px 0;border-bottom:1px solid var(--line)}
.weather-alerts .weather-note:first-child{margin-top:0}
/* A warning: side line in the colour of its level, a light tint of it as background (also in the dark theme). */
.weather-alert{--level:var(--dwd-1);margin:0 0 8px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--level) 35%,var(--surface,#fff));border-left:4px solid var(--level);
  border-radius:var(--radius-sm,8px);background:color-mix(in srgb,var(--level) 9%,var(--surface,#fff))}
.weather-alert.level-moderate{--level:var(--dwd-2)}
.weather-alert.level-severe{--level:var(--dwd-3)}
.weather-alert.level-extreme{--level:var(--dwd-4)}
.weather-alert-head{display:flex;align-items:flex-start;gap:6px;margin:0;overflow-wrap:anywhere}
.weather-alert-meta{margin:2px 0 0 22px;color:var(--ink-soft);font-size:11px}
.weather-alert-text{margin:6px 0 0;white-space:pre-line;overflow-wrap:anywhere}
.weather-subtitle{margin:12px 0 6px;font-size:13px;font-weight:600}
.weather-forecast{display:grid;gap:2px;margin:0;padding:0;list-style:none}
.weather-forecast-day{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:2px 10px;padding:6px 0;border-bottom:1px solid var(--line)}
.weather-forecast-name{display:flex;flex-wrap:wrap;gap:0 8px;min-width:0}
.weather-forecast-name span{color:var(--ink-soft)}
.weather-forecast-temperatures{display:flex;gap:6px;font-size:13px}
.weather-forecast-details{grid-column:2/-1;color:var(--muted);font-size:11px}
.weather-source{margin:10px 0 0;color:var(--muted);font-size:11px;overflow-wrap:anywhere}
.weather-alerts .weather-source{margin-top:6px}
.weather-link{display:inline-block;margin-top:2px;color:var(--ink-soft);font-size:11px}

@media (max-width:1100px){
  .weather-panel{right:max(20px,var(--safe-right))}
}
/* Phone: only the current weather in the header; the details use the width of the window inside the safe area. */
@media (max-width:600px){
  .weather-button{gap:0;padding:0 6px}
  .weather-days{display:none}
  .weather-panel{left:max(8px,var(--safe-left));right:max(8px,var(--safe-right));width:auto}
}
