/* ==========================================================================
   CSS PAGES - BERITA.CSS (Katalog dan Detail Berita)
   ========================================================================== */

/* CATALOG / GRID BERITA — 3 kolom desktop, 1 kolom mobile */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 1024px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-page-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* TAG ACTIVE BANNER */
.tag-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--cream);
  border: 1px solid var(--gray-300);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.tag-active-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.tag-active-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-left: 0.4rem;
}

.tag-active-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--gray-300);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition-fast);
}

.tag-active-reset:hover {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.tag-active-reset i { width: 0.9rem; height: 0.9rem; }

/* 2. CATALOG NAVBAR TOOLBAR */
.berita-search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 400px;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 2.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-300);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  background-color: var(--cream);
}

.search-input:focus {
  background-color: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46, 90, 28, 0.08);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 1.15rem;
  height: 1.15rem;
}

/* 3. PAGINATION BUTTONS */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 4rem;
}

.page-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  transition: var(--transition-fast);
}

.page-num:hover, .page-num.active {
  background-color: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* 4. DETAIL NEWS PAGE LAYOUT */
/* Grid utama: konten kiri (lebar baca nyaman) + sidebar kanan (berita lain) */
.detail-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  align-items: start;
}

.detail-main {
  max-width: 100%;
}

.detail-header {
  margin-bottom: 2rem;
}

.detail-category-tag {
  display: inline-block;
  background-color: var(--lime-light);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-title {
  font-family: var(--font-sans);
  font-size: 1.95rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--gray-300);
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-meta-item i {
  color: var(--green);
  width: 1rem;
  height: 1rem;
}

.detail-featured-image {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 3rem;
  aspect-ratio: 16/9;
}

.detail-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 5. ARTICLE CONTENT — typography nyaman baca (referensi portal berita) */
.article-content {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.85;
  color: #1F2937;
  font-weight: 400;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--font-sans);
  color: #111827;
  font-weight: 800;
  margin-top: 2.4rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article-content h1 { font-size: 1.85rem; }
.article-content h2 { font-size: 1.6rem; }
.article-content h3 { font-size: 1.35rem; }
.article-content h4 { font-size: 1.15rem; }

.article-content p {
  margin-bottom: 1.4rem;
  color: #1F2937;
}

.article-content blockquote {
  border-left: 5px solid var(--lime);
  background-color: var(--cream);
  padding: 1.5rem;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  font-style: italic;
  color: #4B5563;
  margin: 2rem 0;
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }

.article-content li {
  margin-bottom: 0.5rem;
  color: #1F2937;
}

.article-content strong {
  font-weight: 700;
  color: #111827;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

.article-content a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover { color: var(--green-dark); }

/* 6. TAGS */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.5rem;
}

.detail-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--cream);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-300);
  text-decoration: none;
  transition: var(--transition-fast);
}

.detail-tag-chip:hover {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.detail-tag-chip::before {
  content: '#';
  opacity: 0.6;
  font-weight: 700;
}

/* 6b. SIDEBAR — Berita Lainnya (list vertikal di kanan, desktop) */
.detail-sidebar {
  position: sticky;
  top: 6.5rem;
}

.detail-sidebar-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--lime);
}

.detail-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sidebar-news-item {
  display: flex;
  gap: 0.85rem;
  text-decoration: none;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-news-item:last-child { border-bottom: none; padding-bottom: 0; }

.sidebar-news-thumb {
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-100);
}

.sidebar-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-news-body {
  flex: 1;
  min-width: 0;
}

.sidebar-news-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.sidebar-news-item:hover .sidebar-news-title { color: var(--green); }

.sidebar-news-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-weight: 600;
}

/* 7. SHARE BAR */
.detail-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--gray-300);
}

.detail-share-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
}

.detail-share-label i { width: 1.05rem; height: 1.05rem; color: var(--green); }

.detail-share-buttons {
  display: flex;
  gap: 0.6rem;
}

.share-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.share-btn i { width: 1.15rem; height: 1.15rem; }
.share-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); opacity: 0.92; }

.share-wa   { background: #25D366; }
.share-fb   { background: #1877F2; }
.share-x    { background: #000000; }
.share-tg   { background: #229ED9; }
.share-copy { background: var(--muted); }

@media (max-width: 768px) {
  .page-hero {
    padding-top: 8rem;
    padding-bottom: 3.5rem;
  }
  .page-title {
    font-size: 2rem;
  }
  .detail-title {
    font-size: 1.5rem;
    line-height: 1.35;
  }
  .detail-share {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Detail: sidebar pindah ke bawah artikel, 1 kolom */
  .detail-page-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .detail-sidebar {
    position: static;
    border-top: 1px solid var(--gray-300);
    padding-top: 2rem;
  }
}

/* Hide category tag overlays on news images */
.news-category-tag {
  display: none !important;
}

