/* ============================================
   BERITA PAGE - Split View Layout
   ============================================ */

/* ---- Page Header ---- */
.page-header {
  padding-top: 80px;
}

/* ---- Split View Container ---- */
.berita-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .berita-split {
    grid-template-columns: 2fr 1fr; /* Kiri 2/3, Kanan 1/3 */
    align-items: start;
  }
}

/* ---- Left: Content Viewer ---- */
.berita-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  min-height: 400px;
  line-height: 1.8;
  color: var(--gray-700);
}
.berita-content h1, .berita-content h2, .berita-content h3 {
  font-family: var(--font-display);
  color: var(--gray-900);
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}
.berita-content h1 { font-size: 1.8rem; }
.berita-content h2 { font-size: 1.4rem; }
.berita-content h3 { font-size: 1.2rem; }
.berita-content p { margin-bottom: 1rem; }
.berita-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.berita-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.berita-content a:hover { text-decoration: underline; }
.berita-content ul, .berita-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.berita-content li { margin-bottom: 0.4rem; }
.berita-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--gray-500);
  font-style: italic;
}
.berita-content code {
  background: var(--gray-100);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}
.berita-content pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}
.berita-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.content-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400);
}

/* ---- Right: Sidebar List ---- */
.berita-sidebar {
  position: sticky;
  top: 80px; /* Kompensasi navbar */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 0.5rem;
}
.berita-sidebar::-webkit-scrollbar { width: 6px; }
.berita-sidebar::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 3px; }
.berita-sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.berita-sidebar::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

.berita-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---- News List Item ---- */
.berita-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.berita-item:hover {
  border-color: var(--primary-light);
  transform: translateX(4px);
}
.berita-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.berita-item__thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-100);
}
.berita-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.berita-item__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 1.2rem;
}
.berita-item__content {
  flex: 1;
  min-width: 0;
}
.berita-item__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.berita-item__meta {
  font-size: 0.72rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.berita-item.active .berita-item__title { color: var(--primary-dark); }
.berita-item.active .berita-item__meta { color: var(--gray-600); }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--gray-400);
}
.empty-state i { font-size: 2rem; margin-bottom: 0.5rem; }

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-title { height: 1.2rem; width: 80%; margin-bottom: 0.5rem; }
.skeleton-meta { height: 0.8rem; width: 50%; }
.skeleton-content { height: 1rem; width: 100%; margin: 0.5rem 0; }
.skeleton-content.short { width: 90%; }
.skeleton-content.shorter { width: 70%; }

/* ---- Mobile: Stack Layout ---- */
@media (max-width: 899px) {
  .berita-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .berita-content {
    order: 2; /* Content below list on mobile */
  }
  .berita-sidebar {
    order: 1;
  }
}

/* ============================================
   BERITA CONTENT STYLING
   ============================================ */
.markdown-body {
  line-height: 1.8;
  color: var(--gray-700);
  font-size: 0.95rem;
}
.markdown-body p { margin-bottom: 1rem; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: var(--font-display);
  color: var(--gray-900);
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}
.markdown-body a { color: var(--primary); font-weight: 600; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--gray-500);
  font-style: italic;
}
.markdown-body code {
  background: var(--gray-100);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}
.markdown-body pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
}
.markdown-body pre code { background: none; padding: 0; color: inherit; }

/* ✅ Image Wrapper: Centered, Responsive, Shadow */
.img-wrapper {
  text-align: center;
  margin: 2rem 0;
}
.img-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
.img-wrapper img:hover { transform: scale(1.02); }

/* ✅ Video Wrapper: 16:9 Responsive YouTube */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 2rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Mobile adjustment */
@media (max-width: 899px) {
  .markdown-body { font-size: 0.9rem; }
  .img-wrapper, .video-wrapper { margin: 1.5rem 0; }
}