/**
 * Experience hero — fullscreen slideshow (md_experience_hero shortcode)
 * - Left: CTA centered in the remaining width beside the panel.
 * - Right: text panel (~36%, max 350px) + responsive margin-right — typography and frosted panel look.
 * - Ken Burns on active slide; --md-exp-ken-duration matches autoplay (set on section in PHP).
 * - Nav: large edge prev/next + dots (inactive #fff; active headline teal; overrides Elementor).
 */

.md-exp-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  --md-exp-hero-teal: #0097a7;
  --md-exp-hero-panel-w: 36%;
  --md-exp-ken-duration: 5000ms;
}

.admin-bar .md-exp-hero {
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
  .admin-bar .md-exp-hero {
    min-height: calc(100vh - 46px);
    min-height: calc(100svh - 46px);
    height: calc(100vh - 46px);
    height: calc(100svh - 46px);
  }
}

.md-exp-hero__swiper {
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.md-exp-hero__swiper .swiper-wrapper {
  min-height: inherit;
}

.md-exp-hero__slide {
  position: relative;
  min-height: inherit;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
}

.md-exp-hero__bg {
  position: absolute;
  inset: 0;
  background-image: var(--md-exp-bg-desktop);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  transform: scale(1);
  transform-origin: center center;
  will-change: transform;
}

.md-exp-hero__slide.swiper-slide-active .md-exp-hero__bg {
  animation: md-exp-hero-ken-in var(--md-exp-ken-duration, 5000ms) linear forwards;
}

@keyframes md-exp-hero-ken-in {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

.md-exp-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.12) 0%,
      rgba(0, 0, 0, 0.04) 55%,
      rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.md-exp-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: inherit;
  min-height: 100vh;
  min-height: 100dvh;
}

.admin-bar .md-exp-hero__inner {
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
}

/* CTA: fills space to the left of the panel; content centered in that band */
.md-exp-hero__visual {
  flex: 1 1 calc(100% - var(--md-exp-hero-panel-w));
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  box-sizing: border-box;
}

.md-exp-hero__cta {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #fff;
  color: #fff;
  font-family: inherit;
  font-size: clamp(0.7rem, 1.1vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-align: center;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.md-exp-hero__cta:hover,
.md-exp-hero__cta:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}

.md-exp-hero__cta--static {
  pointer-events: none;
}

/* Right column: original width cap + frosted panel (soft edge into image on the left) */
.md-exp-hero__panel {
  position: relative;
  flex: 0 0 var(--md-exp-hero-panel-w);
  max-width: 350px;
  margin-right: clamp(12px, 12vw, 200px);
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(20px, 3vw, 48px) clamp(16px, 2.5vw, 40px);
  box-sizing: border-box;
}

.md-exp-hero__headline {
  margin: 0 0 1rem;
  font-family: "Luxenta";
  /* Base 32px; fluid down for narrow viewports / panel */
  font-size: 33px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--md-exp-hero-teal);
}

.md-exp-hero__body {
  margin: 0;
  font-family: "Roboto";
  font-size: clamp(0.85rem, 1.05vw, 1rem);
  line-height: 1.55;
  color: #222;
}

.md-exp-hero__body p {
  margin: 0 0 0.75em;
  font-family: "Roboto";
  font-size: 16px;
}

.md-exp-hero__body p:last-child {
  margin-bottom: 0;
}

/* Bottom-left caption (desktop: absolute; mobile: flex order 0 above panel) */
.md-exp-hero__caption {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 5;
  color: #ffffff;
  font-family: "Roboto", "Trebuchet MS", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  /* Stop before the frosted panel begins */
  max-width: calc(100% - var(--md-exp-hero-panel-w) - 48px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  box-sizing: border-box;
}

/* Large edge arrows — vertically centered */
/* !important: override Elementor / theme focus & accent on nav buttons */
.md-exp-hero .md-exp-hero__edge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: clamp(48px, 8vw, 64px);
  height: clamp(48px, 8vw, 64px);
  margin: 0;
  padding: 0;
  border: none !important;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.25) !important;
  color: #fff !important;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  box-shadow: none !important;
  display: none !important;
}

.md-exp-hero .md-exp-hero__edge--prev {
  left: clamp(10px, 2.5vw, 28px);
}

.md-exp-hero .md-exp-hero__edge--next {
  right: clamp(10px, 2.5vw, 28px);
}

.md-exp-hero .md-exp-hero__edge:hover {
  background-color: rgba(0, 0, 0, 0.45) !important;
  color: #fff !important;
}

.md-exp-hero .md-exp-hero__edge:focus-visible {
  outline: 2px solid #000 !important;
  outline-offset: 3px;
  background-color: #000 !important;
  color: #fff !important;
}

.md-exp-hero .md-exp-hero__edge:active {
  background-color: #000 !important;
  color: #fff !important;
}

.md-exp-hero .md-exp-hero__edge.swiper-button-disabled {
  opacity: 0.3 !important;
  cursor: not-allowed;
  pointer-events: none;
}

.md-exp-hero__edge-icon {
  display: flex;
  line-height: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* Dot row — wrapper stays above slides; bullets use custom class (Swiper) to beat Elementor */
.md-exp-hero .md-exp-hero__dots-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(16px, 3vh, 40px);
  z-index: 12;
  display: flex !important;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.md-exp-hero .md-exp-hero__dots-wrap .md-exp-hero__dots {
  pointer-events: auto;
}

.md-exp-hero .md-exp-hero__dots.swiper-pagination {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: calc(100% - 48px);
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  min-height: 12px;
  visibility: visible !important;
  opacity: 1 !important;
}

.md-exp-hero .md-exp-hero__bullet {
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background-color: #fff !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.md-exp-hero .md-exp-hero__bullet--active {
  background-color: var(--md-exp-hero-teal) !important;
  opacity: 1 !important;
  transform: scale(1.15);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.md-exp-hero .md-exp-hero__bullet:focus {
  outline: none !important;
}

.md-exp-hero .md-exp-hero__bullet:focus-visible {
  outline: 2px solid var(--md-exp-hero-teal) !important;
  outline-offset: 3px;
}


@media (max-width: 1024px) {
  .md-exp-hero__headline {
    font-size: 26px !important;
  }

  .md-exp-hero__body p {
    font-size: 16px !important;
  }

}

@media (max-width: 781px) {

  /*
   * Full-viewport hero: bg fills slide; frosted strip pinned to viewport bottom (carousel
   * reserves footer padding so bullets overlap that band — pagination stays outside Swiper DOM).
   */
  .md-exp-hero {
    --md-exp-hero-panel-w: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: var(--md-exp-hero-h, 100svh);
    height: 100vh;
    height: var(--md-exp-hero-h, 100svh);
    overflow-x: clip;
    /* Pull final paint down 1px to kill subpixel gaps vs parent / next section */
    transform: translateZ(0);
  }

  .admin-bar .md-exp-hero {
    min-height: calc(100vh - 46px);
    min-height: calc(var(--md-exp-hero-h, 100svh) - 46px);
    height: calc(100vh - 46px);
    height: calc(var(--md-exp-hero-h, 100svh) - 46px);
  }

  .md-exp-hero__bg {
    background-image: var(--md-exp-bg-mobile, var(--md-exp-bg-desktop));
    inset: 0;
    width: auto;
    height: auto;
  }

  .md-exp-hero__bg::after {
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0) 45%,
        rgba(0, 0, 0, 0.52) 100%);
  }

  .md-exp-hero__body p {
    font-size: 14px !important;
  }

  .md-exp-hero__swiper {
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform: translateZ(0);
  }

  .md-exp-hero__swiper .swiper-wrapper {
    min-height: inherit;
    height: 100%;
    box-sizing: border-box;
  }

  .md-exp-hero__slide {
    position: relative;
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    backface-visibility: hidden;
  }

  /*
   * Pin the overlay stack to the slide’s bottom edge (flex alone can leave a 1px seam on some DPRs).
   */
  .md-exp-hero__inner {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 1;
    flex: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    width: 100%;
    margin-top: 0;
    min-height: 0 !important;
    padding: 0;
    box-sizing: border-box;
    gap: 12px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .admin-bar .md-exp-hero__inner {
    min-height: 0 !important;
  }

  .md-exp-hero__visual {
    flex: 0 0 auto;
    order: 1;
    min-height: 0;
    height: auto;
    padding: 0 clamp(14px, 4vw, 24px);
    width: 100%;
    box-sizing: border-box;
  }

  /* Caption: sits above the visual/panel stack; absolute becomes relative in column flex */
  .md-exp-hero__caption {
    position: relative;
    left: 0;
    bottom: 0;
    order: 0;
    width: 100%;
    max-width: 100%;
    padding: 0 24px 0 24px;
    box-sizing: border-box;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.35);
    font-size: 12px;
  }

  .md-exp-hero__panel {
    flex: 0 0 auto;
    order: 2;
    max-width: none;
    width: 100%;
    margin-right: 0;
    padding: 28px clamp(14px, 4vw, 24px) 28px;
    border: 0 solid transparent;
    border-radius: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    transform: translateZ(0);
  }

  /*
   * Carousels: reserve a compact footer band for bullets (stay in section DOM — avoids Swiper/layout thrash).
   */
  .md-exp-hero.md-exp-hero--multi .md-exp-hero__panel {
    padding-bottom: calc(1rem + 20px);
  }

  /* Bullets centred in the padded band above the viewport bottom */
  .md-exp-hero.md-exp-hero--multi>.md-exp-hero__dots-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 22;
    margin: 0;
    padding: 0 clamp(14px, 4vw, 24px);
    pointer-events: none;
    box-sizing: border-box;
  }

  /* Keep dots above slide layer during fade transitions */
  .md-exp-hero.md-exp-hero--multi>.md-exp-hero__dots-wrap .md-exp-hero__dots {
    pointer-events: auto;
    position: relative;
    z-index: 23;
  }

  .md-exp-hero__cta {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    align-self: center;
  }

  .md-exp-hero__headline {
    font-size: 24px !important;
  }

  .md-exp-hero__body {
    font-size: clamp(0.85rem, 3vw, 14px);
  }

  .md-exp-hero .md-exp-hero__bullet {
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
  }

  .md-exp-hero .md-exp-hero__bullet--active {
    background: var(--md-exp-hero-teal) !important;
    background-color: var(--md-exp-hero-teal) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55) !important;
  }

  .md-exp-hero__edge {
    width: 44px;
    height: 44px;
  }

  .md-exp-hero__edge-icon svg {
    width: 32px;
    height: 32px;
  }

  /*
   * Elementor (and similar) often adds a bordered/padded wrapper under the hero; hairlines at
   * the bottom usually come from there, not .md-exp-hero itself (uses :has — modern browsers).
   */
  body .elementor-widget.elementor-widget-shortcode:has(.md-exp-hero),
  body .elementor-widget.elementor-widget-html:has(.md-exp-hero) {
    border-bottom: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
  }

  body .elementor-widget.elementor-widget-shortcode:has(.md-exp-hero)>.elementor-widget-container,
  body .elementor-widget.elementor-widget-html:has(.md-exp-hero)>.elementor-widget-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }
}