/* ==========================================================================
   Hero slider (index.php only)
   Uses the existing theme values: #5270FF, #C8D6FA, Poppins, .btn-common,
   .container and the 18px radius from the original hero image card.
   ========================================================================== */

.hero-slider {
  --hero-delay: 5s;            /* keep in sync with DELAY in hero-slider.js */
  position: relative;
  width: 100%;
  /* fixed height per breakpoint = no layout shift while images load */
  height: 640px;
  /* The fixed-top navbar is a different height per breakpoint and header.php
     adds a ~21px <br> in flow, so: margin-top = navbar height - 21px.
     Measured: phones 184px, tablets 127px, 992-1199px 99px, 1200px+ 70px. */
  margin-top: 163px;
  overflow: hidden;
  background: #1b2160;         /* dark indigo shown before the first image paints */
  color: #fff;
}

.hero-slider__track {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: pan-y;         /* vertical page scroll stays native; JS handles horizontal swipe */
}

/* ---- Slides (fade) ---------------------------------------------------- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease, visibility 0s linear 0s;
  z-index: 1;
}

/* Full-bleed photo (high-resolution stock slides) */
.hero-slide__media,
.hero-slide__media img {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-slide__media img {
  object-fit: cover;
  object-position: center;
  transform: scale(1);
}
/* slow "Ken Burns" zoom on the visible slide */
.hero-slide.is-active .hero-slide__media img {
  animation: heroZoom 9s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* Blurred background behind framed (company) photos */
.hero-slide__bg {
  position: absolute;
  inset: -30px;                /* hide blurred edges */
  background-size: cover;
  background-position: center;
  filter: blur(6px) saturate(1.1);
}

/* Dark indigo overlay built from the theme colour #5270FF */
.hero-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(16, 22, 74, 0.92) 0%,
    rgba(27, 38, 128, 0.75) 45%,
    rgba(82, 112, 255, 0.30) 100%);
}
.hero-slide--framed .hero-slide__overlay {
  background: linear-gradient(90deg,
    rgba(16, 22, 74, 0.94) 0%,
    rgba(27, 38, 128, 0.85) 50%,
    rgba(52, 72, 190, 0.70) 100%);
}

/* ---- Content (aligned with .container) -------------------------------- */
.hero-slide__content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-bottom: 40px;        /* room for the dots row */
}
.hero-slide__content > .container { width: 100%; }

.hero-slide__layout {
  display: flex;
  align-items: center;
  gap: 50px;
}
.hero-slide__text {
  flex: 1 1 auto;
  max-width: 560px;
}
.hero-slide--framed .hero-slide__text { max-width: none; flex: 1 1 45%; }

.hero-slide__photo {
  order: 2;                    /* photo on the right on desktop */
  flex: 0 0 52%;
  border-radius: 18px;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(8, 12, 48, 0.55);
  background: #fff;
}
.hero-slide__photo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-slide__title {
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 44px;
  line-height: 1.2;
  margin: 0 0 16px;
}
.hero-slide__sub {
  color: #fff;
  opacity: 0.92;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 26px;
}
.hero-slide__actions .btn {
  margin: 0 10px 10px 0;
}
.hero-slide__actions .btn-light-theme,
.hero-slide__actions .btn-light-theme:hover {
  background-color: #C8D6FA;
  color: #5270FF;
}

/* Text + photo entrance on each slide change.
   Not on first page load (.has-moved is added by JS on the first change),
   so the first slide's headline and photo are visible immediately. */
.hero-slider.has-moved .hero-slide.is-active .hero-slide__title,
.hero-slider.has-moved .hero-slide.is-active .hero-slide__sub,
.hero-slider.has-moved .hero-slide.is-active .hero-slide__actions {
  animation: heroUp 0.8s ease both;
}
.hero-slider.has-moved .hero-slide.is-active .hero-slide__sub     { animation-delay: 0.12s; }
.hero-slider.has-moved .hero-slide.is-active .hero-slide__actions { animation-delay: 0.24s; }
.hero-slider.has-moved .hero-slide.is-active .hero-slide__photo   { animation: heroIn 0.9s ease both 0.1s; }
@keyframes heroUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateX(30px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- Controls --------------------------------------------------------- */
.hero-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.hero-slider__arrow:hover,
.hero-slider__arrow:focus-visible { background: #5270FF; }
.hero-slider__arrow--prev { left: 16px; }
.hero-slider__arrow--next { right: 16px; }

.hero-slider__nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 3;
}
.hero-slider__nav .container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-slider__dot {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: width 0.3s ease;
}
.hero-slider__dot[aria-current="true"] {
  width: 40px;
  background: rgba(255, 255, 255, 0.3);
}
/* progress fill = time until the next slide */
.hero-slider__dot[aria-current="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: left center;
}
.hero-slider.is-playing .hero-slider__dot[aria-current="true"]::after {
  animation: heroProgress var(--hero-delay) linear forwards;
}
@keyframes heroProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.hero-slider__toggle {
  margin-left: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.hero-slider__toggle:hover,
.hero-slider__toggle:focus-visible { background: #5270FF; }

.hero-slider button:focus-visible,
.hero-slider a:focus-visible {
  outline: 3px solid #C8D6FA;
  outline-offset: 2px;
}

/* ---- Responsive ------------------------------------------------------- */
@media (min-width: 576px) {
  .hero-slider { margin-top: 106px; }
}
@media (min-width: 992px) {
  .hero-slider { margin-top: 78px; }
}
@media (min-width: 1200px) {
  .hero-slider { margin-top: 49px; }
}

@media (max-width: 1199px) {
  .hero-slider__arrow--prev { left: 8px; }
  .hero-slider__arrow--next { right: 8px; }
  .hero-slide__title { font-size: 38px; }
  .hero-slide__layout { gap: 36px; }
  /* keep text and dots clear of the side arrows, and aligned with each other */
  .hero-slide__layout,
  .hero-slider__nav .container > :first-child { margin-left: 40px; }
  .hero-slide__layout { margin-right: 40px; }
}

@media (max-width: 991px) {
  .hero-slider { height: 600px; }
  .hero-slide__title { font-size: 32px; }
  .hero-slide__sub { font-size: 16px; }
  .hero-slide__content { padding-bottom: 64px; }
  .hero-slider__arrow { width: 40px; height: 40px; margin-top: -20px; font-size: 16px; }

  /* framed slides stack: photo on top, text below */
  .hero-slide--framed .hero-slide__layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .hero-slide--framed .hero-slide__photo {
    order: 0;
    flex: none;
    width: 100%;
    max-width: 420px;
    border-width: 4px;
    border-radius: 14px;
  }
  .hero-slide--framed .hero-slide__overlay {
    background: linear-gradient(180deg, rgba(16, 22, 74, 0.80) 0%, rgba(16, 22, 74, 0.94) 100%);
  }
}

@media (max-width: 575px) {
  .hero-slider { height: 586px; }   /* fits under top bar (42px) + mobile header (184px) on a 375x812 phone */
  .hero-slide__overlay {
    background: linear-gradient(180deg,
      rgba(16, 22, 74, 0.45) 0%,
      rgba(16, 22, 74, 0.80) 45%,
      rgba(16, 22, 74, 0.94) 100%);
  }
  .hero-slide__content { align-items: flex-end; padding-bottom: 70px; }
  .hero-slide--framed .hero-slide__content { align-items: center; }
  .hero-slide__layout,
  .hero-slider__nav .container > :first-child { margin-left: 0; }
  .hero-slide__layout { margin-right: 0; }
  .hero-slide--framed .hero-slide__layout { gap: 18px; }
  .hero-slide__title { font-size: 27px; margin-bottom: 10px; }
  .hero-slide__sub { font-size: 15px; margin-bottom: 16px; }
  .hero-slide__actions .btn { margin-right: 6px; padding: 10px 14px; }
  .hero-slider__arrow { top: 28%; width: 36px; height: 36px; margin-top: -18px; font-size: 14px; }}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide.is-active { transition: none; }
  .hero-slide.is-active .hero-slide__media img,
  .hero-slider.has-moved .hero-slide.is-active .hero-slide__title,
  .hero-slider.has-moved .hero-slide.is-active .hero-slide__sub,
  .hero-slider.has-moved .hero-slide.is-active .hero-slide__actions,
  .hero-slider.has-moved .hero-slide.is-active .hero-slide__photo,
  .hero-slider.is-playing .hero-slider__dot[aria-current="true"]::after { animation: none; }
}
