/* === theme-carousel.css — Swiper carousel that switches between the 6
   theme SECTIONS (intro + card grid); the cards inside each section are a
   static grid, not swipeable themselves === */

.theme-carousel {
  /* Local, component-scoped values, not global tokens. --nav-inset: side strip reserved for the
     arrow + hover-preview text so they never overlap the grid. */
  --nav-inset: 220px;
  --nav-arrow-gap: 35px;
  --nav-arrow-size: 40px;
  --nav-arrow-rest-offset: calc(var(--nav-inset) - var(--nav-arrow-gap) - var(--nav-arrow-size));
  position: relative;
  background: var(--clr-white);
  border-radius: var(--radius-24);
  padding: var(--sp13) 0;
}

/* Caps the swiper+arrow cluster at 1140px content + nav-inset on ultra-wide screens. .theme-carousel__nav's
   position doesn't depend on this padding — its arrows re-derive their offset via --nav-arrow-rest-offset. */
.theme-carousel__swiper-wrap {
  position: relative;
  width: 100%;
  max-width: calc(1140px + (2 * var(--nav-inset)));
  margin: 0 auto;
  padding: 0 var(--nav-inset);
}

/* Fallback safety net duplicating vendor swiper-bundle.min.css, in case it fails to load — keeps only one slide visible. */
.theme-carousel__swiper.swiper {
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
}

.theme-carousel__swiper .swiper-wrapper {
  display: flex;
}

.theme-carousel__swiper .swiper-slide {
  flex-shrink: 0;
  width: 100%;
}

/* Fallback in case Swiper JS never initializes: .swiper-slide-active is present statically in the
   markup for the starting theme, and is also the class Swiper itself toggles once it does init. */
.theme-carousel__swiper .swiper-slide {
  visibility: hidden;
}

.theme-carousel__swiper .swiper-slide-active {
  visibility: visible;
}

.theme-carousel__panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp8);
}

.theme-carousel__intro {
  display: flex;
  align-items: flex-end;
  gap: var(--sp8);
  padding-left: var(--sp11);
}

.theme-carousel__graphic {
  flex-shrink: 0;
  width: 295px;
}

/* max-width overrides the <img>'s width/height HTML attrs (295x193) so it shrinks with the container. */
.theme-carousel__graphic img {
  display: block;
  max-width: 100%;
  height: auto;
}

.theme-carousel__divider {
  flex-shrink: 0;
  align-self: stretch;
  width: 1px;
  background: var(--clr-primary);
}

.theme-carousel__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp6);
  max-width: 700px;
}

.theme-carousel__title {
  margin: 0;
  color: var(--clr-gray-dark);
  font-family: var(--primary-ff);
  font-weight: var(--fw-bold);
  font-size: var(--fs-32);
  line-height: 1.1875;
}

/* Do not duplicate font-size/line-height here — this component's CSS loads after body-text.css, so a local
   override would beat and break that class's responsive step-down at max-width:767px. Reuse it, don't fork it. */
.theme-carousel__description {
  --text-lh: 1.444444;
}

/* body-text-field only zeroes a last-child's margin-bottom, not a lone child's default top margin. */
.theme-carousel__description p {
  margin: 0;
}

/* Card count varies 2-7 per theme; only column count (3) is fixed, rows add automatically. */
.theme-carousel__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 260px;
  gap: var(--sp6);
}

/* :has() detects a 1-2 card grid (which would otherwise sit left-aligned against empty grid tracks) and
   switches to a centered flex row. Card width/height must stay in sync with the same rule's 2-col/1-col
   versions in theme-carousel--tablet-1200.css and --mobile-520.css. */
.theme-carousel__cards:has(> .theme-carousel__card:nth-child(1):nth-last-child(-n+2)) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.theme-carousel__cards:has(> .theme-carousel__card:nth-child(1):nth-last-child(-n+2))>.theme-carousel__card {
  flex: 0 0 calc((100% - 2 * var(--sp6)) / 3);
  height: 260px;
}

/* .is-in-view is added per-card by js/theme-carousel(-drupal).js on its own scroll entry (not once for the
   whole grid) — keeps later rows of a tall grid animating as they're actually reached, not pre-finished. */
.theme-carousel__card {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.theme-carousel__card.is-in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .theme-carousel__card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Each card is a real link (Hard Rule #18: buttons vs links) — the <li>
   is just the grid cell; .theme-carousel__card-link is the whole
   clickable box and carries the visual styling. */
.theme-carousel__card-link {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: var(--sp8);
  box-sizing: border-box;
  border-radius: 0 var(--radius-54) 0 var(--radius-54);
  text-decoration: none;
  outline-offset: -3px;
}

.theme-carousel__card:nth-child(even) .theme-carousel__card-link {
  border-radius: var(--radius-54) 0 var(--radius-54) 0;
}

.theme-carousel__card-link:hover .theme-carousel__card-img,
.theme-carousel__card-link:focus-visible .theme-carousel__card-img {
  transform: scale(1.05);
}

.theme-carousel__card-link:focus-visible {
  outline: 2px solid var(--clr-white);
}

.theme-carousel__card-link:not(.theme-carousel__card-link--disabled):hover .theme-carousel__card-label,
.theme-carousel__card-link:not(.theme-carousel__card-link--disabled):focus-visible .theme-carousel__card-label {
  color: var(--clr-yellow-orange);
}

/* coming_soon cards render as a <div>, not an <a> (twig) — no destination
   to click through to yet, so no hover zoom/pointer affordance either. */
.theme-carousel__card-link--disabled {
  cursor: default;
}

.theme-carousel__card-link--disabled img {
  opacity: 0.5;
}

.theme-carousel__card-link--disabled:hover .theme-carousel__card-img {
  transform: none;
}

.theme-carousel__card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.theme-carousel__card-overlay {
  position: absolute;
  inset: 0;
  background: var(--clr-black-30);
}

.theme-carousel__card-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp5);
}

.theme-carousel__card-label {
  color: var(--clr-white);
  font-family: var(--primary-ff);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-21);
  line-height: 1.2857;
  text-align: center;
  transition: color 0.15s ease;
}

/* Intentionally not uppercased, unlike .theme-carousel__card-label. */
.theme-carousel__card-badge {
  color: var(--clr-yellow-orange);
  font-family: var(--primary-ff);
  font-weight: var(--fw-bold);
  font-size: var(--fs-18);
  line-height: 1.2857;
  text-align: center;
}

/* Must stay nested inside .theme-carousel__swiper-wrap (not .theme-carousel) so arrows track the wrapper's
   capped/centered content on ultra-wide screens instead of .theme-carousel's own unbounded width. */
.theme-carousel__nav {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* .theme-carousel__arrow must stay the stable hit-area (never moves) — only its child .theme-carousel__arrow-visual
   slides via transform on hover. Moving the button itself causes a hover-position feedback flicker loop. */
.theme-carousel__arrow {
  position: absolute;
  /* --nav-cards-center-y is set by JS (active .theme-carousel__cards' midpoint); 50% is only the pre-JS fallback. */
  top: var(--nav-cards-center-y, 50%);
  transform: translateY(-50%);
  width: var(--nav-arrow-size);
  height: var(--nav-arrow-size);
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  background: transparent !important;
}

.theme-carousel__arrow--prev {
  left: var(--nav-arrow-rest-offset);
}

.theme-carousel__arrow--next {
  right: var(--nav-arrow-rest-offset);
}

.theme-carousel__arrow-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-white);
  border: 0.8px solid var(--clr-gray-dark);
  border-radius: var(--radius-50);
  color: var(--clr-gray-dark);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Slid out to where left/right:0 would put it — this is now the resting
   position (not a :hover-triggered move), so the visual sits at its
   "revealed" spot by default and only its color changes on hover. */
.theme-carousel__arrow--prev .theme-carousel__arrow-visual {
  transform: translateX(calc(-1 * var(--nav-arrow-rest-offset)));
}

.theme-carousel__arrow--next .theme-carousel__arrow-visual {
  transform: translateX(var(--nav-arrow-rest-offset));
}

.theme-carousel__arrow:hover .theme-carousel__arrow-visual,
.theme-carousel__arrow:focus-visible .theme-carousel__arrow-visual {
  background: var(--clr-yellow-orange);
  border-color: var(--clr-yellow-orange);
  color: var(--clr-white);
}

.theme-carousel__arrow:focus-visible .theme-carousel__arrow-visual {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.theme-carousel__arrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-carousel__arrow-icon svg {
  width: 16px;
  height: 14px;
}

/* Always-visible preview (previously hover-only) — rendered at rest (opacity:1); hover only recolors
   .theme-carousel__arrow-visual. Mirrored for prev: beside the arrow's right side, left-aligned. */
.theme-carousel__arrow-preview {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  /* width: 90px; */
  min-width: 153px;
  width: auto;
  opacity: 1;
  pointer-events: auto;
}

/* left/right stay glued to the stable hit-area at exactly 100%; the 13px gap is padding, not a positioning
   offset, and the transform matches .theme-carousel__arrow-visual's own outward shift. */
.theme-carousel__arrow--prev .theme-carousel__arrow-preview {
  left: 100%;
  padding-left: 13px;
  align-items: flex-start;
  text-align: left;
  transform: translate(calc(-1 * var(--nav-arrow-rest-offset)), -50%);
}

.theme-carousel__arrow--next .theme-carousel__arrow-preview {
  right: 100%;
  padding-right: 13px;
  align-items: flex-end;
  text-align: right;
  transform: translate(var(--nav-arrow-rest-offset), -50%);
}

.theme-carousel__arrow-name {
  width: 100%;
  padding-bottom: var(--sp2);
  border-bottom: 1px solid var(--clr-gray-300);
  color: var(--clr-gray-dark);
  font-family: var(--primary-ff);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-12);
  line-height: 1.2857;
  text-transform: uppercase;
}

.theme-carousel__arrow-caption {
  color: var(--clr-gray-dark);
  font-family: var(--primary-ff);
  font-weight: var(--fw-light);
  font-size: var(--fs-14);
  line-height: 2.143;
  white-space: nowrap;
}
