/**
 * Materials page — full-bleed carousel matching home hero motion (fade + zoom + brand veil).
 * Scoped: .page-supply #km-materials-carousel
 */

.page-supply .km-materials-carousel-section {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--km-ceo-bg);
}

.page-supply #km-materials-carousel {
  min-height: min(72vh, 720px);
  height: min(72vh, 720px);
  max-height: 720px;
  overflow: hidden;
}

.page-supply #km-materials-carousel .carousel-inner {
  height: 100%;
  min-height: min(72vh, 720px);
  overflow: hidden;
}

.page-supply #km-materials-carousel .carousel-item {
  position: relative;
  height: 100%;
  min-height: min(72vh, 720px);
  overflow: hidden;
}

.page-supply #km-materials-carousel .carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  z-index: 0;
  transform: none;
  transition: none;
  animation: none;
}

/* Same black overlay as home hero */
.page-supply #km-materials-carousel .carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  opacity: 1;
}

.page-supply #km-materials-carousel .carousel-item.active::before {
  animation: none;
}

.page-supply #km-materials-carousel .carousel-item.active .carousel-img {
  animation: kmMaterialsZoom 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kmMaterialsZoom {
  0% {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.18) translate3d(-0.75%, -0.35%, 0);
  }
}

@keyframes kmMaterialsVeil {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

/* Crossfade — match home hero */
.page-supply #km-materials-carousel.carousel-fade .carousel-item {
  transition: opacity 3.2s cubic-bezier(0.42, 0, 0.58, 1);
}

.page-supply #km-materials-carousel.carousel-fade .active.carousel-item-left,
.page-supply #km-materials-carousel.carousel-fade .active.carousel-item-right {
  transition: opacity 3.2s cubic-bezier(0.42, 0, 0.58, 1);
}

.page-supply #km-materials-carousel .carousel-caption.km-materials-carousel__stack {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  transform: translateY(-46%);
  max-width: min(960px, 94vw);
  margin-left: auto;
  margin-right: auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
}

.page-supply #km-materials-carousel .km-materials-carousel__kicker {
  font-family: var(--md-font-body), "Outfit", "Roboto", sans-serif;
  font-weight: 600;
  font-size: clamp(0.72rem, 1.8vw, 0.88rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.page-supply #km-materials-carousel .km-materials-carousel__title {
  font-family: var(--md-font-display), "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(1.65rem, 5vw + 0.5rem, 3rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-blue-800);
  -webkit-text-fill-color: var(--color-blue-800);
  margin: 0 0 clamp(1rem, 3vw, 1.5rem);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(255, 255, 255, 0.45),
    0 4px 24px rgba(0, 0, 0, 0.5);
}

.page-supply #km-materials-carousel .carousel-item.active .km-materials-carousel__title {
  animation: kmMaterialsTitleTint 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kmMaterialsTitleTint {
  0% {
    color: var(--color-blue-800);
    -webkit-text-fill-color: var(--color-blue-800);
  }
  72% {
    color: var(--color-blue-800);
    -webkit-text-fill-color: var(--color-blue-800);
  }
  72.1% {
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
  100% {
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
}

.page-supply #km-materials-carousel .km-materials-carousel__lede {
  font-family: var(--md-font-body), "Outfit", "Roboto", sans-serif;
  font-size: clamp(0.92rem, 2.2vw, 1.12rem);
  font-weight: 500;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.94);
  margin: 0;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

/* Controls + indicators above veil */
.page-supply #km-materials-carousel .carousel-indicators {
  bottom: 1.5rem;
  margin-bottom: 0;
  z-index: 5;
}

.page-supply #km-materials-carousel .carousel-control-prev,
.page-supply #km-materials-carousel .carousel-control-next {
  width: 48px;
  height: 48px;
  top: auto;
  bottom: 1.35rem;
  opacity: 0.9;
  z-index: 5;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(8px);
}

.page-supply #km-materials-carousel .carousel-control-prev {
  left: 1rem;
  right: auto;
}

.page-supply #km-materials-carousel .carousel-control-next {
  right: 1rem;
  left: auto;
}

.page-supply #km-materials-carousel .carousel-control-prev:hover,
.page-supply #km-materials-carousel .carousel-control-next:hover {
  background: var(--color-blue-600) !important;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .page-supply #km-materials-carousel.carousel-fade .carousel-item,
  .page-supply #km-materials-carousel.carousel-fade .active.carousel-item-left,
  .page-supply #km-materials-carousel.carousel-fade .active.carousel-item-right {
    transition: opacity 0.45s ease;
  }

  .page-supply #km-materials-carousel .carousel-item.active .carousel-img {
    animation: none;
    transform: scale(1.08);
  }

  .page-supply #km-materials-carousel .carousel-item.active::before {
    animation: none;
    opacity: 0.72;
  }

  .page-supply #km-materials-carousel .carousel-item.active .km-materials-carousel__title {
    animation: none;
    color: #fff;
    -webkit-text-fill-color: #fff;
  }
}

@media (max-width: 576px) {
  .page-supply #km-materials-carousel {
    min-height: 56vh;
    height: 56vh;
    max-height: none;
  }

  .page-supply #km-materials-carousel .carousel-inner,
  .page-supply #km-materials-carousel .carousel-item {
    min-height: 56vh;
  }

  .page-supply #km-materials-carousel .carousel-caption.km-materials-carousel__stack {
    transform: translateY(-42%);
    padding-bottom: 3.5rem;
  }
}
