/**
 * mod_vr_slider
 * Clean rebuild for a neutral, dependency-free hero slider.
 *
 * Design notes:
 * - The visible slide image is a normal <img> inside <picture>. This avoids the
 *   browser-dependent pitfalls we saw with CSS background-image variables.
 * - Hidden slides remain in the DOM, but only the active slide is visible and
 *   interactive.
 * - Ken Burns is applied only when JavaScript adds .is-animating. The
 *   outgoing slide keeps that class until after the fade. This keeps the
 *   animation reset away from the visible transition as far as possible.
 */

.vr-slider-frame {
  width: 100%;
  background: var(--vr-slider-bg-color, #000);
}

.vr-slider {
  position: relative;
  width: 100%;
  min-height: var(--vr-slider-min-height, 520px);
  height: var(--vr-slider-height, 100vh);
  overflow: hidden;
  background: var(--vr-slider-bg-color, #000);
  isolation: isolate;
}

/*
 * Full-height heroes must use the visible viewport on mobile Safari/iPadOS.
 * Plain 100vh can include browser chrome that is not currently visible and may
 * make the slider extend below the screen. 100svh is the CSS fallback; JS sets
 * --vr-slider-dynamic-height from visualViewport/innerHeight when available.
 */
.vr-slider--viewport {
  height: var(--vr-slider-dynamic-height, var(--vr-slider-height, 100vh));
}

@supports (height: 100svh) {
  .vr-slider--viewport {
    height: var(--vr-slider-dynamic-height, 100svh);
  }
}

/* Width modes live on an outer frame so the configured background colour can
   fill the side areas around a boxed slider as well as the image-loading phase.
   The actual slider root stays the JavaScript instance boundary. */
.vr-slider-frame--width-position {
  width: 100%;
}

.vr-slider-frame--width-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.vr-slider-frame--width-container {
  width: 100%;
}

.vr-slider-frame--width-container > .vr-slider {
  width: min(100%, var(--vr-slider-max-width, 1200px));
  max-width: var(--vr-slider-max-width, 1200px);
}

.vr-slider-frame--width-container.vr-slider-frame--align-left > .vr-slider {
  margin-left: 0;
  margin-right: auto;
}

.vr-slider-frame--width-container.vr-slider-frame--align-center > .vr-slider {
  margin-left: auto;
  margin-right: auto;
}

.vr-slider-frame--width-container.vr-slider-frame--align-right > .vr-slider {
  margin-left: auto;
  margin-right: 0;
}

.vr-slider[data-touch-swipe="1"] {
  /* Allow vertical page scrolling while keeping horizontal swipes for slides. */
  touch-action: pan-y;
}


.vr-slider--auto {
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Each module instance receives its own inline CSS variables on .vr-slider.
   The class names are shared globally, but the values are scoped by the root. */
.vr-slider__slides,
.vr-slider__slide,
.vr-slider__picture,
.vr-slider__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vr-slider__slide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--vr-slider-fade-duration, 1200ms) ease, visibility 0s linear var(--vr-slider-fade-duration, 1200ms);
  z-index: 1;
}

.vr-slider__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--vr-slider-fade-duration, 1200ms) ease, visibility 0s linear 0s;
  z-index: 2;
}

.vr-slider__picture {
  display: block;
  overflow: hidden;
}

.vr-slider__image {
  display: block;
  object-fit: cover;
  object-position: var(--vr-slide-position, 50% 50%);
  transform-origin: var(--vr-slide-focus, 50% 50%);
  transform: scale(var(--vr-slide-zoom-start, 1));
  will-change: transform;
}

.vr-slider__slide.is-animating.has-kenburns .vr-slider__image {
  animation: vrSliderKenBurns var(--vr-slide-duration, 9000ms) ease-in-out forwards;
}

.vr-slider__slide.no-kenburns .vr-slider__image,
.vr-slider__slide:not(.is-animating) .vr-slider__image {
  animation: none !important;
}

.vr-slider__slide.no-kenburns .vr-slider__image {
  transform: scale(1) !important;
  will-change: auto;
}

.vr-slider__overlay {
  position: absolute;
  inset: 0;
  background: var(--vr-slide-overlay-background, transparent);
  opacity: 1;
  z-index: 3;
  pointer-events: none;
}

/* Text block sits above image and overlay, but below navigation controls. */
.vr-slider__content {
  position: absolute;
  z-index: 4;
  color: var(--vr-slider-text-color, #fff);
  max-width: var(--vr-slider-content-max-width, 760px);
  text-align: var(--vr-slider-content-align, left);
  box-sizing: border-box;
  background: var(--vr-slide-content-bg, transparent);
  border: var(--vr-slide-content-border-width, 0px) solid var(--vr-slide-content-border-color, transparent);
  border-radius: var(--vr-slide-content-radius, 0px);
  padding: var(--vr-slide-content-padding, 0px);
}

.vr-slider__content--top-left,
.vr-slider__content--top-center,
.vr-slider__content--top-right {
  top: var(--vr-slider-content-inset, 48px);
}

.vr-slider__content--bottom-left,
.vr-slider__content--bottom-center,
.vr-slider__content--bottom-right {
  bottom: var(--vr-slider-content-inset, 48px);
}

.vr-slider__content--top-left,
.vr-slider__content--center-left,
.vr-slider__content--bottom-left {
  left: var(--vr-slider-content-inset, 48px);
}

.vr-slider__content--top-right,
.vr-slider__content--center-right,
.vr-slider__content--bottom-right {
  right: var(--vr-slider-content-inset, 48px);
}

.vr-slider__content--top-center,
.vr-slider__content--bottom-center {
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--vr-slider-content-max-width, 760px), calc(100% - (2 * var(--vr-slider-content-inset, 48px))));
}

.vr-slider__content--center-left,
.vr-slider__content--center,
.vr-slider__content--center-right {
  top: 50%;
}

.vr-slider__content--center-left {
  transform: translateY(-50%);
}

.vr-slider__content--center-right {
  transform: translateY(-50%);
}

.vr-slider__content--center {
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(var(--vr-slider-content-max-width, 760px), calc(100% - (2 * var(--vr-slider-content-inset, 48px))));
}

.vr-slider__headline {
  margin: 0 0 0.35em;
  color: var(--vr-slider-headline-color, #fff);
  font-size: var(--vr-slider-headline-size, 72px);
  line-height: var(--vr-slider-headline-line-height, 1);
  font-weight: 400;
}

.vr-slider__text {
  margin: 0;
  color: var(--vr-slider-text-color, #fff);
  font-size: var(--vr-slider-text-size, 24px);
  line-height: var(--vr-slider-text-line-height, 1.45);
}

.vr-slider__content a {
  color: var(--vr-slider-link-color, currentColor);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.vr-slider__content a:hover,
.vr-slider__content a:focus-visible {
  color: var(--vr-slider-link-hover-color, var(--vr-slider-link-color, currentColor));
}

/* Optional global text overlay uses the same visual rules as slide content,
   but fades independently above all individual slides. */
.vr-slider__global-content {
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--vr-slider-fade-duration, 1200ms) ease, visibility 0s linear var(--vr-slider-fade-duration, 1200ms);
}

.vr-slider__global-content.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--vr-slider-fade-duration, 1200ms) ease, visibility 0s linear 0s;
}

/* Small, non-clickable scroll hint for full-height hero sliders. It uses
   currentColor so the module only needs one colour parameter. */
.vr-slider__scroll-hint {
  --vr-slider-scroll-hint-translate-x: -50%;

  position: absolute;
  z-index: 6;
  left: var(--vr-slider-scroll-hint-left, 50%);
  bottom: var(--vr-slider-scroll-hint-bottom, 30px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--vr-slider-scroll-hint-color, #fff);
  opacity: var(--vr-slider-scroll-hint-opacity, 0.75);
  pointer-events: none;
  transform: translate(var(--vr-slider-scroll-hint-translate-x), 0);
  animation: vrSliderScrollHintFloat 2200ms ease-in-out infinite;
}


/* Explicit position classes keep left/right scroll-hint placement reliable across
   browsers. The PHP inline variable remains as a safe fallback, but these class
   rules make the responsive edge distance visible on small/touch viewports. */
.vr-slider__scroll-hint-position--center {
  left: 50%;
  right: auto;
  --vr-slider-scroll-hint-translate-x: -50%;
}

.vr-slider__scroll-hint-position--left {
  left: var(--vr-slider-scroll-hint-edge, 140px);
  right: auto;
  --vr-slider-scroll-hint-translate-x: 0;
}

.vr-slider__scroll-hint-position--right {
  left: auto;
  right: var(--vr-slider-scroll-hint-edge, 140px);
  --vr-slider-scroll-hint-translate-x: 0;
}

.vr-slider__scroll-hint-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.vr-slider__scroll-hint-chevron {
  width: 18px;
  height: 18px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/*
 * The prominent variant deliberately keeps the existing subtle variant untouched.
 * It uses a rotated text/line composition similar to classic hero scroll cues.
 * The animated line changes its real width, not only its transform, so the
 * label follows the line end and appears to move calmly up/down after rotation.
 */
.vr-slider__scroll-hint--prominent {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: lowercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  transform-origin: left bottom;
  transform: rotate(-90deg);
  opacity: 0;
  animation: vrSliderScrollHintFadeIn 700ms ease 2000ms forwards;
}

.vr-slider__scroll-hint--prominent.vr-slider__scroll-hint-position--center {
  transform: translateX(-50%) rotate(-90deg);
}

.vr-slider__scroll-hint--prominent .vr-slider__scroll-hint-label {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
}

.vr-slider__scroll-hint--prominent .vr-slider__scroll-hint-line {
  display: block;
  flex: 0 0 auto;
  width: 58px;
  height: 3px;
  background: currentColor;
  opacity: 0.92;
  animation: vrSliderScrollHintLine 4000ms ease-in-out infinite;
}

@keyframes vrSliderScrollHintFloat {
  0%, 100% {
    transform: translate(var(--vr-slider-scroll-hint-translate-x), 0);
  }
  50% {
    transform: translate(var(--vr-slider-scroll-hint-translate-x), 8px);
  }
}

@keyframes vrSliderScrollHintFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: var(--vr-slider-scroll-hint-opacity, 0.75);
  }
}

@keyframes vrSliderScrollHintLine {
  0%, 100% {
    width: 58px;
  }
  50% {
    width: 28px;
  }
}

.vr-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 180ms ease, opacity 180ms ease;
}

.vr-slider__arrow:hover,
.vr-slider__arrow:focus-visible {
  background: rgba(0, 0, 0, 0.52);
}

.vr-slider__arrow--prev {
  left: clamp(14px, 2.5vw, 34px);
}

.vr-slider__arrow--next {
  right: clamp(14px, 2.5vw, 34px);
}

.vr-slider__dots {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: clamp(18px, 4vh, 42px);
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
}

.vr-slider__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.vr-slider__dot.is-active,
.vr-slider__dot:hover,
.vr-slider__dot:focus-visible {
  background: rgba(255, 255, 255, 0.92);
}

/* Optional reveal for slider controls.
   The visible state is class-based instead of :focus-within-only: a normal
   mouse click must not keep hover controls pinned after the pointer leaves.
   Keyboard users still receive visible controls while navigating the slider. */
.vr-slider--arrows-hover .vr-slider__arrow,
.vr-slider--dots-hover .vr-slider__dots {
  opacity: 0;
  pointer-events: none;
}

.vr-slider--arrows-hover.is-pointer-over .vr-slider__arrow,
.vr-slider--arrows-hover.is-keyboard-active .vr-slider__arrow,
.vr-slider--dots-hover.is-pointer-over .vr-slider__dots,
.vr-slider--dots-hover.is-keyboard-active .vr-slider__dots {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .vr-slider--arrows-hover:hover .vr-slider__arrow,
  .vr-slider--dots-hover:hover .vr-slider__dots {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: none), (pointer: coarse) {
  .vr-slider--arrows-hover .vr-slider__arrow,
  .vr-slider--dots-hover .vr-slider__dots {
    opacity: 1;
    pointer-events: auto;
  }
}

@keyframes vrSliderKenBurns {
  from {
    transform: scale(var(--vr-slide-zoom-start, 1));
  }
  to {
    transform: scale(var(--vr-slide-zoom-end, 1.12));
  }
}

@media (max-width: 1180px), (hover: none), (pointer: coarse) {
  .vr-slider {
    --vr-slider-scroll-hint-edge: 70px;
  }
}

@media (max-width: 767px) {
  .vr-slider {
    min-height: min(var(--vr-slider-min-height, 520px), 86vh);
  }

  /* Text block sits above image and overlay, but below navigation controls. */
.vr-slider__content {
    max-width: min(var(--vr-slider-content-max-width, 760px), calc(100% - 44px));
  }

  .vr-slider__content--top-left,
  .vr-slider__content--top-center,
  .vr-slider__content--top-right {
    top: max(22px, var(--vr-slider-content-inset, 48px));
  }

  .vr-slider__content--bottom-left,
  .vr-slider__content--bottom-center,
  .vr-slider__content--bottom-right {
    bottom: max(52px, var(--vr-slider-content-inset, 48px));
  }

  .vr-slider__content--top-left,
  .vr-slider__content--center-left,
  .vr-slider__content--bottom-left {
    left: 22px;
  }

  .vr-slider__content--top-right,
  .vr-slider__content--center-right,
  .vr-slider__content--bottom-right {
    right: 22px;
  }

  .vr-slider__content--top-center,
  .vr-slider__content--center,
  .vr-slider__content--bottom-center {
    width: calc(100% - 44px);
  }

  .vr-slider__headline {
    font-size: min(var(--vr-slider-headline-size, 72px), 42px);
  }

  .vr-slider__text {
    font-size: min(var(--vr-slider-text-size, 24px), 20px);
  }

  .vr-slider__arrow {
    width: 38px;
    height: 38px;
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vr-slider__slide,
  .vr-slider__image,
  .vr-slider__arrow,
  .vr-slider__dot,
  .vr-slider__global-content,
  .vr-slider__scroll-hint,
  .vr-slider__scroll-hint-line,
  .vr-slider__scroll-hint-label {
    transition: none !important;
    animation: none !important;
  }

  .vr-slider__scroll-hint--prominent {
    opacity: var(--vr-slider-scroll-hint-opacity, 0.75) !important;
  }

  .vr-slider__slide.is-active.has-kenburns .vr-slider__image {
    transform: scale(var(--vr-slide-zoom-start, 1));
  }
}
