/* ===== CSS Variables & Reset ===== */
/* Ka'bah-inspired: deep black kiswah + gold calligraphy */
:root {
  --gold: #c9a84c;
  --gold-light: #e2c56d;
  --gold-dark: #a8872e;
  --gold-glow: rgba(201, 168, 76, 0.35);
  --primary: var(--gold);
  --primary-dark: var(--gold-dark);
  --primary-light: var(--gold-light);
  --accent: var(--gold);
  --bg-dark: #0a0a0a;
  --bg-card: #141414;
  --bg-section: #111111;
  --bg-elevated: #1c1c1c;
  --text-light: #f0ece4;
  --text-muted: #a49d90;
  --text-dark: #0a0a0a;
  --white: #f5f0e8;
  --border: rgba(201, 168, 76, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --font: 'Source Sans Pro', 'Segoe UI', sans-serif;
  --max-width: 960px;
  --nav-height: 64px;
}

/* Light mode overrides */
html.light-mode {
  --bg-dark: #f0ece3;
  --bg-card: #ffffff;
  --bg-section: #f7f4ed;
  --bg-elevated: #ffffff;
  --text-light: #111111;
  --text-muted: #444038;
  --white: #111111;
  --gold: #9e7c1a;
  --gold-light: #b8912a;
  --gold-dark: #7a5e0f;
  --border: rgba(140, 110, 30, 0.25);
  --border-subtle: rgba(0, 0, 0, 0.1);
}
html.light-mode body { background: var(--bg-dark); color: var(--text-light); }
html.light-mode .site-nav { background: rgba(255, 255, 255, 0.95); }
html.light-mode .nav-brand { color: #111; }
html.light-mode .nav-links a { color: #444038; }
html.light-mode .nav-links a:hover, html.light-mode .nav-links a.active { background: rgba(140,110,30,0.1); color: #111; }
html.light-mode .hero { background: radial-gradient(ellipse at 50% 40%, #f0e8d4 0%, #f5f2ec 70%); }
html.light-mode .hero::before { background: radial-gradient(ellipse at 50% 30%, rgba(201,168,76,0.1), transparent 60%); }
html.light-mode .hero h1 { background: linear-gradient(180deg, #111 0%, #6b5210 100%); -webkit-background-clip: text; background-clip: text; }
html.light-mode .page-header { background: linear-gradient(180deg, #e8e0cc 0%, #f0ece3 100%); }
html.light-mode .page-header h1 { background: linear-gradient(180deg, #111, #6b5210); -webkit-background-clip: text; background-clip: text; }
html.light-mode .section-block { background: var(--bg-card); border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
html.light-mode .section-block p { color: #333; }
html.light-mode .section-block li { color: #333; }
html.light-mode .quote-block { background: rgba(140,110,30,0.06); border-left-color: #9e7c1a; color: #222; }
html.light-mode .news-ticker-wrap { background: rgba(255,255,255,0.98); }
html.light-mode .news-ticker a { color: #444; }
html.light-mode .news-ticker-close { background: rgba(255,255,255,0.98); color: #444; }
html.light-mode .news-ticker-label { color: #fff; }
html.light-mode .btn-start { color: #0a0a0a; }
html.light-mode .btn-secondary { border-color: #9e7c1a; color: #6b5210; }
html.light-mode .section-block h2 { color: #111; }
html.light-mode .section-block h3 { color: #6b5210; }
html.light-mode .hero-search input { background: #fff; color: #111; border-color: rgba(0,0,0,0.12); }
html.light-mode .hero-search input::placeholder { color: #888; }
html.light-mode .hero-search-results { background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.15); border-color: rgba(0,0,0,0.1); }
html.light-mode .search-result:hover { background: rgba(140,110,30,0.06); }
html.light-mode .search-q { color: #111; }
html.light-mode .search-a { color: #555; }
html.light-mode .page-toc-inner { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light-mode .page-toc-label { color: #6b5210; }
html.light-mode .page-toc-links a { background: rgba(0,0,0,0.03); color: #333; border-color: rgba(0,0,0,0.1); }
html.light-mode .page-toc-links a:hover { background: rgba(140,110,30,0.1); color: #111; }
html.light-mode .news-card { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
html.light-mode .news-card-body h3 a { color: #111; }
html.light-mode .news-card-body p { color: #555; }
html.light-mode .news-category { color: #6b5210; }
html.light-mode .quiz-card { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
html.light-mode .practical-card { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
html.light-mode .practical-card h3 { color: #111; }
html.light-mode .practical-card p { color: #555; }
html.light-mode .quiz-question { background: #fff; border-color: rgba(0,0,0,0.08); }
html.light-mode .quiz-question h3 { color: #111; }
html.light-mode .quiz-option { background: #faf8f4; border-color: rgba(0,0,0,0.1); color: #222; }
html.light-mode .quiz-option:hover { border-color: #9e7c1a; background: rgba(140,110,30,0.06); }
html.light-mode .cp-option { background: #faf8f4; border-color: rgba(0,0,0,0.1); color: #222; }
html.light-mode .cp-option:hover { border-color: #9e7c1a; }
html.light-mode .cp-question h4 { color: #111; }
html.light-mode .resume-bar-inner { background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.18); border-color: rgba(0,0,0,0.1); }
html.light-mode .resume-text { color: #222; }
html.light-mode .page-nav a { background: #fff; border-color: rgba(0,0,0,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
html.light-mode .page-nav a .title { color: #111; }
html.light-mode .page-nav a .label { color: #666; }
html.light-mode .reflection { background: linear-gradient(135deg, rgba(140,110,30,0.06), rgba(140,110,30,0.02)); border-color: rgba(140,110,30,0.15); }
html.light-mode .reflection p { color: #333; }
html.light-mode .fiqh-note { background: rgba(140,110,30,0.04); border-color: rgba(140,110,30,0.12); color: #333; }
html.light-mode .fiqh-note .fiqh-label { color: #6b5210; background: rgba(140,110,30,0.08); }
html.light-mode .highlight-box { background: rgba(140,110,30,0.05); border-color: rgba(140,110,30,0.15); color: #222; }
html.light-mode .warning-box { color: #222; }
html.light-mode .tip-box { color: #222; }
html.light-mode .dua-block { background: rgba(140,110,30,0.05); border-color: rgba(140,110,30,0.15); }
html.light-mode .dua-block .transliteration { color: #6b5210; }
html.light-mode .dua-block .translation { color: #444; }
html.light-mode .arabic-text { color: #6b5210; }
html.light-mode .checkpoint-quiz { background: linear-gradient(135deg, rgba(140,110,30,0.07), rgba(140,110,30,0.02)); border-color: rgba(140,110,30,0.2); }
html.light-mode .checkpoint-quiz h2 { color: #6b5210; }
html.light-mode .info-table th { background: rgba(140,110,30,0.1); color: #6b5210; }
html.light-mode .info-table td { color: #333; }
html.light-mode .reading-progress { background: rgba(0,0,0,0.05); }
html.light-mode .search-overlay { background: rgba(240,236,227,0.92); }
html.light-mode .search-overlay-inner input { background: #fff; color: #111; border-color: rgba(0,0,0,0.12); }
html.light-mode .search-results { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); border-color: rgba(0,0,0,0.1); }
html.light-mode .nav-links.open { background: rgba(255,255,255,0.98); border-color: rgba(0,0,0,0.08); }
html.light-mode .section-read-marker { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
html.light-mode .reveal-btn { border-color: #9e7c1a; color: #6b5210; background: rgba(140,110,30,0.06); }
html.light-mode .reveal-btn:hover { background: rgba(140,110,30,0.12); }
html.light-mode .site-footer { color: #666; }
html.light-mode .theme-toggle { color: #6b5210; border-color: rgba(0,0,0,0.12); }
html.light-mode .steps-list li::before { color: #fff; }
html.light-mode .hero .toc a { color: #333; background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
html.light-mode .hero .toc a:hover { background: rgba(140,110,30,0.08); }

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

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--nav-height) + 80px); }
body.has-ticker [id] { scroll-margin-top: calc(var(--nav-height) + 116px); }

body {
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-light);
  background: var(--bg-dark);
  -webkit-font-smoothing: antialiased;
}

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

/* Icon sizes */
.toc-icon { width: 32px; height: 32px; flex-shrink: 0; }
.section-icon { width: 28px; height: 28px; vertical-align: middle; display: inline-block; margin-right: 0.4rem; }
.nav-icon { width: 18px; height: 18px; vertical-align: middle; display: inline-block; margin-right: 0.3rem; opacity: 0.8; }
.card-icon-svg { width: 36px; height: 36px; margin-bottom: 0.5rem; }
.section-illustration { max-width: 100%; width: 100%; aspect-ratio: 800/320; height: auto; margin: 2rem auto 0; display: block; border-radius: 4px; cursor: zoom-in; transition: opacity 0.2s; object-fit: contain; }
.section-illustration:hover { opacity: 0.9; }
/* Photos provide their own width/height attributes — trust them so the browser
   derives the natural aspect ratio instead of forcing the SVG 800/320 letterbox. */
.section-illustration[width][height] { aspect-ratio: auto; }

/* Image lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 1rem; cursor: zoom-out;
}
.lightbox.open { display: flex; overflow-y: auto; }
.lightbox-img {
  max-width: 95vw; max-height: 90vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transform: scale(0.95); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.lightbox.open .lightbox-img { transform: scale(1); opacity: 1; }
.lightbox-close {
  position: fixed; top: 1rem; right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-zoom {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.5rem;
}
.lightbox-zoom button {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-zoom button:hover { background: rgba(255,255,255,0.2); }
.container { width: 100%; }

/* Suppress ALL Google Translate visual artifacts */
.goog-text-highlight { background: none !important; box-shadow: none !important; border: none !important; }
.goog-te-banner-frame { display: none !important; }
#goog-gt-tt, .goog-te-balloon-frame, .goog-te-menu-frame { display: none !important; }
.skiptranslate { display: none !important; }
font[style] > font { background: none !important; box-shadow: none !important; }
font { background: none !important; box-shadow: none !important; }
a { color: var(--gold-light); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

/* ===== Buttons (polished/shine effect) ===== */
.btn-start {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 2.2rem; border-radius: 50px;
  font-size: 1.05rem; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer; text-decoration: none;
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #ddb94e 0%, #b8942a 50%, #c9a84c 100%);
  color: #0a0a0a;
  box-shadow:
    0 2px 8px rgba(201, 168, 76, 0.3),
    0 8px 32px rgba(201, 168, 76, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform .2s, box-shadow .2s;
}
.btn-start::before {
  content: '';
  position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-start:hover {
  transform: translateY(-2px);
  color: #0a0a0a;
  box-shadow:
    0 4px 16px rgba(201, 168, 76, 0.4),
    0 12px 40px rgba(201, 168, 76, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-start:hover::before { left: 125%; }
.btn-start:active { transform: translateY(0); }

/* Secondary button variant */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 2.2rem; border-radius: 50px;
  font-size: 1.05rem; font-weight: 600; font-family: inherit;
  border: 2px solid var(--gold); cursor: pointer; text-decoration: none;
  background: transparent; color: var(--gold);
  transition: all .2s;
}
.btn-secondary:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.15);
}

/* ===== Navigation ===== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  transition: box-shadow .3s;
}
.site-nav.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,.6); }

.nav-brand {
  font-size: 1.15rem; font-weight: 700; color: var(--white);
  letter-spacing: -0.02em; white-space: nowrap;
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; }
.nav-logo { width: 28px; height: 28px; flex-shrink: 0; }
.nav-brand span { color: var(--gold); }

.nav-links {
  list-style: none; display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end;
}
.nav-links a {
  display: block; padding: 0.4rem 0.7rem; border-radius: 6px;
  font-size: 0.82rem; font-weight: 400; color: var(--text-muted);
  transition: background .2s, color .2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(201, 168, 76, 0.1); color: var(--gold-light);
}

/* ===== Page Controls Bar (language + theme + font) ===== */
.page-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.5rem;
  max-width: var(--max-width); margin: 0 auto;
  padding: calc(var(--nav-height) + 0.25rem) 1.5rem 0;
}
body.has-ticker .page-controls { padding-top: calc(var(--nav-height) + 36px + 0.25rem); }
.page-controls:empty { display: none; }

.theme-toggle {
  background: none; border: 1px solid var(--border);
  color: var(--gold); font-size: 1.1rem; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(201,168,76,0.1); border-color: var(--gold); }

/* Nav dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.4rem; min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); z-index: 1001;
  list-style: none; margin: 0.25rem 0 0;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 8px;
  font-size: 0.85rem; color: var(--text-muted); white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-dropdown-menu a:hover { background: rgba(201,168,76,0.1); color: var(--gold-light); }
.nav-dropdown-menu a.active { color: var(--gold); }
html.light-mode .nav-dropdown-menu { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 0.25rem; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--nav-height) + 2rem) 1.5rem 2rem;
  background: radial-gradient(ellipse at 50% 40%, #1a1508 0%, #0a0a0a 70%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(201,168,76,0.08), transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(201,168,76,0.04), transparent 50%);
}
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 0.5em;
  background: linear-gradient(180deg, #f5f0e8 0%, #c9a84c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 span { color: var(--gold); display: block; }

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem); color: var(--text-muted);
  max-width: 600px; margin-bottom: 2rem;
}

/* Hero buttons use global .btn-start */

/* Hajj Countdown */
.hajj-countdown {
  margin-bottom: 1.5rem; padding: 0.6rem 1.5rem;
  border-radius: 50px; font-size: 0.95rem;
  color: var(--text-muted); letter-spacing: 0.01em;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid var(--border);
  opacity: 0; animation: fadeUp 0.6s 0.3s forwards;
}
.hajj-countdown:empty { display: none; }
.hajj-countdown strong { color: var(--gold-light); }
.hajj-countdown .countdown-date {
  display: inline-block; margin-left: 0.3rem;
  font-size: 0.82rem; opacity: 0.6;
}
.hajj-countdown .countdown-live {
  display: inline-block; animation: pulse 1.5s ease-in-out infinite;
  color: var(--gold);
}
.hajj-countdown.live {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--gold);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero .toc {
  margin-top: 3rem; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; max-width: 800px; width: 100%; text-align: left;
}
.hero .toc a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem; border-radius: 12px;
  background: rgba(255,255,255,0.03); color: var(--text-light);
  border: 1px solid var(--border-subtle);
  transition: background .2s, border-color .2s, transform .2s;
  font-size: 0.95rem;
}
.hero .toc a:hover {
  background: rgba(201,168,76,0.08); border-color: var(--border);
  transform: translateY(-2px);
}
.hero .toc .num {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(165deg, #ddb94e, #a8872e);
  color: #0a0a0a;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.hero .toc .toc-card-num {
  color: var(--gold);
  font-weight: 700;
  opacity: 0.85;
  margin-right: 0.15rem;
  font-variant-numeric: tabular-nums;
}

/* ===== Page Header ===== */
.page-header {
  padding: 0.25rem 1.5rem 1rem;
  text-align: center;
  background: linear-gradient(180deg, #151208 0%, var(--bg-dark) 100%);
}
.page-header::after {
  content: ''; display: block;
  width: 80px; height: 2px; margin: 1.5rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  letter-spacing: -0.03em; margin-bottom: 0.5rem;
  background: linear-gradient(180deg, #f5f0e8, #c9a84c);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header .lead {
  font-size: 1.15rem; color: var(--text-muted); max-width: 650px; margin: 0 auto;
}

/* ===== Content ===== */
.content { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.section-block {
  margin-bottom: 3rem; padding: 2rem;
  background: var(--bg-card); border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.section-block h2 {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem;
  color: var(--white); letter-spacing: -0.02em;
  padding-bottom: 0.75rem;
  border-bottom: none;
  background-image: linear-gradient(90deg, var(--gold), transparent);
  background-size: 100% 2px;
  background-position: bottom left;
  background-repeat: no-repeat;
}
.section-block h3 {
  font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.5rem;
  color: var(--gold-light);
}
.section-block p { margin-bottom: 0.75rem; color: var(--text-muted); }
.section-block p strong, .section-block li strong { color: var(--white); font-weight: 600; }

.section-block ul, .section-block ol {
  margin: 0.75rem 0 0.75rem 1.5rem; color: var(--text-muted);
}
.section-block li { margin-bottom: 0.4rem; }

.section-block .img-wrap {
  margin: 1.25rem 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.section-block .img-wrap img { width: 100%; }

.section-block .img-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;
  margin: 1.25rem 0;
}
.section-block .img-row .img-wrap { margin: 0; }

.quote-block {
  margin: 1rem 0; padding: 1.25rem 1.5rem;
  background: rgba(201, 168, 76, 0.04);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  font-style: italic; color: var(--text-light);
}
.quote-block cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.85rem; color: var(--text-muted); }

.arabic-text {
  font-size: 1.6rem; text-align: center; direction: rtl;
  padding: 1rem; margin: 1rem 0;
  color: var(--gold); line-height: 2;
}

.dua-block {
  margin: 1rem 0; padding: 1.25rem;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 12px; text-align: center;
}
.dua-block .transliteration {
  font-size: 1.05rem; font-weight: 600; color: var(--gold); margin-bottom: 0.5rem;
}
.dua-block .translation { font-size: 0.95rem; color: var(--text-muted); font-style: italic; }

.highlight-box {
  margin: 1rem 0; padding: 1.25rem;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 12px;
}

.checkpoint {
  margin: 2rem 0; padding: 1.5rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(201,168,76,0.02));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 16px;
}
.checkpoint h3 {
  color: var(--gold); margin-top: 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.checkpoint ol { color: var(--text-muted); }

.steps-list { counter-reset: step; list-style: none; margin-left: 0 !important; }
.steps-list li {
  counter-increment: step; position: relative;
  padding-left: 3rem; margin-bottom: 1rem !important;
}
.steps-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: linear-gradient(165deg, #ddb94e, #a8872e);
  color: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}

/* Table */
.info-table {
  width: 100%; max-width: 100%;
  border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem;
  display: block;          /* allow horizontal scroll on overflow */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.info-table > tbody, .info-table > thead { display: table; width: 100%; }
.info-table th, .info-table td {
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  word-break: break-word;
}
.info-table th { background: rgba(201,168,76,0.08); color: var(--gold-light); font-weight: 600; }
.info-table td { color: var(--text-muted); }
.info-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Spiritual Reflection */
.reflection {
  margin: 1.5rem 0; padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.04), rgba(201,168,76,0.02));
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 16px; position: relative;
  overflow: hidden;
}
.reflection::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-dark));
}
.reflection .reflection-label {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold); margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  background: rgba(201,168,76,0.08);
}
.reflection p { color: var(--text-light); font-style: italic; margin-bottom: 0.5rem; }
.reflection p:last-child { margin-bottom: 0; }
.reflection cite {
  display: block; margin-top: 0.5rem;
  font-style: normal; font-size: 0.82rem; color: var(--text-muted);
}

/* Warning / Important box */
.warning-box {
  margin: 1rem 0; padding: 1.25rem;
  background: rgba(220, 53, 69, 0.06);
  border: 1px solid rgba(220, 53, 69, 0.15);
  border-left: 4px solid #dc3545;
  border-radius: 0 12px 12px 0;
}
.warning-box strong { color: #ff6b6b; }

/* Tip box */
.tip-box {
  margin: 1rem 0; padding: 1.25rem;
  background: rgba(40, 167, 69, 0.06);
  border: 1px solid rgba(40, 167, 69, 0.15);
  border-left: 4px solid #28a745;
  border-radius: 0 12px 12px 0;
}
.tip-box strong { color: #51cf66; }

/* Fiqh note */
.fiqh-note {
  margin: 1rem 0; padding: 1rem 1.25rem;
  background: rgba(201, 168, 76, 0.03);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 12px; font-size: 0.9rem;
}
.fiqh-note .fiqh-label {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold); margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  background: rgba(201,168,76,0.08);
}

/* Section sub-header */
.section-block h4 {
  font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.4rem;
  color: var(--text-light);
}

/* Two-column layout */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin: 1rem 0;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== Page Navigation ===== */
.page-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem 4rem;
}
.page-nav a {
  flex: 1; display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1.25rem 1.5rem; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  transition: border-color .2s, transform .2s;
}
.page-nav a:hover { border-color: var(--gold); transform: translateY(-2px); }
.page-nav a .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.page-nav a .title { font-size: 1rem; font-weight: 600; color: var(--white); }
.page-nav .next { text-align: right; }

/* ===== Footer ===== */
.site-footer {
  text-align: center; padding: 2rem 1.5rem;
  border-top: none;
  color: var(--text-muted); font-size: 0.85rem;
  position: relative;
}
.site-footer::before {
  content: ''; display: block;
  width: 100px; height: 1px; margin: 0 auto 1.5rem;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.4), transparent);
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .hero {
    min-height: auto; justify-content: flex-start;
    padding-top: calc(var(--nav-height) + 1rem); padding-bottom: 2rem;
  }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; background: rgba(10,10,10,0.98);
    padding: 1rem; gap: 0; border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.95rem; }
  .nav-toggle { display: block; }
  .nav-dropdown-menu {
    display: none; position: static; background: none; border: none;
    box-shadow: none; padding: 0 0 0 1rem; min-width: 0; margin: 0;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { font-size: 0.9rem; padding: 0.6rem 1rem; }

  .section-block { padding: 1.25rem; }
  .section-block h2 { font-size: 1.3rem; }

  .page-nav { flex-direction: column; }
  .page-nav .next { text-align: left; }

  .hero .toc { grid-template-columns: 1fr; }

  .arabic-text { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 1.8rem; }
  .section-block { padding: 1rem; border-radius: 12px; }
}

/* ===== News Ticker ===== */
.news-ticker-wrap {
  position: fixed; top: var(--nav-height); left: 0; right: 0; z-index: 999;
  height: 36px; background: rgba(10, 10, 10, 0.98);
  border-bottom: 1px solid rgba(201, 168, 76, 0.12);
  display: flex; align-items: center; overflow: hidden;
  margin: 0; padding: 0;
}
.news-ticker-wrap:empty { display: none; }
.news-ticker-label {
  flex-shrink: 0; padding: 0 0.75rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #0a0a0a;
  background: linear-gradient(165deg, #ddb94e, #a8872e);
  height: 100%; display: flex; align-items: center;
  position: relative; z-index: 10;
  /* Soft drop-shadow to the right so the scrolling text fades into the label
     rather than slamming into a hard edge as it disappears under the chip. */
  box-shadow: 6px 0 8px -4px rgba(10, 10, 10, 0.7);
}
.news-ticker {
  display: flex; animation: ticker 180s linear infinite;
  white-space: nowrap;
}
.news-ticker:hover { animation-play-state: paused; }
.news-ticker a {
  display: inline-block; padding: 0 2rem;
  font-size: 0.82rem; color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
}
.news-ticker a:hover { color: var(--gold); }
.news-ticker-close {
  flex-shrink: 0; width: 36px; height: 36px;
  background: rgba(10, 10, 10, 0.98); border: none; border-left: 1px solid var(--border-subtle);
  color: var(--text-muted); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
  position: relative; z-index: 10;
}
.news-ticker-close:hover { color: var(--gold); background: rgba(201,168,76,0.1); }
.news-ticker .breaking { color: #ff6b6b; font-weight: 600; }
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
body.has-ticker { --ticker-offset: 36px; }
body.has-ticker .site-nav { border-bottom: none; }
body.has-ticker .page-header { padding-top: 0.25rem; }
body.has-ticker .hero { padding-top: calc(var(--nav-height) + var(--ticker-offset) + 2rem); }

/* ===== News Page ===== */
.news-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem;
}
.news-filter-btn {
  padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.85rem;
  background: rgba(255,255,255,0.03); color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all .2s;
}
.news-filter-btn:hover, .news-filter-btn.active {
  background: rgba(201,168,76,0.1); color: var(--gold-light);
  border-color: var(--border);
}

.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.news-card {
  background: var(--bg-card); border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden; transition: transform .2s, border-color .2s;
}
.news-card:hover { transform: translateY(-3px); border-color: var(--border); }
.news-card-img { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  padding: 0.2rem 0.6rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.news-badge.breaking { background: #dc3545; color: white; }
.news-card-body { padding: 1.25rem; }
.news-card-meta { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.78rem; }
.news-category { text-transform: uppercase; color: var(--gold); font-weight: 600; letter-spacing: 0.05em; }
.news-date { color: var(--text-muted); }
.news-card-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.4; }
.news-card-body h3 a { color: var(--white); }
.news-card-body h3 a:hover { color: var(--gold-light); }
.news-card-body p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.news-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; }
.news-source { color: var(--text-muted); }
.news-read-more { color: var(--gold); font-weight: 600; }

@media (max-width: 768px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ===== Quiz ===== */
.quiz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem; margin: 1.5rem 0;
}
.quiz-card {
  background: var(--bg-card); border-radius: 16px; padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  cursor: pointer; transition: transform .2s, border-color .2s;
  text-decoration: none; display: block;
}
.quiz-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.quiz-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.quiz-card h3 { font-size: 1.1rem; font-weight: 600; color: var(--white); margin-bottom: 0.25rem; }
.quiz-card .quiz-count { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.quiz-card .quiz-progress-bar {
  height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.quiz-card .quiz-progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.4s ease;
}
.quiz-card .quiz-status {
  margin-top: 0.5rem; font-size: 0.8rem;
  display: flex; justify-content: space-between;
}
.quiz-card .quiz-status .score { color: var(--gold); font-weight: 600; }
.quiz-card .quiz-status .progress-text { color: var(--text-muted); }

/* Quiz in-progress */
.quiz-container { max-width: 700px; margin: 0 auto; }
.quiz-header { margin-bottom: 2rem; }
.quiz-progress {
  height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06);
  margin-bottom: 1rem; overflow: hidden;
}
.quiz-progress-inner {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.3s ease;
}
.quiz-counter { font-size: 0.85rem; color: var(--text-muted); text-align: right; }
.quiz-question {
  background: var(--bg-card); border-radius: 16px; padding: 2rem;
  border: 1px solid var(--border-subtle); margin-bottom: 1.5rem;
}
.quiz-question h3 { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--white); }
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-option {
  padding: 1rem 1.25rem; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.06);
  color: var(--text-light); cursor: pointer;
  transition: all .2s; font-size: 0.95rem; text-align: left;
  font-family: inherit; width: 100%; display: block;
}
.quiz-option:hover { border-color: var(--gold); background: rgba(201,168,76,0.06); }
.quiz-option.correct {
  border-color: #28a745; background: rgba(40,167,69,0.12);
  color: var(--white);
}
.quiz-option.incorrect {
  border-color: #dc3545; background: rgba(220,53,69,0.12);
  color: var(--white);
}
.quiz-option.disabled { pointer-events: none; opacity: 0.6; }
.quiz-feedback {
  margin-top: 1rem; padding: 1rem 1.25rem; border-radius: 12px;
  font-size: 0.92rem; display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct-fb {
  background: rgba(40,167,69,0.08); border: 1px solid rgba(40,167,69,0.15);
  color: #51cf66;
}
.quiz-feedback.incorrect-fb {
  background: rgba(220,53,69,0.08); border: 1px solid rgba(220,53,69,0.15);
  color: var(--text-light);
}
.quiz-feedback .learn-more { color: var(--gold-light); font-weight: 600; }
.quiz-next-btn {
  display: none; margin-top: 1rem; padding: 0.75rem 2rem;
  border-radius: 50px; border: none;
  background: linear-gradient(165deg, #ddb94e 0%, #b8942a 50%, #c9a84c 100%) !important;
  color: #0a0a0a !important; font-size: 1rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .2s;
  box-shadow: 0 2px 8px rgba(201,168,76,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  position: relative; overflow: hidden;
}
.quiz-next-btn::before {
  content: '';
  position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.quiz-next-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.4), inset 0 1px 0 rgba(255,255,255,0.35); }
.quiz-next-btn:hover::before { left: 125%; }
.quiz-next-btn.show { display: inline-block; }

/* Quiz results */
.quiz-results { text-align: center; padding: 2rem; }
.quiz-score-circle {
  width: 140px; height: 140px; margin: 0 auto 1.5rem;
  border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 900;
}
.quiz-score-circle.pass {
  background: rgba(40,167,69,0.12); border: 4px solid #28a745; color: #51cf66;
}
.quiz-score-circle.fail {
  background: rgba(220,53,69,0.12); border: 4px solid #dc3545; color: #ff6b6b;
}
.quiz-score-circle small { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

/* Leaderboard */
.leaderboard-table {
  width: 100%; margin-top: 1rem;
  border-collapse: collapse; font-size: 0.88rem;
  table-layout: fixed;
}
.leaderboard-table th, .leaderboard-table td {
  padding: 0.6rem 0.75rem; text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle; overflow: hidden; text-overflow: ellipsis;
}
.leaderboard-table th {
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gold);
  background: rgba(201,168,76,0.06);
  white-space: nowrap;
}
.leaderboard-table th:nth-child(1) { width: 8%; }
.leaderboard-table th:nth-child(2) { width: 35%; }
.leaderboard-table th:nth-child(3) { width: 22%; }
.leaderboard-table th:nth-child(4) { width: 15%; }
.leaderboard-table th:nth-child(5) { width: 20%; }
.leaderboard-table td { color: var(--text-muted); }
.leaderboard-table td:first-child { font-weight: 700; color: var(--gold); text-align: center; }
.leaderboard-table tr:hover td { background: rgba(255,255,255,0.02); }
.leaderboard-table .country-flag { margin-right: 0.3rem; }

/* ===== Practical Guide ===== */
.practical-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem; margin: 1.5rem 0;
}
.practical-card {
  background: var(--bg-card); border-radius: 16px; padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  transition: transform .2s, border-color .2s;
  text-decoration: none; display: block;
}
.practical-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.practical-card .card-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.practical-card h3 { font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: 0.25rem; }
.practical-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Table of Contents (quick jump links) ===== */
.page-toc {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
}
.page-toc-inner {
  background: var(--bg-card); border-radius: 16px;
  border: 1px solid var(--border-subtle); padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.page-toc-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gold); margin-bottom: 0.75rem;
}
.page-toc-links {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.page-toc-links a {
  display: inline-block; padding: 0.3rem 0.75rem; border-radius: 50px;
  font-size: 0.8rem; color: var(--text-muted);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  transition: all .2s; white-space: nowrap;
}
.page-toc-links a:hover {
  background: rgba(201,168,76,0.1); color: var(--gold-light);
  border-color: var(--border);
}
.page-toc-links a.toc-checkpoint {
  background: linear-gradient(165deg, #ddb94e, #b8942a);
  color: #0a0a0a; font-weight: 600;
  border-color: transparent;
}
.page-toc-links a.toc-checkpoint:hover {
  box-shadow: 0 2px 12px rgba(201,168,76,0.3);
  color: #0a0a0a;
}

/* Quiz link card at bottom of pages */
.quiz-cta {
  margin: 2rem 0; padding: 1.5rem; text-align: center;
  background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(201,168,76,0.02));
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 16px;
}
.quiz-cta h3 { color: var(--gold); margin-bottom: 0.5rem; }
.quiz-cta p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }

/* ===== Quick Reference Mode (I am doing X now) ===== */
.quick-ref-trigger {
  display: none; /* shown via JS if in Makkah */
  margin: 1rem auto; text-align: center;
}
.quick-ref-trigger.visible { display: block; }
.quick-ref-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.85rem 1.75rem; border-radius: 16px;
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  border: 2px solid #28a745; cursor: pointer;
  background: rgba(40,167,69,0.1); color: #51cf66;
  transition: background .2s; position: relative; overflow: visible;
  animation: pulseGlow 2s ease-in-out infinite;
  line-height: 1.3;
}
.quick-ref-btn .qr-line-1 { font-weight: 700; }
.quick-ref-btn .qr-line-2 {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.92;
}
.quick-ref-btn:hover {
  background: rgba(40,167,69,0.2);
}
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(40,167,69,0.55);
    transform: scale(1);
    border-color: #28a745;
  }
  50% {
    box-shadow: 0 0 26px 10px rgba(40,167,69,0.25);
    transform: scale(1.025);
    border-color: #51cf66;
  }
}

/* Quick reference overlay */
.quick-ref-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.95); backdrop-filter: blur(8px);
  overflow-y: auto; padding: 1rem;
}
.quick-ref-overlay.open { display: flex; flex-direction: column; align-items: center; }
.quick-ref-close {
  position: fixed; top: 1rem; right: 1rem; z-index: 2001;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: var(--white); font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.quick-ref-close:hover { background: rgba(255,255,255,0.2); }

.quick-ref-content {
  max-width: 500px; width: 100%; padding: 2rem 0;
}
.quick-ref-content h2 {
  font-size: 1.5rem; font-weight: 900; color: var(--gold);
  text-align: center; margin-bottom: 1.5rem;
}
.quick-ref-step {
  margin-bottom: 1.25rem; padding: 1rem 1.25rem;
  background: var(--bg-card); border-radius: 12px;
  border-left: 4px solid var(--gold);
  position: relative;
}
.quick-ref-step .step-num {
  position: absolute; top: -0.5rem; left: -0.5rem;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(165deg, #ddb94e, #a8872e);
  color: #0a0a0a; font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.quick-ref-step h4 {
  font-size: 1rem; font-weight: 600; color: var(--white);
  margin-bottom: 0.3rem;
}
.quick-ref-step p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.quick-ref-step .qr-dua {
  margin-top: 0.5rem; padding: 0.5rem 0.75rem;
  background: rgba(201,168,76,0.06); border-radius: 8px;
  font-size: 0.85rem; color: var(--gold-light);
  direction: rtl; text-align: center; line-height: 1.8;
}
.quick-ref-step .qr-trans {
  font-size: 0.8rem; color: var(--text-muted); font-style: italic;
  text-align: center; margin-top: 0.25rem; direction: ltr;
}
.quick-ref-step.qr-today {
  border-left-color: #28a745;
  background: rgba(40, 167, 69, 0.06);
  border: 1px solid rgba(40, 167, 69, 0.2);
  border-left: 4px solid #28a745;
}
.qr-today-badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 50px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.4rem;
  background: #28a745; color: #fff;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== Inline Checkpoint Quiz ===== */
.checkpoint-quiz {
  margin: 2rem 0; padding: 1.5rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(201,168,76,0.02));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 16px;
}
.checkpoint-quiz h2 {
  color: var(--gold); font-size: 1.3rem; margin-bottom: 1rem;
  border: none; background: none; padding-bottom: 0;
}
.cp-progress { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.cp-progress-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.cp-progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.3s ease;
}
.cp-progress-text { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.cp-question h4 {
  font-size: 1.05rem; font-weight: 600; color: var(--white);
  margin-bottom: 1rem; line-height: 1.5;
}
.cp-options { display: flex; flex-direction: column; gap: 0.5rem; }
.cp-option {
  padding: 0.75rem 1rem; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.06);
  color: var(--text-light); cursor: pointer; font-size: 0.9rem;
  font-family: inherit; text-align: left; width: 100%;
  transition: all .15s;
}
.cp-option:hover { border-color: var(--gold); background: rgba(201,168,76,0.06); }
.cp-option.correct { border-color: #28a745; background: rgba(40,167,69,0.12); color: var(--white); }
.cp-option.incorrect { border-color: #dc3545; background: rgba(220,53,69,0.12); color: var(--white); }
.cp-option.disabled { pointer-events: none; }

.cp-feedback {
  margin-top: 0.75rem; padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.88rem; line-height: 1.6;
}
.cp-feedback.correct { background: rgba(40,167,69,0.08); border: 1px solid rgba(40,167,69,0.15); color: #51cf66; }
.cp-feedback.incorrect { background: rgba(220,53,69,0.06); border: 1px solid rgba(220,53,69,0.12); color: var(--text-light); }

.cp-nav {
  display: flex; justify-content: space-between; margin-top: 1rem;
}
.cp-nav-btn {
  padding: 0.5rem 1.25rem; border-radius: 50px; border: none;
  font-size: 0.85rem; font-weight: 700; font-family: inherit; cursor: pointer;
  background: linear-gradient(165deg, #ddb94e, #b8942a) !important;
  color: #0a0a0a !important;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(201,168,76,0.2);
}
.cp-nav-btn:hover {
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
  transform: translateY(-1px);
}
.cp-finish, .cp-retry {
}
.cp-finish:hover, .cp-retry:hover {
  box-shadow: 0 2px 12px rgba(201,168,76,0.3);
}

.cp-results { text-align: center; padding: 1rem 0; }
.cp-score-ring {
  width: 100px; height: 100px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.cp-score-ring.pass { background: rgba(40,167,69,0.12); border: 3px solid #28a745; }
.cp-score-ring.needs-work { background: rgba(201,168,76,0.1); border: 3px solid var(--gold); }
.cp-score-num { font-size: 1.6rem; font-weight: 900; color: var(--white); line-height: 1; }
.cp-score-label { font-size: 0.75rem; color: var(--text-muted); }
.cp-results h4 { font-size: 1rem; color: var(--text-light); margin-bottom: 1rem; font-weight: 400; }

/* ===== Hero Search Bar ===== */
.hero-search {
  width: 100%; max-width: 560px; margin-bottom: 1.75rem;
  position: relative; z-index: 50;
}
.hero-search input {
  width: 100%; padding: 0.85rem 1.5rem; border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-light); font-size: 1rem; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.hero-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search-results {
  position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; z-index: 100;
  max-height: 400px; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.hero-search-results:empty { display: none; }

/* ===== Search Overlay (Ctrl+K on non-home pages) ===== */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
  align-items: flex-start; justify-content: center;
  padding: 15vh 1rem 2rem;
}
.search-overlay.open { display: flex; }
.search-overlay-inner {
  max-width: 560px; width: 100%;
}
.search-overlay-inner input {
  width: 100%; padding: 0.85rem 1.5rem; border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(20,20,20,0.95);
  color: var(--text-light); font-size: 1rem; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-overlay-inner input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}
.search-overlay-inner input::placeholder { color: var(--text-muted); }

/* Shared search result styles */
.search-results {
  max-height: 50vh; overflow-y: auto;
  margin-top: 0.5rem; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.search-results:empty { display: none; }
.search-result {
  display: block; padding: 0.75rem 1.25rem;
  transition: background .15s; text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(201,168,76,0.06); }
.search-q {
  display: block; font-size: 0.95rem; font-weight: 600;
  color: var(--white); margin-bottom: 0.15rem;
}
.search-a {
  display: block; font-size: 0.82rem; color: var(--text-muted);
}
.search-empty {
  text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.9rem;
}

@media (max-width: 768px) {
  .search-overlay { padding: 10vh 1rem 2rem; }
}

/* ===== Reading Progress ===== */
.reading-progress {
  position: fixed; top: var(--nav-height); left: 0; right: 0;
  height: 3px; z-index: 998; background: rgba(255,255,255,0.03);
}
body.has-ticker .reading-progress { top: calc(var(--nav-height) + 36px); }
.reading-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.1s linear;
}

/* Section read marker */
.section-read-marker {
  position: absolute; top: 1rem; right: 1rem;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer; padding: 0;
}
.section-read-marker:hover {
  border-color: rgba(40,167,69,0.5);
  background: rgba(40,167,69,0.08);
}
.srm-check {
  font-size: 0.7rem; color: transparent;
  transition: color 0.3s ease;
}
.section-read .section-read-marker {
  background: rgba(40,167,69,0.12);
  border-color: rgba(40,167,69,0.4);
}
.section-read .srm-check { color: #51cf66; }

/* Resume bar */
.resume-bar {
  position: fixed; bottom: -80px; left: 0; right: 0;
  z-index: 1000; padding: 0 1rem;
  transition: bottom 0.4s ease;
}
.resume-bar.visible { bottom: 1rem; }
.resume-bar-inner {
  max-width: 600px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.6rem 0.6rem 0.6rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.resume-text {
  font-size: 0.85rem; color: var(--text-light);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.resume-last { color: var(--text-muted); font-size: 0.8rem; }
.resume-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.resume-btn {
  border: none; border-radius: 50px; cursor: pointer;
  font-family: inherit; font-size: 0.8rem; font-weight: 600;
  transition: all 0.2s;
}
.resume-continue {
  padding: 0.45rem 1rem;
  background: linear-gradient(165deg, #ddb94e, #b8942a);
  color: #0a0a0a;
}
.resume-continue:hover { box-shadow: 0 2px 12px rgba(201,168,76,0.3); }
.resume-dismiss {
  width: 32px; height: 32px; padding: 0;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.resume-dismiss:hover { background: rgba(255,255,255,0.1); color: var(--white); }

@media (max-width: 480px) {
  .resume-text .resume-last { display: none; }
  .section-read-marker { width: 20px; height: 20px; top: 0.75rem; right: 0.75rem; }
  .srm-check { font-size: 0.6rem; }
}

/* ===== Interactive Reveals ===== */
/* Content is visible by default for SEO/accessibility. JS adds .js-loaded to body, then hides. */
.reveal-hidden {
  transition: opacity 0.4s ease, max-height 0.5s ease, margin 0.3s ease, padding 0.3s ease;
}
body.js-loaded .reveal-hidden {
  opacity: 0; max-height: 0; overflow: hidden; margin: 0 !important; padding: 0 !important;
}
.reveal-show {
  opacity: 1; max-height: 2000px; overflow: visible;
}
/* Restore margins/padding on reveal */
.reveal-show.translation, .reveal-show.transliteration { margin-bottom: 0.5rem !important; }
.quote-answer.reveal-show { display: inline; }

.reveal-btn {
  display: inline-block; margin: 0.75rem 0 0.25rem;
  padding: 0.4rem 1.1rem; border-radius: 50px;
  border: 1.5px dashed var(--gold);
  background: rgba(201,168,76,0.06);
  color: var(--gold); font-size: 0.82rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.3s ease;
  animation: subtlePulse 3s ease-in-out infinite;
}
.reveal-btn:hover {
  background: rgba(201,168,76,0.12);
  border-style: solid;
  animation: none;
}
.reveal-btn-done {
  border-color: #28a745; color: #51cf66;
  background: rgba(40,167,69,0.08);
  border-style: solid; animation: none;
  pointer-events: none;
}
@keyframes subtlePulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Reflection question prompt */
.reflection-question {
  font-size: 1.1rem !important; font-weight: 600;
  color: var(--gold) !important; font-style: italic !important;
  margin: 0.5rem 0 0.25rem !important; line-height: 1.6;
  opacity: 1 !important; max-height: none !important;
  overflow: visible !important;
}
html.light-mode .reflection-question { color: #6b5210 !important; }

.reveal-btn-reflection {
  border-color: rgba(201,168,76,0.4);
  border-style: solid; width: 100%; text-align: center;
  padding: 0.6rem 1rem;
  background: rgba(201,168,76,0.1);
}
.reveal-btn-quote { font-style: italic; }
.reveal-btn-highlight { width: 100%; text-align: center; }

/* ===== Language Selector ===== */
.lang-selector { position: relative; margin-right: 0.5rem; flex-shrink: 0; }
.lang-toggle {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 50px;
  font-size: 0.78rem; font-weight: 600; font-family: inherit;
  cursor: pointer; padding: 0.3rem 0.75rem;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.lang-toggle:hover { color: var(--gold); border-color: var(--gold); }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 0.5rem); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.5rem; z-index: 1100;
  min-width: 200px; max-height: 400px; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.lang-dropdown.open { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; padding: 0.45rem 0.75rem; border: none; border-radius: 8px;
  background: none; color: var(--text-muted); font-family: inherit;
  font-size: 0.85rem; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.lang-option:hover { background: rgba(201,168,76,0.08); color: var(--gold-light); }
.lang-option.active { color: var(--gold); font-weight: 600; }
.lang-flag { font-size: 1.1rem; flex-shrink: 0; }
.lang-native { font-weight: 600; flex: 1; }
.lang-name { font-size: 0.75rem; opacity: 0.6; flex-shrink: 0; }

html.light-mode .lang-dropdown { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
html.light-mode .lang-option:hover { background: rgba(140,110,30,0.08); }

/* RTL Support */
html.rtl-mode .section-block h2 {
  background-position: bottom right;
}
html.rtl-mode .quote-block { border-left: none; border-right: 4px solid var(--gold); border-radius: 12px 0 0 12px; }
html.rtl-mode .warning-box { border-left: none; border-right: 4px solid #dc3545; border-radius: 12px 0 0 12px; }
html.rtl-mode .tip-box { border-left: none; border-right: 4px solid #28a745; border-radius: 12px 0 0 12px; }
html.rtl-mode .reflection::before { left: auto; right: 0; }
html.rtl-mode .section-read-marker { right: auto; left: 1rem; }
html.rtl-mode .page-nav .next { text-align: left; }
html.rtl-mode .steps-list li { padding-left: 0; padding-right: 3rem; }
html.rtl-mode .steps-list li::before { left: auto; right: 0; }
html.rtl-mode .nav-links { justify-content: flex-start; }
html.rtl-mode .nav-links a { text-align: right; }
html.rtl-mode .lang-dropdown { right: auto; left: 0; }
html.rtl-mode .section-block h2 { background-position: bottom right; }
html.rtl-mode .page-toc-links { direction: rtl; }

@media (max-width: 768px) {
  .lang-toggle { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
  .lang-dropdown { right: -1rem; min-width: 180px; }
}

/* ===== Font Size Controls ===== */
.font-controls {
  display: flex; align-items: center; gap: 2px;
  margin-right: 0.5rem; flex-shrink: 0;
}
.font-btn {
  background: none; border: none; color: var(--text-muted);
  font-family: inherit; cursor: pointer; padding: 0.2rem 0.35rem;
  border-radius: 4px; transition: color .2s, background .2s;
  line-height: 1;
}
.font-btn:hover { color: var(--gold); background: rgba(201,168,76,0.1); }
.font-decrease { font-size: 0.7rem; }
.font-reset { font-size: 0.85rem; font-weight: 600; }
.font-increase { font-size: 1rem; }

@media (max-width: 768px) {
  .page-controls { padding: calc(var(--nav-height) + 0.4rem) 0.75rem 0.25rem; }
  .hero { padding-top: var(--nav-height) !important; padding-bottom: 1.5rem !important; }
  body.hero-page .site-nav {
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
  }
  body.hero-page .news-ticker-wrap { display: none; }
  body.hero-page .page-controls { display: none; }
  body.hero-page.nav-visible .site-nav {
    opacity: 1; pointer-events: auto;
  }
  body.hero-page.nav-visible .news-ticker-wrap { display: flex; }
  body.hero-page.nav-visible .page-controls { display: flex; }
  /* Hide the separate floating controls - replaced by FAB */
  body.hero-page .hero-lang-float,
  body.hero-page .hero-controls-float { display: none !important; }
  body.hero-page .hero {
    padding: 0 1rem 2rem !important; margin-top: 0 !important;
    min-height: 100vh; min-height: 100dvh;
    justify-content: flex-start;
  }
  body.hero-page .hero::before { display: none; }
  body.hero-page .hero .hero-logo { margin-top: 1rem; }
  /* Floating Action Button - settings */
  .fab-settings {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 950;
  }
  /* Push back-to-top above the FAB */
  .back-to-top { bottom: 5rem !important; }
  .fab-settings-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: linear-gradient(165deg, #ddb94e, #b8942a);
    color: #0a0a0a; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(201,168,76,0.3);
    transition: transform 0.3s, box-shadow 0.2s;
  }
  .fab-settings-btn:hover { box-shadow: 0 6px 24px rgba(201,168,76,0.45); }
  .fab-settings.open .fab-settings-btn { transform: rotate(45deg); }
  .fab-menu {
    position: absolute; bottom: 56px; right: 0;
    display: none; flex-direction: column; gap: 0.5rem;
    align-items: flex-end;
  }
  .fab-settings.open .fab-menu { display: flex; }
  .fab-menu-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: 50px;
    background: linear-gradient(165deg, #ddb94e, #b8942a);
    border: none;
    box-shadow: 0 4px 16px rgba(201,168,76,0.3);
    white-space: nowrap; font-size: 0.82rem; color: #0a0a0a; font-weight: 600;
    cursor: pointer; transition: box-shadow 0.15s;
    font-family: inherit;
  }
  .fab-menu-item:hover { box-shadow: 0 6px 24px rgba(201,168,76,0.45); }

  /* Entrance animations */
  @keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes heroScaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
  }
  body.hero-page .hero > * {
    opacity: 0; animation: heroFadeUp 0.7s ease forwards;
  }
  body.hero-page .hero > *:nth-child(1) { animation: heroScaleIn 0.8s ease 0.1s forwards; }
  body.hero-page .hero > *:nth-child(2) { animation: heroFadeIn 0.6s ease 0.3s forwards; }
  body.hero-page .hero > *:nth-child(3) { animation: heroFadeUp 0.7s ease 0.5s forwards; }
  body.hero-page .hero > *:nth-child(4) { animation: heroFadeUp 0.7s ease 0.7s forwards; }
  body.hero-page .hero > *:nth-child(5) { animation: heroFadeUp 0.6s ease 0.9s forwards; }
  body.hero-page .hero > *:nth-child(6) { animation: heroFadeUp 0.6s ease 1.0s forwards; }
  body.hero-page .hero > *:nth-child(7) { animation: heroFadeUp 0.6s ease 1.1s forwards; }
  body.hero-page .hero > *:nth-child(8) { animation: heroFadeUp 0.5s ease 1.2s forwards; }
  body.hero-page .hero > *:nth-child(9) { animation: heroFadeUp 0.5s ease 1.3s forwards; }
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(165deg, #ddb94e, #b8942a);
  color: #0a0a0a; border: none; cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(10px);
}
.back-to-top.visible {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.back-to-top:hover {
  box-shadow: 0 6px 24px rgba(201,168,76,0.45);
  transform: translateY(-2px);
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===========================================================
   Guide context bar (replaces news ticker on guide pages)
   =========================================================== */
.guide-context-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* Clip any stray child overflow so a long section title can't push the
     viewport wider than itself (which was causing the burger menu to slide
     off the right edge of guide pages on mobile). */
  overflow: hidden;
  max-width: 100vw;
}
html.light-mode .guide-context-bar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
.gcb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted, #999);
  min-height: 38px;
}
.gcb-guide {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-shrink: 0;
}
.gcb-guide:hover { color: var(--gold-light); }
.gcb-guide-num {
  font-weight: 700;
  opacity: 0.85;
}
.gcb-divider {
  opacity: 0.4;
  flex-shrink: 0;
}
.gcb-section {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #e8e8e8);
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
html.light-mode .gcb-section { color: #1a1a1a; }
.gcb-section-num {
  color: var(--gold);
  font-weight: 700;
  opacity: 0.85;
  flex-shrink: 0;
}
.gcb-section-num:empty { display: none; }
.gcb-section-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcb-share {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 5px;
  padding: 0.32rem 0.7rem;
  color: var(--gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.gcb-share:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
}
.gcb-share:active { transform: scale(0.96); }
.gcb-share svg { display: block; }

/* Hide news ticker if it somehow renders on a guide page */
body.is-guide .news-ticker-wrap { display: none !important; }

/* Belt-and-braces: prevent any stray child element on guide / practical pages
   from causing horizontal page scroll (which would push the fixed nav and
   burger menu off the right edge of the viewport).
   Apply to BOTH html and body since position:fixed elements anchor to the
   initial containing block (html). overflow-x:clip is the modern equivalent
   of hidden but does NOT break position:sticky. */
html:has(body.is-guide),
html:has(body.is-practical) {
  overflow-x: clip;
  max-width: 100vw;
}
body.is-guide,
body.is-practical {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}
@supports not (overflow-x: clip) {
  html:has(body.is-guide),
  html:has(body.is-practical),
  body.is-guide,
  body.is-practical {
    overflow-x: hidden;
  }
}

/* ===========================================================
   Guide picker overlay (opens when user taps the guide name
   in the context bar — full-screen list of all guides)
   =========================================================== */
.guide-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1.25rem 2rem;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.guide-picker-overlay.open { opacity: 1; }
.guide-picker-overlay[hidden] { display: none; }

.gp-card {
  background: linear-gradient(180deg, #151208 0%, #0a0a0a 100%);
  border: 1px solid rgba(232, 198, 110, 0.25);
  border-radius: 20px;
  padding: 2rem 1.5rem 2.25rem;
  width: 100%;
  max-width: 720px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}
.guide-picker-overlay.open .gp-card { transform: translateY(0); }
html.light-mode .gp-card {
  background: linear-gradient(180deg, #faf6ec 0%, #ffffff 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.gp-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 40px; height: 40px;
  background: rgba(232, 198, 110, 0.08);
  border: 1px solid rgba(232, 198, 110, 0.2);
  border-radius: 10px;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.gp-close:hover {
  background: rgba(232, 198, 110, 0.18);
  border-color: var(--gold);
}
.gp-close:active { transform: scale(0.95); }

.gp-heading {
  margin: 0 2.5rem 0.25rem 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.gp-subtitle {
  margin: 0 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #999);
}

.gp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}

.gp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.1rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(232, 198, 110, 0.15);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text, #e8e8e8);
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.gp-item:hover {
  background: rgba(232, 198, 110, 0.07);
  border-color: rgba(232, 198, 110, 0.45);
  transform: translateY(-2px);
}
html.light-mode .gp-item {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}
html.light-mode .gp-item:hover {
  background: rgba(140, 110, 30, 0.06);
}

.gp-item.gp-active {
  background: rgba(232, 198, 110, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 0 24px rgba(232, 198, 110, 0.15);
}

.gp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(165deg, var(--gold-light), var(--gold-dark));
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.gp-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.92;
}

.gp-title {
  line-height: 1.3;
}

@media (max-width: 480px) {
  .guide-picker-overlay { padding: 3rem 1rem 1.5rem; }
  .gp-card { padding: 1.5rem 1rem 1.75rem; }
  .gp-heading { font-size: 1.2rem; }
  .gp-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .gp-item { padding: 0.9rem 0.5rem; font-size: 0.82rem; }
  .gp-num { width: 26px; height: 26px; font-size: 0.8rem; }
  .gp-icon { width: 30px; height: 30px; }
}

/* Hint that the guide breadcrumb in the context bar is interactive */
.gcb-guide { cursor: pointer; }
.gcb-guide:hover .gcb-guide-num,
.gcb-guide:hover .gcb-guide-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Section / TOC numbering */
.section-num {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.55rem;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}
.toc-num {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.4rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
}
.guide-num {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.4rem;
  opacity: 0.8;
}
/* Override the page-header h1 gradient-text effect for the number,
   otherwise the span inherits -webkit-text-fill-color:transparent
   and renders as part of the title gradient (visually invisible-feeling
   whitespace that makes the title look off-centre). */
.page-header h1 .guide-num {
  -webkit-text-fill-color: var(--gold);
  color: var(--gold);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: 0.78em;
  vertical-align: 0.12em;
  opacity: 0.75;
}
.nav-num {
  color: var(--gold);
  font-weight: 700;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  margin-right: 0.15rem;
  font-size: 0.92em;
}
.card-num {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
  margin-right: 0.4rem;
  font-size: 0.9em;
}

/* Author sign-off (used at the end of long-form sections) */
.author-signoff {
  text-align: center;
  margin-top: 1.75rem;
  color: var(--gold);
  opacity: 0.85;
  font-size: 1.05rem;
}
.author-signoff.author-name {
  margin-top: 0.4rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  opacity: 0.75;
}

/* Audio player (e.g. Talbiyah recitation under a dua-block) */
.audio-player {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.1rem;
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 8px;
  text-align: center;
}
.audio-player figcaption {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 0.55rem;
}
.audio-player audio {
  width: 100%;
  max-width: 480px;
  height: 38px;
  display: block;
  margin: 0 auto;
}
/* Tint native audio controls in WebKit/Chromium (best-effort — vendor-locked) */
.audio-player audio::-webkit-media-controls-panel {
  background-color: rgba(20, 18, 12, 0.95);
}
html.light-mode .audio-player {
  background: rgba(201, 168, 76, 0.08);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Smooth-scroll offset so sticky nav + bar don't cover the heading */
html { scroll-behavior: smooth; }
main h2[id],
main section[id] { scroll-margin-top: calc(var(--nav-height) + 56px); }

/* "A new version is available" toast (service worker update prompt).
   Slides up from the bottom; tap Refresh to reload, × to dismiss until
   the user navigates again. */
.sw-update-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(120%);
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.8rem 0.7rem 1.2rem;
  background: rgba(20, 18, 12, 0.97);
  border: 1px solid rgba(232, 198, 110, 0.45);
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  font-size: 0.88rem;
  font-weight: 500;
  color: #f0e8d4;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  max-width: calc(100vw - 32px);
}
.sw-update-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.sw-update-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-update-btn {
  background: var(--gold);
  color: #0a0a0a;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.sw-update-btn:hover { background: var(--gold-light); }
.sw-update-btn:active { transform: scale(0.96); }
.sw-update-dismiss {
  background: transparent;
  border: none;
  color: rgba(240, 232, 212, 0.55);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.35rem;
  font-family: inherit;
  flex-shrink: 0;
}
.sw-update-dismiss:hover { color: var(--gold); }
html.light-mode .sw-update-toast {
  background: rgba(255, 255, 255, 0.97);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.12);
}
@media (max-width: 480px) {
  .sw-update-toast {
    font-size: 0.82rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    gap: 0.6rem;
  }
  .sw-update-btn { padding: 0.4rem 0.95rem; font-size: 0.78rem; }
}

/* Share toast */
.share-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: #0a0a0a;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile tweaks */
@media (max-width: 768px) {
  /* Match the nav's 1.5rem horizontal padding so the breadcrumb on the
     left lines up with the logo above it, and the share button on the
     right lines up with the burger menu. */
  .gcb-inner {
    padding: 0.45rem 1.5rem;
    gap: 0.45rem;
    font-size: 0.78rem;
  }
  /* Allow the guide title to truncate gracefully when space is tight,
     but always show it (no longer collapsed to just the number). */
  .gcb-guide {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }
  .gcb-guide-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gcb-share-label { display: none; }  /* icon-only share button */
  .gcb-share { padding: 0.35rem 0.45rem; }
  main h2[id],
  main section[id] { scroll-margin-top: calc(var(--nav-height) + 50px); }
}

/* RTL adjustments */
body.rtl-mode .gcb-divider { transform: scaleX(-1); }
body.rtl-mode .section-num,
body.rtl-mode .toc-num,
body.rtl-mode .guide-num,
body.rtl-mode .nav-num {
  margin-right: 0;
  margin-left: 0.5rem;
}
