/* ==========================================================================
   Kulturkieker – Contao 5.7 Kompatibilitäts-CSS
   Übersetzt die Regeln aus styles_generated.css + styles_customized_kulturkieker.css
   von den Contao-4.13-Klassen auf das neue Twig-Markup von Contao 5:
     .ce_text            → .content-text          (ebenso headline, hyperlink, player, download, gallery)
     .float_left/right   → .media--left/right > figure
     .float_above/below  → .media--above/below > figure
     .image_container    → figure (ohne Klasse)
     figcaption.caption  → figcaption
     .ce_gallery .cols_N → .content-gallery--cols-N
     .video_container    → .content-player > figure
   Als letzte Datei im Seitenlayout einbinden (nach styles_customized_kulturkieker.css).
   Legacy-Module (News, Events, Navigation, Formulare) behalten ihre alten Klassen
   und werden hier bewusst nicht angefasst.
   ========================================================================== */

/* ---------- Bilder / Media ---------- */

/* <figure> ist display:flex – früher sorgte .image_container für die Spalte,
   sonst steht die Bildunterschrift neben dem Bild */
:is(.media, .content-image, .content-gallery, .content-player) figure {
  flex-direction: column;
}

.media--left > figure {
  float: left;
  margin-bottom: 1em;
}

.media--right > figure {
  float: right;
  margin-bottom: 1em;
}

.media--above > figure {
  margin-bottom: 1em;
}

.media--below > figure {
  margin-top: 1em;
}

@media screen and (min-width: 48em) {
  .media--left > figure {
    margin-right: 1em;
  }
  .media--right > figure {
    margin-left: 1em;
  }
}

@media screen and (max-width: 58.6875em) {
  .media--left > figure,
  .media--right > figure {
    float: none;
  }
}

:is(.content-image, .media, .content-gallery) figcaption {
  text-align: center;
  max-width: 350px;
}

/* ---------- Text / Überschriften ---------- */

.content-text {
  margin-bottom: var(--base-spacing-unit);
}

.content-text h1,
.content-text h2,
.content-text h3,
.content-text h4,
.content-text h5 {
  margin-top: var(--base-spacing-unit);
  margin-bottom: var(--base-spacing-unit);
}

.content-text h1 + h2 {
  margin-top: 0;
}

h2.content-headline {
  margin-bottom: 1em;
}

/* Slogan-Labels (Gemeinde-Farben) */
.content-text.slogan {
  background: var(--color-brand3);
  max-width: fit-content;
  padding: 0.25em 0.5em;
  color: #fff;
  border: 1px solid var(--color-brand3);
}
.content-text.slogan.apen            { border-left: 10px solid orange; }
.content-text.slogan.bad-zwischenahn { border-left: 10px solid aquamarine; }
.content-text.slogan.edewecht        { border-left: 10px solid yellow; }
.content-text.slogan.rastede         { border-left: 10px solid cornflowerblue; }
.content-text.slogan.westerstede     { border-left: 10px solid darkviolet; }
.content-text.slogan.wiefelstede     { border-left: 10px solid violet; }
.content-text.slogan.kulturkieker    { border-left: 10px solid var(--color-highlight); }

/* ---------- Buttons (Hyperlink-Element mit Klasse btn) ---------- */

.content-hyperlink.btn > a {
  border-radius: var(--button-border-radius);
  padding: var(--button-spacing);
  display: inline-block;
  border: var(--button-border-width) solid transparent;
  font-family: var(--button-font-family);
  font-weight: var(--button-font-weight);
  line-height: var(--button-line-height);
  text-align: center;
  background: none transparent;
  white-space: nowrap;
  text-decoration: none;
  margin-bottom: var(--base-spacing-unit);
  transition: 250ms ease-in-out;
}

.content-hyperlink.btn--secondary > a {
  background: var(--button-bg-2);
  border-color: var(--button-bg-2);
  color: var(--color-btn-text-2);
}

.content-hyperlink.btn--secondary > a:hover {
  border-color: var(--button-bg-hover-2);
  background: var(--button-bg-hover-2);
}

.content-hyperlink.btn.btn--pulsing {
  overflow: visible;
}

.content-hyperlink.btn.btn--pulsing > a {
  box-shadow: 0 0 0 0 #000;
  transform: scale(1);
  animation: pulsingBoxShadow 2s ease infinite;
  transition: 300ms ease-in-out;
}

.content-hyperlink.btn.btn--pulsing > a:hover {
  animation: none;
}

/* ---------- Video-Player (16:9) ---------- */

.content-player > figure:has(video) {
  position: relative;
  padding-bottom: 56.25%;
  width: 100%;
  height: auto;
}

.content-player video {
  border: 0;
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Downloads ---------- */

.content-download,
.content-downloads {
  margin-bottom: 1rem;
}

/* ---------- Galerie ---------- */

.content-gallery {
  margin-bottom: var(--base-spacing-unit);
}

.content-gallery > ul {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-columns: 1fr;
  column-gap: var(--grid__gutter);
  row-gap: var(--grid__gutter);
  padding: 0;
  margin: 0;
  list-style: none;
}

.content-gallery > ul li {
  grid-column: 1 / -1;
}

.content-gallery img {
  display: block;
}

/* mobil 2 Spalten, ab 48em gemäß Einstellung */
.content-gallery:where([class*="content-gallery--cols-"]:not(.content-gallery--cols-1)) > ul > li {
  grid-column: span 6 / span 6;
}

@media screen and (min-width: 48em) {
  .content-gallery.content-gallery--cols-3 > ul > li { grid-column: span 4 / span 4; }
  .content-gallery.content-gallery--cols-4 > ul > li { grid-column: span 3 / span 3; }
  .content-gallery.content-gallery--cols-6 > ul > li { grid-column: span 2 / span 2; }
}

/* Tabellen: die alte Regel "table tr.even" wurde im Theme ohnehin auf
   transparent zurückgesetzt – kein Ersatz für .even/.odd nötig. */