/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* --- DEFAULT: DARK MODE --- */
  --bg-color: #0f1115;       
  --card-bg: #161b22;        
  --paper-bg: #1c212c;       
  --text-primary: #e6edf3;   
  --text-secondary: #8b949e; 
  --accent: #d2a36d;         
  --nav-height: 70px;

  /* VARIABLE BARU UNTUK NAVBAR & INPUT */
  --nav-bg: rgba(15, 17, 21, 0.95);
  --border-color: rgba(255,255,255,0.05);
  --input-bg: #0d1117;
}

/* --- MODE TERANG (LIGHT) --- */
[data-theme="light"] {
  --bg-color: #ffffff;
  --card-bg: #f3f4f6;
  --paper-bg: #fffdf5;
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --accent: #b08855;
  
  --nav-bg: rgba(255, 255, 255, 0.95); /* Navbar Putih Transparan */
  --border-color: rgba(0,0,0,0.1);
  --input-bg: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* TRANSISI HALUS (Global) */
body, .navbar, .article-card, .btn, input, textarea, .paper-container, .share-btn, .meta-item, svg, path, .nav-links {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, fill 0.5s ease;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color); /* Variable */
  color: var(--text-primary);        /* Variable */
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, blockquote, .chapter-mark { font-family: 'Merriweather', serif; }

.container {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
}

/* =========================================
   2. NAVBAR (PERBAIKAN UTAMA DISINI)
   ========================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%; height: var(--nav-height);
  
  /* GANTI KE VARIABLE BIAR BISA BERUBAH WARNA */
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  
  backdrop-filter: blur(12px);
  z-index: 9999; /* Z-INDEX TINGGI BIAR BISA DIKLIK */
  display: flex; align-items: center;
}

.nav-container {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px;
  position: relative;
}

.logo {
  font-family: 'Merriweather', serif; font-weight: 900;
  color: var(--text-primary); /* Variable */
  text-decoration: none; font-size: 1.5rem; letter-spacing: 1px;
  z-index: 1002;
}

/* Nav Desktop */
.nav-links { list-style: none; display: flex; gap: 30px; align-items: center; }

.nav-link {
  text-decoration: none; 
  color: var(--text-secondary); /* Variable */
  font-size: 0.9rem;
  font-weight: 500; transition: 0.3s; position: relative;
  display: flex; align-items: center; gap: 5px; 
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: -5px; left: 0;
  width: 100%; height: 1px; background: var(--accent);
}

.btn-nav {
  border: 1px solid var(--accent); padding: 8px 16px; border-radius: 4px; color: var(--accent) !important;
}
.btn-nav.active::after { display: none; }
.btn-nav:hover { background: var(--accent); color: var(--bg-color) !important; }

/* Hamburger Icon */
.hamburger {
  display: none; cursor: pointer; flex-direction: column; gap: 5px;
  z-index: 1002;
}
.hamburger .bar {
  display: block; width: 25px; height: 3px; 
  background-color: var(--text-primary); /* Variable */
  border-radius: 3px; transition: 0.3s; 
}

/* Tombol Tema */
.theme-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: 0.3s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }


/* =========================================
   3. HERO SECTION (Code Lama, Cuma Ganti Warna ke Variable)
   ========================================= */
.hero-section { min-height: 100vh; display: flex; align-items: center; padding-top: var(--nav-height); }
.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.hero-text h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 10px; color: var(--text-primary); }
.hero-text h2 { font-size: 1.3rem; color: var(--accent); font-weight: 300; font-style: italic; margin-bottom: 20px; }
.hero-text p { color: var(--text-secondary); margin-bottom: 40px; max-width: 500px; text-align: justify; }

.hero-image img {
  width: 100%; max-width: 320px; border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6); display: block; margin: 0 auto;
  transform: rotate(-3deg); transition: 0.5s ease;
}
.hero-image img:hover { transform: rotate(0) scale(1.02); }

/* Genre Badges */
.genre-wrapper { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; }
.genre-badge {
  font-family: 'Inter', sans-serif; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 1px; padding: 6px 14px;
  border: 1px solid var(--border-color); color: var(--accent);
  border-radius: 50px; background: var(--card-bg); /* Variable */
  font-weight: 600; cursor: default;
}
.genre-badge:hover { background: var(--accent); color: var(--bg-color); }

/* =========================================
   4. INFO BAR
   ========================================= */
.book-info-bar {
  background-color: var(--card-bg); /* Variable */
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color); 
  padding: 30px 0; margin-top: -1px;
}
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.info-item { display: flex; flex-direction: column; gap: 5px; position: relative; }
.info-item:not(:last-child)::after {
  content: ''; position: absolute; right: -10px; top: 10%; height: 80%; width: 1px; background: var(--border-color);
}
.info-label { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.info-value { font-family: 'Merriweather', serif; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

/* =========================================
   5. BUTTONS & UI
   ========================================= */
.btn {
  display: inline-block; padding: 12px 28px; text-decoration: none; border-radius: 50px;
  font-weight: 600; font-size: 0.95rem; transition: all 0.3s ease; border: 1px solid transparent; text-align: center;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.btn-primary { background: var(--accent); color: var(--bg-color); }
.btn-outline { border-color: var(--text-secondary); color: var(--text-secondary); margin-left: 10px; }
.btn-outline:hover { border-color: var(--text-primary); color: var(--text-primary); background: transparent; }

.cta-group { display: flex; align-items: center; }
.links-grid { display: flex; justify-content: center; gap: 15px; margin-top: 40px; flex-wrap: wrap; }
.btn-wa { background: #25D366; color: #fff; }
.btn-shopee { background: #EE4D2D; color: #fff; }
.btn-playstore { background: #00875f; color: #fff; }
.btn-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: white; }

/* =========================================
   6. SECTIONS CONTENT
   ========================================= */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h3 { font-size: 2rem; margin-bottom: 10px; color: var(--text-primary); }
.about-section { background: var(--card-bg); text-align: center; } /* Variable */
.quote-box {
  font-size: 1.4rem; font-style: italic; max-width: 800px; margin: 0 auto;
  border-left: 3px solid var(--accent); padding-left: 30px; color: var(--text-primary);
}

/* Prolog */
.prolog-section { background: var(--bg-color); }
.paper-container {
  background: var(--paper-bg); /* Variable */
  padding: 60px 40px; border-radius: 4px;
  max-width: 800px; margin: 0 auto; position: relative;
  border: 1px solid var(--border-color); 
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.chapter-mark { display: block; text-align: center; color: var(--accent); letter-spacing: 3px; font-weight: bold; margin-bottom: 30px; font-size: 0.9rem; }
.paper-content p { font-family: 'Merriweather', serif; font-size: 1.1rem; color: var(--text-primary); margin-bottom: 20px; line-height: 1.9; text-align: justify; }
.paper-content p:first-of-type::first-letter { font-size: 3.5rem; float: left; margin-top: -5px; margin-right: 10px; color: var(--accent); font-weight: 700; line-height: 1; }
.ornament { text-align: center; color: var(--accent); font-size: 1.5rem; margin-top: 30px; opacity: 0.7; }

/* Media */
.gallery-grid, .video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.photo img { width: 100%; height: 300px; object-fit: cover; border-radius: 8px; opacity: 0.7; transition: 0.4s; }
.photo img:hover { opacity: 1; transform: scale(1.02); }
.video-wrapper video { width: 100%; border-radius: 8px; }

.cta-section { text-align: center; border-top: 1px solid var(--border-color); }
footer { text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 0.85rem; border-top: 1px solid var(--border-color); }

/* =========================================
   7. MOBILE RESPONSIVE FIX
   ========================================= */

/* TABLET (Max 1024px) */
@media (max-width: 1024px) {
  .hero-text h1 { font-size: 3rem; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .info-item:not(:last-child)::after { display: none; }
  .gallery-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
}

/* MOBILE (HP - Max 768px) */
@media (max-width: 768px) {
  
  /* Navbar Mobile */
  .hamburger { display: flex; z-index: 1002; }
  
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 75%; height: 100vh;
    background: var(--bg-color); /* Variable */
    flex-direction: column; justify-content: center; align-items: center;
    transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.8); z-index: 1001; padding-top: 60px;
    border-left: 1px solid var(--border-color);
  }
  
  .nav-links.active { right: 0; } 
  
  .nav-links li { margin: 25px 0; }
  .nav-link { font-size: 1.2rem; }

  .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); background: var(--accent); }
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: var(--accent); }

  .hero-section { padding-top: 110px; text-align: center; display: block; height: auto; padding-bottom: 60px; }
  .hero-content { grid-template-columns: 1fr; gap: 40px; display: flex; flex-direction: column; }
  .hero-image { order: 1; } 
  .hero-text { order: 2; }
  .hero-text h1 { font-size: 2.5rem; }
  .hero-image img { max-width: 240px; transform: rotate(0); margin-bottom: 20px;}
  .genre-wrapper { justify-content: center; }
  
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .paper-container { padding: 40px 20px; }
  .paper-content p { font-size: 1rem; text-align: left; }
  .gallery-grid, .video-grid { grid-template-columns: 1fr; }
  .cta-group { display: flex; flex-direction: column; gap: 15px; width: 100%; }
  .btn { width: 100%; } 
  .btn-outline { margin-left: 0; }
}

/* --- CSS UNTUK BAGIAN KARTU ARTIKEL (HOMEPAGE) --- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.article-card {
  background-color: var(--card-bg); /* Variable */
  border: 1px solid var(--border-color); /* Variable */
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  border-color: #555;
}

.card-image {
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-color); /* Variable */
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .card-image img {
  transform: scale(1.05); 
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-date {
  font-size: 0.85rem;
  color: var(--text-secondary); /* Variable */
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'Inter', sans-serif;
}

.article-card h4 {
  font-family: 'Merriweather', serif;
  font-size: 1.25rem;
  color: var(--text-primary); /* Variable */
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-card p {
  font-size: 0.95rem;
  color: var(--text-secondary); /* Variable */
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- HALAMAN BACA ARTIKEL (Detail Page) --- */

.read-section {
  padding-top: 100px; 
  padding-bottom: 5rem;
  background-color: var(--bg-color); /* Variable */
  min-height: 100vh;
}

.read-container {
  max-width: 720px; 
  margin: 0 auto;
  padding: 0 1.5rem;
}

.read-header {
  text-align: center;
  margin-bottom: 2rem;
}

.meta-info {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.meta-tag {
  color: var(--text-primary); /* Variable */
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
}

.meta-divider {
  margin: 0 5px;
  color: var(--border-color);
}

.read-title {
  font-family: 'Merriweather', serif;
  font-size: 2.5rem;
  color: var(--text-primary); /* Variable */
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* --- GAMBAR SISIPAN DI TENGAH TEKS (PENTING!) --- */
.sisipan-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 30px 0;
}
.img-sisipan {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
/* ------------------------------------------------ */

/* GAMBAR UTAMA */
.read-image {
  margin: 2.5rem auto 3.5rem auto;
  text-align: center;
  max-width: 80%;
}

.read-image img {
  max-width: 100%;
  max-height: 450px;
  width: auto; height: auto;
  display: block; margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
  object-fit: contain;
}

@media (max-width: 768px) {
  .read-image img { max-height: 300px; }
  .read-title { font-size: 1.8rem; }
  
  .meta-divider { display: none; }
  .meta-info { gap: 8px; }
  .meta-item { background: var(--card-bg); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-color); font-size: 0.8rem; }
  .meta-tag { border: none; padding: 0; }
}

/* Typography Isi Artikel */
.read-content p {
  font-family: 'Merriweather', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary); /* Variable */
  margin-bottom: 1.5rem;
}

.read-content h3 {
  color: var(--text-primary); font-family: 'Inter', sans-serif; font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem;
}

.read-content blockquote {
  border-left: 4px solid var(--text-primary); padding-left: 1.5rem; margin: 2rem 0;
  font-size: 1.2rem; font-style: italic; color: var(--text-primary); font-family: 'Merriweather', serif;
}

.read-footer {
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-color); text-align: center;
}

.btn-back {
  color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: color 0.3s;
}
.btn-back:hover { color: var(--text-primary); }

/* --- TOMBOL BACA PREMIUM --- */
.card-footer {
  margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border-color); 
}

.btn-read-premium {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background-color: transparent;
  border: 1px solid var(--border-color); border-radius: 50px; 
  color: var(--text-primary); text-decoration: none; font-family: 'Inter', sans-serif;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.5px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.btn-read-premium:hover {
  background-color: var(--text-primary); color: var(--bg-color); border-color: var(--text-primary);
  transform: translateY(-3px); box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15); 
}

.icon-arrow { font-size: 1.2rem; transition: transform 0.3s ease; }
.btn-read-premium:hover .icon-arrow { transform: translateX(5px); }

/* META AUTHOR & DIVIDER */
.meta-divider { margin: 0 10px; color: var(--border-color); }
.meta-author { color: var(--accent); font-weight: 600; font-style: normal; }

/* WADAH TOMBOL LIKE */
.like-wrapper {
  text-align: center; margin: 3rem 0; padding: 2rem 0;
  border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}

.like-text {
  font-family: 'Merriweather', serif; font-style: italic; color: var(--text-secondary); margin-bottom: 15px; font-size: 0.9rem;
}

/* TOMBOL NAVIGASI BALIK */
.btn-back-nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 24px;
  background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 50px;
  color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-back-nav:hover {
  background: var(--accent); border-color: var(--accent); color: var(--bg-color);
  transform: translateX(-5px); box-shadow: 0 0 15px rgba(210, 163, 109, 0.2);
}

/* IKON SVG */
.icon-svg { width: 16px; height: 16px; fill: currentColor; }

/* KOTAK PENCARIAN (SEARCH BAR) */
.search-wrapper {
  max-width: 500px; margin: 0 auto 40px auto; position: relative;
}

#searchInput {
  width: 100%; padding: 15px 50px 15px 25px; background-color: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: 50px; color: var(--text-primary);
  font-family: 'Inter', sans-serif; font-size: 1rem; outline: none; transition: all 0.3s ease;
}

#searchInput:focus { border-color: var(--accent); box-shadow: 0 0 15px rgba(210, 163, 109, 0.2); }

.search-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.2rem; opacity: 0.5; pointer-events: none; color: var(--text-secondary);
}

/* MENU SHARE */
.share-area { text-align: center; margin: 20px 0 60px 0; }
.share-title { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.share-buttons { display: flex; justify-content: center; gap: 15px; }
.share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-secondary);
  transition: all 0.3s ease; cursor: pointer; text-decoration: none;
}
.share-btn svg { width: 22px; height: 22px; }
.share-btn:hover {
  transform: translateY(-5px); border-color: var(--accent); color: var(--accent);
  box-shadow: 0 5px 15px rgba(210, 163, 109, 0.2);
}
button.share-btn { outline: none; }
#copy-alert { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--accent); opacity: 0; transition: opacity 0.3s ease; }

/* KOLOM KOMENTAR */
.comment-section { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.comment-section h3 { font-family: 'Merriweather', serif; color: var(--text-primary); margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 15px; margin-bottom: 40px; }
.comment-form input, .comment-form textarea {
  background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary); padding: 12px;
  border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 0.95rem; width: 100%; box-sizing: border-box;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); }
#btnSend {
  background: var(--accent); color: var(--bg-color); border: none; padding: 10px 25px;
  border-radius: 50px; font-weight: 600; cursor: pointer; align-self: flex-start; transition: 0.3s;
}
#btnSend:hover { background: var(--accent-hover); }
#btnSend:disabled { background: var(--text-secondary); cursor: not-allowed; }

.comment-item {
  background: var(--card-bg); border: 1px solid var(--border-color); padding: 15px;
  border-radius: 8px; margin-bottom: 15px; animation: fadeIn 0.5s ease;
}
.comment-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.comment-name { color: var(--accent); font-weight: bold; }
.comment-body { color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }
.loading-text { color: var(--text-secondary); font-style: italic; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- TAMBAHAN: BIAR NAVIGASI AKTIF GARISNYA DIAM --- */
.nav-link.active {
  color: var(--accent) !important; /* Warna Teks jadi Emas */
}

.nav-link.active::after {
  width: 100% !important; /* Garis bawah tetap lebar penuh */
}
