/* =====================================================================
   MSICF — مؤسسة رعاية المساجد والمؤسسات الشرعية
   نظام تصميم مطابق لهوية الموقع الأصلي: أخضر/ذهبي، خط Cairo فقط،
   بطاقات مستديرة الحواف بأسلوب مألوف واحترافي، متجاوب بالكامل.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root{
  --green:      #0b5241;
  --green-2:    #1a7a5e;
  --green-3:    #2a9d82;
  --green-bg:   #e8f5f0;
  --green-bg2:  #f2faf7;
  --gold:       #c9a84c;
  --gold-2:     #e8c96d;
  --gold-bg:    #fdf9ee;
  --dark:       #0c1714;
  --text:       #1a2820;
  --mid:        #3a5248;
  --muted:      #7a9c8e;
  --border:     rgba(11,82,65,.14);
  --shadow-sm:  0 2px 12px rgba(11,82,65,.08);
  --shadow:     0 6px 28px rgba(11,82,65,.13);
  --shadow-lg:  0 16px 52px rgba(11,82,65,.18);
  --r:          14px;
  --r-lg:       22px;
  --r-xl:       32px;
  --white:      #ffffff;
}

*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; font-size:16px; }
body{
  font-family:'Cairo', sans-serif;
  direction:rtl;
  color:var(--text);
  background:#fff;
  line-height:1.8;
  overflow-x:hidden;
  width:100%;
}
img{ display:block; max-width:100%; height:auto; }
a{ color:inherit; text-decoration:none; }
ul,ol{ list-style:none; }
button{ font-family:inherit; cursor:pointer; }
::selection{ background:var(--gold-2); color:var(--dark); }

h1,h2,h3,h4{
  font-family:'Cairo', sans-serif;
  font-weight:800;
  color:var(--green);
  line-height:1.35;
}
h1{ font-size:clamp(1.9rem,4.6vw,3.2rem); }
h2{ font-size:clamp(1.5rem,3vw,2.15rem); }
h3{ font-size:clamp(1.1rem,2vw,1.35rem); }
.eyebrow{
  font-size:.82rem; font-weight:700; letter-spacing:.01em;
  color:var(--gold); display:flex; align-items:center; gap:.5em; margin-bottom:10px;
}
.eyebrow::before{ content:""; width:22px; height:3px; background:var(--gold); border-radius:2px; display:inline-block; }
p{ color:var(--mid); }
.lede{ font-size:1.06rem; color:var(--mid); max-width:64ch; }

.wrap{ max-width:1180px; margin:0 auto; padding:0 20px; width:100%; }
.section{ padding:64px 0; }
.section.tight{ padding:40px 0; }
.section.on-green{ background:var(--green-bg2); }
.section.on-dark{ background:var(--dark); }
.section.on-dark h1,.section.on-dark h2,.section.on-dark h3{ color:var(--white); }
.section.on-dark p{ color:#cfe0d6; }
.section.on-dark .eyebrow{ color:var(--gold-2); }

/* ---------------- Image frame — simple, consistent rounded corners (no fixed-px arches) ---------------- */
.img-frame{
  position:relative; border-radius:var(--r-lg); overflow:hidden;
  border:1px solid var(--border); box-shadow:var(--shadow); background:var(--green-bg);
  width:100%;
}
.img-frame img{ width:100%; height:100%; object-fit:cover; display:block; }
.ratio-4-3{ aspect-ratio:4/3; }
.ratio-1-1{ aspect-ratio:1/1; }
.ratio-16-10{ aspect-ratio:16/10; }

/* ---------------- Navbar ---------------- */
#navbar{
  position:fixed; top:0; right:0; left:0; z-index:999; height:74px;
  background:rgba(255,255,255,.96); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
#navbar .wrap{ height:100%; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand img{ height:40px; width:40px; flex-shrink:0; }
.brand-text{ font-weight:800; font-size:.98rem; color:var(--green); line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-text small{ display:block; font-weight:500; font-size:.66rem; color:var(--muted); }
nav.mainnav{ display:flex; gap:4px; align-items:center; }
nav.mainnav a{
  font-size:.9rem; font-weight:600; padding:9px 12px; color:var(--mid);
  border-radius:8px; transition:.2s;
}
nav.mainnav a:hover,nav.mainnav a.active{ color:var(--green); background:var(--green-bg); }
.nav-cta{
  background:var(--green)!important; color:var(--white)!important; padding:10px 18px!important;
  border-radius:999px!important; font-weight:700!important;
}
.nav-cta:hover{ background:var(--green-2)!important; }
.navToggle{ display:none; background:none; border:0; color:var(--green); font-size:1.6rem; padding:6px; }

@media(max-width:960px){
  nav.mainnav{
    position:fixed; top:74px; right:0; left:0; background:var(--white);
    flex-direction:column; align-items:stretch; padding:8px 16px 18px;
    border-bottom:1px solid var(--border); box-shadow:var(--shadow);
    max-height:calc(100vh - 74px); overflow-y:auto;
    transform:translateY(-8px); opacity:0; visibility:hidden; transition:.2s;
  }
  nav.mainnav.open{ transform:translateY(0); opacity:1; visibility:visible; }
  nav.mainnav a{ padding:13px 10px; border-bottom:1px solid var(--green-bg); border-radius:0; }
  .nav-cta{ margin-top:10px; text-align:center; }
  .navToggle{ display:block; }
}

/* ---------------- Hero ---------------- */
.hero{ padding:118px 0 56px; }
.hero-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:40px; align-items:center; }
.hero h1{ margin-bottom:16px; }
.hero .lede{ margin-bottom:26px; }
.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; }
.btn{
  display:inline-flex; align-items:center; gap:8px; padding:13px 24px; font-weight:700; font-size:.92rem;
  border-radius:999px; border:2px solid transparent; transition:.2s;
}
.btn-primary{ background:var(--green); color:var(--white); }
.btn-primary:hover{ background:var(--green-2); }
.btn-ghost{ border-color:var(--green); color:var(--green); }
.btn-ghost:hover{ background:var(--green); color:var(--white); }
.btn-gold{ background:var(--gold); color:var(--dark); }
.btn-gold:hover{ background:var(--gold-2); }
.hero-stat{
  margin-top:18px; display:inline-flex; align-items:center; gap:14px; background:var(--gold-bg);
  border:1px solid var(--border); border-radius:var(--r); padding:14px 18px; max-width:100%;
}
.hero-stat b{ font-size:1.5rem; color:var(--green); white-space:nowrap; }
.hero-stat span{ font-size:.82rem; color:var(--mid); }
@media(max-width:860px){ .hero-grid{ grid-template-columns:1fr; } .hero{ padding-top:96px; } }

/* ---------------- Stat register strip ---------------- */
.register{ background:var(--dark); color:var(--white); }
.register .wrap{ display:grid; grid-template-columns:repeat(4,1fr); gap:0; }
.reg-item{ padding:26px 14px; text-align:center; border-right:1px solid rgba(255,255,255,.1); }
.reg-item:first-child{ border-right:none; }
.reg-item b{ display:block; font-size:1.7rem; font-weight:800; color:var(--gold-2); }
.reg-item span{ font-size:.78rem; color:#cfe0d6; }
@media(max-width:700px){ .register .wrap{ grid-template-columns:repeat(2,1fr); } .reg-item{ border-right:1px solid rgba(255,255,255,.1); } .reg-item:nth-child(2n+1){ border-right:none; } }

/* ---------------- Grids ---------------- */
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.grid-2{ display:grid; grid-template-columns:repeat(2,1fr); gap:26px; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media(max-width:860px){ .grid-3{ grid-template-columns:1fr 1fr; } .grid-2{ grid-template-columns:1fr; } .grid-4{ grid-template-columns:1fr 1fr; } }
@media(max-width:560px){ .grid-3{ grid-template-columns:1fr; } .grid-4{ grid-template-columns:1fr 1fr; } }

.card{
  background:var(--white); border:1px solid var(--border); border-radius:var(--r-lg);
  display:flex; flex-direction:column; overflow:hidden; transition:.2s; height:100%;
}
.card:hover{ box-shadow:var(--shadow); transform:translateY(-2px); }
.card .img{ aspect-ratio:16/10; overflow:hidden; background:var(--green-bg); }
.card .img img{ width:100%; height:100%; object-fit:cover; }
.card .body{ padding:18px 20px 22px; display:flex; flex-direction:column; gap:8px; flex:1; }
.card .body h3{ font-size:1.08rem; }
.card .body p{ font-size:.9rem; }
.card .tag{ font-size:.72rem; color:var(--gold); font-weight:700; }
.card .more{ margin-top:auto; padding-top:8px; font-size:.85rem; font-weight:700; color:var(--green); }

.sector-band{
  display:grid; grid-template-columns:.85fr 1.15fr; gap:28px; align-items:center;
  background:var(--green-bg2); border:1px solid var(--border); border-radius:var(--r-xl);
  padding:26px; margin-bottom:22px;
}
.sector-band .img-frame{ aspect-ratio:4/3; }
.sector-band:nth-child(even){ grid-template-columns:1.15fr .85fr; }
.sector-band:nth-child(even) .imgcol{ order:2; }
@media(max-width:820px){
  .sector-band, .sector-band:nth-child(even){ grid-template-columns:1fr; padding:18px; }
  .sector-band:nth-child(even) .imgcol{ order:0; }
}

/* ---------------- Mini photo strip (extra images per sector) ---------------- */
.photo-strip{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:12px; margin-top:16px; }
.photo-strip .img-frame{ aspect-ratio:1/1; border-radius:var(--r); box-shadow:none; }

/* ---------------- Timeline / spec list ---------------- */
.speclist{ display:flex; flex-direction:column; }
.speclist li{ display:flex; gap:14px; padding:16px 0; border-bottom:1px solid var(--border); }
.speclist li .num{
  flex-shrink:0; width:34px; height:34px; border-radius:50%; background:var(--green-bg);
  color:var(--green); font-weight:800; font-size:.85rem; display:flex; align-items:center; justify-content:center;
}
.speclist li .txt b{ color:var(--green); display:block; margin-bottom:2px; }
.speclist li .txt span{ display:block; color:var(--mid); font-size:.9rem; }

/* ---------------- Stat cards for project pages ---------------- */
.stat-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:26px 0; }
.stat-card{ background:var(--gold-bg); border:1px solid var(--border); border-radius:var(--r); padding:16px; text-align:center; }
.stat-card b{ display:block; font-size:1.4rem; font-weight:800; color:var(--green); }
.stat-card span{ font-size:.78rem; color:var(--mid); }
@media(max-width:700px){ .stat-row{ grid-template-columns:1fr 1fr; } }

/* ---------------- Story blocks ---------------- */
.story-block{ display:grid; grid-template-columns:.85fr 1.15fr; gap:32px; align-items:center; margin-bottom:44px; }
.story-block:nth-child(even){ grid-template-columns:1.15fr .85fr; }
.story-block:nth-child(even) .story-figure{ order:2; }
.story-figure .img-frame{ aspect-ratio:1/1; }
.story-num{ color:var(--gold); font-weight:800; font-size:.9rem; margin-bottom:6px; display:block; }
@media(max-width:820px){ .story-block, .story-block:nth-child(even){ grid-template-columns:1fr; } .story-block:nth-child(even) .story-figure{ order:0; } }

/* ---------------- Gallery ---------------- */
.gal-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:12px; }
.gal-grid figure{ margin:0; border:1px solid var(--border); border-radius:var(--r); overflow:hidden; aspect-ratio:1/1; }
.gal-grid img{ width:100%; height:100%; display:block; object-fit:cover; }

/* ---------------- Footer ---------------- */
footer{ background:var(--dark); color:#cfe0d6; padding:48px 0 20px; }
.foot-grid{ display:grid; grid-template-columns:1.3fr 1fr 1fr 1fr; gap:30px; margin-bottom:32px; }
footer h4{ color:var(--white); font-size:1rem; margin-bottom:14px; font-weight:800; }
footer a{ display:block; padding:5px 0; font-size:.88rem; color:#cfe0d6; }
footer a:hover{ color:var(--gold-2); }
.foot-brand img{ height:40px; margin-bottom:12px; }
.foot-bottom{ border-top:1px solid rgba(255,255,255,.12); padding-top:18px; font-size:.8rem; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; color:#9fb8ab; }
@media(max-width:760px){ .foot-grid{ grid-template-columns:1fr 1fr; } }
@media(max-width:460px){ .foot-grid{ grid-template-columns:1fr; } }

/* ---------------- Misc ---------------- */
.badge-legal{ display:inline-flex; align-items:center; gap:8px; background:var(--gold-bg); border:1px solid var(--border); border-radius:999px; padding:9px 16px; font-size:.83rem; margin:5px 5px 0 0; }
.badge-legal b{ color:var(--green); }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:center; }
@media(max-width:820px){ .two-col{ grid-template-columns:1fr; } }
.center{ text-align:center; }
.mx-auto{ margin-left:auto; margin-right:auto; }
.mt-10{margin-top:10px;} .mt-20{margin-top:20px;} .mt-40{margin-top:40px;} .mt-60{margin-top:60px;}
.small{ font-size:.85rem; color:var(--muted); }
.section-head{ max-width:680px; margin-bottom:36px; }
.section-head.center{ margin-left:auto; margin-right:auto; text-align:center; }

.breadcrumb{ font-size:.82rem; color:var(--muted); padding:96px 0 0; }
.breadcrumb .wrap{ display:flex; gap:6px; flex-wrap:wrap; }
.breadcrumb a{ color:var(--green); }

.donate-box{ background:var(--white); border:1px solid var(--border); border-radius:var(--r-lg); padding:24px; box-shadow:var(--shadow-sm); }
.donate-box h4{ color:var(--green); margin-bottom:8px; font-size:1.05rem; font-weight:800; }
.donate-box .row{ display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px dashed var(--border); font-size:.9rem; gap:10px; }

.need-card{ background:var(--white); border:1px solid var(--border); border-radius:var(--r-lg); padding:22px; height:100%; }
.need-card .amt{ color:var(--gold); font-weight:800; font-size:1.1rem; margin-bottom:6px; display:block; }
.need-card h3{ margin-bottom:8px; }
.need-card p{ font-size:.9rem; }

/* Prevent any accidental horizontal overflow anywhere */
.wrap, .hero-grid, .grid-2, .grid-3, .grid-4, .two-col, .sector-band, .story-block { max-width: none; }
