/* ==========================================================
   Präsentationskomponente
   Sprint S-44.3.4:
   Präsentationsbühne, Typografie, Medien und kompakte
   Kapitelnavigation ohne Pause-/Starten-Schaltfläche
   ========================================================== */

.praesentation-comp {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #fff;
  color: inherit;
}

/* ----------------------------------------------------------
   Schließen
   ---------------------------------------------------------- */

.praesentation-comp__close {
  position: fixed;
  z-index: 30;
  top: 1rem;
  right: 1rem;

  display: inline-flex;
  width: 3rem;
  height: 3rem;

  align-items: center;
  justify-content: center;

  box-sizing: border-box;

  border: 2px solid currentColor;
  border-radius: 50%;

  background: #fff;
  color: inherit;

  font: inherit;
  font-size: 2rem;
  line-height: 1;

  text-decoration: none;
  cursor: pointer;
}

.praesentation-comp__close:hover {
  background: rgb(0 0 0 / 6%);
  text-decoration: none;
}

.praesentation-comp__close:focus-visible,
.praesentation-comp__button:focus-visible,
.praesentation-comp__chapter-button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   Grundstruktur
   ---------------------------------------------------------- */

.praesentation-comp__viewport {
  min-height: 100vh;
  min-height: 100svh;
}

.praesentation-comp__viewport:not(.is-initialized) .splide__track {
  overflow: visible;
}

.praesentation-comp__slides {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ----------------------------------------------------------
   Präsentationsbühne
   ---------------------------------------------------------- */

.praesentation-comp__slide {
  display: flex;
  width: 100%;

  min-height: 100vh;
  min-height: 100svh;

  align-items: flex-start;
  justify-content: center;

  box-sizing: border-box;

  padding:
    clamp(7rem, 12vh, 10rem)
    clamp(2rem, 4vw, 5rem)
    9rem;
}

.praesentation-comp__slide-inner {
  width: min(72rem, 100%);
  margin-inline: auto;
}

.praesentation-comp .is-section__text {
  max-width: unset;
}

/*
 * Die Ueberschrift liegt seit S-44.3.4 im aeusseren Container und nutzt
 * innerhalb der Praesentationsbuehne deren volle Breite.
 */
.praesentation-comp
  .is-section-container > .is-section__heading {
  max-width: none;
}


/* ----------------------------------------------------------
   Typografie
   ---------------------------------------------------------- */

.praesentation-comp__slide-inner h1,
.praesentation-comp__slide-inner h2,
.praesentation-comp__slide-inner h3 {
  max-width: 32ch;
  margin-top: 0;
  line-height: 1.15;
  text-wrap: balance;
}

.praesentation-comp__slide-inner h2 {
  font-size: clamp(1.75rem, 2.4vw, 2.75rem);
}

.praesentation-comp__slide-inner h3 {
  font-size: clamp(1.35rem, 1.8vw, 2rem);
}

.praesentation-comp__slide-inner p,
.praesentation-comp__slide-inner li {
  line-height: 1.65;
}

.praesentation-comp__slide-inner p {
  margin-block: 0 1.1em;
}

.praesentation-comp__slide-inner p:last-child {
  margin-bottom: 0;
}

.praesentation-comp__slide-inner ul,
.praesentation-comp__slide-inner ol {
  padding-inline-start: 1.5rem;
}

/* ----------------------------------------------------------
   Bilder und Medien
   ---------------------------------------------------------- */

.praesentation-comp__slide-inner img,
.praesentation-comp__slide-inner video {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - 15rem);
  object-fit: contain;
}

.praesentation-comp__slide-inner figure {
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 0;
}

.praesentation-comp__slide-inner iframe {
  display: block;
  max-width: 100%;
  border: 0;
}

.praesentation-comp__slide-inner .media-oembed-content {
  width: min(100%, 64rem);
  aspect-ratio: 16 / 9;
  height: auto;
}

/* ----------------------------------------------------------
   Links
   ---------------------------------------------------------- */

.praesentation-comp__slide-inner a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

.praesentation-comp__slide-inner a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   Aktivierte Splide-Ausgabe
   ---------------------------------------------------------- */

.praesentation-comp__viewport.is-initialized .splide__track {
  overflow: hidden;
}

.praesentation-comp__viewport.is-initialized
  .praesentation-comp__slides {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  backface-visibility: hidden;
}

.praesentation-comp__viewport.is-initialized
  .praesentation-comp__slide {
  flex-shrink: 0;
}

.splide__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----------------------------------------------------------
   Hauptnavigation
   ---------------------------------------------------------- */

.praesentation-comp__navigation {
  position: fixed;
  z-index: 20;

  right: 0;
  bottom: 0;
  left: 0;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "prev chapters next"
    ". pagination .";

  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;

  box-sizing: border-box;
  padding: 0.75rem 1.25rem;

  background: rgb(255 255 255 / 90%);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 8%);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.praesentation-comp__button {
  display: inline-flex;
  min-height: 2.75rem;

  align-items: center;
  justify-content: center;

  gap: 0.5rem;

  box-sizing: border-box;
  padding: 0.5rem 1rem;

  border: 2px solid currentColor;

  background: transparent;
  color: inherit;

  font: inherit;

  cursor: pointer;
}

.praesentation-comp__button:hover:not(:disabled) {
  background: rgb(0 0 0 / 6%);
}

.praesentation-comp__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ----------------------------------------------------------
   Orientierung: Kapitel und aktuelle Position
   ---------------------------------------------------------- */

.praesentation-comp__orientation {
  display: contents;
}

.praesentation-comp__prev {
  grid-area: prev;
}

.praesentation-comp__next {
  grid-area: next;
}

.praesentation-comp__chapters {
  grid-area: chapters;
  display: flex;
  max-width: 100%;

  align-items: center;
  justify-content: center;

  gap: 0.35rem;

  overflow-x: auto;

  margin: 0;
  padding: 0.25rem;

  list-style: none;

  scrollbar-width: thin;
}

.praesentation-comp__chapter {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.praesentation-comp__chapter-button {
  display: inline-flex;

  min-width: 2.7rem;
  width: 2.7rem;
  height: 2.7rem;

  align-items: center;
  justify-content: center;

  box-sizing: border-box;

  border: 2px solid currentColor;
  border-radius: 0.35rem;

  background: transparent;
  color: inherit;

  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;
  opacity: 0.75;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.praesentation-comp__chapter-button:hover {
  background: rgb(0 0 0 / 6%);
  opacity: 1;
}

.praesentation-comp__chapter-button[aria-current="step"] {
  background: rgb(0 0 0 / 10%);
  border-color: currentColor;
  color: inherit;
  font-weight: 700;
  opacity: 1;
}

.praesentation-comp__pagination {
  grid-area: pagination;
  min-width: 4rem;
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   Reduzierte Bewegung
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .praesentation-comp__slides {
    scroll-behavior: auto;
  }

  .praesentation-comp__chapter-button {
    transition: none;
  }
}

/* ----------------------------------------------------------
   Tablet
   ---------------------------------------------------------- */

@media (max-width: 60rem) {
  .praesentation-comp__slide {
    padding:
      clamp(6rem, 10vh, 8rem)
      clamp(1.5rem, 3vw, 3rem)
      9rem;
  }

  .praesentation-comp__navigation {
    column-gap: 0.75rem;
    padding-inline: 1rem;
  }

  .praesentation-comp__slide-inner img,
  .praesentation-comp__slide-inner video {
    max-height: calc(100svh - 16rem);
  }
}

/* ----------------------------------------------------------
   Smartphone
   ---------------------------------------------------------- */

@media (max-width: 47.99rem) {
  .praesentation-comp {
    overflow: hidden;
  }

  .praesentation-comp__close {
    top: 0.75rem;
    right: 0.75rem;

    width: 2.75rem;
    height: 2.75rem;

    font-size: 1.75rem;
  }

  .praesentation-comp__slide {
    padding:
      5.5rem
      1.25rem
      8.5rem;
  }

  .praesentation-comp__slide-inner {
    width: 100%;
  }

  .praesentation-comp__slide-inner h2 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }

  .praesentation-comp__slide-inner h3 {
    font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  }

  .praesentation-comp__slide-inner p,
  .praesentation-comp__slide-inner li {
    line-height: 1.55;
  }

  .praesentation-comp__slide-inner img,
  .praesentation-comp__slide-inner video {
    max-height: calc(100svh - 15rem);
  }

  .praesentation-comp__navigation {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "prev chapters next"
      ". pagination .";
    column-gap: 0.4rem;
    row-gap: 0.15rem;
    padding: 0.5rem 0.75rem 0.65rem;
  }

  .praesentation-comp__button {
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
  }

  .praesentation-comp__button-label {
    display: none;
  }

  .praesentation-comp__chapters {
    justify-content: center;
    gap: 0.25rem;
    padding-inline: 0.15rem;
  }

  .praesentation-comp__chapter-button {
    min-width: 2.35rem;
    width: 2.35rem;
    height: 2.35rem;
    font-size: 0.95rem;
  }

  .praesentation-comp__pagination {
    font-size: 0.85rem;
  }
}

/* ==========================================================
   Kapitel 4 – Sprint 4F: Anwendung des Button-Systems
   ========================================================== */

/* Schließen: quadratischer sekundärer Icon-Button. */
.praesentation-comp__close,
.presentation-page__close {
  border: 2px solid currentColor;
  border-radius: 0;
  background: #fff;
  color: var(--button-color-secondary, currentColor);
  transition:
    background-color var(--button-transition, 180ms ease),
    border-color var(--button-transition, 180ms ease),
    color var(--button-transition, 180ms ease);
}

.praesentation-comp__close:hover,
.presentation-page__close:hover {
  border-color: var(--button-bg-primary, #36752e);
  background: var(--button-bg-primary, #36752e);
  color: #fff;
}

/* Zurück: sekundär; Weiter: primär. */
.praesentation-comp__button {
  min-height: 2.75rem;
  border: 2px solid currentColor;
  border-radius: 0;
  background: #fff;
  color: var(--button-color-secondary, currentColor);
  font-weight: 700;
  transition:
    background-color var(--button-transition, 180ms ease),
    border-color var(--button-transition, 180ms ease),
    color var(--button-transition, 180ms ease);
}

.praesentation-comp__button:hover:not(:disabled) {
  border-color: var(--button-bg-primary, #36752e);
  background: var(--button-bg-primary, #36752e);
  color: #fff;
}

.praesentation-comp__next {
  border-color: var(--button-bg-primary, #36752e);
  background: var(--button-bg-primary, #36752e);
  color: #fff;
}

.praesentation-comp__next:hover:not(:disabled) {
  border-color: var(--button-bg-primary-hover, #285b22);
  background: var(--button-bg-primary-hover, #285b22);
  color: #fff;
}

/* Foliennummern: kompakte Icon-Buttons; aktive Folie primär. */
.praesentation-comp__chapter-button {
  border: 2px solid currentColor;
  border-radius: 0;
  background: #fff;
  color: var(--button-color-secondary, currentColor);
  opacity: 1;
}

.praesentation-comp__chapter-button:hover {
  border-color: var(--button-bg-primary, #36752e);
  background: var(--button-bg-primary, #36752e);
  color: #fff;
}

.praesentation-comp__chapter-button[aria-current="step"] {
  border-color: var(--button-bg-primary, #36752e);
  background: var(--button-bg-primary, #36752e);
  color: #fff;
  opacity: 1;
}

.praesentation-comp__close:focus-visible,
.presentation-page__close:focus-visible,
.praesentation-comp__button:focus-visible,
.praesentation-comp__chapter-button:focus-visible {
  outline: 3px solid var(--button-focus, #f4cf00);
  outline-offset: 3px;
}

/* ==========================================================
   Kapitel 4 – Sprint 4G: Viewport-Höhe und Danger-Button
   ========================================================== */

.page-node-type-praesentation {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.page-node-type-praesentation .dialog-off-canvas-main-canvas,
.presentation-page,
.presentation-page__main,
.presentation-page__main > .region,
.presentation-page__main > .region > .block,
.praesentation-comp {
  min-height: 0;
}

.page-node-type-praesentation .dialog-off-canvas-main-canvas,
.presentation-page {
  display: flex;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.presentation-page,
.presentation-page__main,
.praesentation-comp {
  flex: 1 1 auto;
}

.presentation-page__main,
.presentation-page__main > .region,
.presentation-page__main > .region > .block,
.praesentation-comp {
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.presentation-page__main > .region,
.presentation-page__main > .region > .block,
.praesentation-comp {
  flex-direction: column;
}

.praesentation-comp {
  height: 100%;
  min-height: 0;
}

.praesentation-comp__viewport {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.praesentation-comp__viewport .splide__track,
.praesentation-comp__viewport .splide__list,
.praesentation-comp__slide {
  height: 100%;
  min-height: 0;
}

.praesentation-comp__slide {
  overflow: hidden;
}

.praesentation-comp__slide-inner {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.praesentation-comp__navigation {
  flex: 0 0 auto;
}

.praesentation-comp__close {
  border-color: var(--button-danger, #b42318);
  background: #fff;
  color: var(--button-danger, #b42318);
}

.praesentation-comp__close:hover,
.praesentation-comp__close:focus-visible {
  border-color: var(--button-danger-hover, #8f1c13);
  background: var(--button-danger-hover, #8f1c13);
  color: #fff;
}

/* ==========================================================
   Kapitel 4 – Sprint 4H: Inhalte vertikal zentrieren
   ========================================================== */

/*
 * Jede Folie nutzt den vollstaendig verfuegbaren Buehnenraum als
 * Flex-Container. Kurze Inhalte liegen dadurch unabhaengig von ihrer
 * Eigenhoehe vertikal in der Mitte. Die horizontale Ausrichtung bleibt
 * weiterhin dem jeweiligen Inhaltsabschnitt ueberlassen.
 */
.praesentation-comp__slide {
  align-items: center;
}

/*
 * Umfangreiche Folien bleiben innerhalb der Buehne scrollbar. Durch
 * max-height: 100% kann der Flex-Container kurze Inhalte zentrieren,
 * ohne lange Inhalte ueber den verfuegbaren Raum hinauszuschieben.
 */
.praesentation-comp__slide-inner {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ==========================================================
   Kapitel 4 – Sprint 4I: Buehnenhoehe abzüglich Navigation
   ========================================================== */

/*
 * Die Navigation belegt eine eigene Grid-Zeile. Dadurch wird ihre
 * tatsaechliche Hoehe automatisch von der Praesentationsbuehne
 * abgezogen; feste Reserven im unteren Slide-Padding entfallen.
 */
.praesentation-comp {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.praesentation-comp__viewport {
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.praesentation-comp__viewport .splide__track,
.praesentation-comp__viewport .splide__list,
.praesentation-comp__slide {
  height: 100%;
  min-height: 0;
}

.praesentation-comp__slide {
  align-items: center;
  padding:
    clamp(2rem, 5vh, 4rem)
    clamp(2rem, 4vw, 5rem);
}

.praesentation-comp__navigation {
  position: static;
  z-index: 20;
  width: 100%;
  flex: none;
}

/* Allgemeine Abschnittsabstaende gehoeren nicht in die Folienbuehne. */
.page-node-type-praesentation .section--seitenabschnitt {
  --section-padding-y: 0;
}

@media (max-width: 60rem) {
  .praesentation-comp__slide {
    padding:
      clamp(1.5rem, 4vh, 3rem)
      clamp(1.5rem, 3vw, 3rem);
  }
}

@media (max-width: 47.99rem) {
  .praesentation-comp__slide {
    padding: 1.25rem;
  }
}

/* ==========================================================
   Kapitel 4 – Sprint 4J: Navigation absolut positionieren
   ========================================================== */

/*
 * Die Navigation liegt dauerhaft am unteren Rand der Komponente.
 * Die Folien reservieren auf allen Geraeten 100px fuer diese Leiste.
 */
.praesentation-comp {
  position: relative;
  display: flex;
  flex-direction: column;
}

.praesentation-comp__viewport {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.praesentation-comp__slide {
  padding-bottom: 100px;
}

.praesentation-comp__navigation {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
}

@media (max-width: 60rem) {
  .praesentation-comp__slide {
    padding-bottom: 100px;
  }
}

@media (max-width: 47.99rem) {
  .praesentation-comp__slide {
    padding-bottom: 100px;
  }
}
