/* ==========================================================================
   Raumplan – Bildschirm
   Gestaltung nach „VA Gestaltungsvorgaben RDMH“ (Stand 24.03.2026):
   - Schrift Helvetica Neue / Arial (5.2, 5.2.1), Bold für Überschriften;
     Leitsatz in der Fußzeile in Merriweather Light Italic (Zitat außerhalb des Fließtexts).
   - Farben nur Primär- und Sekundärfarben (5.3): Rot = belegt, Blau = frei,
     Lachs (DRK-Sekundär) = Veranstaltung, Grau = gesperrt; Schwarz nur als Schrift.
   - Hell und sachlich (9.3.3).
   Feste Vorgaben (unverändert): Logo 1 links / Logo 2 rechts in einer Linie, RDMH-Logo
   als Hauptlogo etwas größer (5.4, 5.4.3), rote Bereichsbalken mit Name und Anzahl,
   roter Spruch mittig in weißer Fußzeile, Hintergrundbild unter dem Kopf mit einstellbarer Transparenz.
   Nur Darstellung – Klassen, Struktur und Logik unverändert.
   ========================================================================== */

@font-face { font-family: "Merriweather"; src: url("/fonts/merriweather-300i.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --accent: #e60005;           /* Einstellungen → Akzentfarbe */
  --red: #e60005; --blue: #1662a3; --grey: #a6a6a6;
  --navy: #002d55; --ice: #ebf5ff; --salmon: #eb8264; --peach: #fac3af; --steel: #698caf; --mist: #b4c3d7;
  --blue-10: #e8eff6; --blue-20: #d0e0ed; --red-10: #fde6e6; --grey-10: #f6f6f6; --grey-30: #e4e4e4; --grey-50: #d3d3d3; --peach-50: #fde1d7;
  --brand-red: var(--red);
  --text: #000; --muted: var(--navy); --line: var(--grey-30);
  --shadow: 0 .1vh .3vh rgba(0, 45, 85, .1), 0 .3vh 1.2vh rgba(0, 45, 85, .07);
  --f-text: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --f-quote: "Merriweather", Georgia, serif;
  --cols: 4;
  --rows: 3;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; width: 100%; height: 100%; overflow: hidden;
  background: var(--ice); color: var(--text);
  font-family: var(--f-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; }
.rp-root { width: 100%; height: 100%; display: grid; }
.rp-message {
  place-self: center; max-width: 70vw; padding: 3.2vh 2.4vw;
  border-top: .7vh solid var(--red); border-radius: 2px;
  background: #fff; box-shadow: var(--shadow); font-size: clamp(1rem, 1.6vw, 1.8rem); color: var(--muted);
}
.rp-message strong { display: block; color: var(--text); margin-bottom: .3em; font-weight: 700; }

/* ---------- Rahmen: weißer Kopf mit roter Linie, helles Blau darunter ---------- */
.rp-slide {
  height: 100vh; padding: 2vh 2.2vw 1.4vh;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 1.4vh;
  background: linear-gradient(180deg, #fff 0, #fff 13vh, var(--grey-50) 13vh, var(--grey-50) calc(13vh + 1px), var(--ice) calc(13vh + 1px));
  border-top: .55vh solid var(--red);
}
.rp-slide.no-toolbar { grid-template-rows: auto minmax(0, 1fr) auto; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; min-height: 8vh; }
.rp-brand { display: flex; align-items: center; gap: 1.4vw; min-width: 0; }
.rp-brand img { width: clamp(44px, 4.4vw, 88px); height: clamp(44px, 4.4vw, 88px); object-fit: contain; }
.rp-brand > div { padding-left: 1.4vw; border-left: 1px solid var(--grey-50); }
.rp-brand strong { display: block; font: 700 clamp(24px, 2.5vw, 54px)/1.05 var(--f-text); color: var(--text); }
.rp-brand span { display: block; color: var(--blue); font: 400 clamp(12px, 1vw, 21px)/1.3 var(--f-text); margin-top: .3em; }
.rp-time { text-align: right; flex: 0 0 auto; }
.rp-clock { font: 700 clamp(30px, 3.3vw, 70px)/1 var(--f-text); font-variant-numeric: tabular-nums; color: var(--text); }
.rp-date { margin-top: .3em; color: var(--blue); font: 400 clamp(13px, 1.05vw, 21px)/1.2 var(--f-text); }
.rp-preview { display: inline-block; margin-top: .35em; padding: .2em .6em; border-radius: 2px; background: var(--peach); color: var(--text); font: 700 clamp(11px, .8vw, 16px) var(--f-text); }

/* ---------- Werkzeugleiste und Zählwerk ---------- */
.rp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1.2vw; flex-wrap: wrap; }
.rp-sites { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--blue); border-radius: 2px; overflow: hidden; background: #fff; }
.rp-sites button, .rp-toggle {
  border: 0; border-left: 1px solid var(--blue-20); background: #fff; color: var(--blue); border-radius: 0;
  padding: .5em 1.1em; font: 700 clamp(12px, .9vw, 18px)/1.2 var(--f-text);
}
.rp-sites button:first-child { border-left: 0; }
.rp-sites button.active { background: var(--blue); color: #fff; }
.rp-sites button:focus-visible, .rp-toggle:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.rp-toggle { border: 1px solid var(--blue); border-radius: 2px; }
.rp-toggle[aria-pressed="true"] { background: var(--blue); color: #fff; }
.rp-summary { display: flex; gap: .6vw; }
.rp-summary div { display: flex; align-items: baseline; gap: .7vw; padding: .6vh 1vw; border-radius: 2px; background: #fff; box-shadow: var(--shadow); }
.rp-summary span { color: var(--muted); font: 400 clamp(11px, .8vw, 17px)/1 var(--f-text); }
.rp-summary strong { font: 700 clamp(19px, 1.6vw, 34px)/1 var(--f-text); font-variant-numeric: tabular-nums; }
.rp-summary .s-occupied { border-left: .4vw solid var(--red); }
.rp-summary .s-free { border-left: .4vw solid var(--blue); }
.rp-summary .s-blocked { border-left: .4vw solid var(--grey); }

/* ---------- Raster der Räume ---------- */
.rp-grid {
  min-height: 0; display: grid; gap: .8vw;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
}
.rp-card {
  container-type: size;
  min-width: 0; min-height: 0; position: relative; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 2px; background: #fff; box-shadow: var(--shadow);
}
.rp-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: max(6px, 1.6cqw); background: var(--grey); }
.rp-card.state-occupied::before { background: var(--accent); }
.rp-card.state-event::before { background: var(--salmon); }
.rp-card.state-free::before, .rp-card.state-free-soon::before { background: var(--blue); }
.rp-card.state-blocked::before { background: repeating-linear-gradient(135deg, var(--grey) 0 6px, var(--grey-50) 6px 12px); }
.rp-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 7cqh 4cqw 1cqh 7cqw; }
.rp-card h2 { margin: 0; font-family: var(--f-text); font-weight: 700; font-size: 14px; font-size: clamp(15px, min(15cqh, 8cqw), 50px); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-card-type { display: block; margin-top: .3em; color: var(--muted); font-size: clamp(11px, min(8cqh, 4.4cqw), 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Status: Farbfläche mit Text (Farbe nie allein – der Text sagt den Zustand) */
.rp-pill {
  flex: 0 0 auto; padding: .25em .6em; border-radius: 2px; background: var(--grey-30); color: var(--text);
  font: 700 clamp(10px, min(7.5cqh, 4cqw), 22px)/1.25 var(--f-text); white-space: nowrap;
}
.state-occupied .rp-pill { background: var(--red); color: #fff; }
.state-event .rp-pill { background: var(--salmon); color: #000; }
.state-free .rp-pill, .state-free-soon .rp-pill { background: var(--blue); color: #fff; }
.state-blocked .rp-pill { background: var(--grey); color: #000; }
.rp-card-main { min-height: 0; padding: 1cqh 4cqw 1cqh 7cqw; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.rp-card-main time { color: var(--red); font: 700 clamp(11px, min(8.5cqh, 4.6cqw), 26px)/1.2 var(--f-text); font-variant-numeric: tabular-nums; }
.state-event .rp-card-main time, .state-blocked .rp-card-main time { color: var(--navy); }
.rp-card-main strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .1em 0 .05em; font-family: var(--f-text); font-weight: 700; font-size: clamp(14px, min(16cqh, 8.5cqw), 52px); line-height: 1.08; }
.rp-card-main p { margin: 0; color: var(--muted); font-size: clamp(11px, min(9cqh, 5cqw), 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-free { color: var(--muted); font: 400 clamp(13px, min(11cqh, 6cqw), 34px)/1.15 var(--f-text); }
.state-free .rp-free, .state-free-soon .rp-free { color: var(--blue); font-weight: 700; }
.rp-card-next { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2.5cqh 4cqw 2.5cqh 7cqw; background: var(--grey-10); border-top: 1px solid var(--line); font-size: clamp(10px, min(8cqh, 4.4cqw), 24px); }
.rp-card-next span { color: var(--muted); white-space: nowrap; }
.rp-card-next strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
@container (max-height: 130px) { .rp-card-main p, .rp-card-type { display: none; } }
.rp-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; border: 2px dashed var(--mist); border-radius: 2px; color: var(--muted); background: #fff; font: 400 clamp(18px, 1.8vw, 36px) var(--f-text); }

.rp-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: clamp(10px, .75vw, 15px); }
.rp-footer .rp-problem { color: var(--red); font-weight: 700; }

/* ---------- Einzelraum (Türschild) ---------- */
.rp-room { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.8vw; }
.rp-room-now {
  min-height: 0; position: relative; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 4vh 3vw; border-radius: 2px; background: #fff; box-shadow: var(--shadow); border-left: 1.4vw solid var(--grey);
}
.rp-room-now.state-occupied { border-left-color: var(--accent); }
.rp-room-now.state-event { border-left-color: var(--salmon); }
.rp-room-now.state-free, .rp-room-now.state-free-soon { border-left-color: var(--blue); }
.rp-room-now.state-blocked { border-left-color: var(--grey); }
.rp-room-now h1 { margin: 0; font: 700 clamp(40px, 6.6vw, 140px)/1 var(--f-text); }
.rp-room-now .rp-card-type { font-size: clamp(14px, 1.4vw, 30px); }
.rp-room-title { display: flex; flex-direction: column; align-items: flex-start; gap: .8vh; }
.rp-room-now .rp-pill { font-size: clamp(14px, 1.3vw, 28px); padding: .3em .8em; margin-top: 1.4vh; }
.rp-room-current { align-self: center; }
.rp-room-current time { display: block; color: var(--red); font: 700 clamp(16px, 1.7vw, 36px)/1.2 var(--f-text); }
.state-event .rp-room-current time, .state-blocked .rp-room-current time { color: var(--navy); }
.rp-room-current strong { display: block; margin: .15em 0; font: 700 clamp(28px, 3.6vw, 80px)/1.05 var(--f-text); }
.rp-room-current p { margin: .4em 0 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 36px); }
.rp-room-nextline { color: var(--muted); font-size: clamp(14px, 1.3vw, 28px); border-top: 1px solid var(--grey-50); padding-top: 2vh; }
.rp-room-nextline strong { color: var(--text); }
/* Tagesablauf als Tabelle */
.rp-day { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1vh; padding: 3vh 1.8vw; border-radius: 2px; background: #fff; box-shadow: var(--shadow); }
.rp-day h3 { margin: 0 0 .8vh; padding-bottom: 1vh; border-bottom: 2px solid var(--red); font: 700 clamp(18px, 1.6vw, 34px)/1.1 var(--f-text); }
.rp-day ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; min-height: 0; overflow: hidden; }
.rp-day li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.3vw; padding: 1.3vh .8vw; background: transparent; border-left: 5px solid var(--grey); border-bottom: 1px solid var(--line); }
.rp-day li.k-course { border-left-color: var(--accent); }
.rp-day li.k-event { border-left-color: var(--salmon); }
.rp-day li.k-block { border-left-color: var(--grey); }
.rp-day li.is-past { opacity: .45; }
.rp-day li.is-now { background: var(--blue-10); box-shadow: 0 0 0 2px var(--blue) inset; }
.rp-day time { font: 700 clamp(13px, 1.1vw, 24px)/1.3 var(--f-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-day strong { display: block; font: 700 clamp(15px, 1.3vw, 28px)/1.15 var(--f-text); }
.rp-day span { display: block; color: var(--muted); font-size: clamp(12px, .95vw, 20px); }
.rp-day .rp-free { padding: 2vh 0; }

@media (max-width: 900px) {
  .rp-slide { padding: 14px; }
  .rp-summary { display: none; }
  .rp-room { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rp-brand span { display: none; }
  .rp-brand > div { padding-left: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .rp-card, .rp-room-now { transition: border-color .4s; }
}

/* ---------- Hinweise, Vorschau-Grund, Seitenanzeige ---------- */
.rp-reason { display: inline-block; margin-top: .4em; padding: .2em .6em; border-radius: 2px; background: var(--blue-10); color: var(--navy); font: 700 clamp(11px, .8vw, 17px)/1.3 var(--f-text); }
.rp-banner { display: flex; gap: 1.2vw; align-items: baseline; padding: .9vh 1.2vw; border-radius: 2px; background: #fff; border-left: .5vw solid var(--red); font-size: clamp(13px, 1vw, 22px); box-shadow: var(--shadow); }
.rp-banner strong { white-space: nowrap; font-weight: 700; }
.rp-slide.has-banner { grid-template-rows: auto auto auto minmax(0, 1fr) auto; }
.rp-slide.no-toolbar.has-banner { grid-template-rows: auto auto minmax(0, 1fr) auto; }
/* Hinweis-Seite */
.rp-notice {
  height: 100vh; padding: 5vh 6vw; display: grid; grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, #fff 0, #fff 14vh, var(--grey-50) 14vh, var(--grey-50) calc(14vh + 1px), var(--ice) calc(14vh + 1px));
  border-top: .65vh solid var(--red);
}
.rp-notice article { position: relative; align-self: center; max-width: 1300px; padding: 5vh 4.5vw 5.5vh; border-left: .6vw solid var(--red); border-radius: 2px; background: #fff; box-shadow: var(--shadow); }
.rp-notice .kicker { color: var(--red); font: 700 clamp(13px, 1.1vw, 22px)/1.2 var(--f-text); }
.rp-notice h1 { margin: .3em 0 .15em; font: 700 clamp(2.4rem, 5vw, 6.4rem)/1.05 var(--f-text); }
.rp-notice p { margin: .6em 0 0; font-size: clamp(1.2rem, 2.1vw, 2.8rem); white-space: pre-wrap; line-height: 1.35; color: var(--text); max-width: 40ch; }
.rp-dots { display: flex; gap: 6px; }
.rp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--mist); }
.rp-dots i.on { background: var(--blue); }

/* ---------- Logos (bis zu zwei, in den Einstellungen änderbar) ---------- */
.rp-logos { display: flex; align-items: center; gap: 1.2vw; flex: none; }
.rp-logos:empty { display: none; }
.rp-brand .rp-logos img { width: auto; height: clamp(48px, 5vw, 100px); max-width: 22vw; object-fit: contain; }

/* Logo 1 (RDMH, Hauptlogo, etwas größer) links neben dem Titel, Logo 2 rechts neben der Uhr – beide auf einer Mittellinie */
.rp-head { align-items: center; }
.rp-head .rp-time { margin-left: auto; }
.rp-logo { display: flex; align-items: center; flex: none; }
.rp-logo img { width: auto; height: clamp(48px, 5vw, 100px); max-width: 22vw; object-fit: contain; }
.rp-logo.right img { height: clamp(40px, 4.2vw, 84px); }
.rp-logo.right { margin-left: 2vw; padding-left: 2vw; border-left: 1px solid var(--grey-50); }
.rp-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }

/* ---------- Fußzeilen-Spruch: mittig, rot, auf allen Bildschirmen ---------- */
.rp-footer.has-slogan { display: grid; grid-template-columns: 1fr auto 1fr; }
.rp-footer .rp-foot-end { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.rp-slogan { color: var(--red); font: italic 300 clamp(16px, 1.75vw, 38px)/1.15 var(--f-quote); text-align: center; white-space: nowrap; }
@media (max-width: 900px) { .rp-slogan { white-space: normal; } }

/* ---------- Bereiche: roter Balken je Kategorie ---------- */
.rp-group-bar {
  grid-column: 1 / -1; margin: 0; min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 1vw;
  padding: 0 1.1vw; border-radius: 2px; background: var(--red); color: #fff;
  font: 700 clamp(15px, 1.45vw, 32px)/1 var(--f-text); overflow: hidden;
}
.rp-group-bar small { font: 400 .7em/1 var(--f-text); }
.rp-grid.grouped { row-gap: .55vw; }

/* ---------- Hintergrundbild unter dem Kopf ---------- */
.rp-slide.has-bg, .rp-notice.has-bg { position: relative; isolation: isolate; }
.rp-bg { position: absolute; left: 0; right: 0; top: calc(13vh + 1px); bottom: 0; z-index: -1; background-size: cover; background-position: center; background-repeat: no-repeat; pointer-events: none; }
.rp-notice .rp-bg { top: calc(14vh + 1px); }

/* ---------- Fußzeile: weißer Balken über die ganze Breite (auch über einem Hintergrundbild) ---------- */
.rp-slide { padding-bottom: 0; }
.rp-slide > .rp-footer { margin: 0 -2.2vw; padding: 1.1vh 2.2vw 1.3vh; min-height: 5vh; background: #fff; border-top: 1px solid var(--grey-50); }
.rp-notice { padding-bottom: 0; }
.rp-notice > .rp-footer { margin: 0 -6vw; padding: 1.1vh 6vw 1.3vh; min-height: 5vh; background: #fff; border-top: 1px solid var(--grey-50); }
@media (max-width: 900px) {
  .rp-slide > .rp-footer { margin: 0 -14px; padding: 10px 14px; }
}

/* ---------- Medienseite: Bild, Folie oder Video auf ganzer Fläche ---------- */
.rp-media { height: 100vh; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--navy); border-top: .55vh solid var(--red); }
.rp-media-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.rp-media-stage img, .rp-media-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.rp-media > .rp-footer { padding: 1.1vh 2.2vw 1.3vh; min-height: 5vh; background: #fff; border-top: 1px solid var(--grey-50); }

/* ---------- Kurskategorien: Farbstreifen der Karte, Tagesablauf (public/kategorien.js) ---------- */
.rp-card.state-free::before, .rp-card.state-free-soon::before { background: var(--grey-30); }
.rp-card-main time, .rp-room-current time { color: var(--navy); }
.rp-card.cat-rsplus::before { background: #002d55; }
.rp-room-now.cat-rsplus { border-left-color: #002d55; }
.rp-day li.cat-rsplus { border-left-color: #002d55; }
.rp-card.cat-praxan::before { background: #fac3af; }
.rp-room-now.cat-praxan { border-left-color: #fac3af; }
.rp-day li.cat-praxan { border-left-color: #fac3af; }
.rp-card.cat-sim::before { background: #b4c3d7; }
.rp-room-now.cat-sim { border-left-color: #b4c3d7; }
.rp-day li.cat-sim { border-left-color: #b4c3d7; }
.rp-card.cat-nfs::before { background: #e60005; }
.rp-room-now.cat-nfs { border-left-color: #e60005; }
.rp-day li.cat-nfs { border-left-color: #e60005; }
.rp-card.cat-rs::before { background: #1662a3; }
.rp-room-now.cat-rs { border-left-color: #1662a3; }
.rp-day li.cat-rs { border-left-color: #1662a3; }
.rp-card.cat-fobi::before { background: #698caf; }
.rp-room-now.cat-fobi { border-left-color: #698caf; }
.rp-day li.cat-fobi { border-left-color: #698caf; }
.rp-card.cat-eh::before { background: #eb8264; }
.rp-room-now.cat-eh { border-left-color: #eb8264; }
.rp-day li.cat-eh { border-left-color: #eb8264; }
.rp-card.cat-sonst::before { background: #a6a6a6; }
.rp-room-now.cat-sonst { border-left-color: #a6a6a6; }
.rp-day li.cat-sonst { border-left-color: #a6a6a6; }
.rp-card.state-blocked::before { background: repeating-linear-gradient(135deg, var(--grey) 0 6px, var(--grey-50) 6px 12px); }
.rp-room-now.state-free, .rp-room-now.state-free-soon { border-left-color: var(--grey-30); }

/* Wach-halten-Video: winzig, fast unsichtbar, aber im Bild (sonst pausiert der Browser es) */
.rp-wach { position: fixed; right: 0; bottom: 0; width: 2px; height: 2px; opacity: 0.01; pointer-events: none; z-index: 0; }
