/* =========================================================================
   REKTOR UNTAD CUP III 2026 — News / Berita Index
   Scoped styles for template-news.php only. Everything is namespaced under
   .news-page / .news-masthead so nothing leaks onto the landing page or other
   templates. Reuses the theme's existing fonts (Manrope / Space Grotesk) and
   layout helpers (.container, .section--deep, .post-hero__breadcrumbs).
   ========================================================================= */

.news-page {
  /* --- News design tokens (swap --news-accent to recolor the whole page) --- */
  --news-accent: #E53935;
  --news-accent-dark: #C62828;
  --news-bg: #F5F5F5;
  --news-card: #FFFFFF;
  --news-title: #1A1A1A;
  --news-meta: #757575;
  --news-line: #ECECEC;
  --news-rad: 8px;
  --news-rad-lg: 14px;
  --news-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  --news-shadow-hover: 0 18px 38px rgba(15, 23, 42, 0.16);
  --news-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  background: var(--news-bg);
  padding-block: clamp(2rem, 5vw, 3.25rem) clamp(3.5rem, 8vw, 6rem);
}

/* ----- Masthead (dark band so the fixed white nav stays readable) ----- */
.news-masthead {
  position: relative;
  overflow: hidden;
  /* Top padding clears the fixed navbar, mirroring .page-hero. */
  padding-block: clamp(6.5rem, 11vw, 8.5rem) clamp(2.2rem, 5vw, 3.4rem);
}

.news-masthead__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(720px 360px at 50% 130%, rgba(232, 160, 32, 0.16), transparent 60%);
  pointer-events: none;
}

.news-masthead .container {
  position: relative;
  z-index: 1;
}

.news-eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.news-masthead__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--white);
  line-height: 1.1;
  margin: 0;
}

/* =========================================================================
   SECTION 1 — HERO ROW (slider + recent list)
   ========================================================================= */
.news-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: stretch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ----- Slider ----- */
.news-slider {
  position: relative;
  border-radius: var(--news-rad-lg);
  overflow: hidden;
  box-shadow: var(--news-shadow);
  background: #0b1d3a;
}

.news-slider__viewport {
  overflow: hidden;
  height: 100%;
}

.news-slider__track {
  display: flex;
  height: 100%;
  transition: transform 0.55s var(--news-ease);
  will-change: transform;
}

.news-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: block;
  color: var(--white);
  aspect-ratio: 16 / 9;
}

.news-slide__media,
.news-slide__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.news-slide__media img {
  object-fit: cover;
  transition: transform 6s var(--news-ease);
}

.news-slider:hover .news-slide__media img {
  transform: scale(1.05);
}

.news-slide__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #162e55, #0b1d3a);
}

.news-slide__media--empty svg {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.35);
}

.news-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 14, 29, 0.92) 0%, rgba(8, 14, 29, 0.55) 35%, rgba(8, 14, 29, 0) 65%);
}

.news-slide__content {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(1.1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.news-slide__chip {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--news-accent);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.news-slide__date {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.news-slide__title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--white);
  margin: 0;
  max-width: 36ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

/* Slider arrows */
.news-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0b1d3a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.25s var(--news-ease), background 0.2s var(--news-ease), transform 0.2s var(--news-ease);
}

.news-slider:hover .news-slider__nav,
.news-slider__nav:focus-visible {
  opacity: 1;
}

.news-slider__nav:hover {
  background: var(--news-accent);
  color: var(--white);
}

.news-slider__nav--prev { left: 14px; }
.news-slider__nav--next { right: 14px; }

.news-slider__nav svg {
  width: 22px;
  height: 22px;
}

/* Slider dots */
.news-slider__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 3;
}

.news-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.25s var(--news-ease), background 0.25s var(--news-ease);
  cursor: pointer;
}

.news-slider__dot.is-active {
  width: 22px;
  background: var(--news-accent);
}

/* ----- Recent list ----- */
.news-recent {
  display: flex;
  flex-direction: column;
  background: var(--news-card);
  border-radius: var(--news-rad-lg);
  box-shadow: var(--news-shadow);
  padding: clamp(1rem, 1.6vw, 1.4rem);
}

.news-recent__heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--news-title);
  padding-bottom: 0.85rem;
  margin: 0 0 0.4rem;
  position: relative;
}

.news-recent__heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: var(--news-accent);
}

.news-recent__list {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 0;
}

.news-recent__item + .news-recent__item {
  border-top: 1px solid var(--news-line);
}

.news-recent__link {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0;
}

.news-recent__thumb {
  position: relative;
  display: block;
  width: 78px;
  height: 64px;
  border-radius: var(--news-rad);
  overflow: hidden;
  background: #eef1f6;
  flex-shrink: 0;
}

.news-recent__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--news-ease);
}

.news-recent__link:hover .news-recent__thumb img {
  transform: scale(1.07);
}

.news-recent__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #b6bfce;
}

.news-recent__thumb--empty svg { width: 24px; height: 24px; }

.news-recent__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.news-recent__date {
  font-size: 0.74rem;
  color: var(--news-meta);
  font-weight: 500;
}

.news-recent__title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--news-title);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s var(--news-ease);
}

.news-recent__link:hover .news-recent__title {
  color: var(--news-accent);
}

.news-recent__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--news-line);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--news-accent);
  transition: gap 0.2s var(--news-ease), color 0.2s var(--news-ease);
}

.news-recent__more svg { width: 16px; height: 16px; }

.news-recent__more:hover {
  color: var(--news-accent-dark);
  gap: 0.65rem;
}

/* =========================================================================
   SECTION 2 — MAIN GRID
   ========================================================================= */
.news-section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.news-section-head__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--news-title);
  margin: 0;
  position: relative;
  padding-left: 0.85rem;
}

.news-section-head__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: var(--news-accent);
}

.news-section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--news-line);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 1.8vw, 1.5rem);
}

.news-card {
  background: var(--news-card);
  border-radius: var(--news-rad);
  overflow: hidden;
  box-shadow: var(--news-shadow);
  transition: transform 0.2s var(--news-ease), box-shadow 0.2s var(--news-ease);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--news-shadow-hover);
}

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef1f6;
}

.news-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--news-ease);
}

.news-card:hover .news-card__thumb img {
  transform: scale(1.06);
}

.news-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #b6bfce;
}

.news-card__thumb--empty svg { width: 40px; height: 40px; }

.news-card__chip {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--news-accent);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35);
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem 1.1rem;
  flex: 1;
}

.news-card__date {
  font-size: 0.75rem;
  color: var(--news-meta);
  font-weight: 500;
}

.news-card__title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--news-title);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s var(--news-ease);
}

.news-card:hover .news-card__title {
  color: var(--news-accent);
}

/* =========================================================================
   SECTION 3 — PAGINATION
   ========================================================================= */
.news-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
}

.news-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.6rem;
  border-radius: var(--news-rad);
  background: var(--news-card);
  color: var(--news-title);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--news-shadow);
  transition: background 0.2s var(--news-ease), color 0.2s var(--news-ease), transform 0.2s var(--news-ease);
}

.news-pagination a.page-numbers:hover {
  background: #fdecec;
  color: var(--news-accent);
  transform: translateY(-2px);
}

.news-pagination .page-numbers.current {
  background: var(--news-accent);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(229, 57, 53, 0.32);
}

.news-pagination .page-numbers.dots {
  background: transparent;
  box-shadow: none;
}

.news-pagination .page-numbers svg {
  width: 18px;
  height: 18px;
}

/* ----- Empty state ----- */
.news-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: clamp(3rem, 8vw, 5rem) 1rem;
  text-align: center;
  color: var(--news-meta);
}

.news-empty svg {
  width: 48px;
  height: 48px;
  color: #c2cad6;
}

/* Screen-reader-only utility (used by pagination prev/next labels). */
.news-page .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
/* Tablet — 2-column grid, stack the hero. */
@media (max-width: 1024px) {
  .news-hero-row {
    grid-template-columns: 1fr;
  }

  .news-slider__nav {
    opacity: 1; /* no hover on touch — keep arrows visible */
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile — single column. */
@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-recent__link {
    grid-template-columns: 88px 1fr;
  }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  .news-slider__track,
  .news-slide__media img,
  .news-card,
  .news-card__thumb img,
  .news-recent__thumb img {
    transition: none !important;
  }
}
