.homepage-carousel {
  padding: 34px 0 18px;
  background: #f5f8f6;
}

.carousel-shell {
  position: relative;
  width: min(980px, calc(100% - 40px));
}

.carousel-viewport {
  position: relative;
  min-height: 260px;
  aspect-ratio: 16 / 5.4;
  overflow: hidden;
  border: 1px solid #d9e3de;
  background: #161a18;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s ease, visibility .55s ease;
}

.carousel-slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.carousel-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-copy {
  position: absolute;
  z-index: 2;
  left: clamp(24px, 5vw, 72px);
  top: 50%;
  width: min(560px, 65%);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .75);
  transform: translateY(-50%);
}

.carousel-copy h2 {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(1.7rem, 3.2vw, 3.2rem);
  line-height: 1.14;
}

.carousel-copy > span {
  display: block;
  max-width: 520px;
  margin-top: 13px;
  color: #e4eee9;
  font-size: .92rem;
  line-height: 1.65;
}

.carousel-copy > a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 10px 15px;
  color: #fff;
  background: #df7d29;
  font-size: .78rem;
  font-weight: 750;
}

.carousel-copy > a:hover { background: #ef903d; color: #fff; }
.carousel-copy > a svg { width: 15px; height: 15px; }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-top: 14px;
}

.carousel-controls > button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #b8cbc2;
  border-radius: 50%;
  color: #174c3d;
  background: #fff;
  cursor: pointer;
}

.carousel-controls > button:hover { color: #fff; background: #176347; }
.carousel-controls > button span { font-size: 1.45rem; line-height: 1; }

.carousel-indicators { display: flex; gap: 7px; }
.carousel-indicators button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #9db8ac;
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}
.carousel-indicators button.is-active { width: 25px; background: #df7d29; }

@media (max-width: 700px) {
  .homepage-carousel { padding: 14px 0 6px; }

  .carousel-viewport {
    height: clamp(170px, 48vw, 240px);
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 6px;
  }

  .carousel-slide::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 30% 0 0;
    background: linear-gradient(0deg, rgba(5, 27, 21, .86), rgba(5, 27, 21, 0));
    pointer-events: none;
  }

  .carousel-copy {
    top: auto;
    right: 16px;
    bottom: 14px;
    left: 16px;
    width: auto;
    transform: none;
  }

  .carousel-copy h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: clamp(1.05rem, 4.6vw, 1.35rem);
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .carousel-copy > span { display: none; }

  .carousel-copy > a {
    margin-top: 9px;
    padding: 7px 10px;
    font-size: .68rem;
  }

  .carousel-controls { gap: 11px; padding-top: 9px; }

  .carousel-controls > button {
    width: 30px;
    height: 30px;
  }

  .carousel-controls > button span { font-size: 1.2rem; }
  .carousel-indicators { gap: 6px; }
  .carousel-indicators button { width: 7px; height: 7px; }
  .carousel-indicators button.is-active { width: 20px; }
}

@media (max-width: 400px) {
  .carousel-viewport { height: 170px; }
  .carousel-copy h2 { font-size: 1.02rem; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide { transition: none; }
}
