/* =====================================================
   New Home Slider — Modern Full-Width Hero Slider
   ===================================================== */

/* ---- Container ---- */
.nhs-container {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  background: #111;
  margin: 0;
  padding: 0;
  display: block;
}

/* ---- Swiper ---- */
.nhs-swiper {
  width: 100%;
  height: var(--nhs-desktop-height, 650px);
  overflow: hidden;
  /* Needed for Swiper creative effect 3D perspective */
  perspective: 1200px;
}

/* ---- Individual Slide ---- */
.nhs-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Defensively reset any display/flex overrides injected by other Swiper plugins */
  display: block !important;
  text-align: left;
  flex-direction: unset;
  align-items: unset;
  justify-content: unset;
}

/* ---- Background Images ---- */
.nhs-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* No will-change or forced transform here — avoid premature compositing layers
     that break display:none→block transitions on mobile browsers */
}

/* Ken Burns subtle zoom on active slide (disabled when .nhs-no-zoom is on the container) */
.nhs-container:not(.nhs-no-zoom) .nhs-bg {
  transition: transform 9s ease-out;
}
.nhs-container:not(.nhs-no-zoom) .swiper-slide-active .nhs-bg,
.nhs-container:not(.nhs-no-zoom) .swiper-slide-duplicate-active .nhs-bg {
  transform: scale(1.06);
  will-change: transform;
}

/* When zoom is off, keep background static */
.nhs-no-zoom .nhs-bg {
  transform: none !important;
  transition: none !important;
  will-change: auto !important;
}

/* Show/hide desktop vs mobile images — scoped to .nhs-container for specificity
   Desktop ≥1200px shows desktop image; tablet + mobile ≤1199px shows mobile image */
.nhs-container .nhs-bg-mobile { display: none; }
.nhs-container .nhs-bg-desktop { display: block; }

@media (max-width: 1199px) {
  .nhs-container .nhs-bg-desktop { display: none !important; }
  .nhs-container .nhs-bg-mobile  { display: block !important; }
}

/* ---- Overlay Layer ---- */
.nhs-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Left-positioned slides — gradient from left */
.nhs-pos-left.nhs-overlay-none  .nhs-overlay-layer { background: transparent; }
.nhs-pos-left.nhs-overlay-light  .nhs-overlay-layer { background: linear-gradient(100deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.22) 48%, rgba(0,0,0,0) 78%); }
.nhs-pos-left.nhs-overlay-medium .nhs-overlay-layer { background: linear-gradient(100deg, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.32) 50%, rgba(0,0,0,0) 80%); }
.nhs-pos-left.nhs-overlay-dark   .nhs-overlay-layer { background: linear-gradient(100deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.46) 55%, rgba(0,0,0,0.08) 80%); }

/* Centre-positioned slides — uniform overlay */
.nhs-pos-center.nhs-overlay-none   .nhs-overlay-layer { background: transparent; }
.nhs-pos-center.nhs-overlay-light  .nhs-overlay-layer { background: rgba(0,0,0,0.28); }
.nhs-pos-center.nhs-overlay-medium .nhs-overlay-layer { background: rgba(0,0,0,0.48); }
.nhs-pos-center.nhs-overlay-dark   .nhs-overlay-layer { background: rgba(0,0,0,0.66); }

/* ---- Content Area ---- */
.nhs-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8%;
  box-sizing: border-box;
}

.nhs-pos-center .nhs-content {
  justify-content: center;
  text-align: center;
}

/* ---- Inner Text Box ---- */
.nhs-inner {
  max-width: 580px;
  width: 100%;
}

.nhs-pos-center .nhs-inner {
  max-width: 760px;
}

/* ---- Text Entrance Animations ---- */
.nhs-heading,
.nhs-subtitle,
.nhs-btn-wrap {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.swiper-slide-active .nhs-heading,
.swiper-slide-duplicate-active .nhs-heading {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

.swiper-slide-active .nhs-subtitle,
.swiper-slide-duplicate-active .nhs-subtitle {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.swiper-slide-active .nhs-btn-wrap,
.swiper-slide-duplicate-active .nhs-btn-wrap {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.46s;
}

/* ---- Typography ---- */
.nhs-heading {
  font-size: clamp(1.9rem, 3.8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
}

.nhs-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  font-weight: 400;
  line-height: 1.65;
  margin: 0 0 2.1rem;
  max-width: 480px;
}

.nhs-pos-center .nhs-subtitle {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Text Colours ---- */
.nhs-color-white .nhs-heading,
.nhs-color-white .nhs-subtitle {
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

.nhs-color-dark .nhs-heading,
.nhs-color-dark .nhs-subtitle {
  color: #111111;
  text-shadow: 0 1px 4px rgba(255,255,255,0.2);
}

/* ---- CTA Button Wrapper ---- */
.nhs-btn-wrap {
  display: block;
}

.nhs-pos-center .nhs-btn-wrap {
  display: flex;
  justify-content: center;
}

/* ---- CTA Button Base ---- */
.nhs-btn {
  display: inline-block;
  padding: 15px 42px;
  font-size: clamp(0.82rem, 1.1vw, 0.96rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 2px;
  transition: background 0.28s ease, color 0.28s ease,
              border-color 0.28s ease, transform 0.22s ease,
              box-shadow 0.28s ease;
  white-space: nowrap;
  line-height: 1;
}

.nhs-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  text-decoration: none;
}

.nhs-btn:active {
  transform: translateY(-1px);
}

/* Outline White */
.nhs-btn-outline-white .nhs-btn {
  background: transparent;
  border-color: rgba(255,255,255,0.85);
  color: #ffffff;
}
.nhs-btn-outline-white .nhs-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #ffffff;
  color: #ffffff;
}

/* Outline Dark */
.nhs-btn-outline-dark .nhs-btn {
  background: transparent;
  border-color: rgba(20,20,20,0.75);
  color: #111111;
}
.nhs-btn-outline-dark .nhs-btn:hover {
  background: rgba(0,0,0,0.07);
  border-color: #111111;
  color: #111111;
}

/* Solid White */
.nhs-btn-solid-white .nhs-btn {
  background: #ffffff;
  border-color: #ffffff;
  color: #111111;
}
.nhs-btn-solid-white .nhs-btn:hover {
  background: #f0f0f0;
  border-color: #f0f0f0;
  color: #111111;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
}

/* Solid Dark */
.nhs-btn-solid-dark .nhs-btn {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}
.nhs-btn-solid-dark .nhs-btn:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
  color: #ffffff;
}

/* ---- Navigation Arrows ---- */
.nhs-container .swiper-button-next,
.nhs-container .swiper-button-prev {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.13);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  color: #ffffff;
  transition: background 0.3s ease, transform 0.22s ease, opacity 0.3s ease;
  margin-top: -23px;
  opacity: 0.75;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide default Swiper font icon */
.nhs-container .swiper-button-next:after,
.nhs-container .swiper-button-prev:after {
  display: none !important;
  content: none !important;
}

/* SVG icon colour */
.nhs-container .nhs-arrow svg {
  display: block;
  color: #ffffff;
  flex-shrink: 0;
}

.nhs-container .swiper-button-next:hover,
.nhs-container .swiper-button-prev:hover {
  background: rgba(255,255,255,0.28);
  transform: scale(1.1);
  opacity: 1;
}

.nhs-container .swiper-button-next {
  right: 26px;
}

.nhs-container .swiper-button-prev {
  left: 26px;
}

/* ---- Pagination ---- */
.nhs-container .swiper-pagination {
  bottom: 22px;
}

.nhs-container .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.5);
  opacity: 1;
  border-radius: 4px;
  transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nhs-container .swiper-pagination-bullet-active {
  background: #ffffff;
  width: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ---- Tablet: break out of the 768px container_16 ---- */
@media (min-width: 768px) and (max-width: 1199px) {
  /* The site constrains .container_16 to 768px on tablet.
     Escape it with the same full-width technique. */
  .nhs-container {
    width: 100vw !important;
    max-width: none !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .nhs-content {
    padding: 0 5%;
  }
}

/* ---- Tablet + Mobile (≤1199px) ---- */
@media (max-width: 1199px) {
  /* Use mobile height variable; disable 3D perspective (not needed on touch devices) */
  .nhs-swiper {
    height: var(--nhs-mobile-height, 450px) !important;
    perspective: none !important;
  }

  /* Hide next/prev arrows — use swipe on touch devices */
  .nhs-container .swiper-button-next,
  .nhs-container .swiper-button-prev {
    display: none !important;
    visibility: hidden !important;
  }

  /* Text anchored to bottom for better composition */
  .nhs-content {
    padding: 24px 24px 72px;
    align-items: flex-end;
  }

  /* Override center alignment on small screens */
  .nhs-pos-center .nhs-content {
    justify-content: flex-start;
    text-align: left;
  }

  .nhs-pos-center .nhs-subtitle {
    margin-left: 0;
    margin-right: 0;
  }

  .nhs-pos-center .nhs-btn-wrap {
    justify-content: flex-start;
  }

  .nhs-inner {
    max-width: 100%;
  }

  /* Bottom-up gradient on tablet/mobile for readability */
  .nhs-overlay-none   .nhs-overlay-layer { background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 65%) !important; }
  .nhs-overlay-light  .nhs-overlay-layer { background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.08) 65%) !important; }
  .nhs-overlay-medium .nhs-overlay-layer { background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 65%) !important; }
  .nhs-overlay-dark   .nhs-overlay-layer { background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 60%) !important; }

  /* Always white text on tablet/mobile for readability */
  .nhs-color-dark .nhs-heading,
  .nhs-color-dark .nhs-subtitle {
    color: #ffffff;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
  }

  /* Dark outline → becomes white on tablet/mobile */
  .nhs-btn-outline-dark .nhs-btn {
    border-color: rgba(255,255,255,0.85);
    color: #ffffff;
  }
  .nhs-btn-outline-dark .nhs-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: #ffffff;
    color: #ffffff;
  }

  .nhs-heading { margin-bottom: 0.65rem; }
  .nhs-subtitle { margin-bottom: 1.4rem; }

  /* Ensure inline background-position on .nhs-bg-mobile is not overridden by the base CSS */
  .nhs-bg-mobile {
    background-position: center center; /* fallback; inline style takes precedence */
  }
}

/* ---- Mobile (≤767px): fight the site's .container_16 div { max-width: 310px } ---- */
@media (max-width: 767px) {

  /* Step 1: Force .nhs-container to full viewport width, escaping any grid parent */
  .container_16 .nhs-container,
  .container_16 .nhs-container.grid_1,
  .container_16 .nhs-container.grid_2,
  .container_16 .nhs-container.grid_3,
  .container_16 .nhs-container.grid_4,
  .container_16 .nhs-container.grid_5,
  .container_16 .nhs-container.grid_6,
  .container_16 .nhs-container.grid_7,
  .container_16 .nhs-container.grid_8,
  .container_16 .nhs-container.grid_9,
  .container_16 .nhs-container.grid_10,
  .container_16 .nhs-container.grid_11,
  .container_16 .nhs-container.grid_12,
  .container_16 .nhs-container.grid_13,
  .container_16 .nhs-container.grid_14,
  .container_16 .nhs-container.grid_15,
  .container_16 .nhs-container.grid_16,
  .nhs-container {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
    /* overflow: hidden !important; */
  }

  /* Step 2: Remove max-width: 310px from ALL divs inside .nhs-container
     (set by responsive.css: .container_16 div { max-width: 310px }) */
  .container_16 .nhs-container div,
  .nhs-container div {
    max-width: none !important;
  }

  /* Step 3: Force the Swiper to exactly 100vw */
  .nhs-container .nhs-swiper,
  .nhs-container .swiper-container,
  .nhs-container .swiper-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    /* overflow: hidden !important; */
  }

  /* Step 4: Force each slide to 100% of the (now full-width) swiper */
  .nhs-container .swiper-slide,
  .nhs-container .nhs-slide {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
  }

  /* Step 4b: Slides must also fill the swiper height */
  .nhs-container .swiper-slide,
  .nhs-container .nhs-slide {
    height: 100% !important;
  }

  /* Step 5: Background image divs fill the slide; reset GPU compositing */
  .nhs-container .nhs-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    will-change: auto !important;
    transform: none !important;
    transition: none !important;
  }

  /* Step 6: Content + overlay layers */
  .nhs-container .nhs-overlay-layer,
  .nhs-container .nhs-content {
    position: absolute !important;
    max-width: none !important;
    width: 100% !important;
  }

  .nhs-container .nhs-content {
    height: 100% !important;
    box-sizing: border-box !important;
    padding: 20px 20px 64px !important;
  }

  .nhs-container .nhs-inner {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

}

/* ---- Very small screens ---- */
@media (max-width: 480px) {
  .nhs-container .nhs-content {
    padding: 18px 16px 60px !important;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .nhs-bg { transition: none; }
  .nhs-heading,
  .nhs-subtitle,
  .nhs-btn-wrap {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- Focus accessibility ---- */
.nhs-btn:focus-visible,
.nhs-container .swiper-button-next:focus-visible,
.nhs-container .swiper-button-prev:focus-visible,
.nhs-container .swiper-pagination-bullet:focus-visible {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: 3px;
}
