/* Shared carousel component used by Home highlights and Casa Axis. */

.axis-carousel {
  position: relative;
  width: 100%;
  background: var(--ink);
}

.axis-carousel__viewport {
  position: relative;
  height: clamp(460px, 37.5vw, 760px);
  min-height: 460px;
  overflow: hidden;
}

.axis-carousel__slide {
  position: absolute;
  inset: 0;
  display: block;
  color: var(--brand-cream);
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transition: opacity 640ms ease;
}

.axis-carousel__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.axis-carousel__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.axis-carousel__slide::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.08) 44%, rgba(0, 0, 0, 0.28));
}

.axis-carousel__overlay {
  position: absolute;
  z-index: 2;
  display: grid;
  width: min(620px, calc(100vw - 40px));
  max-width: min(620px, calc(100vw - 40px));
  gap: 8px;
  padding: clamp(18px, 4vw, 56px);
  color: var(--surface);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.46), 0 1px 22px rgba(0, 0, 0, 0.34);
}

.axis-carousel__copy {
  display: grid;
  width: 100%;
  gap: 8px;
  justify-items: stretch;
}

.axis-carousel__copy--align-left {
  text-align: left;
}

.axis-carousel__copy--align-center {
  text-align: center;
}

.axis-carousel__copy--align-right {
  text-align: right;
}

.axis-carousel__copy > * {
  width: 100%;
  min-width: 0;
}

.axis-carousel__overlay strong {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 6rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.94;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.axis-carousel__overlay span {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.35vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.axis-carousel__overlay--top-left {
  top: 0;
  left: 0;
  justify-items: start;
  text-align: left;
}

.axis-carousel__overlay--top-center {
  top: 0;
  left: 50%;
  justify-items: center;
  text-align: center;
  transform: translateX(-50%);
}

.axis-carousel__overlay--top-right {
  top: 0;
  right: 0;
  justify-items: end;
  text-align: right;
}

.axis-carousel__overlay--center-left {
  top: 50%;
  left: 0;
  justify-items: start;
  text-align: left;
  transform: translateY(-50%);
}

.axis-carousel__overlay--center-center {
  top: 50%;
  left: 50%;
  justify-items: center;
  text-align: center;
  transform: translate(-50%, -50%);
}

.axis-carousel__overlay--center-right {
  top: 50%;
  right: 0;
  justify-items: end;
  text-align: right;
  transform: translateY(-50%);
}

.axis-carousel__overlay--bottom-left {
  bottom: 0;
  left: 0;
  justify-items: start;
  text-align: left;
}

.axis-carousel__overlay--bottom-center {
  bottom: 0;
  left: 50%;
  justify-items: center;
  text-align: center;
  transform: translateX(-50%);
}

.axis-carousel__overlay--bottom-right {
  right: 0;
  bottom: 0;
  justify-items: end;
  text-align: right;
}

.axis-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 18px 4px;
  background: var(--page);
}

.axis-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.axis-carousel__dot.is-active {
  background: var(--ink);
}

@media (max-width: 900px) {
  .axis-carousel__viewport {
    height: clamp(300px, 56vw, 460px);
    min-height: 300px;
  }

  .axis-carousel__overlay {
    max-width: min(540px, calc(100vw - 28px));
    padding: 24px;
  }

  .home-hero-carousel .axis-carousel__overlay strong {
    font-size: clamp(1.8rem, 7.4vw, 3.6rem);
    line-height: 1.02;
  }

  .home-hero-carousel .axis-carousel__overlay span {
    font-size: clamp(0.74rem, 2.3vw, 0.98rem);
    line-height: 1.25;
  }
}

@media (max-width: 520px) {
  .axis-carousel__viewport {
    height: clamp(200px, 56vw, 300px);
    min-height: 200px;
  }

  @supports (height: 100svh) {
    .axis-carousel__viewport {
      height: clamp(200px, 56vw, 300px);
    }
  }

  .axis-carousel__overlay {
    right: 16px;
    left: 16px;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    padding: 18px;
  }

  .home-hero-carousel .axis-carousel__overlay {
    max-width: none;
    padding: 16px;
  }

  .axis-carousel__overlay strong {
    font-size: clamp(2rem, 13vw, 4.4rem);
    line-height: 1;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .home-hero-carousel .axis-carousel__overlay strong {
    font-size: clamp(1.3rem, 7.2vw, 2.25rem);
    line-height: 1.02;
  }

  .axis-carousel__overlay span {
    font-size: 0.78rem;
    line-height: 1.22;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: normal;
    text-wrap: balance;
  }

  .home-hero-carousel .axis-carousel__overlay span {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .axis-carousel__overlay--top-left,
  .axis-carousel__overlay--top-center,
  .axis-carousel__overlay--top-right {
    top: 0;
    right: 16px;
    left: 16px;
    transform: none;
  }

  .axis-carousel__overlay--center-left,
  .axis-carousel__overlay--center-center,
  .axis-carousel__overlay--center-right {
    top: 50%;
    right: 16px;
    left: 16px;
    transform: translateY(-50%);
  }

  .axis-carousel__overlay--bottom-left,
  .axis-carousel__overlay--bottom-center,
  .axis-carousel__overlay--bottom-right {
    right: 16px;
    bottom: 0;
    left: 16px;
    transform: none;
  }

  .axis-carousel__overlay--top-left,
  .axis-carousel__overlay--center-left,
  .axis-carousel__overlay--bottom-left {
    justify-items: start;
    text-align: left;
  }

  .axis-carousel__overlay--top-center,
  .axis-carousel__overlay--center-center,
  .axis-carousel__overlay--bottom-center {
    justify-items: center;
    text-align: center;
  }

  .axis-carousel__overlay--top-right,
  .axis-carousel__overlay--center-right,
  .axis-carousel__overlay--bottom-right {
    justify-items: end;
    text-align: right;
  }
}
