.carousel {
  position: relative;
  overflow: hidden;
}

.carousel .carousel-track {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.4s ease;
}

.carousel .carousel-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 100%;
}

.carousel .carousel-slide-image {
  margin: 0;
}

.carousel .carousel-slide-image p {
  margin: 0;
}

.carousel .carousel-slide-image a {
  display: block;
}

/* uniform 16:9 media box across slides, matching the source's cover crop */
.carousel .carousel-slide-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* caption below the image (only authored on some slides) */
.carousel .carousel-slide-body {
  padding: 12px 0 0;
}

.carousel .carousel-slide-body :is(h1, h2, h3, p) {
  margin: 0;
  font-family: var(--heading-font-family);
  font-weight: 700;
  font-size: var(--heading-font-size-l);
  line-height: 1.2;
  text-transform: uppercase;
  color: #000;
}

.carousel .carousel-slide-body a:any-link {
  color: #000;
}

/* ===== Prev / Next: circular buttons centered on the image box ===== */
.carousel .carousel-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  pointer-events: none;
}

.carousel .carousel-nav button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  cursor: pointer;
  box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
}

.carousel .carousel-nav button:hover {
  background: #f0f0f0;
}

.carousel .carousel-nav button svg {
  width: 18px;
  height: 18px;
  fill: currentcolor;
}

/* ===== Dots: overlay anchored to the bottom of the image box ===== */
.carousel .carousel-dots {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  pointer-events: none;
}

.carousel .carousel-dots-bar {
  pointer-events: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0 6px;
  border-radius: 100vmax;
  background: rgb(0 0 0 / 25%);
}

/* Each dot is a full 24x24 tap target (WCAG 2.5.8 / Lighthouse touch-target);
   the visible pip is drawn small via ::before so the design stays compact. */
.carousel .carousel-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.carousel .carousel-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #959da8;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.carousel .carousel-dot[aria-current='true']::before {
  width: 20px;
  border-radius: 100vmax;
  background: #e8eaed;
}

/* ===== Multi-card horizontal scroller (insider + promos variants) =====
   Show several cards at once and scroll the rail (no dots/autoplay). Structure
   only — cards-per-view and layout live here in core; colors are theme. */
.carousel:is(.insider, .promos) {
  position: static;
  overflow: visible;
}

.carousel:is(.insider, .promos) .carousel-track {
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  transition: none;
}

/* promos: stretch cards to equal height across the row */
.carousel.promos .carousel-track {
  align-items: stretch;
}

.carousel:is(.insider, .promos) .carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel:is(.insider, .promos) .carousel-slide {
  flex: 0 0 80%;
  min-width: 0;
}

.carousel.insider .carousel-slide-image img {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
}

/* insider: two image tiles per view from tablet up */
@media (width >= 768px) {
  .carousel.insider .carousel-slide {
    flex-basis: calc((100% - 16px) / 2);
  }
}

/* promos: image-topped cards with a footer row and a pill CTA.
   One card on mobile, four per view on desktop; cards stretch to equal height. */
.carousel.promos .carousel-slide {
  flex: 0 0 80%;
}

@media (width >= 768px) {
  .carousel.promos .carousel-slide {
    flex-basis: calc((100% - 32px) / 3);
  }
}

@media (width >= 1024px) {
  .carousel.promos .carousel-slide {
    flex-basis: calc((100% - 48px) / 4);
  }
}

.carousel.promos .promo-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.carousel.promos .promo-media {
  overflow: hidden;
}

.carousel.promos .promo-media img {
  display: block;
  width: 100%;
  height: auto;
}

.carousel.promos .promo-title {
  margin: 12px 0 0;
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-l, 19px);
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  color: #000;
}

.carousel.promos .promo-desc {
  margin: 8px 0 0;
  font-size: var(--body-font-size-s);
  color: #000;
}

/* footer row: opponent (logo + name) on the left, date/time on the right,
   pushed to the card foot so cards align. A hairline divider sits above the
   row (matching the source), so pin it to the foot with an auto top margin and
   separate the whole row from the content above with a top border. */
.carousel.promos .promo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--light-color);
}

.carousel.promos .promo-opp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--body-font-size-s);
  font-weight: 400;
  color: #000;
}

.carousel.promos .promo-opp .icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
}

.carousel.promos .promo-opp .icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel.promos .promo-date {
  font-size: var(--body-font-size-s);
  font-weight: 700;
  color: var(--text-muted-color);
}

/* full-width green-outlined pill CTA */
.carousel.promos .promo-cta {
  display: block;
  margin-top: 12px;
  padding: 8px 16px;
  border: 2px solid currentcolor;
  border-radius: 100vmax;
  font-size: var(--body-font-size-m);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

/* the section is the positioning context; the nav aligns with the heading row
   (top) and the content column's right edge (not the full-width section edge)
   via a calc that matches the 1600px content cap + gutter */
main .section:has(.carousel.insider),
main .section:has(.carousel.promos) {
  position: relative;
}

/* promos heading row: the "View All" link sits inline after the heading, with
   the carousel wrapping to its own full-width line below */
main .section:has(.carousel.promos) > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 16px;
}

main .section:has(.carousel.promos) > div > h2 {
  margin: 0;
}

main .section:has(.carousel.promos) > div > p {
  margin: 0;
}

main .section:has(.carousel.promos) > div > p a:any-link {
  font-size: var(--body-font-size-m);
  font-weight: 700;
  text-decoration: underline;
}

main .section:has(.carousel.promos) .carousel.promos {
  flex-basis: 100%;
  min-width: 0; /* let the scrolling track shrink to the row instead of overflowing */
  margin-top: 16px;
}

/* arrows sit at the top-right, aligned with the section heading row */
.carousel:is(.insider, .promos) .carousel-nav {
  position: absolute;
  top: 0;
  right: max(24px, calc((100% - 1600px) / 2 + 24px));
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  aspect-ratio: auto;
  width: auto;
  padding: 0;
}

@media (width >= 768px) {
  .carousel:is(.insider, .promos) .carousel-nav {
    right: max(32px, calc((100% - 1600px) / 2 + 32px));
  }
}

.carousel:is(.insider, .promos) .carousel-nav button {
  position: static;
  transform: none;
  width: 32px;
  height: 32px;
  border: 1px solid currentcolor;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.carousel:is(.insider, .promos) .carousel-nav button[disabled] {
  cursor: default;
}
