/* The page bodies of the city pages and the legal pages. Colors, fonts, text styles, header, footer and page frame
   come from ../shared/shared.css. */

/* Colors that show data: the scale of the DWD radar, the DWD warning levels and the markers of the road map */
:root {
  --radar-scale: linear-gradient(90deg, #8ff 0%, #0cc 12%, #090 25%, #9c0 37%, #ff0 50%, #f90 62%, #f00 75%, #33f 87%, #c0c 100%);
  --alert-minor: #e5c100;
  --alert-moderate: #f08c00;
  --alert-severe: #d6202a;
  --alert-extreme: #8e1b8e;
  --marker-closed: #b3263a;
  --marker-other: #d98a1c;
}

/* A link to a place in the page stops below the logo row, which stays at the top of the window */
html { scroll-padding-top: 88px; }

img { max-width: 100%; display: block; }

.wrap { padding: 0 var(--gutter); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

main {
  padding: 32px 0 56px;
  color: var(--color-text-default);
  font: var(--text-p-m);
}

main a { color: var(--color-text-action); }

main h1, main h2, main h3, main h4 {
  margin: 0 0 10px;
  color: var(--color-text-bold);
}

main h1 { font: var(--text-title-m); }
main h2 { font: var(--text-h-1); }
main h3, main h4 { font: var(--text-h-3); }

/* Startseite: the page header with the title on the left and the photo on the right */
.page-intro {
  display: flex;
  /* Cancels the top padding of main, so the header touches the logo row */
  margin: -32px 0 32px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.page-intro-text { flex: 1 1 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 40px var(--gutter); }
.page-intro h1 { margin: 0; color: var(--color-text-very-bold); font: var(--text-title-l); }
.page-intro em { font-family: var(--font-serif); font-weight: 400; }
.page-intro p { margin: 0; max-width: 720px; font: var(--text-p-l); }
/* Stands on the bottom line of the header; half the pixel height of the image, so it stays sharp on 2x screens */
.page-intro-visual { flex: none; width: auto; height: 320px; align-self: flex-end; }

/* Startseite: the menu, the news and the widgets side by side */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  column-gap: 40px;
  align-items: start;
}

/* The menu stays below the logo row */
.home > .side-nav { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 88px; }
.home > .lead-story, .home #nachrichten { grid-column: 2; }
.home .sidebar { grid-column: 3; grid-row: 1 / span 2; }
/* The news and the widgets are cells of the grid above */
.home > .layout { display: contents; }

.side-nav h2 { margin: 0 0 8px; font: var(--text-h-3); }
.side-nav ul { list-style: none; margin: 0; padding: 0; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  color: var(--color-text-default);
  font: var(--text-label-l);
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a[aria-current="page"] { color: var(--color-text-very-bold); }

/* The icon takes the color of the text */
.side-nav a::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-house { --icon: url("../shared/icons/house.svg"); }
.icon-newspaper { --icon: url("../shared/icons/newspaper.svg"); }
.icon-calendar-blank { --icon: url("../shared/icons/calendar-blank.svg"); }
.icon-traffic-cone { --icon: url("../shared/icons/traffic-cone.svg"); }
.icon-cloud-sun { --icon: url("../shared/icons/cloud-sun.svg"); }

.lead-story {
  display: grid;
  gap: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: 32px;
}

.lead-story .visual { min-height: 260px; }

.kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--color-text-action);
  font: var(--text-h-5);
  text-transform: uppercase;
}

.lead-story h2 a,
.card h3 a { text-decoration: none; }

.lead-story h2 a:hover,
.card h3 a:hover { text-decoration: underline; }

.meta {
  margin: 0 0 10px;
  color: var(--color-text-subtle);
  font: var(--text-label-m);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.card {
  display: flex;
  flex-direction: column;
}

.card .visual { height: 170px; margin-bottom: 14px; }

.card p { margin: 0 0 8px; }

.section-title {
  border-bottom: 2px solid var(--color-border-action-highlight);
  padding-bottom: 6px;
  margin: 0 0 20px;
}

.sidebar .box,
.wetter .box {
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 24px;
  font: var(--text-label-l);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 8px 0;
  border-top: 1px solid var(--color-border-subtle);
}

.sidebar li:first-child { border-top: 0; padding-top: 0; }

.sidebar .date {
  display: block;
  color: var(--color-text-subtle);
  font: var(--text-h-5);
}

.sidebar li a { color: inherit; text-decoration: none; }
.sidebar li a:hover { text-decoration: underline; }

.facts dt { color: var(--color-text-subtle); font: var(--text-h-5); }
.facts dd { margin: 0 0 8px; color: var(--color-text-very-bold); font: var(--text-label-l-bold); }

/* Vorschaubilder auf der Startseite */
.visual {
  border-radius: 6px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--color-background-box);
}

/* Artikelfotos mit Bildnachweis */
.photo { margin: 8px 0 28px; }

.photo img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--color-background-box);
}

.photo figcaption,
.video figcaption {
  margin-top: 8px;
  color: var(--color-text-subtle);
  font: var(--text-p-s);
}

.photo .credit,
.video .credit { display: block; margin-top: 2px; }

.credits { font: var(--text-p-s); }

.photo .credit a,
.video .credit a,
.credits a { color: inherit; }

/* Artikelseite */
.article {
  max-width: 720px;
  margin: 0 auto;
  font: var(--text-p-l);
}

.standfirst {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--color-text-subtle);
  font: var(--text-p-xl);
}

.article h2 { margin-top: 32px; font: var(--text-h-2); }

.article blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--color-border-action);
  font: var(--text-p-xl);
  font-style: italic;
}

.back {
  display: inline-block;
  margin-top: 36px;
  font: var(--text-label-m-bold);
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.infobox {
  background: var(--color-background-box);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
}

.infobox p { margin: 0 0 6px; }
.infobox p:last-child { margin-bottom: 0; }

/* Quellenangabe unter Artikeln */
.source {
  margin: 32px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-subtle);
  font: var(--text-p-s);
}

.source a { color: inherit; }

/* Autor unter Artikeln und Autorenseite */
.author-box {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 32px 0 0;
  padding: 18px 20px;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-border-action);
  border-radius: 10px;
}

.author-box > a { flex: none; }

.author-box img,
.author-head img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.author-box img {
  width: 80px;
  height: 80px;
  box-shadow: 0 0 0 3px var(--color-background-elevated), 0 0 0 4px var(--color-border-subtle);
}

.author-box p { margin: 0; color: var(--color-text-subtle); font: var(--text-label-m); }
.author-box .author-label {
  margin-bottom: 2px;
  color: var(--color-text-action);
  font: var(--text-h-5);
  text-transform: uppercase;
}
.author-box .author-name { margin-bottom: 4px; color: var(--color-text-bold); font: var(--text-h-3); }
.author-box .author-name a { color: inherit; text-decoration: none; }
.author-box .author-name a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .author-box { gap: 14px; padding: 16px; }
  .author-box img { width: 64px; height: 64px; }
}

.author-head {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 8px;
}

.author-head img { width: 160px; height: 160px; flex: none; }
.author-head h1 { margin: 0; }
.author-role { margin: 4px 0 0; color: var(--color-text-subtle); font: var(--text-label-m); }
.author-articles { font: var(--text-p-m); }
.author-articles li { margin-bottom: 8px; }
.author-articles .meta { margin-left: 6px; white-space: nowrap; }

@media (max-width: 600px) {
  .author-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .author-head img { width: 120px; height: 120px; }
}

.box-note {
  margin: 12px 0 0;
  color: var(--color-text-subtle);
  font: var(--text-label-s);
}

.box-note a { color: inherit; }

/* Regenradar: Kartengrundlage, Radarbild und Ortsnamen übereinander */
.radar-map {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-background-box);
}

.radar-map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.radar-rain { opacity: 0; transition: opacity .2s; }
.radar-ready .radar-rain { opacity: .85; }
.radar-forecast .radar-rain { opacity: .6; }

.radar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.radar-play {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: 50%;
  background: var(--color-background-default);
  color: var(--color-text-bold);
  cursor: pointer;
}

.radar-play svg { width: 16px; height: 16px; fill: currentColor; }
.radar-play .i-pause,
.radar-play[aria-pressed="true"] .i-play { display: none; }
.radar-play[aria-pressed="true"] .i-pause { display: inline; }

.radar-range { flex: 1; min-width: 0; accent-color: var(--color-background-action); }

.radar-time {
  flex: none;
  color: var(--color-text-subtle);
  font: var(--text-label-s);
  font-variant-numeric: tabular-nums;
}

.radar-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  color: var(--color-text-subtle);
  font: var(--text-label-s);
  background: var(--radar-scale) top / 100% 6px no-repeat;
}

/* Wetterseite */
.wetter h2 { font: var(--text-h-2); }

.wx-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--color-text-bold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wx-icon .wx-fill { fill: var(--color-background-elevated); }
.wx-icon .wx-dot { fill: var(--color-text-bold); stroke: none; }

.wx-max { color: var(--color-text-bold); font-weight: 600; }

.wx-top {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: start;
}

.wx-loading, .wx-error { color: var(--color-text-subtle); }

.wx-now-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 18px;
}

.wx-icon.wx-icon-lg { width: 64px; height: 64px; stroke-width: 1.3; }
.wx-now-temp { color: var(--color-text-bold); font: var(--text-title-l); }
.wx-now-label { color: var(--color-text-subtle); font: var(--text-label-l); }

.wx-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin: 0;
}

.wx-facts dt { color: var(--color-text-subtle); font: var(--text-label-s); }
.wx-facts dd { margin: 0; font: var(--text-label-m-bold); }

.wx-section { margin-top: 36px; }

.wx-hours-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.wx-hours-list li {
  position: relative;
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-background-elevated);
  font: var(--text-label-m);
}

.wx-hours-list .wx-icon { width: 24px; height: 24px; }
.wx-h { color: var(--color-text-subtle); font: var(--text-label-s); }
.wx-t { font: var(--text-label-m-bold); }
.wx-p { color: var(--color-text-info); font: var(--text-label-s); }

.wx-table-wrap { overflow-x: auto; }

.wx-days {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  font: var(--text-label-m);
}

.wx-days th, .wx-days td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}

.wx-days thead th { color: var(--color-text-subtle); font: var(--text-label-s-bold); }
.wx-days tbody tr:last-child > * { border-bottom: 0; }
.wx-cond { display: inline-flex; align-items: center; gap: 8px; }
.wx-cond .wx-icon { width: 22px; height: 22px; }
.wx-sub { display: block; color: var(--color-text-subtle); font: var(--text-label-s); }

/* Wetterwarnungen nach DWD-Warnstufe */
.wx-alerts { margin-bottom: 24px; }
.wx-alert {
  margin: 0 0 12px;
  padding: 14px 18px;
  border-radius: 6px;
  border-left: 6px solid var(--alert-minor);
  background: var(--color-background-elevated);
}

.wx-alert h2 { margin: 0 0 4px; font: var(--text-h-3); }
.wx-alert p { margin: 6px 0 0; }
.wx-alert-time { color: var(--color-text-subtle); font: var(--text-label-m); }
.wx-sev-moderate { border-left-color: var(--alert-moderate); }
.wx-sev-severe { border-left-color: var(--alert-severe); }
.wx-sev-extreme { border-left-color: var(--alert-extreme); }
.wx-alert-none { border-left-color: var(--color-text-success); color: var(--color-text-subtle); }

@media (max-width: 800px) {
  .wx-top { grid-template-columns: minmax(0, 1fr); }
}

/* Rechtliches */
.legal {
  max-width: 720px;
  margin: 0 auto;
  font: var(--text-p-l);
}

.legal h2 { margin-top: 28px; font: var(--text-h-2); }
.legal address { font-style: normal; }
.legal code { font: var(--text-label-m); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.legal pre {
  margin: 16px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--color-background-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
}

/* Responsiv: first the menu goes above the news as one row, then the widgets go below the news */
@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .home > .side-nav { grid-column: 1 / -1; grid-row: auto; position: static; margin-bottom: 16px; }
  .home > .lead-story, .home #nachrichten { grid-column: 1; }
  .home .sidebar { grid-column: 2; grid-row: 2 / span 2; }
  .side-nav h2 { display: none; }
  .side-nav ul { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
}

@media (max-width: 900px) {
  .page-intro-visual { display: none; }
  .home { display: block; }
  .home .sidebar { margin-top: 32px; }
}

@media (max-width: 640px) {
  main h1 { font: var(--text-h-1); }
  .page-intro h1 { font: var(--text-title-m); }
  .lead-story .visual { min-height: 200px; }
  .grid { grid-template-columns: 1fr; }
  .photo img { height: 220px; }
}

/* Terminseite */
.event-month {
  margin: 40px 0 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border-action-highlight);
}
.event-date {
  margin: 28px 0 4px;
  color: var(--color-text-success);
  font: var(--text-label-s-bold);
  text-transform: uppercase;
}
.events { list-style: none; margin: 0; padding: 0; }
.event {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--color-border-subtle);
  scroll-margin-top: 16px;
}
.event:target { background: var(--color-background-box); }
.event-time { color: var(--color-text-bold); font: var(--text-label-m-bold); }
.event h3 { margin: 0 0 4px; }
.event h3 a { text-decoration: none; }
.event h3 a:hover { text-decoration: underline; }
.event p { margin: 0; color: var(--color-text-subtle); font: var(--text-label-m); }
.termine > .box-note { margin-top: 40px; }
@media (max-width: 600px) {
  .event { grid-template-columns: 1fr; gap: 2px; }
}

/* Karte der Baustellen (Leaflet, baustellen-karte.js) */
.roadmap {
  height: 420px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-background-box);
  z-index: 0;
}
.roadmap-legend { margin: 8px 0 0; color: var(--color-text-subtle); font: var(--text-label-s); }
.roadmap-legend span { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin: 0 5px 0 0; vertical-align: -1px; }
.roadmap-legend .dot-other { margin-left: 14px; }
.roadmap-legend .dot-closed { background: var(--marker-closed); }
.roadmap-legend .dot-other { background: var(--marker-other); }
@media (max-width: 600px) {
  .roadmap { height: 320px; }
}

/* Videos von YouTube: erst nach Klick geladen (video.js). The box has the inverted colors of the page. */
.video { margin: 8px 0 28px; }
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: var(--color-background-inverted-default);
  color: var(--color-text-inverted-very-bold);
  border-radius: 6px;
  text-align: center;
}
.video-embed.is-loaded { padding: 0; }
.video-embed iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; }
.video-load {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--color-background-default);
  color: var(--color-text-very-bold);
  font: var(--text-label-l-bold);
  cursor: pointer;
}
.video-load:hover { opacity: 0.85; }
.video-load svg { width: 18px; height: 18px; fill: currentColor; }
.video-hint { margin: 0; max-width: 460px; color: var(--color-text-inverted-subtle); font: var(--text-label-s); }
.video-hint a { color: inherit; }
@media (max-width: 600px) {
  .video-embed { aspect-ratio: auto; min-height: 220px; }
  .video-embed.is-loaded { aspect-ratio: 16 / 9; min-height: 0; }
}

/* Fußball-Box in der Seitenleiste */
.match { margin: 0; }
.match a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: inherit; text-decoration: none; }
.match a:hover { text-decoration: underline; }
.match-teams { color: var(--color-text-very-bold); font: var(--text-label-l-bold); }
.match-score { color: var(--color-text-subtle); font: var(--text-h-1); }
.match-meta { margin: 2px 0 10px; color: var(--color-text-subtle); font: var(--text-label-s); }
.match-video { margin: 0; font: var(--text-label-m-bold); }
