/* ═══════════════════════════════════════════════════════════════
   ILMHUB.org — Main Stylesheet
   Brand: Warm Contemporary | Deep Teal + Warm Off-White + Muted Gold
   Fonts: Lora (headings) + Inter (body)
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --teal:       #1A6B5A;
  --teal-dark:  #134d40;
  --teal-light: #e8f4f1;
  --gold:       #B8963C;
  --gold-light: #f5edd6;
  --cream:      #F8F5EF;
  --charcoal:   #2D2D2D;
  --grey:       #888888;
  --grey-light: #e8e8e8;
  --white:      #FFFFFF;

  --font-heading: 'Lora', Georgia, serif;
  --font-body:    'Inter', 'Segoe UI', Arial, sans-serif;
  --font-arabic:  'Scheherazade New', serif; /* fallback until Majidi5 loaded */

  --sidebar-w:    280px;
  --toc-w:        220px;
  --header-h:     64px;
  --radius:       8px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: #F5F5F5;
  color: var(--charcoal);
  line-height: 1.75;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #FAF8F4;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid #E8E0D0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-header .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--teal-dark);
  letter-spacing: -1px;
}

.site-header .logo-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--charcoal);
  letter-spacing: 0.02em;
}

.site-header .logo-text span {
  color: var(--teal);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header nav a {
  color: var(--charcoal);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.site-header nav a:hover { color: var(--teal); text-decoration: none; }

.btn-enrol {
  background: var(--teal);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  transition: background 0.2s !important;
}
.btn-enrol:hover { background: var(--teal-dark) !important; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 1.4rem;
  margin-left: auto;
}

/* ── Layout shell ──────────────────────────────────────────────── */
.page-shell {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Left Sidebar — Tree Navigation ────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--grey-light);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 50;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--grey-light); border-radius: 2px; }

.nav-section { margin-bottom: 4px; }

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--charcoal);
  user-select: none;
  transition: background 0.15s;
}
.nav-section-header:hover { background: var(--teal-light); }

.nav-section-header .arrow {
  font-size: 0.7rem;
  color: var(--grey);
  transition: transform 0.2s;
}
.nav-section.open .arrow { transform: rotate(180deg); }

.nav-lessons {
  display: none;
  list-style: none;
}
.nav-section.open .nav-lessons { display: block; }

.nav-lessons li a {
  display: block;
  padding: 7px 20px 7px 32px;
  font-size: 0.875rem;
  color: var(--charcoal);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}
.nav-lessons li a:hover {
  background: var(--teal-light);
  color: var(--teal);
  border-left-color: var(--teal-light);
  text-decoration: none;
}
.nav-lessons li a.active {
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 600;
  border-left-color: var(--teal);
}

.nav-course-label {
  padding: 16px 20px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* ── Main Content ──────────────────────────────────────────────── */
.main-content,
.lesson-main {
  margin-left: var(--sidebar-w);
  margin-right: var(--toc-w);
  flex: 1;
  padding: 40px 56px;
  min-width: 0;
  /* Centre the readable content within the available column */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* Cap line-length for readability and keep centred */
.lesson-main > *,
.main-content > * {
  max-width: 780px;
  width: 100%;
}

/* ── Right Sidebar — Table of Contents ─────────────────────────── */
.toc-sidebar {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: var(--toc-w);
  padding: 28px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--grey-light);
  background: var(--white);
}

.toc-sidebar h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li { margin-bottom: 2px; }

.toc-list a {
  display: block;
  font-size: 0.82rem;
  color: var(--grey);
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}
.toc-list a:hover { color: var(--teal); text-decoration: none; }
.toc-list a.active {
  color: var(--teal);
  font-weight: 600;
  border-left-color: var(--teal);
  background: var(--teal-light);
}

/* ── Content Typography ────────────────────────────────────────── */
.lesson-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.25;
  margin-bottom: 8px;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lesson-meta .badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson-meta .meta-text {
  font-size: 0.85rem;
  color: var(--grey);
}

.content-divider {
  border: none;
  border-top: 1px solid var(--grey-light);
  margin: 32px 0;
}

/* Section headings */
.main-content h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-light);
}

.main-content h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 24px 0 8px;
}

.main-content p { margin-bottom: 16px; }

.main-content ul, .main-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.main-content li { margin-bottom: 6px; }

/* ── Video Embed ───────────────────────────────────────────────── */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Objectives Box ────────────────────────────────────────────── */
.objectives-box {
  background: var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.objectives-box h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin: 0 0 12px;
}
.objectives-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.objectives-box li {
  padding: 4px 0 4px 24px;
  position: relative;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.objectives-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

/* ── Vocab Table ───────────────────────────────────────────────── */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 0.9rem;
}
.vocab-table th {
  background: var(--teal);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.vocab-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: middle;
}
.vocab-table tr:nth-child(even) td { background: var(--cream); }
.vocab-table .arabic-cell {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  direction: rtl;
  color: #1a4d3a;
}

/* ── Rule Box ──────────────────────────────────────────────────── */
.rule-box {
  background: var(--teal-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}
.rule-box .rule-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
}
.rule-box p {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Quran Box ─────────────────────────────────────────────────── */
.quran-box {
  border: 2px solid var(--gold-light);
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.quran-box .arabic-verse {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  direction: rtl;
  text-align: right;
  color: #1a4d3a;
  line-height: 2;
  margin-bottom: 8px;
}
.quran-box .verse-ref {
  font-size: 0.8rem;
  color: var(--grey);
  font-style: italic;
  text-align: right;
  margin-bottom: 12px;
}
.quran-box .verse-translation {
  font-style: italic;
  color: var(--charcoal);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--grey-light);
}
.quran-box .verse-point {
  background: var(--teal-light);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--teal-dark);
}
.quran-box .verse-point::before { content: '📌 '; }

/* ── Download Cards ────────────────────────────────────────────── */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0 32px;
}
.download-card {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--charcoal);
  background: var(--white);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.download-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--teal);
  text-decoration: none;
  color: var(--charcoal);
}
.download-card .icon { font-size: 1.8rem; margin-bottom: 8px; }
.download-card .label { font-weight: 600; font-size: 0.9rem; }
.download-card .sublabel { font-size: 0.75rem; color: var(--grey); margin-top: 4px; }

/* ── CTA Banner ────────────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-banner .cta-text h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 6px;
}
.cta-banner .cta-text p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}
.cta-btn {
  background: var(--gold);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.cta-btn:hover { background: #c9a840; text-decoration: none; color: var(--teal-dark); }

/* ── Homepage Hero ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  color: var(--white);
  padding: 80px 48px;
  text-align: center;
}
.hero .arabic-tagline {
  font-family: var(--font-arabic);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 16px;
  direction: rtl;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--gold);
  color: var(--teal-dark);
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: #c9a840; text-decoration: none; color: var(--teal-dark); }
.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.6);
  font-weight: 600;
  padding: 11px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: white; background: rgba(255,255,255,0.1); text-decoration: none; color: white; }

/* ── Course Cards ──────────────────────────────────────────────── */
.courses-section { padding: 60px 48px; max-width: 1100px; margin: 0 auto; }
.courses-section h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.courses-section .section-sub {
  color: var(--grey);
  margin-bottom: 36px;
  font-size: 1rem;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.course-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--charcoal);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); text-decoration: none; color: var(--charcoal); }
.course-card-header {
  height: 8px;
  background: var(--teal);
}
.course-card-header.gold { background: var(--gold); }
.course-card-header.teal-light { background: #2d9c7e; }
.course-card-body { padding: 24px; }
.course-card-body .tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}
.course-card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--teal-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}
.course-card-body p {
  font-size: 0.875rem;
  color: var(--grey);
  margin-bottom: 16px;
  line-height: 1.6;
}
.course-card-body .lessons-count {
  font-size: 0.8rem;
  color: var(--teal);
  font-weight: 600;
}

/* ── Coming Soon Badge ─────────────────────────────────────────── */
.coming-soon {
  display: inline-block;
  background: var(--grey-light);
  color: var(--grey);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  background: var(--teal-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 48px;
  text-align: center;
  font-size: 0.875rem;
  margin-top: 60px;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .footer-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 12px;
}

/* ── Layout shell (lesson pages) ───────────────────────────────── */
.layout-shell {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* Sidebar overlay (mobile) */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}
#sidebar-overlay.visible { display: block; }

/* Sidebar inner scroll container */
.sidebar-inner { padding: 20px 0; }

.sidebar-course-title {
  padding: 8px 20px 20px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-dark);
  border-bottom: 1px solid var(--grey-light);
  margin-bottom: 8px;
  line-height: 1.4;
}
.sidebar-course-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

/* Nav section header as button */
.nav-section-header {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

/* Sidebar CTA block */
.sidebar-cta {
  margin: 24px 16px 16px;
  background: var(--gold-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.sidebar-cta p { font-size: 0.8rem; color: var(--charcoal); margin-bottom: 10px; line-height: 1.5; }
.sidebar-cta-btn {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
}
.sidebar-cta-btn:hover { background: var(--teal-dark); text-decoration: none; color: var(--white); }

/* ── Sidebar lesson nav links ──────────────────────────────────── */
.tree-nav {
  padding: 4px 0 8px;
}
.tree-nav a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 16px 7px 20px;
  font-size: 0.82rem;
  color: var(--charcoal);
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tree-nav a:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
  border-left-color: var(--teal-light);
  text-decoration: none;
}
.tree-nav a.active {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 600;
  border-left-color: var(--teal);
}
.nav-code {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 56px;
  letter-spacing: 0.02em;
}
.tree-nav a.active .nav-code { color: var(--teal); }

/* ── YouTube thumbnail player ──────────────────────────────────── */
.yt-thumb-link {
  display: block;
  text-decoration: none;
  margin-bottom: 32px;
}
.yt-thumb-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  aspect-ratio: 16 / 9;
}
.yt-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}
.yt-thumb-link:hover .yt-thumb-img,
.yt-thumb-wrap:hover .yt-thumb-img { opacity: 0.85; }
.yt-thumb-wrap { cursor: pointer; }
.yt-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yt-play-bg  { fill: rgba(0,0,0,0.72); transition: fill 0.2s; }
.yt-thumb-link:hover .yt-play-bg,
.yt-thumb-wrap:hover .yt-play-bg { fill: #ff0000; }
.yt-play-arrow { fill: #fff; }
.yt-thumb-label {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
}
.yt-thumb-link:hover .yt-thumb-label { color: var(--teal-dark); text-decoration: underline; }

/* Click-to-play label inside thumbnail */
.yt-click-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

/* Inline iframe after click */
.yt-iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #000;
}

/* "Watch on YouTube" link below player */
.yt-external-link {
  margin-top: 10px;
  text-align: right;
}
.yt-external-link a {
  font-size: 0.85rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}
.yt-external-link a:hover {
  text-decoration: underline;
  color: var(--teal-dark);
}

/* TOC sidebar aliases */
.toc { /* same as .toc-sidebar */
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: var(--toc-w);
  padding: 28px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--grey-light);
  background: var(--white);
}
/* TOC direct-child <a> links (generated by build script) */
.toc a, .toc-sidebar nav a {
  display: block;
  font-size: 0.81rem;
  color: var(--grey);
  padding: 5px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
  margin-bottom: 2px;
}
.toc a:hover, .toc-sidebar nav a:hover {
  color: var(--teal);
  background: var(--teal-light);
  border-left-color: var(--teal-light);
  text-decoration: none;
}
.toc a.active, .toc-sidebar nav a.active {
  color: var(--teal-dark);
  font-weight: 600;
  border-left-color: var(--teal);
  background: var(--teal-light);
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  margin-bottom: 12px;
}

/* Header nav aliases */
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.header-nav a {
  color: var(--charcoal);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.header-nav a:hover { color: var(--teal); text-decoration: none; }
.nav-cta {
  background: var(--teal);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--teal-dark) !important; color: var(--white) !important; }

/* Mobile menu button alias */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
}

/* ── Lesson page header block ───────────────────────────────────── */
.lesson-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey-light);
}
.lesson-breadcrumb {
  font-size: 0.8rem;
  color: var(--grey);
  margin-bottom: 12px;
}
.lesson-breadcrumb a { color: var(--teal); text-decoration: none; }
.lesson-breadcrumb a:hover { text-decoration: underline; }
.lesson-code-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.lesson-subtitle {
  font-size: 1rem;
  color: var(--grey);
  margin-bottom: 16px;
}
.lesson-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.lesson-meta span {
  font-size: 0.82rem;
  color: var(--grey);
}
.lesson-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-lesson {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}
.btn-lesson:hover { background: var(--teal-dark); text-decoration: none; color: var(--white); }
.btn-lesson-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-lesson-outline:hover { background: var(--teal-light); color: var(--teal); }

/* Objectives label */
.objectives-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 12px;
}

/* Section heading alias */
.section-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-light);
}

/* Quran box class aliases */
.quran-reference { /* alias for .verse-ref */
  font-size: 0.8rem;
  color: var(--grey);
  font-style: italic;
  text-align: right;
  margin-bottom: 12px;
}
.quran-translation { /* alias for .verse-translation */
  font-style: italic;
  color: var(--charcoal);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--grey-light);
}
.quran-point { /* alias for .verse-point */
  background: var(--teal-light);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--teal-dark);
}

/* Download card aliases */
.download-icon { font-size: 1.8rem; margin-bottom: 8px; }
.download-label { font-weight: 600; font-size: 0.9rem; }
.download-sub { font-size: 0.75rem; color: var(--grey); margin-top: 4px; }

/* CTA banner aliases */
.cta-banner-text { flex: 1; }
.cta-banner-text strong { display: block; font-family: var(--font-heading); font-size: 1.1rem; color: var(--white); margin-bottom: 6px; }
.cta-banner-text span { font-size: 0.9rem; color: rgba(255,255,255,0.8); }
.cta-banner-btn {
  background: var(--gold);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.cta-banner-btn:hover { background: #c9a840; text-decoration: none; color: var(--teal-dark); }

/* Lesson prev/next footer */
.lesson-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  margin-top: 16px;
  border-top: 1px solid var(--grey-light);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 12px;
}
.lesson-nav-prev, .lesson-nav-next { color: var(--teal); }
.lesson-nav-next { text-align: right; }

/* ── Arabic text global ────────────────────────────────────────── */
.arabic { font-family: var(--font-arabic); direction: rtl; }
.arabic-inline {
  font-family: var(--font-arabic);
  font-size: 1.2em;
  color: #1a4d3a;
}

/* ── Responsive ────────────────────────────────────────────────── */
/* ── Tablet: hide right TOC, content fills sidebar→right edge ── */
@media (max-width: 1100px) {
  .toc-sidebar, .toc { display: none; }
  .main-content, .lesson-main {
    margin-right: 0;
    padding: 36px 40px;
  }
}

/* ── Small tablet ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-content, .lesson-main {
    padding: 28px 28px;
  }
}

/* ── Mobile: sidebar collapses to off-canvas ───────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 51;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content, .lesson-main {
    margin-left: 0;
    margin-right: 0;
    padding: 20px 18px;
  }
  .lesson-main > *, .main-content > * { max-width: 100%; }
  .menu-toggle, .mobile-menu-btn { display: flex; }
  .site-header nav, .header-nav { display: none; }
  .hero { padding: 50px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .courses-section { padding: 40px 20px; }
  .lesson-actions { flex-wrap: wrap; gap: 8px; }
  .btn-lesson { font-size: 0.82rem; padding: 8px 14px; }
  .lesson-header h1 { font-size: 1.5rem; }
  .yt-thumb-wrap { border-radius: 6px; }
  .lesson-breadcrumb { font-size: 0.78rem; }
}
