/* ============================================================
   SIA — Dr. Safavi Islamic Academy | Global Stylesheet
   ============================================================ */

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

:root {
  --gold:       #C9A84C;
  --gold-light: #E8C97A;
  --gold-dim:   #8a6d2f;
  /* Lightened mystical deep navy/charcoal palette */
  --dark:       #12131f;   /* deep midnight navy — lighter than pure black */
  --dark-2:     #1a1b2e;   /* slightly lighter navy for alternating sections */
  --dark-3:     #22243a;   /* card/panel backgrounds */
  --dark-4:     #2a2d47;   /* hover states and borders */
  --text:       #EDE6D6;
  --text-muted: #A09585;
  --white:      #FFFFFF;
  --border:     rgba(201,168,76,0.22);
  --radius:     8px;
  --transition: 0.3s ease;
  /* Mystical glow colours */
  --glow-gold:  rgba(201,168,76,0.08);
  --glow-deep:  rgba(80,60,120,0.12);
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--dark);
  /* Subtle Islamic geometric star pattern overlay */
  background-image: url('images/islamic-pattern.svg');
  background-repeat: repeat;
  background-size: 120px 120px;
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  line-height: 1.25;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

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

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* --- Utility --- */
.gold { color: var(--gold); }
.text-center { text-align: center; }

.section {
  padding: 96px 0;
  position: relative;
}

/* Alternating section: slightly lighter navy with faint golden radial glow */
.section-alt {
  background-color: var(--dark-2);
  background-image:
    url('images/islamic-pattern.svg'),
    radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.06) 0%, transparent 70%);
  background-repeat: repeat, no-repeat;
  background-size: 120px 120px, 100% 100%;
}

/* Mystical ambient glow on main sections */
.section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.25), transparent);
  pointer-events: none;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 56px;
}

/* Arabesque-inspired divider with central diamond */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 40px;
  width: 180px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.divider::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(201,168,76,0.5);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--dark);
}
.btn-gold:hover { background: var(--gold-light); color: var(--dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,0.3); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--dark); transform: translateY(-2px); }

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(13,13,13,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.5px;
}

.nav-logo-text { display: flex; flex-direction: column; }
.nav-logo-name { font-size: 0.82rem; font-weight: 600; color: var(--white); letter-spacing: 0.3px; white-space: nowrap; }
.nav-logo-sub  { font-size: 0.62rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; position: static; flex-wrap: nowrap; }
.nav-links > li { position: relative; }
.nav-links a { font-size: 0.84rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0.3px; transition: color var(--transition); white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--white); }

.nav-cta { margin-left: 16px; flex-shrink: 0; }

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 60% 50%, rgba(201,168,76,0.07) 0%, transparent 70%), var(--dark);
  padding-top: 72px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><circle cx="400" cy="400" r="380" fill="none" stroke="%23C9A84C" stroke-width="0.3" opacity="0.15"/><circle cx="400" cy="400" r="280" fill="none" stroke="%23C9A84C" stroke-width="0.3" opacity="0.1"/><circle cx="400" cy="400" r="180" fill="none" stroke="%23C9A84C" stroke-width="0.3" opacity="0.08"/></svg>') right center / 700px no-repeat;
  pointer-events: none;
}

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; padding: 80px 0; }

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.hero-eyebrow::before { content: ''; display: block; width: 32px; height: 1px; background: var(--gold); }

.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 12px; }
.hero h1 span { color: var(--gold); }

.hero-divider { width: 56px; height: 2px; background: var(--gold); margin: 24px 0; }

.hero-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 480px; margin-bottom: 40px; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-image-frame {
  position: relative;
  width: 380px;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: grayscale(20%) contrast(1.05);
}

.hero-image-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.7) 0%, transparent 50%);
}

.hero-image-badge {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 24px;
  text-align: center;
  white-space: nowrap;
  z-index: 2;
}
.hero-image-badge .badge-name { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--white); }
.hero-image-badge .badge-title { font-size: 0.72rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }

/* --- Stats Bar --- */
.stats-bar {
  background: var(--dark-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }

.stat-item {
  text-align: center;
  padding: 0 24px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-number { font-family: 'Playfair Display', serif; font-size: 2.2rem; color: var(--gold); font-weight: 700; }
.stat-label  { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

/* --- About Section (Home) --- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }

.about-image-wrap { position: relative; }
.about-image-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: 520px;
}
.about-image-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }

.about-credential {
  position: absolute;
  bottom: 24px;
  right: -24px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 220px;
}
.about-credential .cred-title { font-size: 0.72rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.about-credential .cred-text  { font-size: 0.85rem; color: var(--text); line-height: 1.5; }

.about-content .section-label { margin-bottom: 12px; }
.about-content h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 24px; }
.about-content p  { color: var(--text-muted); margin-bottom: 20px; font-size: 0.97rem; }

.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0; }
.about-tag {
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

/* --- Courses Section --- */
.courses-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.course-card {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dim));
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}
.course-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: 0 20px 48px rgba(0,0,0,0.4); }
.course-card:hover::before { transform: scaleX(1); }

.course-icon { font-size: 2.4rem; margin-bottom: 20px; }
.course-arabic { font-size: 1.4rem; color: var(--gold-dim); margin-bottom: 12px; font-family: 'Playfair Display', serif; }
.course-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.course-card p  { color: var(--text-muted); font-size: 0.92rem; line-height: 1.7; margin-bottom: 24px; }
.course-link { font-size: 0.85rem; color: var(--gold); font-weight: 600; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; }
.course-link:hover { gap: 10px; }

/* --- Testimonial / Quote --- */
.quote-section {
  background: linear-gradient(135deg, var(--dark-3), var(--dark-2));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  text-align: center;
}
.quote-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--text);
  max-width: 760px;
  margin: 0 auto 24px;
  line-height: 1.6;
}
.quote-text::before { content: '\201C'; color: var(--gold); font-size: 3rem; line-height: 0; vertical-align: -0.5em; margin-right: 4px; }
.quote-text::after  { content: '\201D'; color: var(--gold); font-size: 3rem; line-height: 0; vertical-align: -0.5em; margin-left: 4px; }
.quote-author { font-size: 0.85rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; }

/* --- CTA Section --- */
.cta-section {
  background: radial-gradient(ellipse at center, rgba(201,168,76,0.1) 0%, transparent 70%), var(--dark);
  padding: 100px 0;
  text-align: center;
}
.cta-section h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 20px; }
.cta-section p  { color: var(--text-muted); max-width: 520px; margin: 0 auto 40px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Page Hero (inner pages) --- */
.page-hero {
  padding: 160px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(201,168,76,0.08) 0%, transparent 60%), var(--dark);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 16px; }
.page-hero p   { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* --- About Page --- */
.bio-section { padding: 96px 0; }
.bio-grid { display: grid; grid-template-columns: 340px 1fr; gap: 80px; align-items: start; }
.bio-image-frame { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); position: sticky; top: 96px; }
.bio-image-frame img { width: 100%; height: 460px; object-fit: cover; object-position: center 15%; }
.bio-content h2 { font-size: 1.6rem; margin-bottom: 16px; }
.bio-content p  { color: var(--text-muted); margin-bottom: 20px; font-size: 0.97rem; }
.bio-content h3 { font-size: 1.1rem; color: var(--gold); margin: 36px 0 16px; }

.credentials-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 40px 0; }
.credential-card {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.credential-card .cred-year  { font-size: 0.75rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.credential-card .cred-title { font-size: 0.92rem; color: var(--white); font-weight: 600; margin-bottom: 4px; }
.credential-card .cred-inst  { font-size: 0.82rem; color: var(--text-muted); }

.publications-list { list-style: none; }
.publications-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.publications-list li:last-child { border-bottom: none; }
.pub-year { font-size: 0.78rem; color: var(--gold); min-width: 44px; margin-top: 3px; }
.pub-title { font-size: 0.92rem; color: var(--text); }

/* --- Courses Page --- */
.courses-full-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }

.course-full-card {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
}
.course-full-card:hover { transform: translateY(-6px); box-shadow: 0 24px 56px rgba(0,0,0,0.4); border-color: var(--gold-dim); }

.course-card-header {
  background: linear-gradient(135deg, var(--dark-4), var(--dark-3));
  padding: 40px 36px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.course-card-icon { font-size: 2.8rem; }
.course-card-header h3 { font-size: 1.4rem; margin-bottom: 4px; }
.course-card-header .arabic { font-size: 1.1rem; color: var(--gold); font-family: 'Playfair Display', serif; }

.course-card-body { padding: 32px 36px; }
.course-card-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

.course-topics { list-style: none; margin-bottom: 28px; }
.course-topics li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.course-topics li::before { content: '◆'; color: var(--gold); font-size: 0.5rem; }
.course-topics li:last-child { border-bottom: none; }

/* --- Contact Page --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }

.contact-info h2 { font-size: 1.8rem; margin-bottom: 16px; }
.contact-info p  { color: var(--text-muted); margin-bottom: 40px; }

.contact-item { display: flex; gap: 16px; margin-bottom: 28px; align-items: flex-start; }
.contact-item-icon {
  width: 44px; height: 44px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.contact-item-label { font-size: 0.75rem; color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 4px; }
.contact-item-value { font-size: 0.95rem; color: var(--text); }

.contact-form {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
}
.contact-form h3 { font-size: 1.4rem; margin-bottom: 32px; }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 8px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-group select option { background: var(--dark-4); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Footer --- */
footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }

.footer-brand p { color: var(--text-muted); font-size: 0.88rem; margin-top: 16px; max-width: 280px; line-height: 1.7; }

.footer-col h4 { font-size: 0.78rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.88rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom .footer-links { display: flex; gap: 24px; }
.footer-bottom .footer-links a { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom .footer-links a:hover { color: var(--white); }

/* --- Course Detail Layout --- */
.course-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

/* --- Dropdown Navigation --- */
.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.nav-dropdown > a::after {
  content: '▾';
  font-size: 0.68rem;
  color: var(--gold);
  transition: transform 0.25s ease;
  line-height: 1;
}
.nav-dropdown:hover > a::after {
  transform: rotate(180deg);
}

/* Dropdown panel — positioned relative to the li, appears below nav */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  background: #141414;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  min-width: 210px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  transform: translateY(-6px);
  z-index: 9999;
  box-shadow: 0 24px 56px rgba(0,0,0,0.8);
  pointer-events: none;
  list-style: none;
}
/* Small arrow pointer above dropdown */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 24px;
  width: 10px;
  height: 10px;
  background: #141414;
  border-left: 1px solid rgba(201,168,76,0.25);
  border-top: 1px solid rgba(201,168,76,0.25);
  transform: rotate(45deg);
}
/* Dropdown opens on CLICK only — controlled by JS adding .dropdown-open class */
.nav-dropdown.dropdown-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-dropdown.dropdown-open > a::after {
  transform: rotate(180deg);
}
.dropdown-menu li a {
  display: block;
  padding: 11px 20px;
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, padding-left 0.15s ease;
  border-radius: 0;
}
.dropdown-menu li:first-child a { border-radius: 10px 10px 0 0; }
.dropdown-menu li:last-child  a { border-radius: 0 0 10px 10px; }
.dropdown-menu li a:hover {
  color: var(--white);
  background: rgba(201,168,76,0.1);
  padding-left: 26px;
}

/* Sheikh Safi al-din pill in nav */
.nav-sheikh-link {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold) !important;
  border-radius: 20px;
  padding: 5px 14px !important;
  font-size: 0.82rem !important;
  white-space: nowrap;
}
.nav-sheikh-link:hover {
  background: var(--gold) !important;
  color: var(--dark) !important;
}

/* --- Important Links Section --- */
.important-links-section {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
}
.important-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}
.important-link-card {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.important-link-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.link-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.link-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
  font-family: 'Playfair Display', serif;
}
.link-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.link-card-url {
  font-size: 0.78rem;
  color: var(--gold);
  margin-top: 8px;
  display: block;
  word-break: break-all;
}
/* ─── Mobile hamburger button — standalone fixed element ──────────────── */
/* Hidden on desktop, shown on mobile via media query below */
.mob-menu-btn {
  display: none;              /* desktop: hidden */
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 99999;             /* highest possible — above everything */
  width: 50px;
  height: 50px;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  -webkit-tap-highlight-color: transparent;
}
.mob-menu-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: #0d0d0d;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Keep nav-dotgrid as alias for JS compatibility */
.nav-dotgrid { display: none; }

/* ─── Hamburger button — inside navbar, hidden on desktop ────────────── */
.hamburger-btn {
  display: none;              /* hidden on desktop */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  -webkit-tap-highlight-color: transparent;
  /* Ensure it is always on top */
  position: relative;
  z-index: 9999;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #0d0d0d;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── Overlay (dims the page behind drawer) ─────────────────────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Right-side drawer (Archimedes style) ──────────────────────────── */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--dark-2);
  border-left: 1px solid var(--border);
  z-index: 1200;
  display: none;                 /* Safari fix: use display:none when closed */
  flex-direction: column;
  transform: translateX(110%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0.32s;
  overflow: hidden;
  overflow-y: auto;
  pointer-events: none;
}
.mobile-drawer.open {
  display: flex;                 /* Show when open */
  transform: translateX(0);
  visibility: visible;
  overflow-y: auto;
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0s;
  pointer-events: auto;
}

/* Drawer header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-drawer-title {
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.mobile-drawer-close {
  width: 34px;
  height: 34px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mobile-drawer-close:hover { background: rgba(201,168,76,0.2); }

/* Drawer nav links */
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer-nav a {
  display: block;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid rgba(201,168,76,0.08);
  transition: color 0.2s, background 0.2s;
}
.mobile-drawer-nav a:last-child { border-bottom: none; }
.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active { color: var(--gold); background: rgba(201,168,76,0.06); }

/* Drawer important links section */
.mobile-drawer-section {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 12px 20px 6px;
  font-weight: 700;
}
.mobile-drawer-section a {
  display: block;
  padding: 10px 20px 10px 28px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(201,168,76,0.06);
  transition: color 0.2s;
  line-height: 1.4;
}
.mobile-drawer-section a:last-child { border-bottom: none; }
.mobile-drawer-section a:hover { color: var(--gold); }

/* Drawer Enrol Now CTA */
.mobile-drawer-enrol {
  display: block;
  margin: 20px 20px 32px;
  background: var(--gold);
  color: var(--dark) !important;
  text-align: center;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s;
  flex-shrink: 0;
}
.mobile-drawer-enrol:hover { background: var(--gold-light); }

/* --- Responsive --- */
/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — World-class mobile-first (Apple / Google / Stripe)
   Breakpoints: 1100 · 1024 · 768 · 480
═══════════════════════════════════════════════════════════════ */

/* ── Large desktop: tighten nav gaps ── */
@media (max-width: 1100px) {
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 0.81rem; }
  .nav-logo-name { font-size: 0.78rem; }
  .nav-logo-sub  { font-size: 0.58rem; }
}

/* ── Tablet landscape ── */
@media (max-width: 1024px) {
  .hero-inner        { grid-template-columns: 1fr; gap: 48px; }
  .hero-image-wrap   { display: none; }
  .about-grid        { grid-template-columns: 1fr; }
  .about-image-wrap  { display: none; }
  .bio-grid          { grid-template-columns: 1fr; }
  .bio-image-frame   { position: static; }
  .footer-grid       { grid-template-columns: 1fr 1fr; }
  .contact-grid      { grid-template-columns: 1fr; }
  .important-links-grid { grid-template-columns: repeat(2, 1fr); }
  /* Course detail: collapse to single column on tablet too */
  .course-layout-grid {
    display: block !important;
  }
  .course-layout-grid > *:first-child { margin-bottom: 40px; }
}

/* ── Mobile: 768px and below ── */
@media (max-width: 768px) {

  /* Global */
  html, body { overflow-x: hidden; max-width: 100%; }
  .section   { padding: 52px 0; }
  .container { padding: 0 20px; }
  * { box-sizing: border-box; }

  /* ── Navigation ── */
  .nav-links                    { display: none !important; }
  /* Hide Enrol Now — target all possible class combinations to beat specificity */
  .nav-cta,
  a.nav-cta,
  .btn.nav-cta,
  .btn-gold.nav-cta,
  a.btn.nav-cta,
  a.btn.btn-gold.nav-cta        { display: none !important; }
  .mob-menu-btn                 { display: none !important; }
  .nav-dotgrid                  { display: none !important; }
  /* Show hamburger — the only mobile nav trigger */
  .hamburger-btn                { display: flex !important; }
  .mobile-overlay               { display: block; }
  /* nav-inner: logo on left, hamburger on right */
  .nav-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    width: 100% !important;
  }
  /* Logo: compact on mobile */
  .nav-logo-text  { display: flex; }
  .nav-logo-name  { font-size: 0.72rem; }
  .nav-logo-sub   { font-size: 0.52rem; letter-spacing: 1px; }
  .nav-logo-badge { width: 36px; height: 36px; font-size: 0.82rem; }

  /* ── Hero ── */
  .hero { min-height: auto; padding: 96px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding: 32px 0; }
  .hero-image-wrap { display: none; }
  .hero h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.2; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .hero-actions .btn { width: 100%; text-align: center; justify-content: center; }

  /* ── Stats bar ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .stat-item  { border-right: none; border-bottom: 1px solid var(--border); padding: 20px 12px; }
  .stat-item:nth-child(odd)  { border-right: 1px solid var(--border); }
  .stat-item:nth-child(3),
  .stat-item:nth-child(4)    { border-bottom: none; }
  .stat-number { font-size: 1.9rem; }

  /* ── About / Bio ── */
  .about-grid        { grid-template-columns: 1fr; }
  .about-image-wrap  { display: none; }
  .about-credential  { display: none; }
  .bio-grid          { grid-template-columns: 1fr; }
  .bio-image-frame   { position: static; max-height: 300px; overflow: hidden; border-radius: 12px; }
  .bio-image-frame img { height: 300px; width: 100%; object-fit: cover; }
  .credentials-grid  { grid-template-columns: 1fr; }

  /* ── Course cards (listing pages) ── */
  .courses-grid       { grid-template-columns: 1fr !important; }
  .courses-full-grid  { grid-template-columns: 1fr !important; }
  .course-card        { padding: 24px 20px; }
  .course-card-header { padding: 24px 20px 16px; }
  .course-card-body   { padding: 20px; }

  /* ── Course DETAIL pages (2-col → 1-col) ── */
  /* Handles both the CSS class and any remaining inline style */
  .course-layout-grid,
  [style*="grid-template-columns: 2fr"],
  [style*="grid-template-columns:2fr"] {
    display: block !important;
    width: 100% !important;
  }
  .course-layout-grid > *,
  [style*="grid-template-columns: 2fr"] > *,
  [style*="grid-template-columns:2fr"] > * {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 32px;
  }
  /* Sidebar stacks below main content */
  .course-sidebar {
    order: 2;
    width: 100% !important;
    max-width: 100% !important;
  }
  .course-main {
    order: 1;
    width: 100% !important;
  }

  /* ── Page hero (inner pages) ── */
  .page-hero    { padding: 112px 0 52px; }
  .page-hero h1 { font-size: clamp(1.6rem, 5vw, 2rem); }

  /* ── Articles / Books grids ── */
  .articles-grid { grid-template-columns: 1fr !important; }
  .books-grid    { grid-template-columns: 1fr !important; }
  .book-card     { flex-direction: column !important; }
  .book-cover    { width: 100% !important; max-width: 180px; margin: 0 auto 16px; }

  /* ── Contact ── */
  .contact-grid  { grid-template-columns: 1fr; }
  .contact-form  { padding: 24px 20px; }
  .form-row      { grid-template-columns: 1fr; }
  .contact-info-item { flex-direction: column; gap: 8px; }

  /* ── Footer ── */
  .footer-grid   { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 12px; }
  .footer-links  { flex-wrap: wrap; justify-content: center; }

  /* ── Important links section ── */
  .important-links-grid { grid-template-columns: 1fr; gap: 12px; }
  .important-link-card  { padding: 16px 20px; }

  /* ── Section titles ── */
  .section-title      { font-size: clamp(1.5rem, 5vw, 2rem); }
  .section-subtitle   { font-size: 0.95rem; }

  /* ── Tables: make scrollable on mobile ── */
  .table-wrap, table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* ── Prevent any element exceeding viewport width ── */
  img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
  }
  pre, code { white-space: pre-wrap; word-break: break-word; }

  /* ── Buttons: full width on mobile ── */
  .btn-group { flex-direction: column; gap: 12px; }
  .btn-group .btn { width: 100%; text-align: center; }
}

/* ── Small mobile: 480px and below ── */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }

  .hero h1       { font-size: 1.7rem; }
  .section-title { font-size: 1.5rem; }
  .page-hero h1  { font-size: 1.5rem; }

  .btn { padding: 13px 22px; font-size: 0.88rem; }
  .course-card  { padding: 20px 16px; }
  .contact-form { padding: 20px 16px; }
  .stat-number  { font-size: 1.7rem; }

  /* Nav logo: only badge on very small screens */
  .nav-logo-text { display: none; }
  .nav-logo-badge { width: 36px; height: 36px; }

  /* Stats: single column on very small screens */
  .stats-grid { grid-template-columns: 1fr; }
  .stat-item  { border-right: none !important; }

  /* Footer: center everything */
  .footer-col { text-align: center; }
  .footer-col ul { padding: 0; }
}

/* ─── Sheikh Safi al-din section on About page ─────────────────────────── */
.sheikh-about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  margin-bottom: 56px;
  align-items: start;
}

.sheikh-bio-card {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.sheikh-bio-card h3 {
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 16px;
}
.sheikh-bio-card p {
  color: var(--text-muted);
  line-height: 1.75;
}
.sheikh-bio-icon {
  width: 48px;
  height: 48px;
  background: rgba(201,168,76,0.12);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.sheikh-facts-card {
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}
.sheikh-facts-card h3 {
  font-size: 1.1rem;
  color: var(--white);
}
.sheikh-facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sheikh-facts-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.sheikh-facts-list li:last-child { border-bottom: none; }
.fact-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.sheikh-facts-list li span:last-child {
  color: var(--text);
  line-height: 1.5;
}

.sheikh-lineage-summary {
  background: linear-gradient(135deg, rgba(201,168,76,0.06) 0%, rgba(201,168,76,0.02) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}
.sheikh-lineage-summary h3 {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 16px;
}
.sheikh-lineage-summary p {
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.75;
}

@media (max-width: 768px) {
  .sheikh-about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sheikh-bio-card,
  .sheikh-facts-card,
  .sheikh-lineage-summary {
    padding: 24px;
  }
}

/* ─── Important Links page ───────────────────────────────────────────────── */
.imp-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.imp-link-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.imp-link-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(201,168,76,0.12);
}

.imp-link-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.08);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.imp-link-body { flex: 1; }

.imp-link-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.4;
}

.imp-link-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.imp-link-url {
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .imp-links-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .imp-link-card { padding: 18px; }
}

/* ═══════════════════════════════════════════════════════════════
   MYSTICAL ENHANCEMENTS — Lightened background + Islamic touches
   ═══════════════════════════════════════════════════════════════ */

/* Hero: deep mystical radial glow emanating from centre-top */
.hero {
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(201,168,76,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 50%, rgba(80,60,120,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 50%, rgba(60,80,120,0.08) 0%, transparent 50%);
}

/* Cards: slightly lighter background with subtle gold border glow */
.course-card,
.book-card,
.article-card,
.stat-item {
  background: var(--dark-3);
  border-color: rgba(201,168,76,0.18);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.course-card:hover,
.book-card:hover,
.article-card:hover {
  border-color: rgba(201,168,76,0.45);
  box-shadow: 0 8px 32px rgba(201,168,76,0.10), 0 0 0 1px rgba(201,168,76,0.12);
}

/* Navbar: slightly lighter with subtle gold bottom border */
.navbar {
  border-bottom: 1px solid rgba(201,168,76,0.15);
  background: rgba(18, 19, 31, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Quote/pullquote section: mystical purple-gold gradient */
.quote-section,
section.section.text-center:has(blockquote),
.section-quote {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(80,60,120,0.18) 0%, transparent 70%),
    var(--dark-2);
}

/* Footer: slightly lighter with gold top accent line */
.footer {
  background: var(--dark-2);
  border-top: 1px solid rgba(201,168,76,0.20);
}

/* Section heading gold underline glow */
.section-title .gold {
  text-shadow: 0 0 20px rgba(201,168,76,0.25);
}

/* Subtle star/sparkle decorative element for section labels */
.section-label::before {
  content: '✦ ';
  opacity: 0.7;
  font-size: 9px;
}
.section-label::after {
  content: ' ✦';
  opacity: 0.7;
  font-size: 9px;
}
