/**
 * NewsroomIN — Full-Width Hero Highlights Banner
 *
 * Visual specifications & Zero-Jitter Stability:
 * - CSS Grid stacking ensures invariant, rock-solid container height across all slides.
 * - Uniform min-height and line clamping for headlines and excerpts prevents any layout shifts.
 * - Fixed height on story line preview labels prevents vertical movement on hover/active.
 * - Clean 12px rounded 16:9 featured photo on the left.
 * - Black HIGHLIGHTS badge, bold white typography, clean text meta line, pill Details button.
 */

/* ==========================================================================
   1. HERO CARD CONTAINER (Contained inside .container)
   ========================================================================== */
.hero-slider-section {
  width: 100%;
  background: var(--brand-accent, #991b1b);
  border-radius: 16px;
  padding: 1.5rem 1.75rem 1.35rem;
  margin-top: 0.5rem;
  margin-bottom: 2.25rem;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}

.hero-slider-container {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   2. MAIN SLIDER VIEWPORT (CSS Grid Stacking for Zero-Jitter Height)
   ========================================================================== */
.hero-slider-viewport {
  display: grid;
  grid-template-areas: "hero-slide-slot";
  position: relative;
  width: 100%;
}

.hero-slide {
  grid-area: hero-slide-slot;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2-Column Asymmetric Grid */
.hero-slide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
  gap: 2rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   3. LEFT COLUMN: 16:9 PHOTO WITH 12PX ROUNDED CORNERS
   ========================================================================== */
.hero-slide-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  height: 100%;
  min-width: 0;
  width: 100%;
}

.hero-slide-img-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  overflow: hidden;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.4s ease;
}

.hero-slide:hover .hero-slide-img {
  transform: scale(1.025);
}

.hero-slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 1.75rem;
  font-weight: 800;
  border-radius: 12px;
}

.hero-slide-placeholder .accent {
  color: #ffffff;
  opacity: 0.85;
}

/* ==========================================================================
   4. RIGHT COLUMN: EDITORIAL TYPOGRAPHY ON BRAND RED
   ========================================================================== */
.hero-slide-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.hero-slide-content-top {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

/* Single Black Badge: HIGHLIGHTS */
.hero-slide-badge-wrap {
  margin-bottom: 0.65rem;
}

.hero-badge-highlights {
  display: inline-block;
  background: #000000;
  color: #ffffff;
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  line-height: 1.1;
}

/* Bold White Headline (Locked 2-line height for zero jitter) */
.hero-slide-title {
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: clamp(1.4rem, 1.9vw, 1.95rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 0.65rem 0;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  min-height: 2.4em;
}

.hero-slide-title a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.hero-slide-title a:hover {
  opacity: 0.9;
}

/* Excerpt / Subtitle (Locked 2-line height for zero jitter) */
.hero-slide-excerpt {
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.4rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  min-height: 3em;
}

/* Reading Time directly below excerpt text */
.hero-slide-reading-time {
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.85rem 0;
}

/* Bottom Meta Row: Category & Author on Left, Details Button on Right */
.hero-slide-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.hero-slide-meta-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.9);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-meta-cat,
a.hero-meta-cat {
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}
a.hero-meta-cat:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.hero-meta-sep {
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.hero-meta-author,
a.hero-meta-author {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}
a.hero-meta-author:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* Pill Outline Details Button */
.hero-slide-details-btn,
a.hero-slide-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff !important;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 0.35rem 1.15rem;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-slide-details-btn:hover,
a.hero-slide-details-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.hero-slide-details-btn .btn-arrow,
a.hero-slide-details-btn .btn-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  color: #ffffff !important;
}

.hero-slide-details-btn:hover .btn-arrow,
a.hero-slide-details-btn:hover .btn-arrow {
  color: #ffffff !important;
  transform: translateX(3px);
}

/* ==========================================================================
   4B. SINGLE SLOT & EXTENDED TEXT MODE (Unclamped Headlines & Rich Excerpts)
   ========================================================================== */
.hero-slider--single-slot {
  padding-bottom: 1.5rem;
}

.hero-slider--single-slot .hero-slider-viewport,
.hero-slide--expand-text .hero-slide-grid {
  min-height: auto;
}

.hero-slider--single-slot .hero-slide-grid {
  align-items: center;
}

/* Explicitly Expanded Text Mode (Enabled via Checkbox Option) */
.hero-slide--expand-text .hero-slide-title {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  min-height: auto;
  max-height: none;
}

.hero-slide--expand-text .hero-slide-excerpt {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  min-height: auto;
  max-height: none;
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

/* ==========================================================================
   5. STORIES PROGRESS LINES (AT THE BOTTOM, IMMUTABLE VERTICAL BASELINE)
   ========================================================================== */
.hero-slider-stories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.story-line-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  outline: none;
  position: relative;
  text-align: left;
}

.story-line-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
}

/* Fixed-height preview: Never shifts the track below it */
.story-line-preview {
  font-family: var(--font-display, "Inter", sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  height: 1.15rem;
  line-height: 1.15rem;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.story-line-btn:hover .story-line-preview,
.story-line-btn.is-active .story-line-preview {
  opacity: 1;
}

.story-line-btn.is-active .story-line-preview {
  color: #ffffff;
  font-weight: 600;
}

.story-line-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  transition: background-color 0.2s ease;
}

.story-line-btn:hover .story-line-track {
  background: rgba(255, 255, 255, 0.45);
}

.story-line-fill {
  width: 0%;
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  transform-origin: left center;
}

/* Active 5-second fill animation */
.story-line-btn.is-active.is-running .story-line-fill {
  animation: storyLineFill 5s linear forwards;
}

/* Paused on slide hover */
.hero-slider-section.is-paused .story-line-btn.is-running .story-line-fill {
  animation-play-state: paused;
}

/* Completed prior slides */
.story-line-btn.is-completed .story-line-fill {
  width: 100%;
  background: rgba(255, 255, 255, 0.65);
}

@keyframes storyLineFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 960px) {
  .hero-slide-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-slider-section {
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    margin-bottom: 2rem;
    border-radius: 14px;
  }

  .hero-slide-title {
    font-size: 1.4rem;
    min-height: auto;
  }

  .hero-slide-excerpt {
    min-height: auto;
  }

  .hero-slider-stories {
    gap: 0.6rem;
    margin-top: 1.25rem;
  }
}

@media (max-width: 640px) {
  .hero-slide-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .hero-slide-details-btn {
    width: 100%;
    justify-content: center;
  }

  .hero-slider-stories {
    gap: 0.4rem;
  }

  .story-line-preview {
    display: none;
  }
}
