/* ==========================================================
   HAYUBELAJAR - Custom Design System (Anti-Slop Craftsmanship)
   Fokus: Kehangatan, Keterbacaan, Kejujuran Visual, & Aksesibilitas
   ========================================================== */

:root {
  /* Palet Warna Organik & Hangat */
  --bg-page: #fbfbfa;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f3ee;
  --bg-hover: #eceae3;

  --text-main: #1d231f;
  --text-muted: #5c6660;
  --text-light: #828c86;
  --text-inverse: #fbfbfa;

  --primary: #1b4d3e;
  /* Forest Teal Hangat */
  --primary-hover: #143b2f;
  --primary-light: #e8f0ec;
  --primary-dark: #0f2d24;

  --accent: #c26d1a;
  /* Terrakota / Warm Amber */
  --accent-light: #fbf0e4;

  --border-color: #e5e3dc;
  --border-strong: #d0cdc3;
  --divider: #eeece4;

  /* Tag & Level Badge Colors */
  --badge-pemula-bg: #eaf3ed;
  --badge-pemula-text: #1b4d3e;
  --badge-menengah-bg: #fdf3e7;
  --badge-menengah-text: #964f0b;
  --badge-lanjutan-bg: #f5eaeb;
  --badge-lanjutan-text: #8c2530;

  /* Tipografi & Ukuran */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

  /* Layout Spacing */
  --container-max: 1160px;
  --prose-max: 70ch;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Transisi Natural */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Bayangan Ringan Realistis (Bukan Glow AI) */
  --shadow-subtle: 0 1px 3px rgba(29, 35, 31, 0.05);
  --shadow-card: 0 2px 6px rgba(29, 35, 31, 0.06), 0 1px 2px rgba(29, 35, 31, 0.04);
}

/* Reset Dasar */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

:focus:not(:focus-visible) {
  outline: none !important;
}

/* ==========================================================
   PAGE ENTRANCE & AESTHETIC REVEAL (Bukan Menghilang)
   ========================================================== */

/* Top Navigation Progress Bar */
.page-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.page-progress-bar.is-loading {
  opacity: 1;
  width: 70%;
}

.page-progress-bar.is-done {
  width: 100%;
  opacity: 0;
}

/* Keyframes Entri Halus Elemen Konten */
@keyframes contentFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Transisi Estetik saat Buka Landing Page (Staggered Entrance) */
.hero-tag {
  animation: contentFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title {
  animation: contentFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.hero-subtitle {
  animation: contentFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-buttons {
  animation: contentFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero-visual {
  animation: contentFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

/* Transisi Estetik Header Halaman Lainnya saat dibuka */
.catalog-header,
.category-header,
.detail-header,
.about-hero,
.auth-container {
  animation: contentFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Scroll / Load Reveal untuk Kartu & Section */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hero-tag,
  .hero-title,
  .hero-subtitle,
  .hero-buttons,
  .hero-visual,
  .catalog-header,
  .category-header,
  .detail-header,
  .about-hero,
  .auth-container,
  .reveal-on-scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Keterbacaan Gambar & Media */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Container Umum */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-wrapper {
  flex: 1;
}

/* ==========================================================
   READING PROGRESS BAR
   ========================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: var(--primary);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ==========================================================
   HEADER & NAVBAR
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background-color: rgba(251, 251, 250, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  transition: border-color var(--transition-fast);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.brand-text {
  color: var(--primary);
}

.brand-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  margin-left: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1001;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--text-main);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.25s ease;
}

.hamburger-bar + .hamburger-bar {
  margin-top: 6px;
}

/* Hamburger → X saat menu terbuka */
.mobile-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ==========================================================
   RESPONSIVE — Mobile (max-width: 768px)
   ========================================================== */

/* Keyframes: tiap item nav masuk dari bawah */
@keyframes navItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
    flex-direction: column;
  }

  /* Slide-down panel dari bawah header */
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #f6f5f0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.3s ease;
    z-index: 800;
    padding: 0 1.5rem;
    border-bottom: 0 solid var(--border-color);
  }

  .site-nav.is-open {
    max-height: 320px;
    padding: 0.75rem 1.5rem 1.25rem;
    border-bottom-width: 1px;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .nav-list li {
    width: 100%;
    opacity: 0;
  }

  /* Animasi stagger — tiap item muncul berurutan */
  .site-nav.is-open .nav-list li {
    animation: navItemIn 0.35s ease forwards;
  }
  .site-nav.is-open .nav-list li:nth-child(1) { animation-delay: 0.05s; }
  .site-nav.is-open .nav-list li:nth-child(2) { animation-delay: 0.1s; }
  .site-nav.is-open .nav-list li:nth-child(3) { animation-delay: 0.15s; }
  .site-nav.is-open .nav-list li:nth-child(4) { animation-delay: 0.2s; }
  .site-nav.is-open .nav-list li:nth-child(5) { animation-delay: 0.25s; }

  .nav-link {
    display: block;
    padding: 0.7rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.005em;
    transition: color 0.15s ease;
  }

  .nav-link:hover,
  .nav-link:active {
    color: var(--text-main);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link.active {
    color: var(--primary);
    font-weight: 600;
  }

  .header-inner {
    position: relative;
  }

  .hero-section {
    padding: 2.25rem 0 1.75rem;
  }

  .hero-section h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }

  .hero-section .hero-subtitle {
    font-size: 0.95rem;
  }

  .materials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .footer-bottom-flex {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* Tablet — 2 kolom grid */
@media (min-width: 769px) and (max-width: 1024px) {
  .materials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}



/* ==========================================================
   BUTTONS & ACTIONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background-color: var(--bg-hover);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-outline-sm {
  display: inline-block;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.btn-outline-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-surface);
}

/* ==========================================================
   HERO SECTION (Tanpa AI Buzzwords & Tanpa Klaim Palsu)
   ========================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-page);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-content {
  max-width: 620px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Visual Sederhana Hero: Editorial Learning Vignette */
.hero-visual {
  position: relative;
}

.hero-card-preview {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.preview-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--primary);
}

.preview-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.preview-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.preview-body p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.825rem;
  color: var(--text-light);
}

/* ==========================================================
   SEARCH BAR SECTION
   ========================================================== */
.search-section {
  padding: 2.5rem 0;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.search-form {
  max-width: 680px;
  margin: 0 auto;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.45rem 0.35rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-btn {
  padding: 0.65rem 1.25rem;
}

.search-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.search-hint-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-hint-link:hover {
  color: var(--primary-hover);
}

/* ==========================================================
   SECTION HEADER (Konsisten & Proporsional)
   ========================================================== */
.section-wrapper {
  padding: 4.5rem 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1.25rem;
}

.section-title-group h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

.section-more-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition-fast);
}

.section-more-link:hover {
  gap: 0.6rem;
  color: var(--primary-hover);
}

/* ==========================================================
   CATEGORIES SECTION (Ringan & Terstruktur, Bukan Card Raksasa)
   ========================================================== */
.categories-list-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.category-item {
  display: block;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-smooth);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.category-item:active {
  transform: scale(0.99);
}

.category-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.category-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.category-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.category-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.category-count {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary);
}

/* ==========================================================
   MATERIALS GRID (Katalog & Beranda)
   ========================================================== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.material-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  outline: none;
}

.material-card:active {
  transform: scale(0.99);
  border-color: var(--border-strong);
}

.material-card a,
.material-card a:focus,
.material-card a:active {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.material-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.card-thumbnail {
  aspect-ratio: 16 / 9;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.material-card:hover .card-thumbnail img {
  transform: scale(1.02);
}

.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1efe8;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-category {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary);
}

.badge-level {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-level.pemula {
  background-color: var(--badge-pemula-bg);
  color: var(--badge-pemula-text);
}

.badge-level.menengah {
  background-color: var(--badge-menengah-bg);
  color: var(--badge-menengah-text);
}

.badge-level.lanjutan {
  background-color: var(--badge-lanjutan-bg);
  color: var(--badge-lanjutan-text);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--divider);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.read-link {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition-fast);
}

.material-card:hover .read-link {
  gap: 0.55rem;
}

/* ==========================================================
   DETAIL MATERI (PENGALAMAN MEMBACA OPTIMAL)
   ========================================================== */
.reader-container {
  max-width: var(--prose-max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.reader-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.reader-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.reader-breadcrumbs a {
  color: var(--text-muted);
}

.reader-breadcrumbs a:hover {
  color: var(--primary);
}

.reader-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.reader-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.reader-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

/* Konten Isi Bacaan (Typography Focused) */
.reader-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #232724;
}

.reader-body h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.reader-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.reader-body p {
  margin-bottom: 1.5rem;
}

.reader-body ul,
.reader-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.reader-body ul {
  list-style: disc;
}

.reader-body ol {
  list-style: decimal;
}

.reader-body li {
  margin-bottom: 0.5rem;
}

/* Callout Note Box */
.note-box {
  background-color: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 1rem;
  color: var(--text-main);
}

.note-box strong {
  color: var(--primary);
}

/* Blockquote */
.reader-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 0 0.75rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* Code Formatting */
.reader-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
}

/* ==========================================================
   CODE BLOCKS & SYNTAX (Tampilan Rapi & Anti-Tumpuk di HP)
   ========================================================== */
.code-block-wrapper {
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  background-color: #17211d;
  border: 1px solid #25362f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem 0.45rem 1rem;
  background-color: #121a16;
  border-bottom: 1px solid #202e28;
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #7d9489;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: rgba(255, 255, 255, 0.08);
  color: #c4d7cd;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.copy-code-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.copy-code-btn:active {
  transform: scale(0.96);
}

.copy-code-btn.is-copied {
  background-color: rgba(27, 77, 62, 0.95);
  color: #a3e6be;
  border-color: #2e7a5b;
}

.copy-code-btn .copy-icon {
  flex-shrink: 0;
}

/* Pre di dalam wrapper */
.code-block-wrapper pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 1rem 1.15rem !important;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e6f0eb;
  -webkit-overflow-scrolling: touch;
}

.code-block-wrapper pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  color: inherit;
  white-space: pre;
}

/* Fallback jika ada pre standalone tanpa wrapper */
.reader-body pre:not(.code-block-wrapper pre) {
  position: relative;
  background-color: #17211d;
  color: #e6f0eb;
  padding: 2.5rem 1.25rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  border: 1px solid #23342e;
}

.reader-body pre:not(.code-block-wrapper pre) code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  color: inherit;
}

.reader-body pre:not(.code-block-wrapper pre) .copy-code-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
}

/* Table Formatting (Kenyamanan Membaca Tabel) */
.reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.reader-body th {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 700;
  text-align: left;
  padding: 0.85rem 1.25rem;
  border-bottom: 2px solid var(--border-strong);
  border-right: 1px solid var(--border-color);
}

.reader-body th:last-child {
  border-right: none;
}

.reader-body td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  color: #2e3530;
}

.reader-body td:last-child {
  border-right: none;
}

.reader-body tr:last-child td {
  border-bottom: none;
}

.reader-body tr:nth-child(even) td {
  background-color: #faf9f6;
}

/* Aksi Akhir Bacaan */
.reader-actions-bar {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.btn-mark-done {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-mark-done:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-mark-done.is-completed {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Navigasi Materi Berikutnya / Sebelumnya */
.material-nav-split {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.material-nav-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-smooth);
}

.material-nav-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.nav-direction {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.nav-item-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ==========================================================
   FILTER & KATALOG PAGE (materi.php)
   ========================================================== */
.catalog-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-subtle);
}

.filter-form-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: center;
}

.form-group-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control-filter {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-page);
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.form-control-filter:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
}

/* Pagination */
.pagination-wrapper {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.page-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-item.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}

.page-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.empty-state h3 {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  background-color: #f3f2eb;
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 3.5rem;
  margin-bottom: 3.5rem;
}

.footer-description {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
  margin-bottom: 0.85rem;
}

.footer-note {
  font-size: 0.825rem;
  color: var(--text-light);
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.footer-list li {
  margin-bottom: 0.65rem;
}

.footer-list a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-list a:hover {
  color: var(--primary);
}

.footer-admin-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
}

.footer-bottom-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================
   TOAST NOTIFICATION (Micro-Interaction)
   ========================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: #1a201c;
  color: #fbfbfa;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #2d3630;
  animation: toastSlideIn 0.25s ease-out forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.toast-fadeout {
  animation: toastFadeOut 0.25s ease-in forwards;
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ========================================================== */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .filter-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-form-grid .form-group-filter:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .mobile-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 59px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: var(--shadow-card);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 1rem;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    font-size: 1.05rem;
  }

  .nav-actions {
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
  }

  .nav-actions .btn {
    width: 100%;
  }

  .reader-title {
    font-size: 1.85rem;
  }

  .material-nav-split {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .filter-form-grid {
    grid-template-columns: 1fr;
  }

  .filter-form-grid .form-group-filter:first-child {
    grid-column: span 1;
  }
}

/* ==========================================================
   DONASI & DUKUNGAN QRIS (Halaman Tentang)
   ========================================================== */
.donate-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-card);
}

.donate-header {
  margin-bottom: 1.5rem;
}

.donate-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 0.65rem;
  line-height: 1.3;
}

.donate-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 0 !important;
}

.donate-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.donate-qr-wrapper {
  background-color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.donate-qr-img {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
}

.donate-qr-caption {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.donate-info {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.donate-info-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.donate-steps {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
}

.donate-steps li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.donate-step-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
  min-width: 18px;
}

.donate-methods-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-top: 0.35rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .donate-card {
    padding: 1.5rem 1.25rem;
  }
  
  .donate-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    text-align: center;
  }

  .donate-qr-wrapper {
    max-width: 220px;
    margin: 0 auto;
  }

  .donate-steps li {
    text-align: left;
  }

  .donate-methods-badge {
    justify-content: center;
    font-size: 0.775rem;
  }
}