/* ════════════════════════════════════════════════════════════
   ARTICLE DETAIL PAGE — article_detail.css
   Diload via page_css.php ketika $page === 'article-detail'
   Semua warna menggunakan variabel global dari custom.css.
   ════════════════════════════════════════════════════════════ */


/* ════════════════════════════════════════════════════════════
   1. ARTICLE HERO
   Dark  : foto gelap + dark overlay dari bawah
   Light : Split Tone — cream solid kiri → transparan kanan
   ════════════════════════════════════════════════════════════ */

.article-hero {
  position: relative;
  height: 480px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: var(--bg-deep);
  transition: background 0.3s ease;
}

.article-hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1532619187608-e5375cab36aa?w=1600&q=80')
              center / cover no-repeat;
  transform: scale(1.03);
  transition: transform 8s ease, filter 0.3s ease;
}

[data-theme="dark"] .article-hero-bg,
:root:not([data-theme]) .article-hero-bg {
  filter: grayscale(30%) brightness(0.38);
}

[data-theme="light"] .article-hero-bg {
  filter: brightness(0.82) saturate(0.55);
}

.article-hero:hover .article-hero-bg { transform: scale(1); }

.article-hero-overlay {
  position: absolute;
  inset: 0;
  transition: background 0.3s ease;
}

[data-theme="dark"] .article-hero-overlay,
:root:not([data-theme]) .article-hero-overlay {
  background: linear-gradient(
    to top,
    var(--bg-deep)            0%,
    rgba(8,8,8,0.65)          45%,
    rgba(8,8,8,0.15)          100%
  );
}

[data-theme="light"] .article-hero-overlay {
  background: linear-gradient(
    105deg,
    rgba(245,241,234,0.97)    0%,
    rgba(245,241,234,0.90)    30%,
    rgba(245,241,234,0.45)    55%,
    rgba(245,241,234,0.00)    72%
  );
}

[data-theme="light"] .article-hero {
  border-bottom: 1px solid var(--border-nav);
}

/* Grid texture — redup di light mode */
.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(212,168,67,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,168,67,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  transition: opacity 0.3s ease;
}

[data-theme="light"] .article-hero::before { opacity: 0; }

.article-hero-content {
  position: relative;
  z-index: 10;
  padding: 0 64px 64px;
  width: 100%;
  max-width: 860px;
}

/* Breadcrumb */
.breadcrumb-kbc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.breadcrumb-kbc a {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-kbc a:hover { color: var(--gold); }

.breadcrumb-kbc span {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

[data-theme="light"] .breadcrumb-kbc a    { color: var(--text-muted); }
[data-theme="light"] .breadcrumb-kbc span { color: var(--gold-dark); }

.breadcrumb-sep {
  color: var(--border-gold);
  font-size: 10px;
}

/* Category label */
.article-cat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

[data-theme="light"] .article-cat-label { color: var(--gold-dark); }

.article-cat-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}

[data-theme="light"] .article-cat-label::before { background: var(--gold-dark); }

/* Hero title — terang di dark, gelap di light */
.article-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

[data-theme="light"] .article-hero-title { color: #1C1510; }

/* Hero meta */
.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.meta-chip i { color: var(--gold); font-size: 11px; }

[data-theme="light"] .meta-chip i { color: var(--gold-dark); }

.meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-gold);
}

/* Entry animation */
.hero-entry {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.8s var(--ease-expo) forwards;
}

@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }


/* ════════════════════════════════════════════════════════════
   2. READING PROGRESS BAR
   ════════════════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 2000;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--gold-dark), var(--gold), var(--gold-light));
  transition: width 0.1s linear;
}

@media (max-width: 991.98px) {
  .reading-progress { left: 0; top: var(--topbar-h); }
}


/* ════════════════════════════════════════════════════════════
   3. ARTICLE LAYOUT
   Dark: --bg-card | Light: --bg-deep (#F5F1EA)
   ════════════════════════════════════════════════════════════ */

.article-layout {
  background: var(--bg-card);
  padding: 64px 0 80px;
  transition: var(--transition-theme);
}

[data-theme="light"] .article-layout { background: var(--bg-deep); }


/* ════════════════════════════════════════════════════════════
   4. ARTICLE BODY CONTENT
   ════════════════════════════════════════════════════════════ */

.article-content {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 2;
  max-width: 720px;
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 48px 0 18px;
  line-height: 1.25;
  transition: color 0.3s ease;
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--text-primary);
  margin: 36px 0 14px;
  transition: color 0.3s ease;
}

.article-content p { margin-bottom: 22px; }

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content em {
  font-style: italic;
  color: var(--gold-light);
}

[data-theme="light"] .article-content em { color: var(--gold-dark); }

/* Lists */
.article-content ul,
.article-content ol {
  padding-left: 0;
  margin-bottom: 22px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-content ul li,
.article-content ol li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
}

.article-content ul li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 10px;
}

[data-theme="light"] .article-content ul li::before { background: var(--gold-dark); }

.article-content ol { counter-reset: ol-counter; }

.article-content ol li::before {
  counter-increment: ol-counter;
  content: counter(ol-counter);
  font-family: var(--font-alt);
  font-size: 16px;
  color: var(--gold);
  min-width: 24px;
  flex-shrink: 0;
  line-height: 1.6;
}

[data-theme="light"] .article-content ol li::before { color: var(--gold-dark); }

/* Blockquote */
.article-content blockquote {
  margin: 36px 0;
  padding: 28px 32px;
  border-left: 3px solid var(--gold);
  background: linear-gradient(to right, var(--gold-pale), transparent);
  border-radius: 0 var(--r) var(--r) 0;
  position: relative;
  transition: background 0.3s ease;
}

[data-theme="light"] .article-content blockquote {
  border-left-color: var(--gold-dark);
  background: linear-gradient(to right, var(--gold-pale-md), transparent);
}

.article-content blockquote::before {
  content: '"';
  font-family: var(--font-display);
  font-size: 80px;
  color: var(--border-gold);
  position: absolute;
  top: -10px;
  left: 20px;
  line-height: 1;
  transition: color 0.3s ease;
}

.article-content blockquote p {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

/* Image in article */
.article-content .article-img {
  width: 100%;
  border-radius: var(--r);
  overflow: hidden;
  margin: 32px 0;
  position: relative;
}

.article-content .article-img img {
  width: 100%;
  display: block;
  border-radius: var(--r);
  filter: grayscale(10%);
}

.article-content .article-img figcaption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 0;
  letter-spacing: 1px;
  font-style: italic;
}

/* Divider */
.article-content .content-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0;
}

.article-content .content-divider::before,
.article-content .content-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.article-content .content-divider span {
  color: var(--gold);
  font-size: 14px;
  opacity: 0.5;
}

/* Key takeaway box */
.takeaway-box {
  background: var(--bg-input);
  border: 1px solid var(--border-gold);
  border-radius: var(--r);
  padding: 28px 32px;
  margin: 36px 0;
  transition: var(--transition-theme);
}

[data-theme="light"] .takeaway-box {
  background: var(--bg-page);
  border-color: var(--border-nav);
}

.takeaway-box-label {
  font-family: var(--font-alt);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="light"] .takeaway-box-label { color: var(--gold-dark); }

.takeaway-box-label i { font-size: 16px; }

.takeaway-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.takeaway-box ul li {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  align-items: flex-start;
}

.takeaway-box ul li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

[data-theme="light"] .takeaway-box ul li::before { color: var(--gold-dark); }

/* Tags */
.article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.tag-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tag-pill {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border-gold);
  border-radius: 40px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.tag-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-pale);
}

[data-theme="light"] .tag-pill { border-color: var(--border-nav); }

[data-theme="light"] .tag-pill:hover {
  border-color: var(--gold-dark);
  color: var(--gold-dark);
  background: var(--gold-pale-md);
}

/* Share bar (bottom) */
.share-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.share-bar-label {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.share-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.22s;
  text-decoration: none;
}

.share-icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-pale);
}

.share-icon-btn.wa:hover { border-color:#25D366; color:#25D366; background:rgba(37,211,102,0.06); }
.share-icon-btn.tw:hover { border-color:#1DA1F2; color:#1DA1F2; background:rgba(29,161,242,0.06); }
.share-icon-btn.fb:hover { border-color:#1877F2; color:#1877F2; background:rgba(24,119,242,0.06); }
.share-icon-btn.li:hover { border-color:#0A66C2; color:#0A66C2; background:rgba(10,102,194,0.06); }

/* Author card */
.author-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  padding: 24px;
  margin-top: 40px;
  transition: var(--transition-theme);
}

[data-theme="light"] .author-card { background: var(--bg-page); }

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-input), var(--gold-pale-md));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition-theme);
}

.author-name {
  font-family: var(--font-alt);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.author-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

[data-theme="light"] .author-title { color: var(--gold-dark); }

.author-bio {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}


/* ════════════════════════════════════════════════════════════
   5. SIDEBAR
   ════════════════════════════════════════════════════════════ */

.article-sidebar { position: sticky; top: 24px; }

.sidebar-widget {
  background: var(--bg-card-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition-theme);
}

[data-theme="light"] .sidebar-widget { background: var(--bg-page); }

.widget-title {
  font-family: var(--font-alt);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="light"] .widget-title { color: var(--gold-dark); }

.widget-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Table of Contents */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-item a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: all 0.18s;
  border-left: 2px solid transparent;
  line-height: 1.5;
}

.toc-item a:hover,
.toc-item.active a {
  color: var(--gold);
  background: var(--gold-pale);
  border-left-color: var(--gold);
}

[data-theme="light"] .toc-item a:hover,
[data-theme="light"] .toc-item.active a {
  color: var(--gold-dark);
  background: var(--gold-pale-md);
  border-left-color: var(--gold-dark);
}

.toc-item a span {
  font-family: var(--font-alt);
  font-size: 11px;
  color: var(--border-gold);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Share sidebar */
.sidebar-share-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-share-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.sidebar-share-btn i { font-size: 15px; }

.sidebar-share-btn.wa { --c: #25D366; }
.sidebar-share-btn.tw { --c: #1DA1F2; }
.sidebar-share-btn.fb { --c: #1877F2; }
.sidebar-share-btn.li { --c: #0A66C2; }
.sidebar-share-btn.copy-link-btn { --c: var(--gold); }

.sidebar-share-btn:hover {
  border-color: var(--c, var(--gold));
  color: var(--c, var(--gold));
  background: var(--gold-pale);
}

[data-theme="light"] .sidebar-share-btn:hover { background: var(--gold-pale-md); }

/* Related articles */
.related-article-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.18s;
}

.related-article-item:last-child { border-bottom: none; padding-bottom: 0; }

.related-article-item:hover .related-title { color: var(--gold); }

[data-theme="light"] .related-article-item:hover .related-title { color: var(--gold-dark); }

.related-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.3s;
}

.related-article-item:hover .related-thumb img { filter: grayscale(0%); }

.related-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.18s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}

.related-date {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}


/* ════════════════════════════════════════════════════════════
   6. ARTICLE NAV (prev/next)
   ════════════════════════════════════════════════════════════ */

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}

.article-nav-link {
  background: var(--bg-card-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  padding: 20px 22px;
  text-decoration: none;
  transition: all 0.28s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="light"] .article-nav-link { background: var(--bg-page); }

.article-nav-link:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

[data-theme="light"] .article-nav-link:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.nav-direction {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-direction i { color: var(--gold); }

[data-theme="light"] .nav-direction i { color: var(--gold-dark); }

.nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.article-nav-link.next { text-align: right; }
.article-nav-link.next .nav-direction { justify-content: flex-end; }


/* ════════════════════════════════════════════════════════════
   7. RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
  .article-hero-content { padding: 0 32px 48px; }
  .article-sidebar      { position: static; }
  .article-nav          { grid-template-columns: 1fr; }
  .article-nav-link:hover { transform: none; box-shadow: none; }
}

@media (max-width: 575.98px) {
  .article-hero-content { padding: 0 20px 36px; }
  .article-content      { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-entry        { opacity: 1; transform: none; animation: none; transition: none; }
  .article-hero-bg   { transition: filter 0.3s ease; }
}