/* ============================================
   sprach-test.com — Erweiterungen zum Basisdesign
   Ergänzt style.css um Komponenten, die die
   dynamische Anwendung zusätzlich braucht.
   ============================================ */

/* --------------------------------------------
   Hinweise / Flash-Meldungen
   -------------------------------------------- */
.alert-stack {
  display: grid;
  gap: 10px;
  padding: 18px 0 0;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.93rem;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}

.alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  border-color: #BFE3CC;
  background: #F1F9F4;
  color: #1B5E33;
}

.alert-error {
  border-color: #F0C4C7;
  background: #FDF3F4;
  color: var(--signal-dark);
}

.alert-info {
  border-color: #C9D8EC;
  background: #F2F7FD;
  color: var(--ink-800);
}

/* --------------------------------------------
   Feldfehler
   -------------------------------------------- */
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--signal);
}

.field .hint {
  display: block;
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--slate);
}

/* --------------------------------------------
   Seitenblättern
   -------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--slate);
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 5px;
  /* Bei sieben und mehr Seiten passen die Knöpfe nicht nebeneinander auf
     ein Telefon – ohne Umbruch schoben sie die ganze Seite in die Breite. */
  flex-wrap: wrap;
}

@media (max-width: 420px) {
  .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 0.85rem;
  }
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.page-link:hover:not(.disabled):not(.active) {
  border-color: var(--ink);
}

.page-link.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.page-link.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-gap {
  padding: 0 3px;
  color: var(--slate);
}

/* --------------------------------------------
   Prüfungszentren
   -------------------------------------------- */
.center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.center-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.center-card h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.center-card address {
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--slate);
}

.center-venue {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--signal);
}

.center-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* --------------------------------------------
   Inhalte aus dem Redaktionssystem
   -------------------------------------------- */
.cms-content h1,
.cms-content h2,
.cms-content h3,
.cms-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin: 28px 0 12px;
  color: var(--ink);
}

.cms-content h1 { font-size: 1.7rem; }
.cms-content h2 { font-size: 1.4rem; }
.cms-content h3 { font-size: 1.15rem; }
.cms-content h4 { font-size: 1rem; }

.cms-content > *:first-child {
  margin-top: 0;
}

.cms-content p {
  margin-bottom: 14px;
}

.cms-content ul,
.cms-content ol {
  margin: 0 0 16px 20px;
}

.cms-content li {
  margin-bottom: 7px;
}

.cms-content a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 2px;
  /* Ausgeschriebene Adressen (Datenschutzerklärung!) sind länger als ein
     Telefonbildschirm – ohne Umbruch schoben sie die Seite in die Breite. */
  overflow-wrap: anywhere;
}

/* Lange Wörter generell umbrechen lassen statt überzustehen */
.cms-content {
  overflow-wrap: break-word;
}

.cms-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 14px 0;
}

.cms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92rem;
}

.cms-content th,
.cms-content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.cms-content th {
  background: var(--mist);
  font-weight: 600;
}

.cms-content blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--signal);
  background: var(--mist);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.cms-content iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}

/* Volle Breite des Containers – Text und Seitenkopf beginnen dadurch an
   derselben Kante und rechts bleibt kein Leerfeld. */
.prose-page {
  max-width: none;
}

/* Tabellen im CMS auf schmalen Bildschirmen scrollbar halten */
@media (max-width: 640px) {
  .cms-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* --------------------------------------------
   Breitere Split-Variante (Prüfungsdetail)
   -------------------------------------------- */
.split-wide {
  align-items: start;
}

@media (min-width: 961px) {
  .split-wide {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  }
}

.exam-title-link {
  color: inherit;
  text-decoration: none;
}

.exam-title-link:hover {
  color: var(--signal);
}

/* --------------------------------------------
   Hinterlegtes Logo
   -------------------------------------------- */
.brand-logo {
  display: block;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.site-footer .brand-logo {
  /* Auf dunklem Grund brauchen helle Logos keinen Filter,
     dunkle Logos werden über eine eigene Datei gepflegt. */
  max-width: 220px;
}

@media (max-width: 520px) {
  .brand-logo {
    max-width: 180px;
  }
}

/* --------------------------------------------
   Zurück nach oben
   -------------------------------------------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-md);

  /* Bis zum Erscheinen unsichtbar und nicht anklickbar */
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.16s ease;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  background: var(--signal);
  border-color: var(--signal);
}

.to-top:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: opacity 0.2s ease;
    transform: none;
  }
}

/* ============================================
   Kopfbereich als Bildlaufleiste
   ============================================ */
.hero-slider {
  position: relative;
  overflow: hidden;

  /* Gleiche Höhe wie der ursprüngliche Kopfbereich, damit Überschrift und
     Prüfungsfinder genauso sitzen wie im Entwurf. */
  min-height: clamp(420px, 44vw, 620px);
}

.hero-slides {
  display: grid;
  min-height: inherit;
}

/* Alle Folien liegen übereinander; nur die aktive ist sichtbar */
.hero-slide {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  min-height: inherit;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-slide .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;

  /* Das Grundgerüst blendet Hintergrundbilder auf 55 % ab. Im Slider ist
     das Bild aber die eigentliche Botschaft und bleibt voll sichtbar. */
  opacity: 1;
}

/* Abdunkeln, damit der Text auf jedem Motiv lesbar bleibt */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(15, 33, 56, 0.92) 0%, rgba(15, 33, 56, 0.72) 45%, rgba(15, 33, 56, 0.35) 100%);
}

.hero-slide .hero-inner {
  position: relative;
  z-index: 2;
}

.hero-actions {
  margin-top: 24px;
}

/* --------------------------------------------
   Pfeile
   -------------------------------------------- */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;

  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(15, 33, 56, 0.45);
  color: #fff;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.hero-arrow:hover {
  background: var(--signal);
  border-color: var(--signal);
}

.hero-arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.hero-prev { left: 18px; }
.hero-next { right: 18px; }

/* --------------------------------------------
   Punkte
   -------------------------------------------- */
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 5;

  display: flex;
  gap: 8px;
}

.hero-dot {
  position: relative;   /* Bezug für die vergrößerte Tippfläche auf dem Telefon */
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.hero-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

.hero-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* --------------------------------------------
   Kleinere Bildschirme
   -------------------------------------------- */
@media (max-width: 720px) {
  /* Senkrecht mittig lagen die Pfeile genau auf dem Fließtext: sie
     verdeckten Wörter und jeder Tipp auf den Absatz wechselte die Folie.
     Auf dem Telefon stehen sie deshalb unten neben den Punkten. */
  .hero-arrow {
    top: auto;
    bottom: 12px;
    transform: none;
    width: 44px;
    height: 44px;
  }

  .hero-prev { left: 12px; }
  .hero-next { right: 12px; }

  /* Abstand und Tippfläche gehören zusammen: der Abstand von Mitte zu
     Mitte (10px Punkt + 20px Lücke = 30px) ist genauso groß wie die
     Tippfläche. Wäre sie größer, träfe ein Tipp zwischen zwei Punkten
     den falschen. */
  .hero-dots {
    bottom: 24px;
    gap: 20px;
  }

  /* Der sichtbare Punkt bleibt klein, die Tippfläche wird fingergerecht */
  .hero-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(15, 33, 56, 0.75) 0%, rgba(15, 33, 56, 0.9) 100%);
  }

  /* Platz für die Bedienleiste, damit sie nicht auf dem Text sitzt */
  .hero-slider.has-multiple .hero-inner {
    padding-bottom: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none;
  }
}

/* Der Prüfungsfinder ragt wie im Entwurf in den Kopfbereich hinein.
   Die Regel steht im Grundgerüst und gilt unverändert auch für den Slider. */

/* ============================================
   BILD DER PRÜFUNG
   Karten der Niveaustufen und Kopf der Detailseite
   ============================================ */

/* Das Bild füllt die Kartenbreite, deshalb hebt der negative Rand
   die Polsterung der Karte auf. Der Stufenschlüssel (A1, B2 …)
   sitzt darauf, damit die Karte nicht länger wird als bisher. */
.level-media {
  position: relative;
  display: block;
  margin: -24px -24px 16px;
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  background-color: var(--mist);
  aspect-ratio: 16 / 9;
}

.level-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.level-card:hover .level-media img {
  transform: scale(1.04);
}

.level-media .level-code {
  position: absolute;
  left: 14px;
  bottom: 14px;
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(15, 33, 56, 0.35);
}

/* Ältere Browser ohne aspect-ratio bekommen eine feste Höhe. */
@supports not (aspect-ratio: 16 / 9) {
  .level-media {
    height: 168px;
  }
}

/* Kopfbild der Prüfungsseite */
.exam-hero {
  margin-bottom: 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--mist);
  aspect-ratio: 21 / 9;
}

.exam-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@supports not (aspect-ratio: 21 / 9) {
  .exam-hero {
    height: 320px;
  }
}

@media (max-width: 720px) {
  .exam-hero {
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-media img,
  .level-card:hover .level-media img {
    transition: none;
    transform: none;
  }
}

/* ============================================
   STADTBILDER
   Karten auf der Standortseite und Kopf der Stadtseite
   ============================================ */

/* Das Bild liegt hinter der ganzen Karte. Damit die Angaben lesbar
   bleiben, liegt darüber ein dunkler Schleier; ohne Bild sieht die
   Karte unverändert aus wie bisher. */
.city-card {
  position: relative;
  isolation: isolate;
  border-color: transparent;
  color: #fff;
  overflow: hidden;
}

.city-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.35s ease;
}

.city-card-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 33, 56, 0.72) 0%, rgba(15, 33, 56, 0.9) 100%);
}

.city-card:hover .city-card-bg {
  transform: scale(1.05);
}

.city-card:hover {
  border-color: transparent;
}

.city-card h3,
.city-card p,
.city-card .level-fact dd {
  color: #fff;
}

.city-card .level-code {
  background-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(2px);
}

.city-card .level-facts {
  border-top-color: rgba(255, 255, 255, 0.25);
}

.city-card .level-fact dt {
  color: rgba(255, 255, 255, 0.72);
}

.city-card .btn-outline {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  background-color: transparent;
}

.city-card .btn-outline:hover {
  background-color: #fff;
  border-color: #fff;
  color: var(--ink);
}

/* Kopf der Stadtseite mit Bild */
.page-head-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.page-head-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.page-head-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 33, 56, 0.78) 0%, rgba(15, 33, 56, 0.92) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .city-card-bg,
  .city-card:hover .city-card-bg {
    transition: none;
    transform: none;
  }
}

/* Städte ohne ausgeschriebenen Termin stehen mit dabei, treten aber
   zurück – sie sollen die buchbaren Standorte nicht überdecken. */
.city-card-quiet:not(.city-card) {
  background-color: transparent;
  border-style: dashed;
}

.city-card-quiet:not(.city-card) .level-code {
  background-color: var(--slate);
}

.city-card-quiet .level-fact dd {
  font-weight: 600;
}

.city-card-quiet.city-card .city-card-bg {
  filter: grayscale(0.35);
}

/* ============================================
   TELEFON: BEDIENUNG
   ============================================ */

/* Safari auf dem iPhone zoomt die ganze Seite hinein, sobald ein Feld
   mit weniger als 16px Schrift angetippt wird – und zoomt nicht wieder
   heraus. Das wirkt wie ein Verrutschen des Layouts. Auf kleinen
   Bildschirmen bekommen Eingaben deshalb genau 16px. */
@media (max-width: 767px) {
  .field input,
  .field select,
  .field textarea,
  .finder-form input,
  .finder-form select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  input[type="search"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* Sehr schmale Geräte: Abstand und Tippfläche gemeinsam verkleinern, damit
   die äußeren Punkte nicht unter die Pfeile geraten – und weiterhin genau
   ein Punkt pro Tipp getroffen wird (10 + 18 = 28 = Tippfläche). */
@media (max-width: 400px) {
  .hero-dots {
    gap: 18px;
  }

  .hero-dot::before {
    width: 28px;
    height: 28px;
  }
}

/* Die Buchen-Schaltfläche in der Terminliste ist die wichtigste Aktion
   der Seite – am Telefon bekommt sie volle Fingerhöhe. */
@media (max-width: 767px) {
  .exam-cta .btn {
    min-height: 44px;
  }
}

/* ============================================
   ANMELDUNG AUF DEM TELEFON
   ============================================ */

/* Kernproblem: .booking ist ein Raster. Rasterelemente haben von Haus aus
   min-width: auto, richten sich also nach ihrem breitesten Inhalt. Die
   Fortschrittsleiste ist mit allen drei Beschriftungen rund 550 Pixel
   breit und zog damit die ganze Spalte – und mit ihr das Formular –
   über den Bildschirmrand hinaus. */
.booking > * {
  min-width: 0;
}

@media (max-width: 560px) {
  /* Nur der aktuelle Schritt wird ausgeschrieben, die übrigen bleiben
     als Ziffer stehen. So passt die Leiste ohne Seitwärtsscrollen. */
  .steps {
    gap: 8px;
    overflow-x: visible;
  }

  .step:not(.active) .step-label {
    display: none;
  }

  .step-line {
    flex: 1 1 auto;
    width: auto;
    min-width: 12px;
  }
}

/* Die Schaltflächenzeile ist ein Flex-Element; die Beschriftungen brechen
   nicht um ("Weiter zu Prüfungsdetails"), zusammen sind sie breiter als
   der Bildschirm. Auf dem Telefon stehen sie deshalb untereinander –
   Hauptaktion oben, Zurück darunter. */
@media (max-width: 560px) {
  .panel-nav {
    flex-direction: column-reverse;
  }

  .panel-nav .btn {
    width: 100%;
  }
}

/* --------------------------------------------
   Soziale Netzwerke in der Fußzeile
   Erscheinen nur, wenn unter Einstellungen eine Adresse hinterlegt ist.
   -------------------------------------------- */
.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.social-link:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}

.social-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .social-link {
    transition: none;
  }
}

/* --------------------------------------------
   Ausrichtung von Bildern aus dem Textfeld
   Dieselben Klassen wie im Bearbeitungsfenster, damit die Vorschau
   in der Verwaltung dem Ergebnis auf der Website entspricht.
   -------------------------------------------- */
.cms-content img.img-links {
  float: left;
  margin: 4px 22px 14px 0;
  max-width: 50%;
}

.cms-content img.img-rechts {
  float: right;
  margin: 4px 0 14px 22px;
  max-width: 50%;
}

.cms-content img.img-mitte {
  display: block;
  margin: 18px auto;
}

/* Umflossene Bilder dürfen nicht in den folgenden Abschnitt ragen */
.cms-content::after {
  content: '';
  display: block;
  clear: both;
}

/* Auf schmalen Bildschirmen ist Umfließen unlesbar – Bild steht dann allein */
@media (max-width: 640px) {
  .cms-content img.img-links,
  .cms-content img.img-rechts {
    float: none;
    display: block;
    margin: 16px auto;
    max-width: 100%;
  }
}

/* --------------------------------------------
   Fließtext aus dem Redaktionssystem
   .prose setzt Absätze auf die gedämpfte Farbe – für einleitende Sätze
   gedacht. Bei gepflegten Seiten wirkte der Text dadurch heller als
   alles daneben. Hier gilt die normale Lesefarbe.
   -------------------------------------------- */
.cms-content,
.cms-content p,
.cms-content li,
.cms-content td,
.cms-content th {
  color: var(--ink);
}

/* 0.9375rem entspricht 15px – die Größe, die das Design im gesamten
   Fließtext verwendet (Karten, Vorteile, Häkchenlisten). Mit 1rem wirkte
   der gepflegte Text neben seiner Umgebung zu groß. */
.cms-content,
.cms-content p,
.cms-content li,
.cms-content td,
.cms-content th,
.cms-content blockquote {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Ausrichtung, die im Textfeld gesetzt wurde, muss auch hier greifen */
.cms-content [style*="text-align: justify"] {
  hyphens: auto;
}

/* --------------------------------------------
   Eingefügte Symbole
   Größe richtet sich nach der Textgröße, damit sie in jeder
   Umgebung stimmig bleiben. Die Farbe kommt über color.
   -------------------------------------------- */
.ci {
  display: inline-block;
  vertical-align: -0.18em;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

.ci-s  { width: 1.15em; height: 1.15em; }
.ci-m  { width: 1.5em;  height: 1.5em;  vertical-align: -0.32em; }
.ci-l  { width: 2em;    height: 2em;    vertical-align: -0.5em;  }
.ci-xl { width: 2.8em;  height: 2.8em;  vertical-align: -0.9em;  }

.ci-text {
  display: inline-block;
  line-height: 1;
}

.ci-text.ci-m  { font-size: 1.3em; }
.ci-text.ci-l  { font-size: 1.75em; }
.ci-text.ci-xl { font-size: 2.4em; }

/* --------------------------------------------
   Titelbild einer gepflegten Seite
   -------------------------------------------- */
.page-media {
  margin: 0 0 26px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mist);
}

.page-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------
   Verweise auf Dateien im gepflegten Text
   -------------------------------------------- */
.cms-content .datei-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s, background 0.16s;
}

.cms-content .datei-link::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  /* Blatt mit Pfeil nach unten */
  -webkit-mask: var(--datei-symbol) center / contain no-repeat;
  mask: var(--datei-symbol) center / contain no-repeat;
}

:root {
  --datei-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 12v5'/%3E%3Cpath d='m9.5 14.5 2.5 2.5 2.5-2.5'/%3E%3C/svg%3E");
}

.cms-content .datei-link:hover {
  border-color: var(--ink);
  background: var(--white);
  color: var(--signal);
}

.cms-content .datei-link .datei-info {
  font-weight: 400;
  color: var(--slate);
}

.cms-content .datei-link:hover .datei-info {
  color: inherit;
}

/* --------------------------------------------
   Bausteine aus dem Textfeld
   Dieselben Klassen gelten im Bearbeitungsfenster und auf der Website,
   damit die Vorschau dem Ergebnis entspricht.
   -------------------------------------------- */

/* Häkchenliste wie im Entwurf */
.haken-liste {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.haken-liste li {
  position: relative;
  padding-left: 28px;
}

.haken-liste li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 17px;
  height: 17px;
  background: var(--signal);
  -webkit-mask: var(--haken-symbol) center / contain no-repeat;
  mask: var(--haken-symbol) center / contain no-repeat;
}

:root {
  --haken-symbol: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m5 13 4 4L19 7%27/%3E%3C/svg%3E");
}

/* Schaltfläche im Fließtext */
.inhalt-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--signal);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease;
}

.inhalt-knopf:hover {
  background: var(--signal-dark);
  color: #fff;
}

/* Hinweiskästen */
.hinweis-kasten {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--slate);
  border-radius: 0 10px 10px 0;
  background: var(--mist);
}

.hinweis-kasten strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 700;
}

.hinweis-kasten p:last-child {
  margin-bottom: 0;
}

.hinweis-info {
  border-left-color: #2C6BB3;
  background: #F2F7FD;
}

.hinweis-warnung {
  border-left-color: var(--signal);
  background: #FDF3F4;
}

.hinweis-erfolg {
  border-left-color: #1B5E33;
  background: #F1F9F4;
}

/* --------------------------------------------
   Eingebettetes Video
   Vor dem Klick nur ein Platzhalter – es wird nichts von YouTube
   oder Vimeo geladen. Erst der Klick erzeugt den Rahmen.
   -------------------------------------------- */
.video-einbettung {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  padding: 24px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
  .video-einbettung { height: 320px; }
}

.video-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.video-start::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
}

.video-start:hover {
  background: var(--signal-dark);
  color: #fff;
  transform: scale(1.03);
}

.video-hinweis {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 40ch;
}

/* Nach dem Klick füllt der Rahmen den Kasten */
.video-einbettung.is-geladen {
  padding: 0;
  background: #000;
}

.video-einbettung iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .video-start { transition: none; }
  .video-start:hover { transform: none; }
}
