/* ==========================================================================
   Homepage Text + Overlay Slider
   Left: text content / Right: image slider with text on top
   ========================================================================== */

.home-overlay-slider-section {
  --gutter: 15px;
  --slide-ratio: 674 / 520;
  --slide-radius: 25px;
  --control-size: 44px;
  --control-colour: var(--blue);
  --overlay-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.75) 100%);
  --quote-mark: url('data:image/svg+xml;utf8,<svg width="81" height="65" viewBox="0 0 81 65" xmlns="http://www.w3.org/2000/svg"><path d="M29.25 0L23.75 30.5H33.75V64.25H0V30L9 0H29.25ZM76.25 0L70.75 30.5H80.75V64.25H47V30L56 0H76.25Z" fill="%23ffffff"/></svg>');
  --quote-mark-orange: url('data:image/svg+xml;utf8,<svg width="81" height="65" viewBox="0 0 81 65" xmlns="http://www.w3.org/2000/svg"><path d="M29.25 0L23.75 30.5H33.75V64.25H0V30L9 0H29.25ZM76.25 0L70.75 30.5H80.75V64.25H47V30L56 0H76.25Z" fill="%23fbaf44"/></svg>');
  width: 100%;
  padding-block: clamp(48px, 8vw, 120px);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: clip;
}

.home-overlay-slider-inner {
  max-width: var(--home-max-w);
  width: 100%;
  padding-inline: var(--gutter);
}

.home-overlay-slider-flex {
  display: flex;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

/* Left - text
   ========================================================================== */

.home-overlay-slider-content {
  flex: 1;
  min-width: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  line-height: 28px;

  h1, h2, h3 {
    margin-bottom: 2rem;
  }

  h2{
	font-size: var(--h2-desktop-main);
  }

  .main-header{
 --quote-w: 1.2em;                            
    --quote-h: calc(var(--quote-w) * 65 / 81);   

    position: relative;
    max-width: 15ch;           /* tune so line 1 matches the design */
    padding-block: var(--quote-h);
	padding-bottom: 0px;
	 --quote-shift: 1;
	 --quote-upshift: 1.2;
    padding-right: calc(var(--quote-w) * var(--quote-shift));

	  &::before,
    &::after {
      content: "";
      display: inline-block;
      width: var(--quote-w);
      height: var(--quote-h);
      background: var(--quote-mark) no-repeat center / contain;
    }

    /* Opening mark: pinned to the first word, just above the first line */
    &::before {
      margin-right: calc(var(--quote-w) * -1);
      margin-top: calc(var(--quote-h) * -1.3);
      vertical-align: top;
	
    }

    /* Closing mark: pinned to the top-right of the heading box, beside line 1 */
    &::after {
      position: absolute;
      top: var(--quote-h);     /* top of the first line (below padding-top) */
      right: 0;                /* sits inside the padding-right reserve */
      rotate: 180deg;
    }
  }

  .intro-header {
    font-size: clamp(1.375rem, 1.125rem + 0.5208vw, 1.75rem);
    font-weight: 400;
    margin-bottom: 1.5rem;
	line-height: 1.3;
  }

  p {
    	font-size: var(--p-desktop);
  }

  .home-overlay-slider-text {
    display: flex;
    flex-direction: column;
    gap: 16px;

    a {
      color: var(--pink);

      &:hover {
        text-decoration: underline;
      }
    }
  }

  .cta-btn-wrapper {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    .site-block-button {
      background: var(--blue);
      color: var(--white);
    }
  }
}

/* Right - slider
   ========================================================================== */

.home-overlay-slider-media {
  flex: 1;
  min-width: 0;
}

/* Reset any global swiper heights */
.home-overlay-slider-section .swiper,
.home-overlay-slider-section .swiper-wrapper,
.home-overlay-slider-section .swiper-slide {
  height: auto;
  min-height: 0;
  max-height: none;
}

.home-overlay-slider-section .swiper {
  width: 100%;
  border-radius: var(--slide-radius);
}

.overlay-slide {
  position: relative;
  width: 100%;
  aspect-ratio: var(--slide-ratio);
  overflow: hidden;
  border-radius: var(--slide-radius);
  isolation: isolate;

  /* Gradient behind the caption so text stays readable on any image */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--overlay-gradient);
    z-index: 1;
    pointer-events: none;
  }
}

.overlay-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.overlay-slide {
.overlay-slide-caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: clamp(20px, 4vw, 48px);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-slide-heading {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  color: inherit;
  text-wrap: balance;
  color: var(--white);
  margin-bottom: 0px;
}

.overlay-slide-text {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.5;
  max-width: 48ch;
  color: var(--white);
  font-weight: 600;
}
}
.overlay-slide-link {
  margin-top: 8px;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  align-self: flex-start;

  &:hover {
    color: var(--light-blue);
  }
}

/* Controls
   ========================================================================== */

.overlay-slider-nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: 24px;
}

.overlay-slider-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--control-colour);
}

.overlay-slider-prev,
.overlay-slider-next {
  display: grid;
  place-items: center;
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;

  &:hover {
    background: var(--control-colour);
    color: #fff;
  }

  &:focus-visible {
    outline: 2px solid var(--control-colour);
    outline-offset: 3px;
  }

  svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* Dots - override swiper's absolute positioning */
.home-overlay-slider-section .overlay-slider-pagination {
  position: static;
  display: flex;
  gap: 0.5rem;
  width: auto;
  color: var(--control-colour);

  .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Dark backgrounds - flip controls to white */
.home-overlay-slider-section.block-navyBlue {
  --control-colour: #fff;

  .overlay-slider-prev:hover,
  .overlay-slider-next:hover {
    color: var(--blue);
  }
}

/* Responsive
   ========================================================================== */


@media (max-width: 970px) {
  .home-overlay-slider-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .home-overlay-slider-content {
    h1 {
      font-size: 32px;
    }
  }
}

@media (max-width: 768px) {
  .home-overlay-slider-section {
    --slide-ratio: 4 / 5;
    --slide-radius: 15px;
  }

  .home-overlay-slider-content {
    .intro-header {
      font-size: 20px;
    }

    .cta-btn-wrapper {
      margin-top: 2.5rem;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay-slider-prev,
  .overlay-slider-next,
  .overlay-slider-pagination .swiper-pagination-bullet {
    transition: none;
  }
}
