/* ═══════════════════════════════════════════
   HERO SLIDER BLOCK
   ═══════════════════════════════════════════ */

/* ── Wrapper ── */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: var(--hs-height, 592px);
  width: 100%;
}

/* ── Slides: stacked via CSS Grid ── */
.hero-slider .hs-slide {
  display: grid;
  grid-template: 1fr / 1fr;
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.8s ease;
}

.hero-slider .hs-slide.is-active {
  opacity: 1;
  z-index: 1;
}

/* First slide visible by default (before JS loads) */
.hero-slider:not(.is-initialized) .hs-slide:first-child {
  opacity: 1;
  z-index: 1;
}

/* ── Slide transition mode ── */
.hero-slider--slide .hs-slide {
  opacity: 1;
  transform: translateX(100%);
  transition: transform 0.6s ease;
}

.hero-slider--slide .hs-slide.is-active {
  transform: translateX(0);
}

.hero-slider--slide .hs-slide.is-exiting {
  transform: translateX(-100%);
  z-index: 1;
}

.hero-slider--slide:not(.is-initialized) .hs-slide:first-child {
  transform: translateX(0);
}

/* ── Slide internals ── */
.hs-slide .hs-background {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
}

.hs-slide .hs-layover {
  grid-area: 1 / 1;
  z-index: 1;
  background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
}

/* ── Content box ── */
.hs-slide .hs-content {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: var(--hs-content-justify, flex-start);
  align-items: var(--hs-content-align-items, flex-start);
  text-align: var(--hs-content-text-align, left);
  padding: var(--hs-content-padding, 30px);
  height: var(--hs-content-height, auto);
  max-height: 100%;
  overflow-y: auto;
  color: var(--hs-text-color, black);
  box-sizing: border-box;
}

/* ── 9-point content positioning ── */
.hs-content--top-left      { align-self: start;  justify-self: start;  width: var(--hs-content-width, 50%); }
.hs-content--top-center    { align-self: start;  justify-self: center; width: var(--hs-content-width, 50%); }
.hs-content--top-right     { align-self: start;  justify-self: end;    width: var(--hs-content-width, 50%); }
.hs-content--center-left   { align-self: center; justify-self: start;  width: var(--hs-content-width, 50%); }
.hs-content--center        { align-self: center; justify-self: center; width: var(--hs-content-width, 50%); }
.hs-content--center-right  { align-self: center; justify-self: end;    width: var(--hs-content-width, 50%); }
.hs-content--bottom-left   { align-self: end;    justify-self: start;  width: var(--hs-content-width, 50%); }
.hs-content--bottom-center { align-self: end;    justify-self: center; width: var(--hs-content-width, 50%); }
.hs-content--bottom-right  { align-self: end;    justify-self: end;    width: var(--hs-content-width, 50%); }

/* ── Side by side layout ── */
.hero-slider .hs-slide.hs-slide--side-by-side {
  grid-template: 1fr / var(--hs-content-width, 50%) 1fr;
}

.hero-slider .hs-slide--side-by-side .hs-background {
  grid-area: 1 / 2;
  width: 100%;
  height: 100%;
}

.hero-slider .hs-slide--side-by-side .hs-content {
  grid-area: 1 / 1;
  width: 100% !important;
  height: 100%;
  align-self: start;
  justify-self: start;
}

/* ── Text color inheritance ── */
.hero-slider h1, .hero-slider h2, .hero-slider h3,
.hero-slider h4, .hero-slider h5, .hero-slider h6 {
  color: var(--hs-text-color, var(--color-text));
}

/* ── Text wrap (title + paragraph positioning) ── */
.hs-slide .hs-text-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  justify-content: var(--hs-text-justify, flex-start);
  align-items: var(--hs-text-align-items, flex-start);
  text-align: var(--hs-paragraph-text-align, left);
}

.hs-slide .hs-text-wrap h1,
.hs-slide .hs-text-wrap h2,
.hs-slide .hs-text-wrap h3,
.hs-slide .hs-text-wrap h4,
.hs-slide .hs-text-wrap h5,
.hs-slide .hs-text-wrap h6,
.hs-slide .hs-paragraph {
  text-align: var(--hs-paragraph-text-align, left);
  width: 100%;
}


/* ── Link styling (matches hero block) ── */
.hs-content a {
  color: var(--hs-text-color, var(--color-text));
  text-decoration: none;
  align-self: var(--hs-link-align-self, flex-start);
  padding: 13px 18px;
  margin-top: 24px;
  font-size: 16px;
  font-weight: 500;
  min-height: 50px;
  width: fit-content;
  min-width: 150px;
  text-align: center;
  letter-spacing: 0.3px;
  border: 2px solid var(--hs-text-color, var(--color-text));
  transition: all 0.2s ease-in-out;
}

.hs-content a:hover {
  text-decoration: none;
  border-color: #a5a5a5;
}

.hs-content a i {
  margin-left: 8px;
}

.hs-content a::after {
  content: none;
}

/* ── Navigation arrows ── */
.hs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  min-width: 0; /* defeat any inherited min-width from theme's global button rule */
  padding: 0;   /* theme's global button rule applies 0 var(--spacing-lg) horizontally */
  gap: 0;       /* theme's global button rule also sets gap */
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.hs-arrow:hover {
  background: rgba(0, 0, 0, 0.4);
}

.hs-arrow--prev {
  left: 16px;
}

.hs-arrow--next {
  right: 16px;
}

/* ── Dots ── */
.hs-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 10px;
}

.hs-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.hs-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.hs-dot.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

/* ── Mobile ── */
@media (max-width: 1140px) {
  /* Slides are position:absolute so parent needs explicit height.
     Content + image heights are summed via calc(). */
  .hero-slider {
    height: calc(var(--hs-mobile-content-height, 200px) + var(--hs-mobile-img-height, 200px));
  }

  .hero-slider.hs-mobile-img-hidden {
    height: var(--hs-mobile-content-height, 400px);
  }

  .hero-slider .hs-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
  }

  /* Image on top (default) */
  .hero-slider.hs-mobile-img-top .hs-slide .hs-background {
    position: relative;
    height: var(--hs-mobile-img-height, 200px);
    min-height: var(--hs-mobile-img-height, 200px);
    flex-shrink: 0;
    order: -1;
  }

  /* Image on bottom */
  .hero-slider.hs-mobile-img-bottom .hs-slide .hs-background {
    position: relative;
    height: var(--hs-mobile-img-height, 200px);
    min-height: var(--hs-mobile-img-height, 200px);
    flex-shrink: 0;
    order: 2;
  }

  /* Image hidden */
  .hero-slider.hs-mobile-img-hidden .hs-slide .hs-background {
    display: none;
  }

  /* Hide layover on mobile when image is stacked */
  .hero-slider.hs-mobile-img-top .hs-slide .hs-layover,
  .hero-slider.hs-mobile-img-bottom .hs-slide .hs-layover {
    display: none;
  }

  /* Content takes remaining space */
  .hs-slide .hs-content {
    position: relative;
    width: 100% !important;
    height: var(--hs-mobile-content-height, auto);
    min-height: var(--hs-mobile-content-height, 200px);
    flex: 1;
    align-self: stretch !important;
    justify-self: stretch !important;
    overflow-y: auto;
  }

  /* Side-by-side collapses to single column */
  .hero-slider .hs-slide.hs-slide--side-by-side {
    grid-template: none;
    display: flex;
    flex-direction: column;
  }

  .hero-slider .hs-slide--side-by-side .hs-background {
    grid-area: auto;
  }

  .hero-slider .hs-slide--side-by-side .hs-content {
    grid-area: auto;
  }

  .hs-arrow--prev { left: 10px; }
  .hs-arrow--next { right: 10px; }

  .hs-dots {
    bottom: 12px;
    gap: 8px;
  }

  .hs-dot {
    width: 10px;
    height: 10px;
  }
}
