/* ══════════════════════════════════════════════════════════════
   News Carousel Component
   Shortcode: [news_carousel]
   ══════════════════════════════════════════════════════════════ */

.news-carousel {
  --cards-visible: 5;
  --gap: 12px;
  position: relative;
  width: 100%;
  user-select: none;
}

.news-carousel__viewport {
  overflow: hidden;
  cursor: grab;
}

.news-carousel__viewport:active {
  cursor: grabbing;
}

.news-carousel__track {
  display: flex;
  gap: var(--gap);
  transition: transform 0.5s ease;
}

/* ── Card ── */

.news-carousel__card {
  flex: 0 0 auto;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.news-carousel__card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.news-carousel__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}

/* Gradient overlay */

.news-carousel__card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  border-radius: 0 0 8px 8px;
}

.news-carousel__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px;
  z-index: 2;
}

.news-carousel__date {
  display: inline;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.news-carousel__title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.1em;
  margin-bottom: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.news-carousel__excerpt {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ── Content Type Icon (Media Mode) ── */

.news-carousel__icon {
  display: none;
}

.news-carousel--media .news-carousel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
}

.news-carousel__icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--color-white);
  stroke-width: 1.5;
  fill: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.news-carousel--media .news-carousel__date {
  display: none;
}

.news-carousel--media .news-carousel__title {
  display: none;
}

.news-carousel--media .news-carousel__excerpt {
  -webkit-line-clamp: 3;
}

/* ── Arrows ── */

.news-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--overlay-dark);
  border: none;
  cursor: pointer;
  padding: 16px 8px;
  transition: background 0.25s;
  border-radius: 4px;
}

.news-carousel__arrow:hover {
  background: var(--overlay-dark-hover);
}

.news-carousel__arrow svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-white);
  stroke-width: 2.5;
  fill: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.news-carousel__arrow--prev {
  left: 12px;
}

.news-carousel__arrow--next {
  right: 12px;
}

/* ── Dots (mobile only) ── */

.news-carousel__dots {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.news-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s;
}

.news-carousel__dot.is-active {
  background: var(--color-primary);
}

/* ── Responsive ── */

@media (max-width: 980px) {
  .news-carousel {
    --cards-visible: 3;
  }

  .news-carousel__title {
    font-size: 15px;
  }

  .news-carousel__excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 767px) {
  .news-carousel {
    --cards-visible: 1;
  }

  .news-carousel__arrow {
    display: none;
  }

  .news-carousel__dots {
    display: flex;
  }

  .news-carousel__overlay {
    padding: 20px 16px;
  }

  .news-carousel__title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .news-carousel__excerpt {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }
}
