:root {
  --primary-green: #0b5e3c;
  --secondary-green: #1c7a52;
  --light-green: #f0f9f5;
  --accent-green: #2b8a60;
  --dark-green: #064e32;
  --gold: #e2c267;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-700: #495057;
  --text-primary: #031b4e;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
  --text-link-new: var(--secondary-green);
  --text-link-visited: var(--secondary-green);
}

a:link {
  color: var(--secondary-green);
  text-decoration: none;
}

a:visited {
  color: var(--secondary-green);
  text-decoration: none;
}

a:hover, a:active {
  color: var(--primary-green);
  text-decoration: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Almarai', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--light-green) 0%, var(--white) 100%);
  opacity: 0;
  animation: fadeInPage .9s ease-out forwards;
  overflow-x: hidden; /* Cegah horizontal scroll karena sidebar off-screen */
}

@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: var(--primary-green);
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 4px;
  font-size: 0.85rem;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

.header {
  background: var(--white);
  padding: .75rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  transition: transform .3s ease;
  padding: .25rem 0;
}

.logo:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.logo::before {
  content: "Q";
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #0b5e3c 0%, #064e32 100%);
  color: #e2c267;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  border: 3px solid #d4af37;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2px 4px rgba(0,0,0,.3);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-main {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.3px;
}

.logo-main .qur {
  color: var(--primary-green);
}

.logo-main .ha {
  color: var(--gold);
}

.logo-main .d {
  color: var(--secondary-green);
}

.logo-main .dotcom {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 1rem;
  margin-left: 2px;
}

.logo-sub {
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-700);
  opacity: .85;
  margin-top: 2px;
}

.desktop-menu-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(11,94,60,0.08);
  color: var(--primary-green);
  border: 1px solid var(--primary-green);
  border-radius: 50px;
  font-weight: 600;
  padding: .45rem 1rem;
  cursor: pointer;
  transition: all .3s ease;
  font-size: 1rem;
  box-shadow: none;
  letter-spacing: .3px;
}

.desktop-menu-toggle:hover {
  background: var(--primary-green);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0,0,0,.2);
}

.menu-toggle {
  display: none; /* Sembunyikan di desktop secara default */
  background: rgba(11,94,60,0.08);
  color: var(--primary-green);
  border: 1px solid var(--primary-green);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all .3s ease;
}

.menu-toggle:hover {
  background: var(--primary-green);
  color: var(--white);
  transform: scale(1.05);
  box-shadow: 0 5px 10px rgba(0,0,0,.2);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 70px auto 0;
  width: 100%;
}

.container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 2rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
  background: var(--light-green);
  border-radius: 8px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.breadcrumb a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--secondary-green);
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: var(--gray-700);
}

.page-header {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--light-green);
}

.page-title {
  color: var(--primary-green);
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--gray-700);
  max-width: 600px;
  margin: 0 auto;
}

.page-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

/* STYLE EXPAND/COLLAPSE SECTION */
.content-section {
  margin: 2rem 0;
  transition: all 0.3s ease;
}

.content-section.collapsed {
  border: 1px solid var(--light-green);
  border-radius: 8px;
  padding: 1rem;
}

.content-section.expanded {
  border-left: 4px solid var(--primary-green);
  padding-left: 1rem;
  background: linear-gradient(to right, rgba(11, 94, 60, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light-green);
  position: relative;
}

.section-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.content-section.expanded .section-number {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(11, 94, 60, 0.2);
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0;
  flex-grow: 1;
}

.expand-toggle {
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.expand-toggle:hover {
  background: var(--secondary-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.expand-toggle .icon {
  transition: transform 0.3s ease;
  font-size: 1.1rem;
}

.expand-toggle.expanded .icon {
  transform: rotate(180deg);
}

.content-collapsible {
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.content-collapsible.expanded {
  max-height: 5000px; /* Nilai besar untuk mengakomodasi konten */
  opacity: 1;
}

/* Indikator status expand/collapse */
.expand-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--light-green);
  border-radius: 50%;
  color: var(--primary-green);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.content-section.expanded .expand-indicator {
  background: var(--primary-green);
  color: white;
  transform: rotate(180deg);
}

.video-container {
  background: var(--light-green);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.content-card {
  background: var(--light-green);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-green);
}

.content-card.collapsible {
  margin-top: 1rem;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.content-text {
  line-height: 1.8;
  color: var(--text-primary);
}

.content-text p {
  margin-bottom: 1rem;
}

.arabic-text {
  font-family: 'Traditional Arabic', 'Scheherazade', serif;
  font-size: 1.5rem;
  text-align: right;
  line-height: 2;
  color: var(--primary-green);
  margin: 1rem 0;
  padding: 1rem;
  background: var(--light-green);
  border-radius: 8px;
  direction: rtl;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 2rem;
  flex-wrap: wrap;
}

.nav-buttons a.nav-button,
.nav-buttons a.nav-button:link,
.nav-buttons a.nav-button:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-green);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 200px;
  justify-content: center;
}

.nav-buttons a.nav-button:hover,
.nav-buttons a.nav-button:active {
  background: var(--secondary-green);
  transform: translateY(-2px);
  color: white;
}

.nav-buttons a.nav-button.prev,
.nav-buttons a.nav-button.prev:link,
.nav-buttons a.nav-button.prev:visited {
  background: var(--gray-700);
  color: white;
}

.nav-buttons a.nav-button.prev:hover,
.nav-buttons a.nav-button.prev:active {
  background: #5a6268;
  color: white;
}

/* ===== MUTIARA SECTION ===== */
.mutiara-section {
  margin: 3rem 0;
}

.mutiara-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.mutiara-card {
  background: var(--light-green);
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--gold);
}

.mutiara-source {
  font-size: 0.9rem;
  color: var(--primary-green);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.mutiara-text {
  color: var(--text-primary);
  line-height: 1.6;
  font-style: italic;
}

.banner-card {
  background: none; 
  color: white;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  margin-top: 2rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.banner-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.banner-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: white;
}

.banner-description {
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.banner-button {
  display: inline-block;
  background: var(--gold);
  color: var(--dark-green);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.banner-button:hover {
  background: #e6c34d;
  transform: translateY(-2px);
}

.footer {
  background: var(--dark-green);
  color: var(--white);
  padding: 3rem 1rem 1rem;
  margin-top: auto;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: left;
}

.footer-section h3 {
  color: var(--light-green);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section p {
  color: var(--light-green);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: .9rem;
  opacity: .9;
}

.footer-section strong {
  color: var(--gold);
}

.footer-section a {
  display: block;
  color: var(--white);
  text-decoration: none;
  margin-bottom: .5rem;
  font-size: .9rem;
  transition: color .3s;
  padding: .2rem 0;
}

.footer-section a:hover {
  color: var(--gold);
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  color: var(--light-green);
  font-size: .9rem;
}

.copyright strong {
  color: var(--gold);
}

.footer .copyright a.footer-link,
.footer .copyright a.footer-link:link,
.footer .copyright a.footer-link:visited {
  color: var(--gold);
  text-decoration: none;
}

.footer .copyright a.footer-link:hover {
  color: var(--light-green);
  text-decoration: underline;
}

/* ===== SIDEBAR (Premium) ===== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-nav-container {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: linear-gradient(160deg, var(--dark-green) 0%, #083d28 100%);
  color: white;
  z-index: 1050;
  transition: right 0.3s ease;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

.sidebar-nav-container.active {
  right: 0;
}

.sidebar-content {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.close-sidebar {
  background: linear-gradient(135deg, var(--gold), #d4af37);
  border: none;
  border-radius: 50%;
  color: var(--dark-green);
  font-size: 1.2rem;
  font-weight: bold;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.close-sidebar:hover {
  background: var(--gold);
  color: var(--primary-green);
  transform: scale(1.05);
}

.sidebar-content h3 {
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav li a {
  display: block;
  padding: 0.8rem 0 0.8rem 1.8rem;
  color: var(--white);
  position: relative;
  font-size: 1.05rem;
  transition: all 0.25s ease;
}

.sidebar-nav li a::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: bold;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.sidebar-nav li a:hover::before {
  transform: translateX(3px);
}

.sidebar-nav li a:hover {
  color: var(--gold);
  text-decoration: none;
}

/* Override global a:link warna hijau yang tidak kelihatan di sidebar gelap */
.sidebar-nav-container a:link,
.sidebar-nav-container a:visited {
  color: var(--white);
  text-decoration: none;
}

.sidebar-nav-container a:hover,
.sidebar-nav-container a:active {
  color: var(--gold);
  text-decoration: none;
}

/* ===== ACTIVE NAVIGATION ===== */
body[data-page="home"] .sidebar-nav a[href="/"],
body[data-page="home"] .sidebar-nav a[href$=".com/"],
body[data-page="quran"] .sidebar-nav a[href*="/quran/"],
body[data-page="hadits"] .sidebar-nav a[href*="/hadits/"],
body[data-page="kajian"] .sidebar-nav a[href*="/kajian/"],
body[data-page="kajian"] .sidebar-nav a[href$="kajian.qurhad.com/"],
body[data-page="doa"] .sidebar-nav a[href*="/doa/"],
body[data-page="dzikir"] .sidebar-nav a[href*="/dzikir/"],
body[data-page="tahsin-tajwid"] .sidebar-nav a[href*="/tahsin-tajwid/"],
body[data-page="jadwal"] .sidebar-nav a[href*="/jadwal/"],
body[data-page="ebook"] .sidebar-nav a[href*="/ebook/"],
body[data-page="tema"] .sidebar-nav a[href*="/tema/"],
body[data-page="ref"] .sidebar-nav a[href*="/ref/"],
body[data-page="mui"] .sidebar-nav a[href*="/mui/"],
body[data-page="donasi"] .sidebar-nav a[href*="/donasi/"] {
  color: var(--gold);
  font-weight: 700;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.06);
}

/* ===== SCROLL TO TOP ===== */
#scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary-green);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-to-top:hover {
  background: var(--secondary-green);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .desktop-menu-toggle {
    display: none;
  }
  .menu-toggle {
    display: block; /* Tampilkan hamburger hanya di mobile/tablet */
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .header-content {
    padding: 0 1rem;
    flex-wrap: wrap;
  }
  
  .logo {
    font-size: 1.5rem;
    gap: 0.5rem;
  }
  
  .logo::before {
    width: 45px;
    height: 45px;
    font-size: 2rem;
  }
  
  .logo-main {
    font-size: 1.4rem;
  }
  
  .logo-sub {
    font-size: 0.65rem;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .breadcrumb {
    padding: 1rem;
    margin: 0 1rem 1rem 1rem;
  }
  
  .section-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .nav-buttons {
    flex-direction: column;
  }
  
  .nav-button {
    flex: none;
    width: 100%;
  }
  
  .mutiara-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .arabic-text {
    font-size: 1.2rem;
  }
  
  /* Responsive untuk expand/collapse */
  .expand-toggle {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .content-section.collapsed,
  .content-section.expanded {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .breadcrumb {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  
  .logo-text {
    display: flex;
  }
  
  .logo::before {
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
  }
  
  .content-card {
    padding: 1.5rem;
  }
  
  .section-number {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .expand-toggle {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 360px) {
  .logo-text {
    display: none;
  }
  
  .logo::before {
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }
}

@media (min-width: 1025px) {
  .menu-toggle {
    display: none;
  }
  
  .desktop-menu-toggle {
    display: flex;
  }
}

@media (max-width: 420px) {
  amp-sidebar {
    width: 260px;
  }
  
  .expand-toggle .text {
    display: none;
  }
  
  .expand-toggle {
    padding: 0.5rem;
    width: auto;
  }
  
  .expand-toggle .icon {
    margin: 0;
  }
}
