/* ============================================================
   Blessings from Allah — Global Stylesheet
   Green Islamic theme. Non-sectarian. Mobile-first.
   ============================================================ */

:root {
  /* Green palette */
  --green-900: #08301f;
  --green-800: #0d4a30;
  --green-700: #13603f;
  --green-600: #1a7a52;
  --green-500: #248f63;
  --green-400: #46a880;
  --green-100: #e4f2ea;
  --green-50:  #f1f8f4;

  /* Accent + neutrals */
  --gold:      #c9a227;
  --gold-soft: #e3c65e;
  --cream:     #f8f6ef;
  --paper:     #ffffff;
  --ink:       #17251d;
  --ink-soft:  #40514a;
  --line:      #e3e8e2;

  --maxw: 1180px;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(8, 48, 31, 0.10);
  --shadow-lg: 0 20px 50px rgba(8, 48, 31, 0.16);
  --font-head: 'Amiri', 'Georgia', serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle Islamic geometric pattern layer behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%231a7a52' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M30 0l30 30-30 30L0 30z'/%3E%3Cpath d='M30 12l18 18-18 18-18-18z'/%3E%3Ccircle cx='30' cy='30' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-color: var(--cream);
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--green-900); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
p { margin-bottom: 1rem; color: var(--ink-soft); }
a { color: var(--green-700); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 76px 0; }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 720px; margin: 0 auto 1rem; }
.arabic { font-family: var(--font-head); direction: rtl; font-size: 1.9rem; color: var(--green-700); line-height: 1.9; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 600; color: var(--gold); margin-bottom: .6rem; }
.divider { width: 90px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border: 0; margin: 18px auto 26px; border-radius: 3px; }
.text-gold { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 50px;
  font-weight: 600; font-family: var(--font-body); cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, box-shadow .2s, background .2s;
  font-size: .98rem;
}
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-800); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-outline { background: transparent; color: var(--green-700); border-color: var(--green-600); }
.btn-outline:hover { background: var(--green-700); color: #fff; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 246, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--green-900); }
.brand:hover { color: var(--green-900); }
.brand .mark { width: 40px; height: 40px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a { padding: 9px 14px; border-radius: 8px; font-weight: 500; font-size: .95rem; color: var(--ink); }
.nav-links a:hover, .nav-links a.active { background: var(--green-100); color: var(--green-800); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--green-800); margin: 5px 0; border-radius: 3px; transition: .3s; }

.nav-links a { font-size: .92rem; }
@media (max-width: 1040px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 10px 16px 18px; box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 12px; border-radius: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  padding: 120px 0 130px;
  background: linear-gradient(rgba(8,48,31,0.82), rgba(13,74,48,0.88)),
              var(--hero-fallback, linear-gradient(135deg, #0d4a30, #13603f));
  background-size: cover; background-position: center;
}
.hero.has-img { background-image: linear-gradient(rgba(8,48,31,0.80), rgba(10,48,31,0.88)), var(--hero-img); }
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255,255,255,.9); }
.hero .arabic { color: var(--gold-soft); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.page-hero { padding: 84px 0 70px; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon { width: 54px; height: 54px; margin-bottom: 16px; color: var(--green-600); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: .96rem; margin-bottom: 0; }

.feature-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: linear-gradient(135deg, var(--green-700), var(--green-500)); min-height: 300px; }
.feature-img img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center; }
.split.reverse .split-text { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.reverse .split-text { order: 0; } }

/* ---------- Name cards (99 names) ---------- */
.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.name-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow); transition: transform .2s;
  border-top: 3px solid var(--gold);
}
.name-card:hover { transform: translateY(-4px); }
.name-card .ar { font-family: var(--font-head); font-size: 2.1rem; color: var(--green-700); }
.name-card .tr { font-weight: 600; color: var(--green-900); margin-top: 6px; }
.name-card .mn { font-size: .9rem; color: var(--ink-soft); }

/* ---------- Callout / verse ---------- */
.verse {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: #fff; border-radius: var(--radius); padding: 44px 40px; text-align: center;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.verse::after {
  content: ""; position: absolute; inset: 0; opacity: .12; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M40 0l40 40-40 40L0 40z'/%3E%3Cpath d='M40 16l24 24-24 24-24-24z'/%3E%3C/g%3E%3C/svg%3E");
}
.verse > * { position: relative; z-index: 1; }
.verse .arabic { color: var(--gold-soft); margin-bottom: 14px; }
.verse .ref { font-size: .9rem; letter-spacing: .05em; opacity: .85; margin-top: 10px; }
.verse p { color: rgba(255,255,255,.94); font-size: 1.15rem; }

/* ---------- Accordion (FAQ) ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-q { width: 100%; text-align: left; background: none; border: 0; padding: 20px 22px; font-size: 1.05rem; font-weight: 600; color: var(--green-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 14px; font-family: var(--font-body); }
.acc-q:hover { background: var(--green-50); }
.acc-q .plus { flex: none; font-size: 1.4rem; color: var(--gold); transition: transform .25s; }
.acc-item.open .acc-q .plus { transform: rotate(45deg); }
.acc-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc-a-inner { padding: 0 22px 20px; }
.acc-item.open .acc-a { max-height: 400px; }

/* ---------- Tools / widgets ---------- */
.widget { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.widget h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.prayer-list { list-style: none; margin-top: 16px; }
.prayer-list li { display: flex; justify-content: space-between; padding: 13px 4px; border-bottom: 1px dashed var(--line); font-weight: 500; }
.prayer-list li:last-child { border-bottom: 0; }
.prayer-list li.next { background: var(--green-50); border-radius: 10px; padding: 13px 14px; color: var(--green-800); font-weight: 700; }
.prayer-list .t { color: var(--green-700); font-weight: 700; }
.hijri-badge { display: inline-block; background: var(--green-100); color: var(--green-800); border-radius: 50px; padding: 8px 18px; font-weight: 600; margin-top: 8px; }
.field { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.field input, .field select { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-size: .95rem; flex: 1; min-width: 140px; }
.muted { font-size: .85rem; color: var(--ink-soft); }
.qibla-dial { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--green-100); position: relative; margin: 14px auto; background: var(--green-50); }
.qibla-needle { position: absolute; top: 12px; left: 50%; width: 4px; height: 63px; background: linear-gradient(var(--gold), var(--green-700)); transform-origin: bottom center; transform: translateX(-50%); border-radius: 4px; transition: transform .5s; }

/* ---------- Pill list / resources ---------- */
.res-group { margin-bottom: 30px; }
.res-list { list-style: none; display: grid; gap: 12px; }
.res-list li { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green-600); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.res-list a { font-weight: 600; }
.res-list .desc { font-size: .92rem; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Stat / theme strip ---------- */
.strip { background: linear-gradient(135deg, var(--green-800), var(--green-700)); color: #fff; }
.strip h2, .strip h3 { color: #fff; }
.strip p { color: rgba(255,255,255,.9); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.8); padding: 60px 0 26px; margin-top: 20px; }
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 1.05rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }
.site-footer a { color: rgba(255,255,255,.78); display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand .mark { width: 42px; height: 42px; }
.footer-brand strong { font-family: var(--font-head); font-size: 1.3rem; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding-top: 20px; text-align: center; font-size: .86rem; color: rgba(255,255,255,.6); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 99 Names explorer ---------- */
.name-card { position: relative; }
.name-card .num { position: absolute; top: 10px; left: 12px; font-size: .72rem; font-weight: 700; color: var(--gold); background: var(--green-50); border-radius: 50px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.notd-card { background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: #fff; border-radius: var(--radius); padding: 30px; text-align: center; box-shadow: var(--shadow-lg); }
.notd-card .eyebrow { color: var(--gold-soft); }
.notd-card .ar { font-family: var(--font-head); font-size: 3rem; color: #fff; line-height: 1.2; }
.notd-card .tr { font-weight: 700; font-size: 1.3rem; margin-top: 6px; }
.notd-card .mn { color: rgba(255,255,255,.9); }
.names-toolbar, .duas-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.names-toolbar input, .duas-toolbar input { flex: 1; min-width: 240px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 50px; font-family: var(--font-body); font-size: 1rem; box-shadow: var(--shadow); }
.names-toolbar input:focus, .duas-toolbar input:focus { outline: 2px solid var(--green-400); }

/* ---------- Du'a library ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { border: 1px solid var(--green-200, #cfe4d8); background: var(--paper); color: var(--green-800); padding: 8px 16px; border-radius: 50px; font-family: var(--font-body); font-weight: 600; font-size: .88rem; cursor: pointer; transition: .2s; }
.chip:hover { border-color: var(--green-500); }
.chip.on { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.dua-card { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.dua-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dua-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.dua-ar { font-size: 1.7rem !important; text-align: right; color: var(--green-800); margin-bottom: 10px; }
.dua-tr { font-style: italic; color: var(--ink-soft); margin-bottom: 6px; }
.dua-en { color: var(--ink); margin-bottom: 6px; }
.dua-ref { margin-bottom: 0 !important; }
.listen { border: 1px solid var(--green-500); background: var(--green-50); color: var(--green-800); border-radius: 50px; padding: 6px 14px; font-family: var(--font-body); font-weight: 600; font-size: .82rem; cursor: pointer; transition: .2s; }
.listen:hover { background: var(--green-700); color: #fff; }

/* ---------- Zakat calculator ---------- */
.zk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
@media (max-width: 520px) { .zk-grid { grid-template-columns: 1fr; } }
.zakat-form label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; color: var(--green-900); gap: 5px; }
.zakat-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-weight: 500; }
.zakat-result { margin-top: 8px; }
.z-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.z-total { display: flex; justify-content: space-between; margin-top: 12px; background: var(--green-700); color: #fff; padding: 14px 18px; border-radius: 12px; font-size: 1.1rem; }
.z-total strong { color: var(--gold-soft); }
.z-total.below { background: var(--green-100); color: var(--green-800); display: block; text-align: center; }

/* ---------- Upcoming Islamic dates ---------- */
.holiday { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px dashed var(--line); gap: 12px; }
.holiday:last-child { border-bottom: 0; }
.hol-badge { flex: none; background: var(--green-100); color: var(--green-800); border-radius: 50px; padding: 6px 14px; font-weight: 700; font-size: .82rem; }

/* ---------- Utility ---------- */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-2{margin-top:1.4rem}
.tag { display:inline-block; background: var(--green-100); color: var(--green-800); font-size:.8rem; font-weight:600; padding:4px 12px; border-radius:50px; }
