/* -----------------------------------------------------------------
   1. RESET & GLOBAL STYLE
   ----------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css");


html,
body {
  height: 100% !important;
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  color: #333;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  overflow: hidden;
  /* Mencegah scroll ganda di window utama */
}

.book,
.book-summary,
.book-body,
.markdown-section,
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section p,
.markdown-section li,
#custom-top-header,
#my-book-switcher {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
}

/* -----------------------------------------------------------------
   2. CUSTOM HEADER (FIXED TOP - WHITE)
   ----------------------------------------------------------------- */
#custom-top-header {
  /* Layout: Flexbox untuk Logo Kiri & Search Kanan */
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;

  /* Posisi: Melayang Tetap di Atas */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 70px !important;
  /* Tinggi Header Tetap */
  z-index: 10000 !important;
  /* Layer Paling Atas */

  /* Tampilan Visual */
  background-color: #ffffff !important;
  border-bottom: 1px solid #eaeaea !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  padding: 0 40px !important;
  /* Jarak Kiri-Kanan Header */
  box-sizing: border-box !important;
}

/* --- BAGIAN KIRI: LOGO --- */
.header-left {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  flex-shrink: 0 !important;
}

.header-logo {
  max-height: 40px !important;
  /* Batasi tinggi logo */
  width: auto !important;
  display: block !important;
}

.header-title {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #111 !important;
  letter-spacing: -0.5px !important;
  white-space: nowrap !important;
}

/* --- BAGIAN KANAN: SEARCH BAR --- */
.header-right {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
  /* Dorong Search ke Kanan Mentok */
}

.search-wrapper {
  display: flex !important;
  align-items: center !important;
  background: #f3f4f6 !important;
  /* Abu muda modern */
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  /* Sudut agak kotak modern */
  padding: 8px 16px !important;
  width: 100% !important;
  max-width: 280px !important;
  height: 38px !important;
  transition: all 0.2s ease;
}

.search-wrapper:focus-within {
  background: #fff !important;
  border-color: #3b82f6 !important;
  /* Biru saat aktif */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.search-wrapper i {
  color: #9ca3af !important;
  margin-right: 10px !important;
  font-size: 14px !important;
}

.search-wrapper input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-size: 14px !important;
  width: 100% !important;
  color: #374151 !important;
}

/* Badge Ctrl+K */
.kbd-badge {
  display: none !important;
  /* Opsional: Tampilkan jika ingin ada badge */
}

#book-search-input {
  display: none !important;
}

/* -----------------------------------------------------------------
   3. SIDEBAR (FIXED LEFT)
   ----------------------------------------------------------------- */
.book-summary {
  position: fixed !important;
  top: 80px !important;
  /* Turunkan sejauh tinggi Header */
  left: 0 !important;
  bottom: 0 !important;
  width: 280px !important;
  /* Lebar Sidebar */
  background: #fafbfc !important;
  /* Subtle background */
  border-right: 1px solid #d0d7de !important;
  overflow-y: auto !important;
  z-index: 900 !important;
  box-shadow: none !important;
  padding-bottom: 40px !important;
}

/* Sembunyikan "Published with HonKit" dan divider di atasnya */
.book-summary ul.summary li:has(.gitbook-link),
.book-summary ul.summary li:has(+ li > .gitbook-link) {
  display: none !important;
}

/* --- SCROLLBAR HANYA SAAT HOVER (Tambahkan bagian baru ini) --- */
/* 1. Sembunyikan Scrollbar secara default untuk Webkit (Chrome, Safari) */
.book-summary::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

/* 2. Sembunyikan Scrollbar secara default untuk Firefox */
.book-summary {
  scrollbar-width: none !important;
  /* Firefox */
}

/* 3. Tampilkan Scrollbar saat Hover (Webkit) */
.book-summary:hover::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

.book-summary:hover::-webkit-scrollbar-thumb {
  background: #d0d7de !important;
  border-radius: 6px !important;
}

.book-summary:hover::-webkit-scrollbar-track {
  background: transparent !important;
}

/* Dropdown di Sidebar */
.custom-sidebar-header {
  padding: 20px;
  background: #fafbfc;
  position: relative;
  border-bottom: 1px solid #d0d7de;
}

/* Sidebar Summary Wrapper */
.book-summary ul.summary {
  padding: 0 12px !important;
  margin: 0 !important;
  list-style: none !important;
}


/* Modifikasi pada container untuk menempatkan ikon */
.custom-sidebar-header.dropdown-wrapper {
  position: relative;
  /* KUNCI: Untuk penempatan ikon absolut */
}

#my-book-switcher {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #424c55 !important;
  background: #ffffff !important;
  border: 1px solid #d0d7de !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  width: 100% !important;
  box-sizing: border-box !important;

  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;

  padding-right: 32px !important;
  transition: all 0.2s ease !important;
}

#my-book-switcher:hover {
  border-color: #424c55 !important;
  background-color: #f6f8fb !important;
}

#my-book-switcher:focus {
  outline: none !important;
  border-color: #1e40af !important;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1) !important;
}

/* --- Gaya untuk Ikon Chevron Kustom (Baru) --- */
.custom-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);

  color: #8b949e !important;
  pointer-events: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

/* Rapikan List Menu */
.book-summary ul.summary li a {
  padding: 10px 20px !important;
  color: #424c55 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  white-space: normal !important;
  line-height: 1.5 !important;
  height: auto !important;
  border-radius: 6px !important;
  margin: 4px 8px !important;
  transition: all 0.2s ease !important;
}

.book-summary ul.summary li a:hover {
  background-color: #eaeef2 !important;
  color: #1f2937 !important;
}

.book-summary ul.summary li.active>a {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  font-weight: 600 !important;
}

.book-summary ul.summary li.header {
  padding: 24px 20px 12px 20px !important;
  color: #57606a !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
}

.book-summary h2 {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #8b949e !important;
  margin: 24px 20px 8px 20px !important;
  padding: 0 !important;
}

/* =========================================================
   SIDEBAR DROPDOWN – CLEAN VERSION (STABLE)
   ========================================================= */

/* Parent chapter */
.book-summary ul.summary>li.chapter {
  position: relative;
  margin: 0 !important;
}

.book-summary ul.summary>li.divider {
  height: 1px !important;
  background: #d0d7de !important;
  margin: 12px 20px !important;
  border: none !important;
}

/* Tambah ruang untuk chevron - HANYA untuk chapter dengan children */
.book-summary ul.summary>li.chapter:has(> ul)>a {
  position: relative;
  padding-right: 36px !important;
}

/* Chapter tanpa children - padding normal */
.book-summary ul.summary>li.chapter:not(:has(> ul))>a {
  position: relative;
  padding-right: 20px !important;
}

/* Chevron - HANYA untuk chapter dengan children */
.book-summary ul.summary>li.chapter:has(> ul)>a::after {
  content: "›";
  font-size: 18px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  color: #8b949e;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.book-summary ul.summary>li.chapter:has(> ul)>a:hover::after {
  color: #424c55;
}

/* Rotate saat open */
.book-summary ul.summary>li.chapter:has(> ul).open>a::after {
  transform: translateY(-50%) rotate(90deg);
  color: #424c55;
}

/* Child hidden default - HANYA untuk chapter dengan children */
.book-summary ul.summary>li.chapter:has(> ul)>ul {
  display: none;
  margin: 0 !important;
  padding: 4px 0 4px 0 !important;
  margin-left: 28px !important;
  border-left: 2px solid #d0d7de !important;
  animation: slideDown 0.3s ease-out;
}

/* Show if open - HANYA untuk chapter dengan children */
.book-summary ul.summary>li.chapter:has(> ul).open>ul {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* AUTO OPEN jika ada active child */
.book-summary ul.summary>li.chapter>ul li.active {
  position: relative;
}

.book-summary ul.summary>li.chapter>ul li.active>a {
  color: #1e40af !important;
  background-color: #dbeafe !important;
  font-weight: 600 !important;
}

/* Garis biru vertikal di item aktif (menimpa border-left abu) */
.book-summary ul.summary>li.chapter>ul li.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #2563eb;
  border-radius: 0;
}

/* Styling untuk sub-items (articles) */
.book-summary ul.summary>li.chapter ul li a {
  padding: 8px 16px 8px 20px !important;
  font-size: 13px !important;
  color: #57606a !important;
  margin: 2px 4px !important;
}

.book-summary ul.summary>li.chapter ul li a:hover {
  background-color: #eaeef2 !important;
  color: #1f2937 !important;
}


/* =========================================================
   SIDEBAR ICON (FONT AWESOME)
   ========================================================= */

/* Base icon */
.book-summary ul.summary li.chapter>a::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #8b949e;
  transition: color 0.2s ease;
}

/* ACTIVE */
.book-summary ul.summary li.active>a::before {
  color: #1e40af;
}

/* HOVER */
.book-summary ul.summary li a:hover::before {
  color: #424c55;
}

/* Header section icon */
.book-summary ul.summary li.header i {
  margin-right: 8px;
  font-size: 14px;
  color: #111827;
}

/* =========================================================
   ICON MAPPING – FULL SUMMARY (BY HREF)
   ========================================================= */

/* README / HOME */
.book-summary ul.summary li.chapter[data-level="1.1"] > a::before {
  content: "\f015"; /* fa-house */
}

/* 1. DATA WARGA */
.book-summary li.chapter[data-level="2.1"] > a::before { content: "\f0fe"; /* fa-plus-square */ }
.book-summary li.chapter[data-level="2.2"] > a::before { content: "\f234"; /* fa-user-plus */ }
.book-summary li.chapter[data-level="2.3"] > a::before { content: "\f56f"; /* fa-file-import */ }
.book-summary li.chapter[data-level="2.4"] > a::before { content: "\f3cd"; /* fa-mobile-screen */ }

/* 2. HUNIAN IURAN */
.book-summary li.chapter[data-level="3.1"] > a::before { content: "\f013"; /* fa-gear/settings */ }
.book-summary li.chapter[data-level="3.2"] > a::before { content: "\f1de"; /* fa-sliders */ }
.book-summary li.chapter[data-level="3.3"] > a::before { content: "\f56f"; /* fa-file-import */ }

/* 3. GARIS PERSETUJUAN */
.book-summary li.chapter[data-level="4.1"] > a::before { content: "\f560"; /* fa-check-double */ }

/* 4. REKENING RT */
.book-summary li.chapter[data-level="5.1"] > a::before { content: "\f19c"; /* fa-building-columns */ }

/* 5. PENERIMAAN DANA */
.book-summary li.chapter[data-level="6.1"] > a::before { content: "\f3cd"; /* fa-mobile */ }
.book-summary li.chapter[data-level="6.2"] > a::before { content: "\f53a"; /* fa-money-bill-wave */ }
.book-summary li.chapter[data-level="6.3"] > a::before { content: "\f4d3"; /* fa-piggy-bank */ }

/* 6. PENGELUARAN OPERASIONAL RT */
.book-summary li.chapter[data-level="7.1"] > a::before { content: "\f53d"; /* fa-money-check-dollar */ }

/* 7. TRANSFER KAS */
.book-summary li.chapter[data-level="8.1"] > a::before { content: "\f029"; /* fa-qrcode */ }
.book-summary li.chapter[data-level="8.2"] > a::before { content: "\e528"; /* fa-money-bill-transfer */ }

/* 8. LAPORAN RT */
.book-summary li.chapter[data-level="9.1"] > a::before { content: "\f571"; /* fa-file-invoice-dollar */ }
.book-summary li.chapter[data-level="9.2"] > a::before { content: "\f201"; /* fa-chart-line */ }

/* 9. DASHBOARD MOBILE */
.book-summary li.chapter[data-level="10.1"] > a::before { content: "\f108"; /* fa-desktop */ }
.book-summary li.chapter[data-level="10.2"] > a::before { content: "\f672"; /* fa-check-to-slot */ }

/* 10. RESET PASSWORD WARGA */
.book-summary li.chapter[data-level="11.1"] > a::before { content: "\f084"; /* fa-key */ }


/* =========================================================
   PAGE TITLE ICON (H1 AUTO)
   ========================================================= */

.markdown-section h1::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 14px;
  color: #6b7280;
  display: inline-block;
}

/* HOME */
.markdown-section h1#selamat-datang-di-rt-online::before { content: "\f015"; }

/* DATA WARGA */
.markdown-section h1#tambah-hunian-dan-blok::before { content: "\f0fe"; }
.markdown-section h1#penambahan-warga-pada-hunian-di-at-online::before { content: "\f234"; }
.markdown-section h1#import-data-warga-secara-massal-melalui-excel::before { content: "\f56f"; }
.markdown-section h1#memberikan-akses-warga-ke-aplikasi-rt-online::before,
.markdown-section h1#memberikan-akses-login-warga-ke-mobile-apps::before { content: "\f3cd"; }

/* HUNIAN IURAN */
.markdown-section h1#mengatur-master-iuran::before { content: "\f013"; }
.markdown-section h1#mengatur-rincian-iuran-pada-hunian::before { content: "\f1de"; }
.markdown-section h1#bulk-import-iuran-hunian::before { content: "\f56f"; }

/* GARIS PERSETUJUAN */
.markdown-section h1#atur-garis-persetujuan::before { content: "\f560"; }

/* REKENING RT */
.markdown-section h1#atur-rekening-rt-untuk-pengelolaan-dana::before { content: "\f19c"; }

/* PENERIMAAN DANA */
.markdown-section h1#bayar-iuran-otomatis-dari-mobile-apps::before { content: "\f3cd"; }
.markdown-section h1#penerimaan-iuran-manual::before { content: "\f53a"; }
.markdown-section h1#penerimaan-lain-lain-rt::before { content: "\f4d3"; }

/* PENGELUARAN OPERASIONAL */
.markdown-section h1#pengeluaran-operasional-rt::before { content: "\f53d"; }

/* TRANSFER KAS */
.markdown-section h1#tarik-saldo-qris-rt::before { content: "\f029"; }
.markdown-section h1#pindah-saldo-rekening-rt::before { content: "\e528"; }

/* LAPORAN */
.markdown-section h1#laporan-keuangan::before { content: "\f571"; }
.markdown-section h1#laporan-iuran-warga::before { content: "\f201"; }

/* DASHBOARD MOBILE */
.markdown-section h1#melihat-data-dashboard::before { content: "\f108"; }
.markdown-section h1#saldo-kas-rt::before { content: "\f555"; }

/* RESET PASSWORD */
.markdown-section h1#memberikan-akses-untuk-reset-password-akun-warga::before { content: "\f084"; }



/* -----------------------------------------------------------------
   4. CONTENT BODY (LAYOUT PADDING BESAR)
   ----------------------------------------------------------------- */
/* Sembunyikan Header Bawaan */
.book-header {
  display: none !important;
}

/* Wadah Utama Konten */
.book-body {
  position: fixed !important;
  top: 70px !important;
  /* Tinggi Header */
  left: 280px !important;
  /* Lebar Sidebar */
  right: 0 !important;
  bottom: 0 !important;

  background: #ffffff !important;
  overflow-y: auto !important;
  /* Scroll bar konten */
  z-index: 1 !important;
  transition: left 0.3s ease !important;
}

.page-inner {
  max-width: 80%;
}

/* --- KUNCI PADDING KIRI-KANAN (SEPERTI GAMBAR 2) --- */
.page-wrapper {
  /* 1. Batasi lebar maksimal tulisan agar tidak sampai ujung layar */
  max-width: 1000px !important;

  /* 2. Taruh di tengah-tengah (Center) */
  margin: 0 auto !important;

  /* 3. Beri jarak lega di dalam container */
  padding-top: 60px !important;
  padding-bottom: 80px !important;
  padding-left: 120px !important;
  /* Padding kiri lebih lega */
  padding-right: 120px !important;
  /* Padding kanan lebih lega */
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Judul Halaman (H1) */
.markdown-section h1 {
  font-size: clamp(28px, 5vw, 36px) !important;
  font-weight: 800 !important;
  margin-bottom: 40px !important;
  color: #111827 !important;
  border-bottom: none !important;
}

.markdown-section h1 i {
  margin-right: 12px;
  font-size: 0.9em;
  color: #2563eb;
  vertical-align: middle;
}

/* Paragraf */
.markdown-section p,
.markdown-section li {
  color: #374151 !important;
  font-size: 16px !important;
}

/* Heading style seperti GitBook */

.markdown-section h1 {
  font-size: 32px !important;
  font-weight: 700 !important;
}

.markdown-section h2 {
  font-size: 24px !important;
  font-weight: 600 !important;
}

.markdown-section h3 {
  font-size: 20px !important;
  font-weight: 600 !important;
}

.markdown-section h4 {
  font-size: 18px !important;
}

.markdown-section p {
  line-height: 1.7 !important;
}

.markdown-section li {
  line-height: 1.7 !important;
}

/* .markdown-section p {
    line-height: 1.8 !important;
    color: #374151 !important;
    margin-bottom: 1.5em !important;
    font-size: clamp(14px, 2.5vw, 18px) !important;
}

.markdown-section li {
    font-size: clamp(14px, 2.5vw, 18px) !important;
    line-height: 1.8 !important;
    margin-bottom: 0.5em !important;
} */

/* -----------------------------------------------------------------
   5. RESPONSIVE (MOBILE)
   ----------------------------------------------------------------- */

/* ---------------------------------------------------------------
   HAMBURGER BUTTON (Mobile Only)
   --------------------------------------------------------------- */
#mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  margin-right: 10px;
  color: #374151;
  font-size: 20px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

#mobile-menu-toggle:hover {
  background: #f3f4f6;
}

/* ---------------------------------------------------------------
   MOBILE OVERLAY BACKDROP
   --------------------------------------------------------------- */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 850;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop Extra Large */
@media (min-width: 1500px) {
  .page-wrapper {
    max-width: 1200px !important;
    padding-left: 140px !important;
    padding-right: 140px !important;
  }

  .nav-container {
    max-width: 1200px !important;
    padding: 20px 140px 40px 140px !important;
  }
}

/* Desktop Large */
@media (min-width: 1200px) and (max-width: 1499px) {
  .page-wrapper {
    max-width: 1100px !important;
    padding-left: 120px !important;
    padding-right: 120px !important;
  }

  .nav-container {
    max-width: 1100px !important;
    padding: 20px 100px 40px 100px !important;
  }
}

@media (max-width: 1199px) {
  #custom-top-header {
    padding: 0 30px !important;
  }

  .page-wrapper {
    max-width: 900px !important;
    padding-left: 80px !important;
    padding-right: 80px !important;
  }

  .nav-container {
    max-width: 900px !important;
  }

  .header-title {
    font-size: clamp(18px, 4vw, 24px) !important;
  }
}

@media (max-width: 1000px) {
  /* Tablet landscape */
  #custom-top-header {
    padding: 0 20px !important;
    height: 60px !important;
  }

  .book-summary {
    width: 240px !important;
    top: 60px !important;
  }

  .book-body {
    left: 240px !important;
    top: 60px !important;
  }

  .page-wrapper {
    max-width: 800px !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
    padding-top: 40px !important;
  }

  .nav-container {
    max-width: 800px !important;
    padding: 20px 40px 40px 40px !important;
  }

  .search-wrapper {
    max-width: 220px !important;
  }
}

/* ---------------------------------------------------------------
   MOBILE / TABLET PORTRAIT  (≤ 768px)
   --------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Body: allow normal scroll on mobile */
  body {
    overflow: auto !important;
    overflow-x: hidden !important;
  }

  /* --- TOP HEADER: visible & compact on mobile --- */
  #custom-top-header {
    display: flex !important;
    padding: 0 12px !important;
    height: 56px !important;
    z-index: 9000 !important;
    position: fixed !important;
  }

  /* Show hamburger */
  #mobile-menu-toggle {
    display: flex !important;
  }

  /* Hide search bar on very small screens to save space */
  .search-wrapper {
    max-width: 160px !important;
  }

  /* Header title smaller */
  .header-title {
    font-size: 16px !important;
  }

  /* --- SIDEBAR: slide-in drawer from left --- */
  .book-summary {
    position: fixed !important;
    top: 56px !important;
    left: -290px !important;
    /* Hidden off-screen by default */
    width: 280px !important;
    height: calc(100% - 56px) !important;
    bottom: 0 !important;
    z-index: 900 !important;
    overflow-y: auto !important;
    transition: left 0.3s ease !important;
    box-shadow: none !important;
  }

  /* When sidebar is open */
  .book-summary.mobile-open {
    left: 0 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
  }

  /* Show overlay backdrop */
  #sidebar-overlay {
    display: block;
  }

  /* --- MAIN CONTENT BODY --- */
  .book-body {
    position: static !important;
    margin-top: 56px !important;
    /* Push below fixed header */
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(100vh - 56px) !important;
    overflow: visible !important;
    transition: none !important;
  }

  /* body-inner must be static on mobile so iframes are not blocked */
  .book-body .body-inner {
    position: static !important;
    overflow: visible !important;
  }

  /* Hide the default GitBook book-header toggle */
  .book-header {
    display: none !important;
  }

  /* Content padding */
  .page-wrapper {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 30px !important;
    padding-bottom: 60px !important;
    max-width: 100% !important;
  }

  .nav-container {
    max-width: 100% !important;
    padding: 20px 20px 40px 20px !important;
  }

  /* Images */
  .markdown-section img {
    max-height: 400px !important;
  }
}

/* ---------------------------------------------------------------
   SMALL MOBILE  (≤ 480px)
   --------------------------------------------------------------- */
@media (max-width: 480px) {

  body {
    overflow: auto !important;
    overflow-x: hidden !important;
  }

  #custom-top-header {
    height: 52px !important;
  }

  .book-summary {
    top: 52px !important;
    height: calc(100% - 52px) !important;
  }

  .book-body {
    margin-top: 52px !important;
  }

  /* Hide search input on very small screens, keep icon */
  .search-wrapper {
    display: none !important;
  }

  .page-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 24px !important;
    padding-bottom: 48px !important;
  }

  .markdown-section h1 {
    font-size: 22px !important;
    margin-bottom: 20px !important;
  }

  .markdown-section h2 {
    font-size: 18px !important;
  }

  .markdown-section h3 {
    font-size: 16px !important;
  }

  .markdown-section p,
  .markdown-section li {
    font-size: 15px !important;
  }

  .markdown-section img {
    max-height: 300px !important;
  }

  .nav-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 15px 16px 40px 16px !important;
  }

  .nav-container .nav-btn {
    min-height: 70px !important;
    padding: 12px 14px !important;
  }

  .nav-title {
    font-size: 13px !important;
  }
}

/* ================================
   PREV / NEXT STYLE
   ================================ */

/* 1. Container Utama (GRID 2 KOLOM) */
.nav-container {
  /* Layout Grid */
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  /* Bagi 2 kolom sama besar */
  gap: 20px;
  /* Jarak tengah */

  /* Posisi & Ukuran */
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 20px 80px 40px 80px !important;
  border-top: 1px solid #eaeaea;
  box-sizing: border-box;

  /* PENTING: Memaksa turun ke bawah & Tinggi Otomatis */
  clear: both !important;
  /* Turun ke bawah jika ada elemen floating */
  height: auto !important;
  /* JANGAN stretch setinggi halaman */
  flex: 0 0 auto !important;
  /* Mencegah flex-grow jika parentnya flex */

  /* Ensure visibility */
  visibility: visible !important;
  opacity: 1 !important;
  display: grid !important;
  position: static !important;
}

/* 2. Tombol Navigasi */
.nav-container .nav-btn {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;

  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s ease;

  height: auto !important;
  min-height: 80px;
  align-self: start !important;

  width: auto !important;
  max-width: 100% !important;
  float: none !important;
  position: static !important;
  margin: 0 !important;
}

/* Element Dummy (Jika salah satu tombol hilang) */
.nav-container .dummy {
  display: none;
}

/* Jika hanya satu tombol, lebarkan penuh */
.nav-container .nav-btn:only-child {
  grid-column: 1 / -1;
}

/* Hover Effect */
.nav-container .nav-btn:not(.dummy):hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
  z-index: 10;
}

/* 3. Typography */
.nav-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  text-align: left;
  align-items: flex-start;
}

/* Prev button: teks rata kanan */
.nav-content.align-right {
  text-align: right;
  align-items: flex-end;
}

/* Label Kecil (Previous / Next) */
.nav-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Judul Halaman */
.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;

  /* Batasi teks panjang maksimal 2 baris */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-container .nav-btn:hover .nav-title {
  color: #2563eb;
}

/* 4. Icon Panah */
.nav-icon {
  font-size: 18px;
  color: #9ca3af;
  flex-shrink: 0;
}

.nav-btn-prev .nav-icon {
  margin-right: 15px;
}

.nav-btn-next .nav-icon {
  margin-left: 15px;
}

.nav-container .nav-btn:hover .nav-icon {
  color: #2563eb;
}

/* 5. Mobile Responsive */
@media (max-width: 1000px) {
  .nav-container {
    padding: 20px 60px 40px 60px !important;
  }
}

@media (max-width: 768px) {
  .nav-container {
    grid-template-columns: 1fr;
    /* Jadi 1 kolom di HP */
    gap: 15px;
    padding: 20px 20px 40px 20px !important;
  }

  .nav-container .dummy {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-container .nav-btn {
    padding: 10px 12px !important;
  }
}

/* ===============================
   CUSTOM CALLOUT (NO PLUGIN)
================================ */

.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 5px solid;
  font-size: 14px;
}

.callout-info {
  background: #eef6ff;
  border-color: #2563eb;
  color: #1e3a8a;
}

.callout-success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.callout-warning {
  background: #fff7ed;
  border-color: #f97316;
  color: #7c2d12;
}

.callout-danger {
  background: #fef2f2;
  border-color: #ef4444;
  color: #7f1d1d;
}

/* ===============================
   IMAGE STYLE
================================ */

.markdown-section img {
  max-width: 100% !important;
  max-height: 600px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 8px !important;
  /* Optional: adds a nice rounded corner to screenshots */
  margin: 20px auto !important;
  /* Center the image */
  display: block !important;
}

/* ===========================
   RESPONSIVE YOUTUBE IFRAME
   =========================== */
iframe[src*="youtube.com"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    position: relative !important;
    z-index: 50 !important;
    pointer-events: auto !important;
}

/* ===========================
   IMAGE LIGHTBOX
   =========================== */

/* Gambar di konten bisa diklik */
.markdown-section img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.markdown-section img:hover {
  opacity: 0.85;
}

/* Overlay backdrop */
#img-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#img-lightbox.active {
  display: flex;
  opacity: 1;
}

/* Gambar preview */
#lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: lightboxZoomIn 0.25s ease;
}

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Tombol close */
#lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 100000;
  line-height: 1;
}

#lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  #img-lightbox {
    padding: 16px;
  }

  #lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
  }

  #lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}