/* =========================================================================
   SHEIKH NAZIM ZAWIYA MAKINDU — Core Theme
   Palette derived from the zawiya logo: forest green, gold/amber,
   brown braid, parchment cream. Tahoma as requested.
   ========================================================================= */

/* Amiri — classic Arabic typeface for Qur'an / dhikr text (local) */
@font-face{
  font-family:'Amiri';font-style:normal;font-weight:400;font-display:swap;
  src:url('../vendor/webfonts/amiri-arabic-400-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200F,U+2010-2011;
}
@font-face{
  font-family:'Amiri';font-style:normal;font-weight:700;font-display:swap;
  src:url('../vendor/webfonts/amiri-arabic-700-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200F,U+2010-2011;
}
/* Any Arabic text: use Amiri first, Tahoma fallback */
.ar,.bismillah,.quran-card .ar,.hadith-band .ar,.footer-bottom .ar,[lang="ar"]{
  font-family:'Amiri','Traditional Arabic',Tahoma,serif;
  direction:rtl;
}

:root{
  /* Default (logo) theme */
  --green:#1F5C3D;
  --green-deep:#163F2B;
  --green-soft:#2E7A52;
  --gold:#C99A3B;
  --gold-deep:#A9792A;
  --gold-light:#E6C778;
  --braid:#5C3A1E;
  --cream:#F7F1E1;
  --cream-2:#EFE6CF;
  --surface:#FFFDF7;
  --surface-2:#F3EAD3;
  --ink:#2A2016;
  --ink-soft:#6B5A42;
  --line:#E4D8BC;
  --shadow:rgba(60,40,15,.18);
  --hero-overlay:rgba(13,32,22,.12);

  --r-sm:10px; --r-md:16px; --r-lg:24px; --r-xl:32px;
  --maxw:1180px;
  --header-h:0px; /* brand row scrolls, nav is sticky */
}

/* Madina dome theme */
:root[data-theme="madina"]{
  --green:#0E4030;
  --green-deep:#06241B;
  --green-soft:#13513C;
  --gold:#E6CB7E;
  --gold-deep:#C9A648;
  --gold-light:#F1E4B4;
  --braid:#0A3326;
  --cream:#F4FBF7;
  --cream-2:#E6F2EC;
  --surface:#FFFFFF;
  --surface-2:#EDF6F1;
  --ink:#0C2A20;
  --ink-soft:#4E6E62;
  --line:#CFE6DA;
  --shadow:rgba(6,36,27,.18);
  --hero-overlay:rgba(4,26,19,.18);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Tahoma,Geneva,Verdana,sans-serif;
  color:var(--ink);
  background:var(--cream);
  line-height:1.6;
  overflow-x:hidden;
}
img{max-width:100%;display:block}
a{color:var(--green);text-decoration:none}
h1,h2,h3,h4{font-family:Tahoma,Geneva,sans-serif;line-height:1.2;margin:0 0 .4em}
.container{max-width:var(--maxw);margin:0 auto;padding:0 20px}
.text-gold{color:var(--gold-deep)}
.text-green{color:var(--green)}

/* ---- Buttons ---- */
.btn{
  display:inline-flex;align-items:center;gap:.5em;cursor:pointer;border:none;
  font-family:inherit;font-weight:700;font-size:15px;letter-spacing:.02em;
  padding:13px 26px;border-radius:40px;transition:transform .15s,box-shadow .2s,background .2s;
}
.btn:active{transform:scale(.96)}
.btn-gold{background:var(--gold);color:#3a2a08;box-shadow:0 6px 18px var(--shadow)}
.btn-gold:hover{background:var(--gold-deep);color:#fff}
.btn-green{background:var(--green);color:#fff;box-shadow:0 6px 18px var(--shadow)}
.btn-green:hover{background:var(--green-deep)}
.btn-outline{background:transparent;color:var(--green);border:2px solid var(--green)}
.btn-outline:hover{background:var(--green);color:#fff}
.btn-ghost{background:rgba(255,255,255,.15);color:#fff;border:1.5px solid rgba(255,255,255,.55);backdrop-filter:blur(6px)}
.btn-ghost:hover{background:rgba(255,255,255,.28)}

/* ---- Section scaffolding ---- */
.section{padding:84px 0}
.section.alt{background:var(--cream-2)}
.eyebrow{
  display:inline-flex;align-items:center;gap:.6em;
  font-size:12.5px;font-weight:700;letter-spacing:.22em;text-transform:uppercase;
  color:var(--gold-deep);margin-bottom:14px;
}
.eyebrow::before,.eyebrow.center::after{
  content:"";width:34px;height:2px;background:linear-gradient(90deg,transparent,var(--gold-deep))
}
.eyebrow.center::before{background:linear-gradient(90deg,var(--gold-deep),transparent)}
.section-title{font-size:clamp(28px,4.4vw,44px);color:var(--green);margin-bottom:14px}
.section-lead{font-size:clamp(16px,2vw,18px);color:var(--ink-soft);max-width:680px}
.center-head{text-align:center}
.center-head .section-lead{margin-left:auto;margin-right:auto}

/* arabesque divider */
.divider{display:flex;align-items:center;justify-content:center;gap:14px;margin:8px 0 0}
.divider .line{height:1px;width:90px;background:linear-gradient(90deg,transparent,var(--gold-deep),transparent)}
.divider .dot{color:var(--gold-deep);font-size:18px}

/* ---- Header / Nav ---- */
/* ============ TWO-ROW HEADER ============
   Row 1 (brand): scrolls away with the page — position:relative
   Row 2 (nav):   sticks to top when Row 1 scrolls out — position:sticky
   ========================================= */

/* The outer wrapper is NOT fixed — it scrolls normally */
.site-header{
  position:relative;
  display:flex;flex-direction:column;
  background:var(--green-deep);
  z-index:1000;
}

/* -- Row 1: Logo + Brand — scrolls with page -- */
.header-brand-row{
  background:var(--green-deep);
  border-bottom:1px solid rgba(255,255,255,.1);
  position:relative; /* scrolls away */
}
.header-brand-inner{
  display:flex;align-items:center;justify-content:space-between;
  padding-top:10px;padding-bottom:10px;
}
.brand{display:flex;align-items:center;gap:20px;text-decoration:none}
.brand img{
  width:var(--logo-sz,300px);height:var(--logo-sz,300px);
  border-radius:50%;object-fit:cover;
  box-shadow:0 0 0 3px var(--gold-deep),0 4px 16px rgba(0,0,0,.4);
  flex-shrink:0;
}
.brand-txt{display:flex;flex-direction:column;gap:2px}
.brand .bt1{
  font-size:var(--bt1-sz,34px);
  font-weight:900;letter-spacing:.18em;
  color:#fff;line-height:1.05;text-transform:uppercase;
  text-decoration:underline;text-decoration-color:var(--gold);
  text-underline-offset:6px;text-decoration-thickness:2px;
}
.brand .bt2{
  font-size:var(--bt2-sz,15px);
  font-weight:700;letter-spacing:.38em;
  color:var(--gold-light);text-transform:uppercase;
}

/* -- Row 2: Nav links — STICKY, stays at top when brand row scrolls away -- */
.header-nav-row{
  background:var(--green-deep);
  border-bottom:2px solid rgba(201,154,59,.35);
  position:sticky;
  top:0;
  z-index:1100;
  display:flex;align-items:center;
  padding:6px 0;
  box-shadow:0 4px 16px rgba(0,0,0,.35);
}
.header-nav-inner{width:100%}
.nav{
  display:flex;align-items:center;
  gap:2px;flex-wrap:nowrap;
}
.nav a{
  padding:8px 14px;border-radius:24px;
  font-size:clamp(13px,1.1vw,16px);
  font-weight:700;color:rgba(255,255,255,.88);
  white-space:nowrap;
  transition:color .2s,background .2s;
}
.nav a:hover,.nav a.active{
  color:#fff;background:rgba(255,255,255,.15);
}
.nav .btn{
  margin-left:8px;padding:9px 20px;
  font-size:clamp(13px,1.1vw,15px);
  white-space:nowrap;flex-shrink:0;
}
.theme-toggle{
  width:40px;height:40px;border-radius:50%;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.1);
  display:grid;place-items:center;cursor:pointer;
  color:var(--gold-light);font-size:17px;margin-left:6px;flex-shrink:0;
  transition:transform .15s,background .2s;
}
.theme-toggle:hover{background:rgba(255,255,255,.2)}
.theme-toggle:active{transform:scale(.9) rotate(20deg)}

/* Hamburger — shown on mobile only */
.hamburger{
  display:none;width:46px;height:46px;border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.1);color:#fff;font-size:22px;cursor:pointer;
  flex-shrink:0;
}

/* mobile nav */
.mobile-nav{
  position:fixed;inset:0 0 0 auto;width:min(82vw,330px);z-index:1100;
  background:var(--surface);box-shadow:-12px 0 40px rgba(0,0,0,.25);
  transform:translateX(102%);transition:transform .32s cubic-bezier(.22,1,.36,1);
  padding:24px 22px;display:flex;flex-direction:column;gap:6px;overflow-y:auto;
}
.mobile-nav.open{transform:translateX(0)}
.mobile-nav a{padding:13px 14px;border-radius:12px;font-weight:600;color:var(--ink);font-size:16px}
.mobile-nav a:hover{background:var(--surface-2)}
.mobile-nav .close{align-self:flex-end;font-size:24px;background:none;border:none;color:var(--ink-soft);cursor:pointer;margin-bottom:8px}
.scrim{position:fixed;inset:0;background:rgba(10,8,4,.45);z-index:1050;opacity:0;pointer-events:none;transition:opacity .3s}
.scrim.show{opacity:1;pointer-events:auto}

/* Hide nav links, show hamburger on tablet/mobile */
@media(max-width:1100px){
  .header-nav-row{ display:none }
  .hamburger{ display:grid !important; place-items:center; }
}
/* On mobile, stack brand row tighter */
@media(max-width:640px){
  --header-h:100px;
  .brand img{ width:72px !important; height:72px !important; }
  .brand .bt1{ font-size:18px !important; }
  .brand .bt2{ font-size:10px !important; }
  .header-brand-inner{ padding-top:4px; padding-bottom:4px; }
}

/* ---- Footer ---- */
.site-footer{background:var(--green-deep);color:#dCe9e0;padding:60px 0 28px}
.site-footer a{color:var(--gold-light)}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:40px;margin-bottom:36px}
.site-footer h4{color:#fff;font-size:15px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:16px}
.site-footer .fbrand{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.site-footer .fbrand img{width:54px;height:54px;border-radius:50%;box-shadow:0 0 0 1.5px var(--gold)}
.site-footer ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:9px;font-size:14px}
.site-footer .muted{color:#9fc0b1;font-size:13.5px;line-height:1.7}
.footer-bottom{border-top:1px solid rgba(255,255,255,.12);padding-top:22px;text-align:center;font-size:13px;color:#9fc0b1}
.footer-bottom .ar{font-size:17px;color:var(--gold-light);display:block;margin-bottom:6px}
.footer-bottom b{color:var(--gold-light)}
@media(max-width:760px){.footer-grid{grid-template-columns:1fr;gap:28px}}

/* reveal on scroll — only hides when JS is active (html.js).
   If JS fails to load, content stays fully visible. */
.reveal{opacity:1;transform:none}
html.js .reveal{opacity:0;transform:translateY(26px);transition:opacity .7s ease,transform .7s cubic-bezier(.22,1,.36,1)}
html.js .reveal.in{opacity:1;transform:none}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001ms!important;transition-duration:.05ms!important}
  .reveal{opacity:1;transform:none}
}

/* =========================================================================
   MOBILE RESPONSIVE — Global fixes
   ========================================================================= */

/* Header is now fully green via the new two-row layout — no overrides needed */

/* ---- Hero: strong overlay so text is always readable ---- */
.hero-overlay{
  background:
    linear-gradient(
      to bottom,
      rgba(10,24,16,.45) 0%,
      rgba(10,24,16,.25) 35%,
      rgba(10,24,16,.55) 75%,
      rgba(10,24,16,.75) 100%
    ) !important;
}
.hero-overlay::after{ display:none !important; }   /* remove gold radial that competes */

/* Hero text always crisp */
.hero h1,
.hero .bismillah,
.hero p.lead,
.hero .kicker,
.hero-location{
  text-shadow:0 2px 16px rgba(0,0,0,.8) !important;
}
.hero .kicker{
  background:rgba(31,92,61,.72) !important;
  border-color:rgba(255,255,255,.35) !important;
}

/* ---- General mobile padding ---- */
@media(max-width:767px){
  .container{ padding:0 16px !important; }
  .section{ padding:52px 0 !important; }
  h1,h2{ word-break:break-word; }

  /* Hero */
  .hero{ min-height:100svh; align-items:flex-end; padding-bottom:60px; }
  .hero-content{ max-width:100% !important; }
  .hero h1{ font-size:clamp(28px,8vw,44px) !important; }
  .hero p.lead{ font-size:15px !important; margin-bottom:22px !important; }
  .hero .bismillah{ font-size:20px !important; }
  .hero-cta{ flex-direction:column; gap:10px !important; }
  .hero-cta .btn{ width:100%; justify-content:center; }
  .hero-location{ font-size:12px; padding:8px 12px; margin-top:18px; }
  .hero-dots{ bottom:18px; }

  /* Impact strip */
  .impact-grid{ grid-template-columns:repeat(2,1fr) !important; }

  /* Feeding / Learn grids */
  .feed-hero,.learn{ grid-template-columns:1fr !important; gap:28px !important; }
  .feed-collage{ grid-template-rows:repeat(3,90px) !important; }
  .programs{ grid-template-columns:1fr !important; gap:18px !important; }

  /* Footer */
  .footer-grid{ grid-template-columns:1fr !important; gap:24px !important; }
  .site-footer{ padding:44px 0 20px !important; }

  /* Donate band */
  .donate-band .container{ flex-direction:column; align-items:flex-start !important; }

  /* Cards */
  .cards.c3,.cards.c2{ grid-template-columns:1fr !important; }

  /* Qasidas */
  .qasida-list{ grid-template-columns:1fr !important; }

  /* Player */
  .player{ flex-wrap:wrap; }
}

@media(max-width:480px){
  .hero h1{ font-size:clamp(24px,7.5vw,36px) !important; line-height:1.15 !important; }
  .section-title{ font-size:clamp(22px,6vw,32px) !important; }
  .prog-card{ padding:22px 18px !important; }
  .hadith-band{ padding:50px 16px !important; }
}

/* Tablet */
@media(min-width:768px) and (max-width:1024px){
  .container{ padding:0 24px !important; }
  .feed-hero,.learn{ grid-template-columns:1fr !important; gap:36px !important; }
  .programs{ grid-template-columns:repeat(2,1fr) !important; }
  .impact-grid{ grid-template-columns:repeat(2,1fr) !important; }
  .footer-grid{ grid-template-columns:1fr 1fr !important; }
}

/* Mobile header: collapse to single row */
@media(max-width:1100px){
  .header-nav-row{ display:none !important; }
  .hamburger{ display:grid !important; place-items:center; }
  :root{ --header-h:150px; }
}
@media(max-width:600px){
  :root{ --header-h:100px; }
  .brand img{ width:72px !important; height:72px !important; }
  .brand .bt1{ font-size:16px !important; letter-spacing:.08em !important; }
  .brand .bt2{ font-size:9px !important; letter-spacing:.2em !important; }
}

/* ---- Mobile nav: green theme ---- */
.mobile-nav{
  background:var(--green-deep) !important;
  color:#fff;
}
.mobile-nav a{
  color:rgba(255,255,255,.88) !important;
  border-radius:10px;
  padding:12px 14px;
}
.mobile-nav a:hover{
  background:rgba(255,255,255,.12) !important;
  color:#fff !important;
}
.mobile-nav .close{
  color:rgba(255,255,255,.7) !important;
}
.mobile-nav .btn-outline{
  color:var(--gold-light) !important;
  border-color:var(--gold-light) !important;
}
