/* ==========================================
   BERITA.CSS — Halaman Berita SMA Excellence
   ========================================== */

/* ── Page Hero (Coverflow Carousel) ─────────── */
.berita-hero {
  background: var(--bg-soft);
  padding: 56px 0 52px;
  overflow: hidden;
}
.berita-hero-title {
  text-align: center;
  margin-bottom: 44px;
}
.berita-hero-title h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}
.berita-hero-title h1 .red  { color: var(--primary); }
.berita-hero-title h1 .dark { color: var(--ink); }

/* Stage — coverflow translateX style */
.coverflow-stage {
  position: relative;
  width: 100%;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Setiap kartu diposisikan absolute, digerakkan JS */
.cf-card {
  position: absolute;
  width: 440px;
  left: 50%;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transform-origin: center center;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out, box-shadow 0.3s ease;
  user-select: none;
}
.cf-card.is-active {
  box-shadow: var(--shadow-card);
  z-index: 20;
}
.cf-card.is-side {
  box-shadow: 0 4px 16px rgba(31,27,36,0.08);
  z-index: 10;
}
.cf-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-soft-2);
  overflow: hidden;
  flex-shrink: 0;
}
.cf-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cf-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary-light), #f0e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.cf-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cf-body h3 {
  font-size: 0.97rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cf-cat  { font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.cf-date { font-size: 0.78rem; color: var(--ink-soft); margin-top: auto; }

/* Tombol panah */
.bcar-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: background .15s ease, transform .15s ease;
  box-shadow: 0 6px 20px rgba(138,31,45,0.32);
}
.bcar-arrow:hover { background: var(--primary-dark); transform: translateY(-50%) scale(1.1); }
.bcar-arrow:disabled { background: #ccc; box-shadow: none; cursor: default; }
.bcar-arrow:disabled:hover { transform: translateY(-50%) scale(1); }
.bcar-arrow svg { width: 20px; height: 20px; }
#bcarPrev { left: 0; }
#bcarNext { right: 0; }

/* Dots */
.cf-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.cf-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all .2s ease;
}
.cf-dot.active { background: var(--primary); width: 22px; border-radius: 4px; }

/* ── Filter + Grid Berita ───────────────────── */
.berita-main {
  padding: 60px 0 80px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Filter bar */
.berita-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.berita-filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-right: 4px;
}
.filter-btn {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Search bar */
.berita-search {
  margin-left: auto;
  position: relative;
}
.berita-search input {
  padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  width: 220px;
  outline: none;
  transition: border-color .15s ease;
}
.berita-search input:focus { border-color: var(--primary); }
.berita-search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--ink-soft);
  pointer-events: none;
}

/* Grid berita utama */
.berita-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.berita-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.berita-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.berita-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-soft-2);
  overflow: hidden;
}
.berita-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.berita-card-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary-light), #f0e8e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.berita-card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.berita-card-body h3 {
  font-size: 0.97rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.berita-card-cat {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}
.berita-card-date {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: auto;
}

/* Paginasi */
.berita-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bpag-btn {
  min-width: 38px; height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
  font-family: inherit;
}
.bpag-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.bpag-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bpag-btn:disabled { opacity: .35; cursor: default; }
.bpag-btn svg { width: 16px; height: 16px; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 991px) {
  .coverflow-stage { height: 380px; }
  .cf-card { width: 340px; }
  .berita-grid { grid-template-columns: repeat(2, 1fr); }
  .berita-search { margin-left: 0; width: 100%; }
  .berita-search input { width: 100%; }
}
@media (max-width: 640px) {
  .berita-hero-title h1 { font-size: 1.6rem; }
  .coverflow-stage { height: 340px; }
  .cf-card { width: 260px; }
  #bcarPrev { left: 4px; }
  #bcarNext { right: 4px; }
  .berita-grid { grid-template-columns: 1fr; }
}
