#berita {
  padding: 60px 20px;
  background: #f9fafb;
}

.berita-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.berita-header {
  text-align: center;
  margin-bottom: 32px;
}

.berita-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.berita-divider {
  width: 80px;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 999px;
  margin: 0 auto;
}

/* Slider wrapper */
.berita-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;        /* bisa geser ke card berikutnya */
  scroll-behavior: smooth;
  padding: 10px;
  scroll-snap-type: x mandatory; /* snap agar card berhenti rapi */
}

.berita-slider::-webkit-scrollbar {
  height: 8px;
}
.berita-slider::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.berita-card {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 card per layar desktop */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-snap-align: start; /* tiap card berhenti pas */
}

.berita-image {
  position: relative;
  width: 100%;
  height: 180px; /* tinggi seragam */
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}
.berita-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.berita-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
  border-radius: 12px 12px 0 0;
}

.berita-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #2563eb;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.berita-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
}
.berita-date {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 6px;
}
.berita-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}
.berita-desc {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 12px;
  flex-grow: 1;
}
.berita-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.berita-btn:hover {
  background: #1e40af;
}

/* Navigasi slider */
.slider-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 10px;
  pointer-events: none;
}
.slider-nav button {
  pointer-events: auto;
  background: rgba(37,99,235,0.9);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.slider-nav button:hover {
  background: #1e40af;
}
.slider-nav svg {
  width: 24px;
  height: 24px;
}

/* Responsif */
@media (max-width: 768px) {
  .berita-card { flex: 0 0 100%; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .berita-card { flex: 0 0 calc((100% - 20px) / 2); }
}
@media (min-width: 1025px) {
  .berita-card { flex: 0 0 calc((100% - 40px) / 3); }
}