/* =========================================================================
   Grundlagen: Reset, Typografie, Container, Buttons, Karten, Flächen,
   Fließtext, Formularelemente. Alles, was mehrere Sektionen teilen.
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg-default);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: var(--leading-tight);
  /* Wie bisher: keine automatische Silbentrennung, nur weiche Trennstriche (&shy;) im Text. */
  hyphens: manual;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  color: var(--accent);
  font-weight: 700;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.skip-link:focus {
  top: 1rem;
}

/* -------------------------------------------------------------------------
   Container und Sektionen
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--text {
  max-width: calc(var(--container-text) + 2 * var(--gutter));
}

/* 1140 px wie die Standardbreite der alten Seite (Impressum, Datenschutz, Aktuelles). */
.container--mittel {
  max-width: calc(var(--container-mittel) + 2 * var(--gutter));
}

/* Abstand oben und unten: Standard des Themes oder je Sektion von der Agentur gesetzt
   (--abstand-*-d für Desktop, --abstand-*-m für Handys aus fe_sektion_attr(), wie bisher je
   Abschnitt verschieden). Ist ein Wert nicht gesetzt, ist die Variable ungültig und der
   Standard greift. */
[data-abstand] {
  --abstand-oben: var(--abstand-oben-d);
  --abstand-unten: var(--abstand-unten-d);
}

@media (max-width: 47.99rem) {
  [data-abstand] {
    --abstand-oben: var(--abstand-oben-m, var(--abstand-oben-d));
    --abstand-unten: var(--abstand-unten-m, var(--abstand-unten-d));
  }
}

.section {
  padding-top: var(--abstand-oben, var(--space-section));
  padding-bottom: var(--abstand-unten, var(--space-section));
  background: var(--surface-bg, transparent);
  color: var(--surface-fg, inherit);
}

/* Zwei gleiche Flächen hintereinander: kein doppelter Abstand. */
.section.surface-hell + .section.surface-hell,
.section.surface-getoent + .section.surface-getoent {
  padding-top: var(--abstand-oben, var(--space-section-follow));
}

/* Hat die folgende Sektion einen eigenen Abstand, gilt nur dieser. */
.section:not(.surface-marke):has(+ .section[data-abstand~="oben"]) {
  padding-bottom: 0;
}

.surface-hell {
  --surface-bg: var(--white);
}

.surface-getoent {
  --surface-bg: var(--gray-50);
}

.surface-nacht {
  --surface-bg: var(--night);
  --surface-fg: var(--white);
  --heading-color: var(--white);
  --link-color: var(--white);
}

.surface-marke {
  --surface-bg: var(--blue-600);
  --surface-fg: var(--white);
  --heading-color: var(--white);
  --link-color: var(--white);
}

/* Blaue Fläche mit Wellenkante oben und unten, wie bisher. */
.section.surface-marke {
  position: relative;
  isolation: isolate;
  margin-top: var(--abstand-oben, 0);
  margin-bottom: var(--abstand-unten, 0);
  padding-block: 6rem 8rem; /* 96/128 px wie bisher, auch mobil; Abstand außen */
  overflow: hidden;
}

.section__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.section__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(21 93 157 / 0.94);
}

.section.surface-marke::before,
.section.surface-marke::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 36px;
  background: var(--bg-page);
  -webkit-mask: url("../img/welle.svg") center top / 292% 100% no-repeat;
  mask: url("../img/welle.svg") center top / 292% 100% no-repeat;
  pointer-events: none;
}

.section.surface-marke::before {
  top: -1px;
}

.section.surface-marke::after {
  bottom: -1px;
  transform: scale(-1, -1);
}

/* Weiße Karten auf Blau behalten ihre eigenen Farben. */
.card {
  --heading-color: var(--fg-brand);
  --link-color: var(--accent);
}

.seitenkopf + .section:not(.surface-marke) {
  padding-top: var(--abstand-oben, clamp(2rem, 4vw, 3.5rem));
}

/* Überschriften laufen wie bisher über die volle Breite, nur der Einleitungstext hat Lesebreite. */
.section-head {
  margin-bottom: var(--space-head);
}

.section-head .lead {
  max-width: min(48.75rem, 60%); /* wie bisher 780 px, schmaler 60 % der Inhaltsbreite (Tablet) */
}

/* Mit Einleitung wie bisher 48 px bis zum Inhalt (32 px Abstand plus 16 px). */
.section-head:has(.lead) {
  margin-bottom: calc(var(--space-head) + 1rem);
}

.section-head--center .lead {
  margin-inline: auto;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-title {
  color: var(--heading-color, var(--fg-brand));
  font-size: var(--text-h2);
  line-height: 1.6;
}

.section-head .lead {
  margin-top: 2rem; /* 32 px wie bisher */
}

.lead {
  font-size: var(--text-lead);
  color: var(--surface-fg, var(--fg-muted));
}

/* -------------------------------------------------------------------------
   Fließtext aus dem Editor (richtext)
   ------------------------------------------------------------------------- */
/* Wie bisher: Absätze ohne Abstand, Leerzeilen sind leere Absätze. Überschriften 8 px darüber, 16 px darunter. */
.prose h2,
.prose h3,
.prose h4 {
  color: var(--heading-color, var(--fg-brand));
  margin-block: 0.5rem 1rem;
  line-height: 1.2;
}

.prose h2 {
  font-size: var(--text-h2);
}

.prose h3 {
  font-size: var(--text-h3);
}

.prose h4 {
  font-size: var(--text-base);
}

.prose ul,
.prose ol {
  padding-left: 2.5rem;
}

.prose a {
  color: var(--link-color, var(--accent)); /* lange Adressen wie bisher ohne Umbruch */
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  padding-left: var(--space-4);
  border-left: 4px solid var(--accent);
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1.875rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--white);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}

.pill:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

.pill:active {
  transform: translateY(1px);
}

.pill--primary {
  /* Hauptbutton: Aussehen wie .pill */
}

.pill--lg {
  min-height: 3rem;
  padding-inline: 2.25rem;
  font-size: var(--text-base);
}

.pill--light {
  background: transparent;
  color: var(--accent);
}

.pill--light:hover {
  background: var(--accent);
  color: var(--white);
}

.surface-marke .pill {
  background: var(--white);
  border-color: var(--white);
  color: var(--blue-600);
}

.surface-marke .pill--light {
  background: transparent;
  color: var(--white);
}

/* In weißen Karten auf Blau bleiben Buttons blau. */
.surface-marke .card .pill {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.surface-marke .card .pill:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.pill--sm {
  min-height: 2.25rem;
  padding: 0.35rem 1.1rem;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}

.link-more .link-arrow {
  transition: transform var(--duration-fast);
}

.link-more:hover .link-arrow {
  transform: translateX(3px);
}

/* -------------------------------------------------------------------------
   Karten und Raster
   ------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  color: var(--fg-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
}

.card__title {
  color: var(--fg-brand);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.6;
}

.card__kicker {
  color: var(--gray-500);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card__media {
  height: 250px; /* wie bisher */
  background: var(--gray-100);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Button sitzt unten, auch wenn die Texte unterschiedlich lang sind. */
.card__foot {
  margin-top: auto;
}

.grid {
  display: grid;
  gap: 3rem; /* 48 px wie bisher, auch mobil */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 17rem)), 1fr));
}

.grid--2 {
  --grid-min: 22rem;
}

.grid--3 {
  --grid-min: 17rem;
}

/* Ab Tablet (768 px) wie auf dem Desktop; die alte Seite hatte für Tablets nur dort eigene
   Spalten, wo das Feld "spalten_tablet" gesetzt ist. */
@media (min-width: 48rem) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  /* Wie bisher: Text neben Bildern linksbündig, Überschriften mittig (Feld "text_tablet"). */
  .text-bild__text {
    text-align: start;
  }

  .text-bild .actions {
    justify-content: flex-start;
  }

  .text-bild__text .actions {
    margin-top: 0; /* wie bisher 20 px unter dem Text */
  }

  /* Buttons untereinander wie bisher (Feld "buttons_tablet"), 20 px Abstand. */
  [data-buttons-tablet] .actions {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 1.25rem;
  }

  [data-buttons-tablet][data-text-tablet="mitte"] .actions {
    align-items: center;
  }

  [data-text-tablet="mitte"] .text-bild__text {
    text-align: center;
  }

  [data-text-tablet="mitte"] .actions {
    justify-content: center;
  }

  [data-rand-rechts-tablet="ohne"] > .container {
    padding-inline-end: 0;
  }

  /* Feste Rasterzeilen wie bisher (Feld "kartenzeilen_tablet"). */
  [data-kartenzeilen-tablet="2"] .grid {
    grid-template-rows: repeat(2, 1fr);
  }

  [data-kartenzeilen-tablet="3"] .grid {
    grid-template-rows: repeat(3, 1fr);
  }

  [data-spalten-tablet="1"] .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-spalten-tablet="2"] .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Text und Bild untereinander (Feld "stapeln_tablet"), Abstände wie mobil. */
  [data-stapeln-tablet] .text-bild__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-stapeln-tablet] .text-bild__media {
    order: 0;
  }

  [data-stapeln-tablet][data-spaltenrand-mobil="10"] .text-bild__text {
    padding: 0.625rem;
  }

  [data-stapeln-tablet][data-spaltenrand-mobil="10"] .text-bild__media {
    margin: 0.625rem;
  }

  [data-stapeln-tablet][data-bildabstand-mobil="0"] .text-bild__inner {
    row-gap: 0;
  }

  [data-stapeln-tablet][data-bildabstand-mobil="1"] .text-bild__inner {
    row-gap: 1rem;
  }

  [data-stapeln-tablet][data-bildabstand-mobil="2"] .text-bild__inner {
    row-gap: 2rem;
  }

  [data-stapeln-tablet][data-bildabstand-mobil="4"] .text-bild__inner {
    row-gap: 4rem;
  }
}

/* Icon-Kachel: blaues Quadrat mit weißem Icon */
.tile {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius);
  background: var(--blue-500);
  color: var(--white);
  font-size: 1.6rem;
  box-shadow: var(--shadow-icon);
}

/* Das Icon sitzt mittig und ist so groß wie die Schrift der Kachel, egal ob
   es vom Theme oder vom Editor (wbmx_icon) ausgegeben wird. */
.tile svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.tile--sm {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
}

/* Bild mit runden Ecken */
.media {
  border-radius: var(--radius);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------------------------------------------------
   Einblenden beim Scrollen (nur mit JavaScript, siehe main.js)
   ------------------------------------------------------------------------- */
.js [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(16px);
}

.js [data-reveal] {
  transition: opacity var(--duration-reveal) var(--ease), transform var(--duration-reveal) var(--ease);
}

.wbmx-preview [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

/* Hinweis nur in der Vorschau des Editors */
.preview-notice {
  padding: var(--space-4);
  border: 2px dashed var(--blue-300);
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: var(--text-sm);
  text-align: center;
}

/* -------------------------------------------------------------------------
   Formularelemente
   ------------------------------------------------------------------------- */
.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  font-size: var(--text-sm);
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--fg-default);
  font: inherit;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--blue-100);
  outline-offset: 0;
}

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-3);
}

.field--check input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.field--check label {
  font-weight: 400;
}

/* -------------------------------------------------------------------------
   Dokumentlisten (wie das bisherige [dokumente]): blaue 44-px-Kachel mit
   Download- bzw. Link-Symbol, Text 16 px halbfett, Hover orange.
   ------------------------------------------------------------------------- */
.doc-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-list--grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #0055a5;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.doc-link .tile {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0055a5;
  font-size: 22px;
  box-shadow: none;
  transition: background-color 0.2s ease;
}

.doc-link:hover {
  color: #ff6600;
}

.doc-link:hover .tile {
  background: #ff6600;
}

/* -------------------------------------------------------------------------
   Daten aus aerops: Status ("Jetzt geöffnet bis …") und Öffnungszeiten
   ------------------------------------------------------------------------- */
.aerops-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.aerops-status__dot {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgb(180 35 24 / 0.18);
}

.aerops-status.is-open .aerops-status__dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgb(29 122 58 / 0.18);
}

.aerops-hours {
  display: grid;
  gap: var(--space-3);
}

.aerops-hours__list {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.aerops-hours__day {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 var(--space-4);
  padding-block: 0.375rem;
  border-bottom: 1px solid var(--gray-100);
}

.aerops-hours__day:last-child {
  border-bottom: 0;
}

.aerops-hours__day dt {
  color: var(--gray-500);
}

.aerops-hours__day.is-today dt,
.aerops-hours__day.is-today dd {
  color: var(--black);
  font-weight: 600;
}

.aerops-hours__day dd {
  margin: 0;
  color: #000;
  text-align: right;
}

.aerops-hours__note {
  display: block;
  color: var(--blue-600);
  font-size: var(--text-xs);
}

/* Kraftstoffpreise in einer Info-Kachel: Preiskästchen, siehe wbmx/sections/info-karten/style.css. */
.aerops-fuel__note {
  margin: var(--space-3) 0 0;
  color: var(--gray-500);
  font-size: var(--text-xs);
}

.aerops-hours__stand {
  margin: 0;
  color: var(--gray-500);
  font-size: var(--text-xs);
}

/* -------------------------------------------------------------------------
   Mobil und Tablet (unter 1024 px) wie bisher: Überschriften und Text neben
   Bildern zentriert, Buttons mittig.
   ------------------------------------------------------------------------- */
@media (max-width: 63.99rem) {
  .section-head,
  .section-title {
    margin-inline: auto;
    text-align: center;
  }

  .text-bild__text {
    text-align: center;
  }

  .actions {
    justify-content: center;
  }

  /* Wo die alte Seite den Text nicht zentriert hat (Feld "text_mobil"). */
  [data-text-mobil="links"] .text-bild__text {
    text-align: start;
  }
}

/* Kleinere Überschriften auf Handys für lange Titel (Feld "titel_mobil"), Werte wie bisher. */
@media (max-width: 47.99rem) {
  [data-titel-mobil="mittel"] .section-title {
    font-size: 1.625rem; /* 26/32 px */
    line-height: 2rem;
  }

  [data-titel-mobil="klein"] .section-title {
    font-size: 1.5rem; /* 24/36 px */
    line-height: 2.25rem;
  }

  .section-head .lead {
    max-width: none;
  }

  [data-lead-mobil="schmal"] .section-head .lead {
    max-width: 60%; /* wie auf dem Desktop (Feld "lead_mobil") */
  }

  .seitenkopf[data-titel-mobil] .seitenkopf__titel {
    font-size: 1.75rem; /* 28 px */
  }

  /* Engere Kartenabstände, wo die alte Seite sie mobil verkleinert hat (Feld "kartenabstand_mobil"). */
  /* Untereinander stehende Buttons wie bisher 20 px auseinander (Elementor-Standard). */
  .actions {
    row-gap: 1.25rem;
  }

  .text-bild__text .actions {
    margin-top: 0;
  }

  /* Innenabstand um Text und Bild wie bisher (Feld "spaltenrand_mobil"). */
  [data-spaltenrand-mobil="10"] .text-bild__text {
    padding: 0.625rem;
  }

  [data-spaltenrand-mobil="10"] .text-bild__media {
    margin: 0.625rem;
  }

  /* Feste Rasterzeilen wie bisher: die ersten Karten sind gleich hoch (Feld "kartenzeilen_mobil"). */
  [data-kartenzeilen-mobil="2"] .grid {
    grid-template-rows: repeat(2, 1fr);
  }

  [data-kartenzeilen-mobil="3"] .grid {
    grid-template-rows: repeat(3, 1fr);
  }

  [data-kartenabstand-mobil="2"] .grid {
    row-gap: 2rem;
  }

  [data-kartenabstand-mobil="1"] .grid {
    row-gap: 1rem;
  }

  [data-kartenabstand-mobil="0"] .grid {
    row-gap: 0;
  }

  /* Abstand zwischen Text und Bild (Feld "bildabstand_mobil"). */
  [data-bildabstand-mobil="2"] .text-bild__inner {
    row-gap: 2rem;
  }

  [data-bildabstand-mobil="1"] .text-bild__inner {
    row-gap: 1rem;
  }

  [data-bildabstand-mobil="0"] .text-bild__inner {
    row-gap: 0;
  }

  [data-bildabstand-mobil="4"] .text-bild__inner {
    row-gap: 4rem;
  }
}

/* -------------------------------------------------------------------------
   Überschrift (Standard): erste Zeile ruhig, zweite Zeile betont. In diesem
   Design gleich gesetzt, die zweite Zeile steht unter der ersten.
   ------------------------------------------------------------------------- */
.headline {
  color: var(--heading-color, var(--fg-brand));
  font-size: var(--text-t2);
  line-height: 1.6;
}

.headline__quiet,
.headline__accent {
  display: block;
}

.headline--hero {
  font-size: var(--text-hero);
}
