@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --gold:        #C9A84C;
  --gold-light:  #E8C97A;
  --gold-dark:   #9A7A2E;
  --gold-pale:   #F5E6B8;
  --deep:        #080812;
  --surface:     #0F0F22;
  --card:        #161628;
  --card-hover:  #1E1E38;
  --border:      rgba(201,168,76,0.18);
  --border-mid:  rgba(201,168,76,0.35);
  --text:        #F0EAD6;
  --text-muted:  #B8A88A;
  --text-faint:  rgba(184,168,138,0.5);
  --green:       #5BAD6F;
  --red:         #E07070;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 4px 24px rgba(201,168,76,0.22);
  --header-h:    68px;
  --max-w:       1140px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Lato', sans-serif;
  background: var(--deep);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-light); }
h1,h2,h3,h4,h5 { font-family: 'Amiri', serif; color: var(--gold-light); line-height: 1.25; }
p { color: var(--text-muted); }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 50px 0; }
#page       { padding-top: var(--header-h); }

.section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 10px;
}
.section-title    { font-size: clamp(1.8rem,4vw,2.8rem); margin-bottom: 14px; }
.section-subtitle { font-size: 1rem; color: var(--text-muted); max-width: 580px; margin-bottom: 44px; }
.text-center { text-align: center; }
.text-center .section-subtitle { margin-left: auto; margin-right: auto; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: var(--radius-sm);
  font-family: 'Amiri', serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--deep);
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(201,168,76,0.38); color: var(--deep); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--gold);
}
.btn-outline:hover { background: rgba(201,168,76,0.08); border-color: var(--gold); color: var(--gold-light); }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: var(--border-mid); transform: translateY(-3px); }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(8,8,18,0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.3s;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.logo-text      { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--gold-light); line-height: 1.1; }
.logo-text small{ display: block; font-size: 0.57rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-muted); font-family: 'Lato', sans-serif; }

/* ── Desktop nav ── */
nav#main-nav ul {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
}
nav#main-nav ul li {
  position: relative;
}
nav#main-nav ul li > a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}
nav#main-nav ul li > a:hover,
nav#main-nav ul li.active > a {
  color: var(--gold-light);
  background: rgba(201,168,76,0.08);
}
/* Dropdown caret for items with submenus */
nav#main-nav ul li.has-dropdown > a::after {
  content: '▾';
  font-size: 0.65rem;
  color: var(--gold);
  opacity: 0.7;
}
/* Dropdown panel */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: rgba(10,10,24,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 8px 0;
  z-index: 2000;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
nav#main-nav ul li.has-dropdown:hover .nav-dropdown,
nav#main-nav ul li.has-dropdown:focus-within .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: block;
  padding: 9px 18px;
  font-size: 0.83rem;
  color: var(--text-muted);
  border-radius: 0;
  transition: all 0.15s;
  background: none !important;
}
.nav-dropdown a:hover { color: var(--gold-light); background: rgba(201,168,76,0.08) !important; padding-left: 24px; }
.nav-dropdown .drop-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  padding: 8px 18px 4px;
  display: block;
  opacity: 0.7;
}
.nav-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* ── Hamburger toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 1100;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.28s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile styles ── */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  nav#main-nav {
    /* Slide down from just below the fixed header */
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #0A0A18;
    border-bottom: 1px solid var(--border-mid);
    /* Hidden state: slide up out of view */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    z-index: 998;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  }
  nav#main-nav.open {
    max-height: 600px;
    opacity: 1;
    overflow-y: auto;
  }

  /* Mobile nav list */
  nav#main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0 20px;
  }
  nav#main-nav ul li {
    border-bottom: 1px solid rgba(201,168,76,0.07);
  }
  nav#main-nav ul li:last-child { border-bottom: none; }

  nav#main-nav ul li > a {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 0;
    color: var(--text-muted);
    justify-content: space-between;
  }
  nav#main-nav ul li > a:hover,
  nav#main-nav ul li.active > a {
    background: rgba(201,168,76,0.07) !important;
    color: var(--gold-light);
    padding-left: 30px;
  }

  /* Mobile dropdowns: show inline below parent */
  .nav-dropdown {
    display: none !important; /* hide hover dropdowns on mobile */
  }
  /* Mobile sub-links shown inline */
  .mobile-sub {
    display: block;
    background: rgba(201,168,76,0.03);
    border-top: 1px solid rgba(201,168,76,0.06);
  }
  .mobile-sub a {
    display: block;
    padding: 10px 24px 10px 38px;
    font-size: 0.85rem;
    color: var(--text-faint);
    border-bottom: 1px solid rgba(201,168,76,0.04);
    transition: all 0.15s;
  }
  .mobile-sub a:last-child { border-bottom: none; }
  .mobile-sub a:hover { color: var(--gold); background: rgba(201,168,76,0.06); }
}
@media (min-width: 861px) {
  .mobile-sub { display: none !important; }
}

/* ============================================================
   PAGE HERO BANNER (inner pages)
   ============================================================ */
.page-hero {
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 90% at 50% 50%, rgba(201,168,76,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero h1 { font-size: clamp(2rem,5vw,3.2rem); margin-bottom: 10px; position: relative; }
.page-hero p  { color: var(--text-muted); max-width: 560px; margin: 0 auto; position: relative; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 44px 0 0;
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
.footer-col h4 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--gold);
  margin-bottom: 14px;
}
.footer-col p { font-size: 0.85rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom p { font-size: 0.76rem; color: var(--text-faint); margin: 0; }

/* ============================================================
   ORNAMENT
   ============================================================ */
.ornament { color: var(--gold); opacity: 0.3; letter-spacing: 10px; text-align: center; margin: 8px 0; }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.field-wrap label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 6px;
}
.field-wrap input,
.field-wrap select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 13px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.field-wrap input:focus,
.field-wrap select:focus { border-color: var(--gold); }
.field-wrap select option { background: var(--deep); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in   { animation: fadeInUp 0.6s ease both; }
.delay-1   { animation-delay: 0.1s; }
.delay-2   { animation-delay: 0.2s; }
.delay-3   { animation-delay: 0.3s; }
.delay-4   { animation-delay: 0.4s; }

/* ============================================================
   MOSQUE SVG BACKGROUND (used on homepage)
   ============================================================ */
.mosque-bg {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1400px;
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } .section { padding: 50px 0; } }

/* ============================================================
   HUB CARDS (Duas hub, Tools hub)
   ============================================================ */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  margin-top: 44px;
}
.hub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px 44px;
  text-decoration: none;
  display: block;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.hub-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.hub-card:hover { border-color: var(--border-mid); transform: translateY(-5px); box-shadow: 0 14px 44px rgba(0,0,0,0.4); }
.hub-card:hover::before { opacity: 1; }
.hub-icon { font-size: 2.2rem; margin-bottom: 14px; display: block; }
.hub-arabic { font-family: 'Amiri', serif; font-size: 1.25rem; color: var(--gold); direction: rtl; margin-bottom: 8px; line-height: 1.5; }
.hub-title { font-family: 'Amiri', serif; font-size: 1.3rem; color: var(--gold-light); margin-bottom: 8px; }
.hub-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 14px; }
.hub-meta { font-size: 0.68rem; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; }
.hub-arrow { position: absolute; bottom: 22px; right: 22px; color: var(--gold); opacity: 0.35; font-size: 1.1rem; transition: all 0.3s; }
.hub-card:hover .hub-arrow { opacity: 1; transform: translateX(4px); }

/* ============================================================
   BOOK CLUB
   ============================================================ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.book-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}
.book-card:hover { border-color: var(--border-mid); transform: translateY(-3px); }
.book-cover {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--surface), var(--card));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.book-cover-text {
  position: absolute; inset: 0; padding: 20px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  background: linear-gradient(160deg, rgba(201,168,76,0.12), rgba(13,13,26,0.8));
}
.book-cover-title { font-family:'Amiri',serif; font-size: 1.1rem; color: var(--gold-light); margin-bottom: 6px; line-height: 1.3; }
.book-cover-author { font-size: 0.72rem; color: var(--text-muted); }
.book-info { padding: 16px 18px; }
.book-cat {
  display: inline-block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.5px;
  background: rgba(201,168,76,0.1); border: 1px solid var(--border); border-radius: 20px;
  padding: 3px 10px; color: var(--gold); margin-bottom: 8px;
}
.book-title { font-family:'Amiri',serif; font-size: 1rem; color: var(--gold-light); margin-bottom: 4px; line-height: 1.3; }
.book-author { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.book-desc { font-size: 0.78rem; color: var(--text-faint); line-height: 1.6; }

/* Filter pills */
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pill {
  padding: 6px 16px; border-radius: 20px; font-size: 0.78rem; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: all 0.2s; font-family: inherit;
}
.pill:hover { border-color: var(--gold); color: var(--gold); }
.pill.active { background: linear-gradient(135deg,var(--gold-dark),var(--gold)); border-color: var(--gold); color: var(--deep); font-weight: 700; }

/* Add book form */
.add-book-panel {
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
  display: none;
}
.add-book-panel.open { display: block; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width:580px) { .form-grid-2 { grid-template-columns:1fr; } }

/* ============================================================
   MENTAL HEALTH PAGE
   ============================================================ */
.condition-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.cond-tab {
  padding: 8px 18px; border-radius: 20px; font-size: 0.82rem;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.cond-tab:hover { border-color: var(--gold); color: var(--gold); }
.cond-tab.active { background: linear-gradient(135deg,var(--gold-dark),var(--gold)); border-color: var(--gold); color: var(--deep); font-weight: 700; }
.verse-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 30px; margin-bottom: 16px;
  border-left: 3px solid var(--gold);
}
.verse-type { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin-bottom: 10px; }
.verse-arabic { font-family:'Amiri',serif; font-size: 1.5rem; color: var(--text); direction:rtl; text-align:right; line-height:2; margin-bottom:14px; }
.verse-translit { font-family:'Amiri',serif; font-size:0.9rem; font-style:italic; color:var(--gold-light); margin-bottom:10px; line-height:1.7; }
.verse-translation { font-size:0.88rem; color:var(--text-muted); line-height:1.8; }
.verse-ref { display:inline-block; margin-top:12px; font-size:0.7rem; background:rgba(201,168,76,0.08); border:1px solid var(--border); border-radius:20px; padding:3px 12px; color:var(--text-faint); }

/* ============================================================
   ZAKAT DEBT TABS
   ============================================================ */
.debt-period-tabs { display:flex; gap:0; margin-bottom:16px; border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); width:fit-content; }
.debt-period-btn { padding:7px 16px; font-size:0.78rem; font-weight:700; font-family:'Lato',sans-serif; border:none; background:transparent; color:var(--text-muted); cursor:pointer; transition:all 0.2s; }
.debt-period-btn.active { background:linear-gradient(135deg,var(--gold-dark),var(--gold)); color:var(--deep); }
