/* ============================================================
   BERITA.CSS — Supplementary styles for Portal Berita
   Load order: bootstrap.css → bootstrap-override.css
             → style-elements.css → berita.css
   Tokens used: --bs-brand, --bs-accent, --bs-neutral, --bs-surface
============================================================ */


/* ===========================
   Base
=========================== */

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f4f3ee;
  color: #1a1a1a;
}


/* ===========================
   Header
=========================== */

.berita-header {
  background: var(--bs-brand);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: padding 0.28s ease, box-shadow 0.28s ease;
}

.berita-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.berita-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff !important;
}

.berita-brand:hover .berita-site-name {
  opacity: 0.85;
}

.berita-logo {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: width 0.28s ease, height 0.28s ease, font-size 0.28s ease;
}

.berita-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.berita-site-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  transition: font-size 0.28s ease, opacity 0.15s;
}

.berita-slogan {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
  letter-spacing: 0.2px;
  transition: opacity 0.2s ease, max-height 0.28s ease;
  max-height: 2rem;
  overflow: hidden;
}

.berita-header-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}


/* ===========================
   Top nav bar
=========================== */

.berita-topnav {
  background: color-mix(in srgb, var(--bs-brand) 80%, #000);
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  white-space: nowrap;
}

.berita-topnav .container-xl {
  display: flex;
  align-items: center;
  gap: 0;
}

.berita-topnav-item {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 0 0.9rem;
  letter-spacing: 0.2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.berita-topnav-item:hover,
.berita-topnav-item.active {
  color: #fff;
  border-bottom-color: var(--bs-accent);
}

/* Header compact — hanya aktif di mobile saat scroll */
@media (max-width: 767px) {
  .berita-header.scrolled {
    padding: 0.45rem 0;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  }

  .berita-header.scrolled .berita-logo {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .berita-header.scrolled .berita-site-name {
    font-size: 0.95rem;
  }

  .berita-header.scrolled .berita-slogan {
    opacity: 0;
    max-height: 0;
  }
}


/* ===========================
   Main area
=========================== */

.berita-main {
  min-height: 70vh;
  padding: 1.75rem 0 3rem;
}


/* ===========================
   News List — Grid
=========================== */

.news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 0 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 576px) {
  .news-list {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1.25rem;
  }
}

@media (min-width: 992px) {
  .news-list {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 1.5rem;
  }
}

@media (min-width: 1280px) {
  .news-list {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ===========================
   News Card
=========================== */

.news-card {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

.news-card:hover,
.news-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Thumbnail */
.news-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--bs-surface);
  flex-shrink: 0;
}

.news-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.news-card:hover .news-thumb {
  transform: scale(1.05);
}

.news-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-neutral);
  font-size: 2.25rem;
}

.news-category-badge {
  position: absolute;
  top: 0.6rem;
  left: 0;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--bs-brand);
  color: #fff;
  z-index: 1;
}

/* Card body */
.news-card-body {
  padding: 0.85rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: #111;
  margin: 0 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-excerpt {
  font-size: 0.76rem;
  color: #6b7280;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
  flex: 1;
}

.news-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.55rem;
  margin-top: auto;
}

.news-card-author {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  color: #6b7280;
}


/* ===========================
   News Detail
=========================== */

.news-detail-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
}

.news-back-btn {
  margin-bottom: 1.25rem;
}

.news-hero-wrap {
  width: 100%;
  margin-bottom: 1.5rem;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: var(--bs-surface);
}

.news-hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-detail-category {
  margin-bottom: 0.6rem;
}

.news-category-badge--inline {
  position: static;
  display: inline-block;
}

.news-detail-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .news-detail-title {
    font-size: 1.85rem;
  }
}

.news-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  font-size: 0.78rem;
  color: #6b7280;
  padding: 0.8rem 0;
  border-top: 2px solid var(--bs-brand);
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.75rem;
}

.news-detail-meta a {
  color: var(--bs-brand);
  text-decoration: none;
}

.news-detail-meta a:hover {
  text-decoration: underline;
}

.news-detail-content {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #374151;
}

.news-detail-content p {
  margin-bottom: 1.1rem;
}

.news-detail-content img {
  max-width: 100%;
  height: auto;
}

.news-detail-content h2,
.news-detail-content h3 {
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: #111;
}

/* Tags */
.news-tags {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.news-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.22rem 0.65rem;
  background: var(--bs-surface);
  color: #374151;
  border: 1px solid #d1d5db;
  font-weight: 500;
  cursor: default;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.news-tag:hover {
  background: color-mix(in srgb, var(--bs-brand) 8%, white);
  border-color: var(--bs-brand);
  color: var(--bs-brand);
}


/* ===========================
   Skeleton Loader
=========================== */

.skeleton {
  background: linear-gradient(
    90deg,
    #e8e8e3 25%,
    #d4d4cf 37%,
    #e8e8e3 63%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-thumb {
  width: 100%;
  padding-top: 56.25%;
}

.skeleton-title {
  height: 17px;
  margin-bottom: 8px;
  width: 88%;
}

.skeleton-title-sm {
  height: 13px;
  margin-bottom: 6px;
  width: 65%;
}

.skeleton-text {
  height: 11px;
  margin-bottom: 6px;
}

.skeleton-text-short {
  height: 11px;
  width: 45%;
}

.skeleton-hero {
  width: 100%;
  height: 280px;
}

@media (min-width: 768px) {
  .skeleton-hero { height: 380px; }
}

.skeleton-heading {
  height: 30px;
  width: 82%;
  margin-bottom: 12px;
}


/* ===========================
   Load More
=========================== */

.berita-load-more {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 0.5rem;
}

.btn-load-more {
  min-height: 44px;
  padding: 0.6rem 2.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

@media (max-width: 575px) {
  .berita-load-more {
    padding: 1.5rem 1rem 0.25rem;
  }

  .btn-load-more {
    width: 100%;
  }
}


/* ===========================
   Empty State
=========================== */

.news-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #9ca3af;
}

.news-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.news-empty-text {
  font-size: 0.95rem;
  margin: 0;
}


/* ===========================
   Footer
=========================== */

.berita-footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 1.1rem 0;
  margin-top: 2rem;
  font-size: 0.8rem;
}
