/* News-Galerie (Karussell mit News-Texten) */

.image-gallery.image-gallery--news {
  --gallery-height: clamp(16rem, 78.1vw, 37.5rem);
  --gallery-transition: 2s cubic-bezier(0.4, 0, 0.2, 1);
  --gallery-track-transition: 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
  --gallery-slide-width: 70cqw;
  --gallery-slide-gap: 1rem;
  --slide-color: var(--color-primary);
  --gallery-edge-color: var(--color-news-bg);
  --mask-image: none;
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
  contain: layout;
  animation: imageGalleryheightInNews 1s cubic-bezier(0.63,-0.4, 0.4, 1.32) forwards;
}

@keyframes imageGalleryheightInNews {
  to {
    height: var(--gallery-height, clamp(16rem, 78.1vw, 37.5rem));
  }
}

/* Wischen nach links/rechts ist Sache der Galerie, senkrechtes Scrollen und Zoomen der Seite bleiben dem Browser */
.image-gallery__viewport,
.image-gallery--hero {
  touch-action: pan-y pinch-zoom;
}

.image-gallery__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  margin-bottom: 5rem;
  container-type: inline-size;
}

.image-gallery__viewport::before,
.image-gallery__viewport::after {
  --gallery-edge-width: 12%;
  --gallery-edge-blur: 10px;
  --gallery-edge-grayscale: 100%;
  content: "";
  position: absolute;
  top: 0;
  width: var(--gallery-edge-width);
  height: 100%;
  pointer-events: none;
  backdrop-filter: blur(var(--gallery-edge-blur)) grayscale(var(--gallery-edge-grayscale));
  -webkit-backdrop-filter: blur(var(--gallery-edge-blur)) grayscale(var(--gallery-edge-grayscale));
  z-index: 5;
}

.image-gallery--news .image-gallery__viewport::before {
  left: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--gallery-edge-color) 98%, transparent) 0%,
    color-mix(in srgb, var(--gallery-edge-color) 82%, transparent) 35%,
    color-mix(in srgb, var(--gallery-edge-color) 35%, transparent) 70%,
    transparent 100%
  );
  mask-image: linear-gradient(to right, var(--color-on-image) 0%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask-image: linear-gradient(to right, var(--color-on-image) 0%, rgba(255, 255, 255, 0) 100%);
}

.image-gallery--news .image-gallery__viewport::after {
  right: 0;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--gallery-edge-color) 98%, transparent) 0%,
    color-mix(in srgb, var(--gallery-edge-color) 82%, transparent) 35%,
    color-mix(in srgb, var(--gallery-edge-color) 35%, transparent) 70%,
    transparent 100%
  );
  mask-image: linear-gradient(to left, var(--color-on-image) 0%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask-image: linear-gradient(to left, var(--color-on-image) 0%, rgba(255, 255, 255, 0) 100%);
}

.image-gallery__track {
  display: flex;
  align-items: stretch;
  gap: var(--gallery-slide-gap);
  height: 100%;
  transition: transform var(--gallery-track-transition);
  will-change: transform;
  position: relative;
  z-index: 1;
}

.image-gallery--news .image-gallery__slide {
  position: relative;
  flex: 0 0 var(--gallery-slide-width);
  width: var(--gallery-slide-width);
  max-width: var(--gallery-slide-width);
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg, 1rem);
  --image-focus: center center;
  transition: all var(--gallery-track-transition);
  pointer-events: none;
}

.image-gallery__slide.is-active,
.image-gallery__slide[aria-hidden="false"] {
  pointer-events: auto;
  cursor: default;
  z-index: 2;
}

.image-gallery__slide.is-adjacent {
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
}

.image-gallery__slide[data-gallery-clone] .image-gallery__content {
  pointer-events: none;
}

.image-gallery__slide[data-gallery-clone].is-active .image-gallery__content {
  pointer-events: auto;
}

.image-gallery.image-gallery--news.is-normalizing .image-gallery__track,
.image-gallery.image-gallery--news.is-normalizing .image-gallery__slide,
.image-gallery.image-gallery--news.is-normalizing .image-gallery__content,
.image-gallery.image-gallery--news.is-normalizing .image-gallery__content > * {
  transition: none !important;
  animation: none !important;
}

.image-gallery.image-gallery--news.is-sliding .image-gallery__slide,
.image-gallery.image-gallery--news.is-normalizing .image-gallery__slide,
.image-gallery.image-gallery--news.is-content-instant .image-gallery__slide {
  transition: opacity 0s, filter 0s, transform 0s !important;
}

.image-gallery.image-gallery--news.is-sliding .image-gallery__slide:not(.is-active),
.image-gallery.image-gallery--news.is-wrap-sliding .image-gallery__slide:not(.is-active) {
}

.image-gallery.image-gallery--news.is-normalizing .image-gallery__slide.is-active {
}

.image-gallery.image-gallery--news.is-normalizing .image-gallery__slide.is-active .image-gallery__content > * {
  opacity: 1;
  transform: none;
  filter: none;
}

.image-gallery.image-gallery--news:where([style*="--mask-image"])::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  -webkit-transform: translateX(-50%) translateZ(0);
  width: 100%;
  max-width: var(--content-width);
  height: 95%;
  aspect-ratio: 1.28;
  background-color: var(--slide-color);
  mask-image: var(--mask-image);
  -webkit-mask-image: var(--mask-image);
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-position: right top;
  -webkit-mask-position: right top;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  transition: background-color var(--gallery-transition);
  z-index: 10;
}

.image-gallery__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: var(--image-focus);
  background-repeat: no-repeat;
  filter: brightness(0.9) opacity(0.8) blur(25px);
  transform: scale(1.2);
}

.image-gallery__slide img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-focus);
}

.image-gallery__media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.image-gallery__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(23, 32, 54, 0.88) 0%,
    rgba(23, 32, 54, 0.58) 38%,
    rgba(23, 32, 54, 0.22) 68%,
    rgba(23, 32, 54, 0.06) 100%
  );
}

.image-gallery__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(3.25rem, 7vw, 4.5rem);
  z-index: 3;
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 0 var(--edge-distance);
  color: var(--color-on-image);
}

.image-gallery__content > * {
  opacity: 0;
  transform: translate3d(0, 1.25rem, 0);
  filter: blur(8px);
  will-change: opacity, transform, filter;
}

.image-gallery.image-gallery--news:not(.is-slide-settled) .image-gallery__slide.is-active .image-gallery__content > * {
  animation: none;
}

.image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content > * {
  animation: galleryContentIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content .image-gallery__meta {
  animation-delay: 0.06s;
}

.image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content .image-gallery__title {
  animation-delay: 0.14s;
}

.image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content .image-gallery__preview {
  animation-delay: 0.24s;
}

.image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content .button--cta {
  animation-delay: 0.34s;
}

.image-gallery.image-gallery--news.is-slide-settled.is-content-instant .image-gallery__slide.is-active .image-gallery__content > * {
  animation: none;
  opacity: 1;
  transform: none;
  filter: none;
}

.image-gallery__slide:not(.is-active) .image-gallery__content {
  pointer-events: none;
}

.image-gallery__slide:not(.is-active) .image-gallery__content > * {
  animation: none;
}

.image-gallery__meta {
  margin: 0 0 0.35rem;
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.image-gallery__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1.2;
  color: var(--color-on-image);
}

.image-gallery__preview {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 2vw, 1.1875rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.image-gallery__content .button.button--cta {
  min-height: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (hover: hover) and (pointer: fine) {
  .image-gallery__content .button.button--cta:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
    color: var(--color-on-image);
    transform: none;
  }
}

.image-gallery__content .button.button--cta .icon {
  width: 0.75rem;
  height: 0.75rem;
}

/* WebKit/Safari: weniger Blur-Last, visibility nach Fade, eigene Compositing-Layers (data-browser von BrowserHandler.js).
   Wichtig: Selektoren auf --news beschränken. Hero nutzt aria-hidden statt .is-active/.is-adjacent;
   sonst bleiben Hero-Bilder unsichtbar (image-gallery.css wird auch unter der News-Galerie geladen
   und überschriebe sonst die Hero-Safari-Overrides). */
body[data-browser="apple-safari"] .image-gallery.image-gallery--news {
  --gallery-transition-duration: 2s;
  --gallery-transition: var(--gallery-transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

body[data-browser="apple-safari"] .image-gallery--news .image-gallery__slide {
  z-index: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

body[data-browser="apple-safari"] .image-gallery--news .image-gallery__slide:not(.is-active):not(.is-adjacent) {
  visibility: hidden;
}

body[data-browser="apple-safari"] .image-gallery.image-gallery--news.is-sliding .image-gallery__slide:not(.is-active),
body[data-browser="apple-safari"] .image-gallery.image-gallery--news.is-normalizing .image-gallery__slide:not(.is-active),
body[data-browser="apple-safari"] .image-gallery.image-gallery--news.is-wrap-sliding .image-gallery__slide:not(.is-active) {
  visibility: visible;
}

body[data-browser="apple-safari"] .image-gallery--news .image-gallery__slide::before {
  filter: brightness(0.4) blur(30px);
  -webkit-filter: brightness(0.4) blur(30px);
  transform: translate3d(0, 0, 0) scale(1.2);
  -webkit-transform: translate3d(0, 0, 0) scale(1.2);
}

body[data-browser="apple-safari"] .image-gallery--news .image-gallery__slide img {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

.image-gallery__controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  -webkit-transform: translateX(-50%) translateZ(0);
  z-index: 11;
}

.image-gallery__controls-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(23, 32, 54, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.image-gallery__nav-button,
.image-gallery__pause-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.image-gallery__nav-button:hover,
.image-gallery__pause-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-on-image);
}

.image-gallery__nav-button:active,
.image-gallery__pause-button:active {
  transform: scale(0.94);
}

.image-gallery.image-gallery--news.is-sliding .image-gallery__nav-button {
  pointer-events: none;
  opacity: 0.45;
  cursor: not-allowed;
}

.image-gallery.image-gallery--news.is-sliding .image-gallery__nav-button:active {
  transform: none;
}

.image-gallery__nav-button:focus-visible,
.image-gallery__pause-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.image-gallery__nav-button .icon,
.image-gallery__nav-button svg {
  width: 1rem;
  height: 1rem;
  color: currentColor;
  stroke: currentColor;
}

.image-gallery__nav-button .icon {
  stroke-width: 2.25;
}

.image-gallery__pause-button img {
  width: 0.95rem;
  height: 0.95rem;
  filter: brightness(0) invert(1);
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.image-gallery__pause-button:hover img {
  opacity: 1;
}

.image-gallery__controls-divider {
  flex-shrink: 0;
  width: 1px;
  height: 1.125rem;
  background: rgba(255, 255, 255, 0.2);
}

.image-gallery__pagination {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

/*
 * Punkte: der Knopf selbst ist 24 × 24 px (WCAG 2.5.8 Zielgröße), sichtbar ist nur
 * der kleine Punkt in der Mitte (::before); der aktive wird zur Pille.
 */
.image-gallery__dot {
  position: relative;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.image-gallery__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  translate: -50% -50%;
  transition:
    width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
    background-color 0.3s ease;
}

.image-gallery__dot:hover::before {
  background: rgba(255, 255, 255, 0.55);
}

.image-gallery__dot.is-active,
.image-gallery__dot[aria-current="true"] {
  width: 2rem;
}

.image-gallery__dot.is-active::before,
.image-gallery__dot[aria-current="true"]::before {
  width: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
}

.image-gallery__dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -2px;
}

.image-gallery__index {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .image-gallery.image-gallery--news,
  .image-gallery.image-gallery--news::after,
  .image-gallery__track,
  .image-gallery__slide {
    transition-duration: 0.01ms;
  }

  .image-gallery.image-gallery--news.is-slide-settled .image-gallery__slide.is-active .image-gallery__content > * {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Safari: Galerie-Transitions während Scroll-to-Top pausieren, damit der Scroll nicht abbricht */
body[data-scrolling-to-top="true"] .image-gallery.image-gallery--news,
body[data-scrolling-to-top="true"] .image-gallery.image-gallery--news::after,
body[data-scrolling-to-top="true"] .image-gallery__track,
body[data-scrolling-to-top="true"] .image-gallery__slide {
  transition-duration: 0.01ms;
}

@media only screen and (max-width: 768px) {
  .image-gallery.image-gallery--news {
    --gallery-height: clamp(27rem, 118vw, 36rem);
    --gallery-slide-width: 88cqw;
    --gallery-slide-gap: 0.75rem;
  }

  .image-gallery--news .image-gallery__viewport {
    margin-bottom: 4.25rem;
  }

  .image-gallery--news .image-gallery__slide {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .image-gallery--news .image-gallery__media {
    flex: 0 1 46%;
    min-height: 0;
    height: auto;
  }

  .image-gallery--news .image-gallery__slide::before {
    bottom: auto;
    height: 46%;
  }

  .image-gallery--news .image-gallery__slide::after {
    display: none;
  }

  .image-gallery--news .image-gallery__content {
    position: relative;
    flex: 1 1 auto;
    align-self: stretch;
    bottom: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    min-height: 0;
    margin-top: auto;
    padding: 0.9rem var(--edge-distance) 0.65rem;
    background: linear-gradient(
      to bottom,
      rgba(23, 32, 54, 0.94) 0%,
      rgba(23, 32, 54, 1) 100%
    );
  }

  .image-gallery--news .image-gallery__title {
    font-size: clamp(1.2rem, 5.5vw, 1.65rem);
  }

  .image-gallery--news .image-gallery__preview {
    font-size: 0.9375rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  [data-admin="true"] .image-gallery--news .image-gallery__preview {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

/* Folie ohne Bild: farbiger Verlauf mit Struktur als Vorlage, damit sie auch ohne Foto gut aussieht.
   Die Farben kommen aus den Farbtönen (auch aus dem gewählten Farbset); Textfläche bleibt durch die dunkle Verlaufsschicht lesbar.
   Im Admin je Folie wählbar: data-bg-tone / data-bg-tone2 (Farbverlauf von … nach …) und data-bg-pattern (Struktur, wie bei den Bereichen). */
.image-gallery__slide--empty,
.admin-hero-timeline__thumb.is-empty,
.slide-swatch {
  --tpl-1: var(--tone-gruen-solid);
  --tpl-2: var(--tone-blau-solid);
  --tpl-3: var(--tone-gelb-solid);
  --tpl-4: var(--tone-rot-solid);
  --tpl-a: radial-gradient(circle, rgba(255, 255, 255, 0.22) 1.5px, transparent 1.8px);
  --tpl-b: linear-gradient(transparent, transparent);
  --tpl-sa: 22px 22px;
  --tpl-sb: auto;
  --tpl-pb: 0 0;
  --tpl-rb: repeat;
  background-color: var(--tpl-1);
  background-image:
    var(--tpl-a),
    var(--tpl-b),
    radial-gradient(ellipse at 8% 10%, color-mix(in srgb, var(--tpl-3) 55%, transparent) 0, transparent 38%),
    radial-gradient(ellipse at 88% 14%, color-mix(in srgb, var(--tpl-2) 75%, transparent) 0, transparent 48%),
    radial-gradient(ellipse at 76% 92%, color-mix(in srgb, var(--tpl-4) 60%, transparent) 0, transparent 50%),
    linear-gradient(135deg, var(--tpl-1), color-mix(in srgb, var(--tpl-1) 55%, var(--tpl-2)));
  background-size: var(--tpl-sa), var(--tpl-sb), auto, auto, auto, auto;
  background-position: 0 0, var(--tpl-pb), 0 0, 0 0, 0 0, 0 0;
  background-repeat: repeat, var(--tpl-rb), no-repeat, no-repeat, no-repeat, no-repeat;
}
.image-gallery__slide--empty:nth-child(4n + 2) { --tpl-1: var(--tone-blau-solid); --tpl-2: var(--tone-gruen-solid); --tpl-3: var(--tone-rot-solid); --tpl-4: var(--tone-gelb-solid); }
.image-gallery__slide--empty:nth-child(4n + 3) { --tpl-1: var(--tone-rot-solid); --tpl-2: var(--tone-blau-solid); --tpl-3: var(--tone-gelb-solid); --tpl-4: var(--tone-gruen-solid); }
.image-gallery__slide--empty:nth-child(4n) { --tpl-1: var(--tone-gelb-solid); --tpl-2: var(--tone-rot-solid); --tpl-3: var(--tone-gruen-solid); --tpl-4: var(--tone-blau-solid); }

/* Eigene Wahl: zwei Töne ergeben den Verlauf (nur Farbe 1: dunklere Variante derselben Farbe) */
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone] {
  --tpl-2: color-mix(in srgb, var(--tpl-1) 60%, #172036);
  --tpl-3: var(--tpl-2);
  --tpl-4: var(--tpl-1);
}
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="gelb"] { --tpl-1: var(--tone-gelb-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="gruen"] { --tpl-1: var(--tone-gruen-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="rot"] { --tpl-1: var(--tone-rot-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="blau"] { --tpl-1: var(--tone-blau-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="orange"] { --tpl-1: var(--tone-orange-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="tuerkis"] { --tpl-1: var(--tone-tuerkis-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="violett"] { --tpl-1: var(--tone-violett-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone="rosa"] { --tpl-1: var(--tone-rosa-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="gelb"] { --tpl-2: var(--tone-gelb-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="gruen"] { --tpl-2: var(--tone-gruen-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="rot"] { --tpl-2: var(--tone-rot-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="blau"] { --tpl-2: var(--tone-blau-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="orange"] { --tpl-2: var(--tone-orange-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="tuerkis"] { --tpl-2: var(--tone-tuerkis-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="violett"] { --tpl-2: var(--tone-violett-solid); }
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-tone2="rosa"] { --tpl-2: var(--tone-rosa-solid); }

/* Strukturen wie bei den Bereichen (Punkte, Karo, Linien, Heft), hell auf dem Verlauf */
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-pattern="none"] {
  --tpl-a: linear-gradient(transparent, transparent);
}
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-pattern="grid"] {
  --tpl-a: linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  --tpl-b: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  --tpl-sa: 28px 28px;
  --tpl-sb: 28px 28px;
}
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-pattern="lines"] {
  --tpl-a: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(255, 255, 255, 0.22) 31px 32px);
  --tpl-sa: auto;
}
:is(.image-gallery__slide--empty, .admin-hero-timeline__thumb.is-empty, .slide-swatch)[data-bg-pattern="notebook"] {
  --tpl-a: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(255, 255, 255, 0.22) 31px 32px);
  --tpl-b: linear-gradient(rgba(255, 190, 190, 0.5), rgba(255, 190, 190, 0.5));
  --tpl-sa: auto;
  --tpl-sb: 2px 100%;
  --tpl-pb: 2.75rem 0;
  --tpl-rb: no-repeat;
}

/* News: Folien ohne Foto bekommen die dunkle Verlaufsschicht über die ganze Fläche (sonst bleibt der untere Rand hell, z. B. bei Gelb) */
@media (min-width: 769px) {
  .image-gallery--news .image-gallery__slide--empty::after { display: block; }
}

/* Viele Bilder: Zähler statt Punkte, damit die Bedienleiste nicht breiter wird als der Bildschirm */
.image-gallery__count {
  display: none;
  min-width: 3.75rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
}
.image-gallery.has-many-slides .image-gallery__dot { display: none; }
.image-gallery.has-many-slides .image-gallery__count { display: inline-block; }

/* Nur ein Eintrag: nichts zum Blättern, also keine Bedienleiste für Besucher (im Admin bleibt sie für die Zeitleiste) */
body:not([data-admin="true"]) .image-gallery[data-slide-count="1"] .image-gallery__controls { display: none; }
/* Ohne Bedienleiste bleibt unter dem Eintrag trotzdem Abstand zum Abschnittsrand (Kartenhöhe wie bisher, die Galerie ist um den Abstand höher) */
body:not([data-admin="true"]) .image-gallery.image-gallery--news[data-slide-count="1"] { --gallery-height: calc(clamp(16rem, 78.1vw, 37.5rem) + 3rem); }
body:not([data-admin="true"]) .image-gallery--news[data-slide-count="1"] .image-gallery__viewport { margin-bottom: 3rem; }
@media only screen and (max-width: 768px) {
  body:not([data-admin="true"]) .image-gallery.image-gallery--news[data-slide-count="1"] { --gallery-height: calc(clamp(27rem, 118vw, 36rem) + 2rem); }
  body:not([data-admin="true"]) .image-gallery--news[data-slide-count="1"] .image-gallery__viewport { margin-bottom: 2rem; }
}

/* Fenstergröße ändert sich: Folien und Feed springen direkt auf die neue Größe (die Animation würde sonst falsch gemessen) */
.image-gallery.is-resizing .image-gallery__track,
.image-gallery.is-resizing .image-gallery__slide,
.image-gallery.is-resizing .image-gallery__slide * { transition: none !important; }
