{% import "/Alu-rex theme from boilerplate/css/_variables.css" as var %}
/* =========================================
   ROOT
========================================= */

.module--section-bg{
  position: relative;
  overflow-x: clip;
}

/* =========================================
   HERO SHELL (REAL HEIGHT DRIVER)
========================================= */

.module--section-bg .hero-shell{
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: var(--hero-minh, 520px);
}

/* =========================================
   MIN HEIGHT PRESETS
========================================= */

.dnd-section.minh-100{ --hero-minh: calc(100svh - var(--header_height_px, 0px)); }
.dnd-section.minh-70{  --hero-minh: calc(70svh - var(--header_height_px, 0px)); }
.dnd-section.minh-50{  --hero-minh: calc(50svh - var(--header_height_px, 0px)); }

@supports not (height: 100svh){
  .dnd-section.minh-100{ --hero-minh: calc(100vh - var(--header_height_px, 0px)); }
  .dnd-section.minh-70{  --hero-minh: calc(70vh - var(--header_height_px, 0px)); }
  .dnd-section.minh-50{  --hero-minh: calc(50vh - var(--header_height_px, 0px)); }
}

/* =========================================
   BACKGROUND LAYERS
========================================= */

.module--section-bg .section-bg{
  position: absolute;
  inset: 0;
  left: 50%;
  margin-left: -50vw;
  width: 100vw;
  overflow: hidden;
}

.module--section-bg .hero-bg{
  position: absolute;
  inset: 0;
}

.module--section-bg .hero-slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.module--section-bg .hero-slide.is-active{
  opacity: 1;
  pointer-events: auto;
}

/* =========================================
   MEDIA
========================================= */

.module--section-bg .hero-slide__base,
.module--section-bg .hero-slide__media,
.module--section-bg .hero-slide__overlay,
.module--section-bg .section-bg__img,
.module--section-bg .section-bg__video,
.module--section-bg .section-bg__overlay,
.module--section-bg .section-bg__custom{
  position: absolute;
  inset: 0;
}

.module--section-bg .hero-slide__img,
.module--section-bg .section-bg__img{
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.module--section-bg .hero-slide__video video,
.module--section-bg .section-bg__video video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   RESPONSIVE MEDIA SWITCHING
========================================= */

.module--section-bg .section-bg__media--md,
.module--section-bg .section-bg__media--sm{
  display: none;
}

@media (max-width: px){
  .module--section-bg .section-bg--is-md .section-bg__media--lg{ display: none; }
  .module--section-bg .section-bg__media--md{ display: block; }
}

@media (max-width: px){
  .module--section-bg .section-bg--is-sm .section-bg__media--lg,
  .module--section-bg .section-bg--is-sm .section-bg__media--md{ display: none; }
  .module--section-bg .section-bg__media--sm{ display: block; }
}

/* =========================================
   TRANSITIONS
========================================= */

.module--section-bg .hero-bg[data-transition="fade"] .hero-slide{
  transition: opacity .6s ease;
}

.module--section-bg .hero-bg[data-transition="fade-zoom"] .hero-slide{
  transition: opacity .6s ease, transform 1.2s ease;
  transform: scale(1.05);
}

.module--section-bg .hero-bg[data-transition="fade-zoom"] .hero-slide.is-active{
  transform: scale(1);
}

.module--section-bg .hero-bg[data-transition="slide"] .hero-slide{
  transition: transform .7s ease, opacity .7s ease;
  transform: translateX(3%);
}

.module--section-bg .hero-bg[data-transition="slide"] .hero-slide.is-active{
  transform: translateX(0);
  opacity: 1;
}

.module--section-bg .hero-bg[data-transition="none"] .hero-slide{
  transition: none;
}

/* =========================================
   CONTENT LAYER
========================================= */

.module--section-bg .hero-content-wrap{
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 3vw, 2rem);
}

.module--section-bg .hero-content{
  margin: 0;
}

/* horizontal */
.module--section-bg .hero-content-wrap--h-left{ justify-content: flex-start; text-align: left; }
.module--section-bg .hero-content-wrap--h-center{ justify-content: center; text-align: center; }
.module--section-bg .hero-content-wrap--h-right{ justify-content: flex-end; text-align: right; }

/* vertical */
.module--section-bg .hero-content-wrap--v-top{ align-items: flex-start; }
.module--section-bg .hero-content-wrap--v-center{ align-items: center; }
.module--section-bg .hero-content-wrap--v-bottom{ align-items: flex-end; }

/* CTA alignment */
.module--section-bg .hero-content-wrap--h-center .hero-ctas{ justify-content: center; }
.module--section-bg .hero-content-wrap--h-right .hero-ctas{ justify-content: flex-end; }

/* =========================================
   CRITICAL: HERO TEXT COLOR FROM PROPS
   (heading + description + eyebrow + everything)
========================================= */

.module--section-bg[data-hero-root]{
  color: rgba(var(--hero-text-rgb, 255,255,255), var(--hero-text-op, 1)) !important;
}

.module--section-bg[data-hero-root] .hero-content,
.module--section-bg[data-hero-root] .hero-content *{
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

/* =========================================
   HERO NAV (span button)
========================================= */

.module--section-bg .hero-nav{
  position: absolute;
  top: 50%;
  right: clamp(12px, 2.5vw, 32px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 3vw, 28px);
  pointer-events: auto;
}

.module--section-bg .hero-nav .hero-nav__btn{
  display: inline-block;
  cursor: pointer;
  user-select: none;

  /* base nav color comes from hero color */
  color: rgba(var(--hero-text-rgb, 255,255,255), var(--hero-text-op, 1)) !important;

  opacity: 0.65;
  transition: opacity .2s ease;
}

.module--section-bg .hero-nav .hero-nav__label{
  display: inline-block;
  line-height: 1;
  color: currentColor !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}

/* hover = opacity only */
.module--section-bg .hero-nav .hero-nav__btn:hover{
  opacity: 0.9;
}

/* active = active color variable */
.module--section-bg .hero-nav .hero-nav__btn.is-active{
  color: var(--hero-active-color, var(--primary_color)) !important;
  opacity: 1;
}

/* focus-visible = outline only */
.module--section-bg .hero-nav .hero-nav__btn:focus-visible{
  outline: 2px solid var(--hero-active-color, var(--primary_color));
  outline-offset: 8px;
  opacity: 1;
}

/* Hide on small screens */
@media (max-width: 767px){
  .module--section-bg .hero-nav{ display: none; }
}

/* =========================================
   CTA BUTTON LABEL COLOR (from prop)
========================================= */

/* apply label color always (not only hover) */
.module--section-bg[data-hero-root] .hero-ctas a,
.module--section-bg[data-hero-root] .hero-ctas a *{
  color: rgba(var(--hero-btn-text-rgb, 255,255,255), var(--hero-btn-text-op, 1)) !important;
  -webkit-text-fill-color: currentColor !important;
}
/* Hover/focus: revert CTA label to theme’s original button colors */
.module--section-bg[data-hero-root] .hero-ctas a:hover,
.module--section-bg[data-hero-root] .hero-ctas a:hover *,
.module--section-bg[data-hero-root] .hero-ctas a:focus-visible,
.module--section-bg[data-hero-root] .hero-ctas a:focus-visible *{
  color: unset !important;
  -webkit-text-fill-color: unset !important;
}

/* =========================================
   BUTTON MAX COMPAT
========================================= */

.module--section-bg .button_max--wrapper a { width: fit-content !important; }

.module--section-bg .button_max--wrapper,
.module--section-bg .button_max--wrapper .hs-cta-wrapper,
.module--section-bg .button_max--wrapper .hs_cos_wrapper_type_cta {
  width: auto !important;
}

.module--section-bg .button_max--wrapper a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.module--section-bg .hero-ctas .button_max--wrapper a,
.module--section-bg .hero-ctas a.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.button_max--wrapper-all{
  overflow: visible !important;
  margin-top: 1.4rem;
}

.module--section-bg .hero-slide__overlay{
  pointer-events: none;
}

/* =========================================
   LAYER STACK (base < media < overlay < content < nav)
========================================= */

/* Ensure hero-shell is the stacking context */
.module--section-bg .hero-shell{
  position: relative;
  isolation: isolate;
}

/* Background container sits behind content */
.module--section-bg .section-bg{
  z-index: 0;
}

/* Content sits above ALL background (including overlay) */
.module--section-bg .hero-content-wrap{
  z-index: 5;
}

/* Nav sits above everything */
.module--section-bg .hero-nav{
  z-index: 10;
}
.module--section-bg .hero-slide__base{ z-index: 0; }
.module--section-bg .hero-slide__media{ z-index: 1; }
.module--section-bg .hero-slide__overlay{ z-index: 2; pointer-events:none; }

.hero-heading {
  line-height:1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
