/* ===== SUPER FULLWIDTH FIX (Block Themes / Twenty Twenty-Five / WooCommerce templates) =====
   Ziel: Der Slider soll IMMER bis an den Browser-Rand gehen – unabhängig von "Global Padding",
   constrained layouts oder Content-Wrappern.
*/
body .wp-site-blocks .msahero-tt5-wrapper.alignfull,
body .wp-site-blocks .wp-block-post-content .msahero-tt5-wrapper.alignfull,
body .wp-site-blocks .wp-block-template-part .msahero-tt5-wrapper.alignfull,
body .wp-site-blocks .wp-block-shortcode .msahero-tt5-wrapper.alignfull,
body .entry-content .msahero-tt5-wrapper.alignfull{
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;

  /* Breakout: echte Viewport-Breite */
  width: 100vw !important;
  max-width: 100vw !important;

  /* Center + translate ist in der Praxis robuster als margin-calc (insb. mit Root Padding) */
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;

  margin: 0 !important;
  padding: 0 !important;

  overflow-x: clip !important;
  overflow-y: visible !important;
}

/* Fallback für Browser ohne overflow-x: clip */
@supports not (overflow-x: clip){
  body .wp-site-blocks .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-post-content .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-template-part .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-shortcode .msahero-tt5-wrapper.alignfull,
  body .entry-content .msahero-tt5-wrapper.alignfull{
    overflow-x: hidden !important;
  }
}

/* iOS/Safari: dynamische Viewport-Units (verhindert "safe area" / UI-Bars Effekte) */
@supports (width: 100dvw){
  body .wp-site-blocks .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-post-content .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-template-part .msahero-tt5-wrapper.alignfull,
  body .wp-site-blocks .wp-block-shortcode .msahero-tt5-wrapper.alignfull,
  body .entry-content .msahero-tt5-wrapper.alignfull{
    width: 100dvw !important;
    max-width: 100dvw !important;
  }
}

.msahero-breakout{
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* ===== Slider ===== */
.msahero-slider{
  position: relative;
  width: 100%;
  overflow: hidden;
}

.msahero-slides{
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 420px;
}

.msahero-slide{
  position: absolute;
  inset: 0;

  /* Background (v1.5 – responsive via CSS vars) */
  background-size: cover;
  background-position: center;
  background-image: var(--msahero-bg-desktop);

  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity .9s ease,
    transform 3.8s ease;

  /* Unsichtbare Slides dürfen keine Klicks abfangen */
  pointer-events: none;
  z-index: 1;
}

.msahero-slide.is-active{
  opacity: 1;
  transform: scale(1);

  /* Nur der aktive Slide ist klickbar */
  pointer-events: auto;
  z-index: 2;
}

/* ===== Video-Kompatibilität =====
   Einige Browser (v.a. Safari/iOS) haben Rendering-Probleme mit <video> in transformierten Containern.
   Für Slides mit Video deaktivieren wir daher das Zoom-Transform, damit Videos zuverlässig sichtbar/abspielbar sind.
*/
.msahero-slide.has-video{
  transform: none;
  transition: opacity .9s ease;
  background-color: #000;
}

.msahero-slide.has-video.is-active{
  transform: none;
}

/* ===== Video Background (optional pro Slide) ===== */
.msahero-video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  /* Video soll keine Klicks abfangen (Buttons/Links darüber bleiben nutzbar) */
  pointer-events: none;
}

/* Fallback-Playbutton, falls Autoplay vom Browser geblockt wird */
.msahero-video-playgate{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.85);
  background: rgba(0,0,0,.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  z-index: 9;
  cursor: pointer;
}

.msahero-video-playgate:hover{
  background: rgba(0,0,0,.50);
}

/* ===== Overlay & Content ===== */
.msahero-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;

  /* über Video / Background */
  z-index: 1;
  /* Overlay soll Video-Controls nicht blockieren */
  pointer-events: none;

  /* Default Overlay – wird vom JS nur gesetzt, wenn kein per-Slide Style vorhanden ist */
  background: linear-gradient(
    to right,
    var(--msahero-overlay-color-1, rgba(0,0,0,.65)),
    var(--msahero-overlay-color-2, rgba(0,0,0,0))
  );
}

/* Overlay deaktiviert (pro Slide) */
.msahero-overlay-disabled{
  background: none !important;
}

/* ===== Content ===== */
.msahero-content{
  max-width: var(--msahero-text-width, 520px);
  padding: 64px;

  /* über Overlay */
  position: relative;
  z-index: 2;

  /* Content bleibt klickbar, obwohl Overlay pointer-events: none hat */
  pointer-events: auto;

  /* Textfarbe */
  color: var(--msahero-text-color, #ffffff);
}

.msahero-align-left{ margin-right:auto; }
.msahero-align-center{ margin:0 auto; text-align:center; }
.msahero-align-right{ margin-left:auto; text-align:right; }

/* ===== Typography (v1.5 – per Slide via CSS vars) ===== */
.msahero-subtitle{
  font-size: var(--msahero-subtitle-size, .8rem);
  letter-spacing: .22em;
  opacity: .85;
  margin-bottom: 16px;

  /* Subtitle als Akzent */
  color: var(--msahero-accent-color, #E7791A);
}

.msahero-headline{
  font-size: var(--msahero-headline-size, 2.6rem);
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 18px;
}

.msahero-text{
  font-size: var(--msahero-text-size, .95rem);
  line-height: 1.55;
  opacity: .9;
  margin-bottom: 24px;
}

/* ===== Text Animation (v1.5) ===== */
.msahero-content.msahero-anim-fadeup{ --msahero-anim-x: 0px; --msahero-anim-y: 14px; --msahero-anim-scale: 1; }
.msahero-content.msahero-anim-fade{ --msahero-anim-x: 0px; --msahero-anim-y: 0px; --msahero-anim-scale: 1; }
.msahero-content.msahero-anim-slideleft{ --msahero-anim-x: -18px; --msahero-anim-y: 0px; --msahero-anim-scale: 1; }
.msahero-content.msahero-anim-slideright{ --msahero-anim-x: 18px; --msahero-anim-y: 0px; --msahero-anim-scale: 1; }
.msahero-content.msahero-anim-zoom{ --msahero-anim-x: 0px; --msahero-anim-y: 0px; --msahero-anim-scale: .98; }

/* Initial */
.msahero-content:not(.msahero-anim-off) .msahero-subtitle,
.msahero-content:not(.msahero-anim-off) .msahero-headline,
.msahero-content:not(.msahero-anim-off) .msahero-text,
.msahero-content:not(.msahero-anim-off) .msahero-btn{
  opacity: 0;
  transform: translate(var(--msahero-anim-x, 0px), var(--msahero-anim-y, 14px)) scale(var(--msahero-anim-scale, 1));
  will-change: transform, opacity;
}

/* Visible on active slide */
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-subtitle,
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-headline,
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-text,
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-btn{
  opacity: 1;
  transform: translate(0px, 0px) scale(1);
  transition-property: opacity, transform;
  transition-duration: var(--msahero-anim-duration, 600ms);
  transition-timing-function: ease;
}

/* Element-specific delays */
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-subtitle{ transition-delay: var(--msahero-delay-subtitle, 100ms); }
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-headline{ transition-delay: var(--msahero-delay-headline, 200ms); }
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-text{ transition-delay: var(--msahero-delay-text, 350ms); }
.msahero-slide.is-active .msahero-content:not(.msahero-anim-off) .msahero-btn{ transition-delay: var(--msahero-delay-button, 500ms); }

/* Animation aus */
.msahero-content.msahero-anim-off .msahero-subtitle,
.msahero-content.msahero-anim-off .msahero-headline,
.msahero-content.msahero-anim-off .msahero-text,
.msahero-content.msahero-anim-off .msahero-btn{
  opacity: 1;
  transform: none;
  transition: none;
}

/* ===== Button ===== */
.msahero-btn{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--msahero-accent-color, #E7791A);
  text-decoration: none;
  letter-spacing: .14em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

.msahero-btn-label{ display:inline-block; }

.msahero-btn-icon svg{
  width: 18px;
  height: 18px;
  display: block;
}

/* Varianten */
.msahero-btn--outline{
  background: transparent;
  color: var(--msahero-accent-color, #E7791A);
}

.msahero-btn--outline:hover{
  background: color-mix(in srgb, var(--msahero-accent-color) 20%, transparent);
}

.msahero-btn--solid{
  background: var(--msahero-accent-color, #E7791A);
  color: #0b1220;
}

.msahero-btn--solid:hover{
  background: color-mix(in srgb, var(--msahero-accent-color) 86%, #000);
}

/* Fallback: ohne Variant-Klasse wie outline */
.msahero-btn:not(.msahero-btn--solid):not(.msahero-btn--outline){
  background: transparent;
  color: var(--msahero-accent-color, #E7791A);
}

/* ===== Controls ===== */
.msahero-dots{
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;

  /* über Slides */
  z-index: 10;
}

.msahero-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: none;
}

.msahero-dot.is-active{
  width: 24px;
  background: #fff;
}

.msahero-arrow-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.65);

  /* über Slides */
  z-index: 10;
}

.msahero-prev{ left: 18px; }
.msahero-next{ right: 18px; }

.msahero-no-dots .msahero-dots{ display:none; }
.msahero-no-arrows .msahero-arrow-btn{ display:none; }

/* ===== Mobile ===== */
@media (max-width:768px){
  .msahero-slides{ height: 60vh; min-height: 340px; }

  /* responsive background */
  .msahero-slide{
    background-image: var(--msahero-bg-mobile, var(--msahero-bg-desktop));
  }

  .msahero-content{ padding: 28px 20px 44px; max-width:100%; }

  /* Typography per breakpoint */
  .msahero-subtitle{ font-size: var(--msahero-subtitle-size-mobile, var(--msahero-subtitle-size, .8rem)); }
  .msahero-headline{ font-size: var(--msahero-headline-size-mobile, var(--msahero-headline-size, 2.6rem)); }
  .msahero-text{ font-size: var(--msahero-text-size-mobile, var(--msahero-text-size, .95rem)); }

  /* Mobile Align overrides */
  .msahero-content.msahero-align-mobile-left{ margin-right:auto; margin-left:0; text-align:left; }
  .msahero-content.msahero-align-mobile-center{ margin:0 auto; text-align:center; }
  .msahero-content.msahero-align-mobile-right{ margin-left:auto; margin-right:0; text-align:right; }

  .msahero-btn{
    width: auto;
    min-width: 220px;
    max-width: 90%;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 20px;
  }
}


/* Wenn Controls als Fallback aktiv sind, muss das Video klickbar sein */
.msahero-slide.msahero-video-controls .msahero-video{
  pointer-events: auto;
}
