// =============================================================================
// NEWS SLIDER — tx_news "Slider" template layout
// =============================================================================

@import '../mixins';

.news-slider-list {
  // Section rhythm: 56px mobile+tablet, 80px laptop+ (--section-space, tokens.scss).
  padding-block: var(--section-space);
}

.news-slider-list__nav {
  display: flex;
  align-items: flex-end; // arrows sit at the bottom of the nav row, space grows above them
  gap: 8px;
  width: max-content;
  height: 72px; // taller than the 40px buttons, so there's visible space above them
  margin-left: auto;
  margin-bottom: 1rem; // 16px on mobile

  @include respond-to('desktop') {
    height: 60px; // 40px buttons + 20px space above, on desktop
    margin-bottom: var(--space-10); // 40px
  }
}

.news-slider-nav-btn {
  @include slider-nav-btn;
  width: 40px;
  height: 40px;
  background-color: var(--color-satin-linen);
  border-radius: var(--radius-pill);
  color: var(--color-mantle);

  img {
    width: 24px;
    height: 24px;
    display: block;
  }
}

.news-slider-nav-btn--prev {
  opacity: 0.35;
}

.news-slider-nav-btn--next {
  opacity: 1;
}

// ─── Slider ──────────────────────────────────────────────────────────────────
.news-slider {
  cursor: grab;
  user-select: none;

  @include slider-breakout;

  &:active { cursor: grabbing; }
}

.news-slider__track {
  align-items: stretch;
}

.news-slider .swiper-slide {
  height: auto;
}

// ─── Card ────────────────────────────────────────────────────────────────────
.news-slider-card {
  width: clamp(304px, calc(197px + 28.53vw), 480px);
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
}

.news-slider-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  picture {
    display: block;
    width: 100%;
    height: 100%;
  }
}

.news-slider-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-slider-card__body {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;

  @include respond-to('desktop') {
    padding: 2rem;
    gap: 1rem;
  }
}

.news-slider-card__date {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.news-slider-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-display-xs);
  font-weight: 500;
  line-height: var(--lh-display-xs);
  color: var(--color-text-primary);
  margin: 0;

  a {
    color: inherit;
    text-decoration: none;

    &:hover,
    &:focus-visible {
      text-decoration: underline;
    }
  }

  @include respond-to('desktop') {
    font-size: var(--fs-display-sm);
    line-height: var(--lh-display-sm);
  }
}

.news-slider-card__teaser {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: var(--lh-xs);
  color: var(--color-text-secondary);
  margin: 0;
  flex: 1;

  @include respond-to('desktop') {
    font-size: var(--fs-lg);
    line-height: var(--lh-lg);
  }
}

.news-slider-card__link {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-gold-dark);
  text-decoration: underline;
  cursor: pointer;

  &:hover,
  &:focus-visible {
    color: var(--color-gold);
  }

  &:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
  }
}

.news-slider-card--cta {
  @include image-overlay-base;
  min-height: 464px;
  background-color: var(--color-gold-dark);
}

.news-slider-card__cta-bg {
  @include overlay-bg;
}

.news-slider-card__cta-overlay {
  @include overlay-gradient;
}

.news-slider-card__cta-content {
  @include overlay-content;
  padding: 2rem;
}

.news-slider-card__cta-link {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.66;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;

  &:hover,
  &:focus-visible {
    color: var(--color-white);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  &:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
  }
}
