/* =========================================================
   جمعية الأمراض المزمنة (SCD) — الأنماط الرئيسية المشتركة
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root{
  /* الألوان الأساسية - مستمدة من شعار الجمعية */
  --primary:        #4A7FC7;
  --primary-600:    #3D6BAE;
  --primary-dark:   #1E3A63;
  --primary-darker: #142a4a;
  --primary-light:  #EAF1FB;
  --primary-lighter:#F5F9FE;

  --accent-teal:    #2FA88A;
  --accent-teal-dark:#1F8A70;
  --accent-amber:   #E8A33D;
  --accent-rose:    #D65B6B;

  --ink:            #1A2333;
  --ink-soft:       #384258;
  --muted:          #6B7A90;
  --muted-2:        #96A3B8;
  --line:           #E3E9F2;
  --surface:        #FFFFFF;
  --surface-dim:    #F6F9FD;
  --surface-alt:    #EFF4FB;

  --shadow-sm: 0 1px 3px rgba(20,42,74,.06), 0 1px 2px rgba(20,42,74,.08);
  --shadow-md: 0 6px 20px rgba(20,42,74,.10);
  --shadow-lg: 0 16px 40px rgba(20,42,74,.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-display: 'Almarai', 'IBM Plex Sans Arabic', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Almarai', sans-serif;

  --container: 1200px;
  --header-h: 76px;

  color-scheme: light;
}

html.dark{
  color-scheme: dark;
  --ink:            #EAF0FA;
  --ink-soft:       #C9D4E5;
  --muted:          #93A2BA;
  --muted-2:        #6B7A90;
  --line:           #223252;
  --surface:        #0F1B2E;
  --surface-dim:    #0B1522;
  --surface-alt:    #16243B;
  --primary-light:  #16263F;
  --primary-lighter:#111E33;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow-md: 0 6px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font-body);
  background:var(--surface);
  color:var(--ink);
  direction:rtl;
  line-height:1.75;
  -webkit-font-smoothing:antialiased;
  transition:background .3s ease, color .3s ease;
}
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; color:var(--ink); }
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; }
ul{ margin:0; padding:0; list-style:none; }
::selection{ background:var(--primary); color:#fff; }

:focus-visible{
  outline:3px solid var(--accent-teal);
  outline-offset:2px;
  border-radius:4px;
}

.container{
  max-width:var(--container);
  margin-inline:auto;
  padding-inline:24px;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:700;
  color:var(--primary);
  background:var(--primary-light);
  padding:6px 14px;
  border-radius:999px;
  margin-bottom:16px;
}
.eyebrow::before{
  content:'';
  width:6px; height:6px;
  border-radius:50%;
  background:var(--accent-teal);
}

/* ============ Header / Nav ============ */
.site-header{
  position:sticky; top:0; z-index:100;
  height:var(--header-h);
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
  border-bottom:1px solid var(--line);
}
.site-header .container{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand img{ width:44px; height:44px; border-radius:50%; }
.brand-text{ display:flex; flex-direction:column; line-height:1.2; }
.brand-text strong{ font-family:var(--font-display); font-size:16px; font-weight:800; color:var(--primary-dark); }
html.dark .brand-text strong{ color:#fff; }
.brand-text span{ font-size:11px; color:var(--muted); letter-spacing:.3px; }

.main-nav{ display:flex; align-items:center; gap:4px; }
.main-nav a{
  padding:9px 14px;
  border-radius:10px;
  font-size:14.5px;
  font-weight:500;
  color:var(--ink-soft);
  white-space:nowrap;
  transition:background .18s, color .18s;
}
.main-nav a:hover{ background:var(--primary-light); color:var(--primary-dark); }
.main-nav a.active{ background:var(--primary); color:#fff; }

.header-actions{ display:flex; align-items:center; gap:10px; }

.icon-btn{
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--ink-soft);
  transition:background .18s, transform .18s, border-color .18s;
}
.icon-btn:hover{ background:var(--primary-light); border-color:var(--primary); color:var(--primary); }
.icon-btn svg{ width:19px; height:19px; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 22px;
  border-radius:12px;
  font-size:14.5px; font-weight:700;
  border:1px solid transparent;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s;
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--primary); color:#fff; box-shadow:var(--shadow-sm); }
.btn-primary:hover{ background:var(--primary-600); box-shadow:var(--shadow-md); }
.btn-ghost{ background:transparent; color:var(--primary-dark); border-color:var(--line); }
html.dark .btn-ghost{ color:#fff; }
.btn-ghost:hover{ background:var(--primary-light); border-color:var(--primary); }
.btn-teal{ background:var(--accent-teal); color:#fff; }
.btn-teal:hover{ background:var(--accent-teal-dark); }
.btn-sm{ padding:8px 16px; font-size:13px; }
.btn-lg{ padding:15px 30px; font-size:16px; border-radius:14px; }
.btn-block{ width:100%; }

.menu-toggle{ display:none; }

/* ============ Hero shapes (signature: arcs echoing the logo's raised arms) ============ */
.arc-divider{
  position:relative;
  height:64px;
  overflow:hidden;
}
.arc-divider svg{ position:absolute; inset:0; width:100%; height:100%; }

.page-hero{
  position:relative;
  padding:64px 0 96px;
  background:
    radial-gradient(1100px 420px at 50% -160px, var(--primary-light), transparent),
    var(--surface);
  overflow:hidden;
  text-align:center;
}
.page-hero h1{
  font-size:clamp(28px,4vw,44px);
  font-weight:800;
  color:var(--primary-dark);
  max-width:760px;
  margin-inline:auto;
}
html.dark .page-hero h1{ color:#fff; }
.page-hero p{
  max-width:640px;
  margin:16px auto 0;
  color:var(--muted);
  font-size:16.5px;
}
.page-hero .breadcrumb{
  display:flex; justify-content:center; gap:8px;
  font-size:13.5px; color:var(--muted); margin-bottom:18px;
}
.page-hero .breadcrumb a:hover{ color:var(--primary); }

/* ============ Sections ============ */
section{ padding:76px 0; }
.section-head{ text-align:center; max-width:640px; margin:0 auto 44px; }
.section-head h2{ font-size:clamp(24px,3.4vw,34px); font-weight:800; }
.section-head p{ color:var(--muted); margin-top:12px; font-size:15.5px; }
.section-dim{ background:var(--surface-dim); }

/* ============ Cards ============ */
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:transparent; }

.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); }

/* Stat block */
.stat{
  text-align:center; padding:28px 18px;
  border-radius:var(--radius-md);
  background:var(--surface);
  border:1px solid var(--line);
}
.stat b{
  display:block;
  font-family:var(--font-display);
  font-size:clamp(26px,3.4vw,38px);
  font-weight:800;
  color:var(--primary);
  margin-bottom:6px;
}
.stat span{ font-size:14px; color:var(--muted); font-weight:500; }

/* Service card */
.service-card{ padding:30px 26px; text-align:right; }
.service-card .icon-wrap{
  width:56px; height:56px; border-radius:16px;
  background:var(--primary-light);
  display:grid; place-items:center;
  margin-bottom:18px;
  color:var(--primary);
}
.service-card .icon-wrap svg{ width:28px; height:28px; }
.service-card h3{ font-size:18px; font-weight:700; margin-bottom:10px; }
.service-card p{ color:var(--muted); font-size:14.5px; }
.service-card .more{ display:inline-flex; align-items:center; gap:6px; margin-top:16px; color:var(--primary); font-weight:700; font-size:14px; }

/* Article card */
.article-card{ overflow:hidden; }
.article-card .thumb{
  height:170px; background:var(--primary-light);
  display:grid; place-items:center; color:var(--primary);
  position:relative;
}
.article-card .thumb .tag{
  position:absolute; top:12px; right:12px;
  background:var(--surface); color:var(--primary);
  font-size:11.5px; font-weight:700; padding:5px 12px; border-radius:999px;
  box-shadow:var(--shadow-sm);
}
.article-card .body{ padding:20px; }
.article-card h3{ font-size:16.5px; font-weight:700; line-height:1.5; margin-bottom:10px; }
.article-card .meta{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--muted-2); margin-top:14px; }

/* Video card */
.video-card{ overflow:hidden; }
.video-card .thumb{
  height:180px; background:var(--primary-dark);
  position:relative; display:grid; place-items:center;
}
.video-card .thumb .play{
  width:56px;height:56px;border-radius:50%;
  background:rgba(255,255,255,.15); border:2px solid #fff;
  display:grid; place-items:center; color:#fff;
  backdrop-filter:blur(4px);
  transition:transform .2s;
}
.video-card:hover .thumb .play{ transform:scale(1.1); }
.video-card .duration{
  position:absolute; bottom:10px; left:10px;
  background:rgba(0,0,0,.6); color:#fff; font-size:11.5px;
  padding:3px 9px; border-radius:6px;
}
.video-card .body{ padding:16px 18px; }
.video-card h3{ font-size:15px; font-weight:700; }
.video-card .meta{ font-size:12.5px; color:var(--muted); margin-top:8px; }

/* Event card */
.event-card{ display:flex; gap:18px; padding:20px; align-items:center; }
.event-date{
  flex:0 0 74px; height:74px; border-radius:16px;
  background:var(--primary); color:#fff;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.event-date b{ font-size:22px; font-weight:800; line-height:1; }
.event-date span{ font-size:12px; margin-top:4px; }
.event-info h3{ font-size:15.5px; font-weight:700; margin-bottom:6px; }
.event-info p{ font-size:13px; color:var(--muted); }

/* Badge */
.badge{
  display:inline-block; padding:4px 12px; border-radius:999px;
  font-size:12px; font-weight:700;
}
.badge-teal{ background:rgba(47,168,138,.12); color:var(--accent-teal-dark); }
.badge-amber{ background:rgba(232,163,61,.15); color:#966619; }
.badge-primary{ background:var(--primary-light); color:var(--primary); }

/* Consultant card */
.consultant-card{ padding:26px; text-align:center; }
.consultant-card .avatar{
  width:88px; height:88px; border-radius:50%; margin:0 auto 16px;
  background:var(--primary-light); color:var(--primary);
  display:grid; place-items:center; font-size:30px; font-weight:800;
}
.consultant-card h3{ font-size:16px; font-weight:700; }
.consultant-card .spec{ color:var(--primary); font-size:13.5px; font-weight:600; margin-top:4px; }
.consultant-card .days{ color:var(--muted); font-size:12.5px; margin-top:10px; }

/* Q&A */
.qa-card{ padding:24px; }
.qa-card .q-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.qa-card .q-text{ font-weight:700; font-size:15.5px; }
.qa-card .q-meta{ font-size:12.5px; color:var(--muted-2); margin-top:6px; }
.qa-card .a-block{
  margin-top:14px; padding:16px; border-radius:12px;
  background:var(--surface-dim); border-inline-start:3px solid var(--accent-teal);
}
.qa-card .a-block .a-by{ font-size:12.5px; color:var(--accent-teal-dark); font-weight:700; margin-bottom:6px; }
.qa-card .a-block p{ font-size:14.5px; color:var(--ink-soft); }

/* Forms */
.form-field{ margin-bottom:18px; text-align:right; }
.form-field label{ display:block; font-size:14px; font-weight:600; margin-bottom:8px; color:var(--ink-soft); }
.form-field .hint{ font-size:12px; color:var(--muted-2); margin-top:6px; }
.form-field input,
.form-field select,
.form-field textarea{
  width:100%;
  padding:13px 16px;
  border-radius:12px;
  border:1.5px solid var(--line);
  background:var(--surface);
  color:var(--ink);
  font-family:inherit;
  font-size:14.5px;
  transition:border-color .18s, box-shadow .18s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primary-light);
  outline:none;
}
.form-field textarea{ resize:vertical; min-height:120px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.checkbox-row{ display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.checkbox-row input{ width:18px; height:18px; accent-color:var(--primary); }
.checkbox-row label{ font-size:14px; color:var(--ink-soft); }

/* Search & filter bar */
.filter-bar{
  display:flex; gap:12px; flex-wrap:wrap; align-items:center;
  padding:18px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); margin-bottom:36px;
}
.filter-bar .search-box{ flex:1; min-width:220px; position:relative; }
.filter-bar .search-box svg{ position:absolute; top:50%; right:16px; transform:translateY(-50%); width:18px; color:var(--muted-2); }
.filter-bar .search-box input{ padding-right:44px; }
.chip-group{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{
  padding:8px 16px; border-radius:999px; font-size:13.5px; font-weight:600;
  background:var(--surface-alt); color:var(--ink-soft); border:1px solid transparent;
  transition:background .18s, color .18s;
}
.chip.active, .chip:hover{ background:var(--primary); color:#fff; }

/* Skeleton loading */
.skeleton{
  background:linear-gradient(90deg, var(--surface-alt) 25%, var(--line) 37%, var(--surface-alt) 63%);
  background-size:400% 100%;
  animation:skeleton-loading 1.4s ease infinite;
  border-radius:8px;
}
@keyframes skeleton-loading{ 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }

/* Toast */
#toast-root{ position:fixed; bottom:24px; left:24px; z-index:9999; display:flex; flex-direction:column; gap:10px; }
.toast{
  display:flex; align-items:center; gap:10px;
  background:var(--ink); color:#fff;
  padding:14px 20px; border-radius:12px; box-shadow:var(--shadow-lg);
  font-size:14px; font-weight:600;
  animation:toast-in .28s ease;
  min-width:260px;
}
html.dark .toast{ background:#fff; color:var(--ink); }
.toast.success{ border-inline-start:4px solid var(--accent-teal); }
.toast.error{ border-inline-start:4px solid var(--accent-rose); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(12px);} to{opacity:1; transform:none;} }

/* Reveal-on-scroll animation */
.reveal{ opacity:0; transform:translateY(18px); transition:opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1 !important; transform:none !important; transition:none !important; }
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}

/* Footer */
.site-footer{
  background:var(--primary-dark);
  color:#D7E3F6;
  padding:64px 0 0;
}
html.dark .site-footer{ background:#081120; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1.2fr; gap:40px; padding-bottom:44px; border-bottom:1px solid rgba(255,255,255,.12); }
.footer-brand{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.footer-brand img{ width:44px; height:44px; border-radius:50%; }
.footer-brand strong{ font-family:var(--font-display); font-size:16px; color:#fff; }
.site-footer p{ font-size:14px; color:#AEC1E0; line-height:1.9; }
.site-footer h4{ color:#fff; font-size:15px; font-weight:700; margin-bottom:18px; }
.site-footer ul li{ margin-bottom:12px; }
.site-footer ul a{ font-size:14px; color:#AEC1E0; transition:color .18s; }
.site-footer ul a:hover{ color:#fff; }
.social-row{ display:flex; gap:10px; margin-top:18px; }
.social-row a{
  width:38px; height:38px; border-radius:50%;
  background:rgba(255,255,255,.08);
  display:grid; place-items:center; color:#fff;
  transition:background .18s;
}
.social-row a:hover{ background:var(--accent-teal); }
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center;
  padding:22px 0; font-size:13px; color:#8AA0C4; flex-wrap:wrap; gap:10px;
}

/* Utilities */
.text-center{ text-align:center; }
.mt-8{ margin-top:8px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;} .mt-48{margin-top:48px;}
.flex{ display:flex; } .items-center{align-items:center;} .justify-between{justify-content:space-between;} .gap-8{gap:8px;} .gap-12{gap:12px;} .gap-16{gap:16px;}
.w-full{ width:100%; }
.hidden{ display:none !important; }

/* Empty state */
.empty-state{ text-align:center; padding:60px 20px; color:var(--muted); }
.empty-state svg{ width:52px; height:52px; margin:0 auto 16px; color:var(--muted-2); }
.empty-state h3{ font-size:16px; color:var(--ink-soft); margin-bottom:8px; }
.empty-state p{ font-size:14px; }

/* Pagination */
.pagination{ display:flex; justify-content:center; gap:8px; margin-top:44px; }
.pagination button{
  width:40px; height:40px; border-radius:10px; border:1px solid var(--line);
  background:var(--surface); color:var(--ink-soft); font-weight:600; font-size:14px;
}
.pagination button.active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.pagination button:hover:not(.active){ background:var(--primary-light); }

/* ============ Responsive ============ */
@media (max-width:980px){
  .main-nav{ display:none; }
  .menu-toggle{ display:grid; }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .grid-4{ grid-template-columns:repeat(2,1fr); }
  .grid-3{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:640px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; }
  section{ padding:56px 0; }
  .page-hero{ padding:44px 0 64px; }
  .form-row{ grid-template-columns:1fr; }
  .event-card{ flex-direction:column; text-align:center; }
}

/* Mobile drawer nav */
.mobile-nav{
  position:fixed; inset:0; z-index:200;
  background:rgba(10,18,32,.5);
  opacity:0; pointer-events:none; transition:opacity .25s;
}
.mobile-nav.open{ opacity:1; pointer-events:auto; }
.mobile-nav .panel{
  position:absolute; top:0; right:0; bottom:0; width:82%; max-width:340px;
  background:var(--surface); padding:24px; overflow-y:auto;
  transform:translateX(100%); transition:transform .3s ease;
  display:flex; flex-direction:column; gap:4px;
}
.mobile-nav.open .panel{ transform:none; }
.mobile-nav a{
  padding:14px 12px; border-radius:10px; font-weight:600; font-size:15px;
  color:var(--ink-soft);
}
.mobile-nav a.active{ background:var(--primary); color:#fff; }
.mobile-nav .close-btn{ align-self:flex-start; margin-bottom:12px; }
