/* =====================================================================
   Tampilan artikel (v3.2): daftar, kartu, halaman tunggal.
   Memakai variabel tema agar otomatis mengikuti mode gelap & warna panel.
   ===================================================================== */

.post-hero-sub { margin: 12px auto 0; max-width: 620px; opacity: .92; font-size: 17px; }

/* ---------- Filter kategori ---------- */
.post-filter { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 36px; }
.post-filter a {
  padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--white);
  color: var(--gray); font-weight: 600; font-size: 14px; text-decoration: none; transition: .2s;
}
.post-filter a:hover { border-color: var(--primary); color: var(--primary); }
.post-filter a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Grid & kartu ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.post-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.post-card-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--primary-light); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.06); }
.post-chip {
  position: absolute; left: 14px; top: 14px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.94); color: var(--primary-dark); font-size: 12px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.post-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.post-card h3 { font-size: 19px; line-height: 1.35; font-weight: 800; margin: 0; }
.post-card h3 a { color: var(--dark); text-decoration: none; }
.post-card h3 a:hover { color: var(--primary); }
.post-card p { margin: 0; color: var(--gray); font-size: 14.5px; line-height: 1.65; }
.post-more { margin-top: auto; padding-top: 4px; color: var(--primary); font-weight: 700; font-size: 14px; text-decoration: none; }
.post-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Kartu unggulan (pertama di halaman 1) */
.post-card--featured { grid-column: 1 / -1; flex-direction: row; }
.post-card--featured .post-card-thumb { flex: 0 0 52%; aspect-ratio: auto; min-height: 320px; }
.post-card--featured .post-card-body { padding: 36px; justify-content: center; }
.post-card--featured h3 { font-size: 28px; line-height: 1.25; }
.post-card--featured p { font-size: 16px; }

.post-grid--plain .post-card--featured { grid-column: auto; flex-direction: column; }

.post-empty { text-align: center; max-width: 480px; margin: 0 auto; padding: 30px 0; color: var(--gray); }
.post-empty h2 { color: var(--dark); margin: 10px 0 8px; }
.post-empty-ico { font-size: 48px; }

/* ---------- Pagination ---------- */
.post-pagination { margin-top: 44px; text-align: center; }
.post-pagination .nav-links { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.post-pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--white); color: var(--dark);
  font-weight: 700; text-decoration: none; transition: .2s;
}
.post-pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.post-pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.post-pagination .page-numbers.dots { border: 0; background: transparent; }
.post-pagination .screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Artikel tunggal ---------- */
.reading-progress {
  position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 9999; background: transparent; pointer-events: none;
}
.reading-progress span {
  display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .08s linear;
}

.post-hero { padding: 72px 0 64px; }
.post-hero h1 { max-width: 860px; margin: 14px auto 20px; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.2; text-wrap: balance; }
.post-hero-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.post-hero-cats a {
  padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.post-hero-cats a:hover { background: rgba(255,255,255,.28); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: center; font-size: 14.5px; opacity: .95; }
.post-meta-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.post-avatar { border-radius: 50%; display: block; }

.post-section { padding-top: 0; }
.post-article { max-width: 780px; margin: 0 auto; }
.post-cover {
  margin: -36px 0 38px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  position: relative; z-index: 2; background: var(--primary-light);
}
.post-cover img { display: block; width: 100%; height: auto; }

/* Tipografi isi artikel */
.post-content { max-width: none; font-size: 18px; line-height: 1.85; color: var(--text-soft, var(--dark)); }
.post-content > p:first-of-type { font-size: 20px; line-height: 1.7; color: var(--dark); }
.post-content p { margin: 0 0 22px; }
.post-content h2 {
  font-size: 28px; line-height: 1.3; margin: 44px 0 16px; padding-left: 16px; color: var(--dark);
  border-left: 5px solid var(--primary); scroll-margin-top: 90px;
}
.post-content h3 { font-size: 22px; line-height: 1.35; margin: 32px 0 12px; color: var(--dark); scroll-margin-top: 90px; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.post-content a:hover { color: var(--primary-dark); }
.post-content ul, .post-content ol { margin: 0 0 24px; padding-left: 26px; }
.post-content li { margin-bottom: 8px; }
.post-content li::marker { color: var(--primary); font-weight: 800; }
.post-content blockquote {
  margin: 32px 0; padding: 22px 26px; border-left: 5px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--primary-soft); color: var(--dark); font-size: 19px; font-style: italic;
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content img, .post-content video { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-content figure { margin: 30px 0; }
.post-content figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--muted); }
.post-content table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 16px; display: block; overflow-x: auto; }
.post-content th, .post-content td { padding: 12px 14px; border: 1px solid var(--border); text-align: left; }
.post-content th { background: var(--primary-soft); color: var(--dark); }
.post-content pre {
  background: #0f1d16; color: #e8f3ec; padding: 18px 20px; border-radius: var(--radius); overflow-x: auto; font-size: 15px; line-height: 1.6;
}
.post-content code { background: var(--primary-light); padding: 2px 7px; border-radius: 6px; font-size: .92em; }
.post-content pre code { background: transparent; padding: 0; }
.post-content hr { border: 0; height: 1px; background: var(--border); margin: 40px 0; }
.post-pages { margin: 20px 0; font-weight: 600; }

/* Daftar isi (dibuat otomatis oleh JS bila ada >= 3 subjudul) */
.post-toc {
  margin: 0 0 34px; padding: 22px 26px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--primary-soft); font-size: 16px; line-height: 1.5;
}
.post-toc strong { display: block; margin-bottom: 10px; color: var(--dark); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.post-toc ol { margin: 0; padding-left: 22px; }
.post-toc li { margin-bottom: 7px; }
.post-toc a { color: var(--gray); text-decoration: none; }
.post-toc a:hover, .post-toc a.is-active { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* Tag, bagikan, penulis */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.post-tags a {
  padding: 6px 14px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark);
  font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.post-tags a:hover { background: var(--primary); color: #fff; }
.post-share { margin-top: 30px; }
.post-author {
  display: flex; gap: 18px; align-items: flex-start; margin-top: 36px; padding: 24px; border-radius: var(--radius-lg);
  background: var(--primary-soft); border: 1px solid var(--border);
}
.post-author p { margin: 6px 0 0; color: var(--gray); font-size: 15px; line-height: 1.6; }
.post-author strong { font-size: 18px; color: var(--dark); }
.post-author-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Sebelumnya / berikutnya */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.post-nav a {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--white); text-decoration: none; transition: .25s;
}
.post-nav a:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow); }
.post-nav span { font-size: 13px; font-weight: 700; color: var(--primary); }
.post-nav strong { color: var(--dark); line-height: 1.4; }
.post-nav-next { text-align: right; grid-column: 2; }

.post-related { margin-top: 70px; }
.post-comments { max-width: 780px; margin: 56px auto 0; }

/* Responsif */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card--featured { flex-direction: column; }
  .post-card--featured .post-card-thumb { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .post-card--featured .post-card-body { padding: 24px; }
  .post-card--featured h3 { font-size: 24px; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-hero { padding: 52px 0 56px; }
  .post-content { font-size: 17px; }
  .post-content h2 { font-size: 24px; }
  .post-cover { margin-top: -28px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { grid-column: auto; text-align: left; }
  .post-author { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card-thumb img, .post-nav a, .reading-progress span { transition: none; }
  .post-card:hover { transform: none; }
}
