/* ------------------------------------------------------------------------
   Component: Hero
   ------------------------------------------------------------------------ */

.hero {
   position: relative;
   padding-block: var(--space-4) var(--space-6);
   padding-inline: var(--space-4);
   overflow-x: hidden;
}

.hero+* {
   margin-block-start: calc(-1 * var(--space-2));
}

.hero__inner {
   display: grid;
   flex: 1;
   gap: var(--space-6, 1.5rem);
   align-items: flex-end;
   padding-block: var(--space-8, 2rem);
   padding-inline: var(--space-8);
}

/* Content */

.hero__content {
   max-width: 42rem;
   text-align: center;
}

.hero__title {
   margin: 0 0 var(--space-3, 0.75rem);
   line-height: 1.1;
   text-shadow: 0 4px 24px rgba(40, 69, 87, 1);
   color: var(--surface);
   font-weight: 700;
}

.hero__lead,
.hero__summary {
   margin: 0 0 var(--space-3, 0.75rem);
   line-height: var(--leading-normal);
   text-shadow: 0 2px 8px rgba(255, 255, 255, .5);
}

.hero__lead {
   color: var(--link);
   font-size: var(--text-xl);
   font-weight: 600;
}

.hero__summary {
   margin-bottom: var(--space-5, 1.25rem);
   font-size: var(--text-lg);
   display: none;
   color: var(--text);
}

.hero__actions {
   display: flex;
   flex-wrap: wrap;
   gap: var(--space-3, 0.75rem);
   align-items: center;
   justify-content: center;
}

/* Links */

.hero__link--primary {
   position: relative;
   /* required if you’re using ::after for effects */
   display: inline-flex;
   align-items: center;
   gap: var(--space-2);
   height: 40px;
   padding-inline: var(--space-4);
   border: none;
   border-radius: var(--radius-sm);
   background-color: var(--link);
   color: var(--surface);
   text-decoration: none;
   font-weight: 600;
   line-height: 1;
   white-space: nowrap;
   font-size: var(--text-lg);
   box-shadow: var(--shadow-md);
}

/* Remove empty rule */
.hero__link--primary:hover {
   background-color: var(--link-hover);
   color: var(--surface);
}

.hero__link--primary:focus {
   outline: 2px solid var(--link);
}

/* If this was intended as a stretched-link, it should be on the card/slide wrapper
   rather than the link itself. Leaving disabled to avoid unexpected behaviour. */
/*
.hero__link--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
*/

/* Media */

.hero__media {
   border-radius: var(--radius-lg, 1rem);
   overflow: hidden;
   min-height: 14rem;
   /* ensures the image has presence on mobile */
}

.hero__image {
   width: 100%;
   height: 100%;
   display: block;
   object-fit: cover;
}

/* ------------------------------------------------------------------------
   Splide integration
   ------------------------------------------------------------------------ */

.splide {
   width: 100%;
}

.splide__list {
   margin: 0;
   padding: 0;
   list-style: none;
}

/* Prevent “jumping” when slides have different content heights */
.hero--carousel .splide__slide {
   height: auto;
}

/* Track overflow (needed if you have shadows/overhang) */
.hero--carousel .splide__track {
   overflow: visible;
}

/* Slide card */

.hero--carousel .hero__slide {
   width: 100%;
   display: flex;
   min-height: 24rem;
   max-height: calc(100vh - 16rem);
   aspect-ratio: 2 / 3;

   border: var(--border-1);
   border-radius: var(--radius-lg);
   overflow: hidden;

   background-color: var(--surface-1);
   box-shadow: var(--shadow-lg);

   outline: 2px solid transparent;
   transition: box-shadow var(--dur-3) var(--ease-standard),
      outline-color var(--dur-3) var(--ease-standard);
}

.hero--carousel .is-visible .hero__slide:hover {
   outline-color: var(--link);
   box-shadow: 0 12px 12px rgba(92, 79, 160, 0.40);
}

/* Arrow buttons */

.hero .splide__arrows {
   position: absolute;
   top: 50%;
   left: var(--space-2);
   right: var(--space-2);
   justify-content: space-between;
   transform: translateY(-50%);
   z-index: 1;
}

.hero .splide__arrow {
   box-shadow: var(--shadow-sm);
   background-color: var(--surface-2);
   transition: all var(--dur-3) var(--ease-standard);
}

.hero .splide__arrow:hover {
   background-color: var(--surface);
}


/* Pagination */

.hero .splide__pagination {
   position: absolute;
   bottom: var(--space-4);
   left: 50%;
   transform: translateX(-50%);
}

.splide__pagination__page {
   color: var(--surface);
}

/* ------------------------------------------------------------------------
   Overlay variant (mobile)
   ------------------------------------------------------------------------ */

.hero--overlay .hero__inner {
   position: relative;
   padding-block: var(--space-10, 2.5rem);
}

.hero--overlay .hero__media {
   position: absolute;
   inset: 0;
   min-height: 100%;
   border-radius: var(--radius-lg);
}

.hero--overlay .hero__image {
   height: 100%;
}

/* Overlay gradient for readability (bottom blend 4rem up) */
.hero--overlay .hero__inner::before {
   content: "";
   position: absolute;
   inset: 0;
   z-index: 1;
   height: calc(100% - var(--space-12));
   background: linear-gradient(to bottom,
         var(--surface-2) 0%,
         var(--surface-2)) 100%);
}

.hero--overlay .hero__content {
   position: relative;
   z-index: 2;
   color: #fff;
   max-width: var(--container-max);
}

/* ------------------------------------------------------------------------
   Breakpoints (mobile first → up)
   ------------------------------------------------------------------------ */

/* ≥ 30rem (480px) */
@media (min-width: 30rem) {
   .hero--carousel .hero__slide {
      aspect-ratio: 2 / 3;
   }
}

/* ≥ 40rem (640px) */
@media (min-width: 40rem) {
   .hero--carousel .hero__slide {
      aspect-ratio: 3 / 2;
   }

   .hero .splide__arrows {
      left: var(--space-4);
      right: var(--space-4);
   }
}

/* ≥ 48rem (768px) */
@media (min-width: 48rem) {
   .hero {
      padding-inline: var(--space-8);
   }

   /* Gradient overlay for carousel edges */
   .hero--carousel::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      pointer-events: none;

      background: linear-gradient(to right,
            rgba(247, 247, 247, 0.9) 0,
            rgba(247, 247, 247, 0.6) 1.25rem,
            rgba(247, 247, 247, 0) 1.5rem,
            rgba(247, 247, 247, 0) calc(100% - 1.5rem),
            rgba(247, 247, 247, 0.6) calc(100% - 1.25rem),
            rgba(247, 247, 247, 0.9) 100%);
   }
}

/* ≥ 64rem (1024px) */
@media (min-width: 64rem) {

   .hero .splide__arrows {
      left: -1.5rem;
      right: -1.5rem;
   }

   .hero .splide__arrow {
      background-color: transparent;
      box-shadow: none;
      color: var(--text);
   }

   .hero:hover .splide__arrow {
      background-color: transparent;
   }

   .hero__inner {
      grid-template-columns: 1.15fr 0.85fr;
      align-items: center;
      gap: var(--space-8, 2rem);
      padding-block: var(--space-12, 3rem);
      padding-inline: 3rem;
   }

   .hero__media {
      min-height: 24rem;
   }

   .hero__content {
      max-width: 48rem;
      text-align: left;
   }

   .hero__summary {
      display: block;
   }

   .hero__actions {
      justify-content: flex-start;
   }

   .hero--carousel .hero__slide {
      max-height: calc(100vh - 24rem);
      aspect-ratio: 21 / 9;
      min-height: 28rem;
   }

   /* Overlay variant: revert to non-overlay layout */
   .hero--overlay .hero__inner {
      position: static;
   }

   .hero--overlay .hero__image {
      height: 100%;
      border-radius: var(--radius-lg);
   }

   .hero--overlay .hero__inner::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
      height: 100%;
      border-radius: var(--radius-lg);

      /* left-to-right readability gradient */
      /*background: linear-gradient(to left,
            var(--surface-2) 30%,
            var(--surface-2) 60%,
            var(--surface-2) 100%);*/
   }

}

/* ≥ 80rem (1280px) */
@media (min-width: 80rem) {
   .hero__carousel {
      max-width: 1376px;
      margin-inline: auto;
   }

   .hero__inner {
      gap: var(--space-10, 2.5rem);
   }

   .hero__title {
      font-size: 3rem;
   }

   .hero__title img {
      max-width: 70%;
   }

   .hero__lead {
      font-size: var(--text-2xl);
   }

   .hero__summary {
      font-size: var(--text-xl);
   }


   .hero__link--primary {
      height: 56px;
      font-size: var(--text-xl);
      font-weight: 700;
   }

   .hero__image {
      transform: scale(1);
      transition: all 1s cubic-bezier(.22, .61, .36, 1);
   }

   .hero:hover .hero__image {
      transform: scale(1.05);
   }

   .hero__media {
      min-height: 28rem;
   }

   /* Edge gradient adjusted to centered 1376px carousel */

}

/* ≥ 96rem (1536x) */
@media (min-width: 96rem) {

   .hero__title {
      font-size: 3.25rem;
   }

    .hero__title img {
        max-width: 100%;
    }

   .hero__lead {
      font-size: var(--text-2xl);
   }

   .hero__summary {
      font-size: var(--text-xl);
   }

   .hero--carousel::before {
      background: linear-gradient(to right,
            rgba(247, 247, 247, 0.99) 0,
            rgba(247, 247, 247, 0.9) calc((100vw - 1376px - 2rem) / 2),
            rgba(247, 247, 247, 0) calc((100vw - 1376px) / 2),
            rgba(247, 247, 247, 0) calc(1376px + ((100vw - 1376px) / 2)),
            rgba(247, 247, 247, 0.9) calc(1376px + ((100vw - 1376px + 2rem) / 2)),
            rgba(247, 247, 247, 0.99) 100%);
   }

   .hero .splide__arrows {
      left: -2.5rem;
      right: -2.5rem;
   }
}