/* ==========================================================================
   Article Content Prose & Table of Contents Stylesheet (Visitor View)
   PT Pusat Teknologi Digital
   Menyelaraskan tampilan konten visitor persis dengan editor admin
   ========================================================================== */

/* Efek Pulse saat bab di klik dari TOC */
@keyframes visitorHeadingPulse {
  0% {
    background-color: rgba(14, 165, 233, 0.25);
    outline: 2px solid rgba(14, 165, 233, 0.6);
  }
  60% {
    background-color: rgba(14, 165, 233, 0.1);
    outline: 2px solid rgba(14, 165, 233, 0.3);
  }
  100% {
    background-color: transparent;
    outline: none;
  }
}

.prose-article h1:target,
.prose-article h2:target,
.prose-article h3:target,
.prose-article h4:target {
  animation: visitorHeadingPulse 1.8s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 4px;
}

/* Tipografi Heading dengan Scroll Margin agar tidak tertutup sticky navbar */
.prose-article h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #0f172a;
  scroll-margin-top: 96px;
  line-height: 1.25;
}

.prose-article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
  scroll-margin-top: 96px;
  line-height: 1.3;
}

.prose-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #334155;
  scroll-margin-top: 96px;
  line-height: 1.35;
}

.prose-article h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
  color: #475569;
  scroll-margin-top: 96px;
  line-height: 1.4;
}

/* Dark Mode Headings */
.dark .prose-article h1 { color: #f8fafc; }
.dark .prose-article h2 { color: #f1f5f9; border-bottom-color: #334155; }
.dark .prose-article h3 { color: #e2e8f0; }
.dark .prose-article h4 { color: #cbd5e1; }

/* Paragraf & Teks Biasa */
.prose-article p {
  margin-top: 0.85rem;
  margin-bottom: 0.85rem;
  line-height: 1.8;
  color: #334155;
}
.dark .prose-article p {
  color: #cbd5e1;
}

/* Kutipan / Blockquote */
.prose-article blockquote {
  border-left: 3px solid #0ea5e9;
  padding-left: 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  margin: 1.25rem 0;
  color: #475569;
  font-style: italic;
  background: rgba(14, 165, 233, 0.04);
  border-radius: 0 0.5rem 0.5rem 0;
}
.dark .prose-article blockquote {
  color: #94a3b8;
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

/* Blok Kode & Pre */
.prose-article pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.15rem;
  border-radius: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  line-height: 1.6;
}
.dark .prose-article pre {
  background: #020617;
  border: 1px solid #1e293b;
}

/* Inline Code */
.prose-article code:not(pre code) {
  background: #f1f5f9;
  color: #0284c7;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  font-weight: 500;
}
.dark .prose-article code:not(pre code) {
  background: #1e293b;
  color: #38bdf8;
}

/* List (Daftar Poin & Nomor) */
.prose-article ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.85rem 0;
}
.prose-article ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 0.85rem 0;
}
.prose-article li {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  line-height: 1.7;
}

/* Tabel Konten */
.prose-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  display: table;
}
.dark .prose-article table {
  border-color: #334155;
}
.prose-article th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.dark .prose-article th {
  background: #0f172a;
  color: #f8fafc;
  border-bottom-color: #334155;
}
.prose-article td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.dark .prose-article td {
  border-bottom-color: #1e293b;
  color: #cbd5e1;
}
.prose-article tr:last-child td {
  border-bottom: none;
}
.prose-article tr:hover td {
  background: #f8fafc;
}
.dark .prose-article tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

/* Tautan dalam konten */
.prose-article a {
  color: #0284c7;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.prose-article a:hover {
  color: #0369a1;
}
.dark .prose-article a {
  color: #38bdf8;
}
.dark .prose-article a:hover {
  color: #7dd3fc;
}

/* Table of Contents Item Active State */
.toc-item-link {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #64748b;
  transition: all 0.15s ease;
  line-height: 1.4;
}
.dark .toc-item-link {
  color: #94a3b8;
}
.toc-item-link:hover {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.08);
}
.dark .toc-item-link:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}
.toc-item-link.toc-active {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.12);
  font-weight: 600;
  border-left: 2px solid #0ea5e9;
}
.dark .toc-item-link.toc-active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-left-color: #38bdf8;
}
