/* =========================================================
   header.css — هيدر الموقع المشترك (الصفحة الرئيسية + مكتبة المناهج)
   ========================================================= */
.site-header{
  position:sticky; top:0; z-index:200;
  padding:12px 20px 0;
  transition:transform .45s cubic-bezier(.2,.8,.2,1), padding .35s ease;
  pointer-events:none; /* الشريط نفسه يستقبل الضغطات */
}
.site-header.is-hidden{transform:translateY(-130%);}
.sh-bar{
  pointer-events:auto;
  max-width:1200px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:14px 22px;
  border-radius:22px;
  background:rgba(250,246,241,0);
  border:1px solid transparent;
  transition:background .35s ease, box-shadow .35s ease, border-color .35s ease, max-width .45s cubic-bezier(.2,.8,.2,1), padding .35s ease;
}
.site-header.is-scrolled .sh-bar{
  max-width:1140px;
  background:rgba(255,255,255,.9);
  -webkit-backdrop-filter:saturate(1.6) blur(14px); backdrop-filter:saturate(1.6) blur(14px);
  border-color:rgba(14,34,36,.08);
  box-shadow:0 18px 40px -22px rgba(10,53,56,.35);
  padding:10px 18px;
}

/* الشعار */
.sh-brand{display:flex; align-items:center; gap:10px; flex-shrink:0; text-decoration:none;}
.sh-brand img{height:48px; width:auto; transition:height .35s ease, transform .4s cubic-bezier(.2,.8,.2,1); filter:drop-shadow(0 6px 14px rgba(10,53,56,.12));}
.site-header.is-scrolled .sh-brand img{height:40px;}
.sh-brand:hover img{transform:scale(1.04);}
.sh-name{display:flex; flex-direction:column; line-height:1.15; font-family:var(--disp);}
.sh-name b{font-size:17px; font-weight:900; color:var(--teal-deep);}
.sh-name small{font-size:12px; font-weight:700; color:var(--red);}

/* روابط التنقل مع مؤشر متحرك */
.sh-nav{position:relative; display:flex; align-items:center; gap:2px; padding:5px; border-radius:100px; background:rgba(10,53,56,.045);}
.sh-nav a{
  position:relative; z-index:1;
  font-family:var(--disp); font-weight:700; font-size:14px; color:var(--teal-deep);
  padding:9px 15px; border-radius:100px; white-space:nowrap; text-decoration:none;
  transition:color .25s ease;
}
.sh-nav a.is-active{color:#fff;}
.sh-indicator{
  position:absolute; z-index:0; top:5px; bottom:5px; left:0; width:0;
  border-radius:100px; background:var(--teal-deep);
  box-shadow:0 8px 18px -8px rgba(10,53,56,.6);
  opacity:0;
  transition:transform .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), opacity .25s ease, background .25s ease;
}
.sh-indicator.is-hover{background:rgba(10,53,56,.1); box-shadow:none;}
.sh-nav.hovering a.is-active{color:var(--teal-deep);}

/* الأزرار */
.sh-actions{display:flex; align-items:center; gap:8px; flex-shrink:0;}
.sh-lib{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--disp); font-weight:800; font-size:14px; color:var(--teal-deep);
  padding:10px 16px; border-radius:100px; border:1.5px solid rgba(10,53,56,.14); background:#fff;
  text-decoration:none; transition:border-color .25s, transform .25s, background .25s, color .25s;
}
.sh-lib svg{width:18px; height:18px; transition:transform .35s cubic-bezier(.2,.8,.2,1);}
.sh-lib:hover{border-color:var(--teal); transform:translateY(-2px);}
.sh-lib:hover svg{transform:rotate(-10deg) scale(1.1);}
.sh-lib.is-active{background:var(--teal-deep); border-color:var(--teal-deep); color:#fff;}
.sh-cta{
  position:relative; overflow:hidden;
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--disp); font-weight:800; font-size:14px; color:#fff;
  padding:11px 18px; border-radius:100px; background:var(--red);
  box-shadow:0 12px 24px -10px rgba(229,67,58,.65);
  text-decoration:none; transition:transform .25s, box-shadow .25s;
}
.sh-cta::after{
  content:''; position:absolute; top:0; bottom:0; width:40%; right:-60%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform:skewX(-20deg); animation:shShine 4.5s ease-in-out infinite;
}
@keyframes shShine{0%,70%{right:-60%;}100%{right:130%;}}
.sh-cta:hover{transform:translateY(-2px); box-shadow:0 16px 30px -10px rgba(229,67,58,.75);}
.sh-cta svg{width:17px; height:17px;}

/* زر القائمة (جوال) */
.sh-burger{
  display:none; position:relative; width:44px; height:44px; border-radius:14px;
  border:1.5px solid rgba(10,53,56,.12); background:#fff; cursor:pointer; padding:0;
  transition:background .25s, border-color .25s;
}
.sh-burger span{
  position:absolute; right:12px; width:18px; height:2.2px; border-radius:2px; background:var(--teal-deep);
  transition:transform .4s cubic-bezier(.2,.8,.2,1), opacity .25s, width .3s, top .4s cubic-bezier(.2,.8,.2,1);
}
.sh-burger span:nth-child(1){top:15px;}
.sh-burger span:nth-child(2){top:21px; width:12px;}
.sh-burger span:nth-child(3){top:27px;}
.sh-burger:hover span:nth-child(2){width:18px;}
.menu-open .sh-burger{background:var(--teal-deep); border-color:var(--teal-deep);}
.menu-open .sh-burger span{background:#fff;}
.menu-open .sh-burger span:nth-child(1){top:21px; transform:rotate(45deg);}
.menu-open .sh-burger span:nth-child(2){opacity:0; transform:translateX(-8px);}
.menu-open .sh-burger span:nth-child(3){top:21px; transform:rotate(-45deg);}

/* شريط تقدم القراءة */
.sh-progress{pointer-events:none; position:fixed; top:0; right:0; left:0; height:3px; z-index:210;}
.sh-progress span{display:block; height:100%; width:100%; transform-origin:right; transform:scaleX(0); background:linear-gradient(270deg, var(--red), #f08a5d 60%, var(--teal));}

/* القائمة الجانبية (جوال) */
.sh-overlay{
  position:fixed; inset:0; z-index:240; background:rgba(14,34,36,.45);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  opacity:0; visibility:hidden; transition:opacity .35s ease, visibility .35s;
}
.sh-drawer{
  position:fixed; top:0; bottom:0; right:0; z-index:250;
  width:min(86vw, 360px); background:var(--cream);
  display:flex; flex-direction:column;
  transform:translateX(105%); visibility:hidden;
  transition:transform .5s cubic-bezier(.2,.8,.2,1), visibility .5s;
  box-shadow:-30px 0 60px -30px rgba(10,53,56,.5);
  border-radius:26px 0 0 26px;
  overflow:hidden;
}
.menu-open .sh-overlay{opacity:1; visibility:visible;}
.menu-open .sh-drawer{transform:none; visibility:visible;}
.shd-head{display:flex; align-items:center; justify-content:space-between; padding:18px 18px 14px; border-bottom:1px solid var(--line);}
.shd-head img{height:64px;}
.shd-close{width:40px; height:40px; border-radius:12px; border:1px solid var(--line); background:#fff; font-size:20px; line-height:1; color:var(--teal-deep); cursor:pointer;}
.shd-links{flex:1; overflow-y:auto; padding:12px 12px; display:flex; flex-direction:column; gap:4px;}
.shd-links a{
  display:flex; align-items:center; gap:14px;
  padding:13px 14px; border-radius:16px; text-decoration:none;
  font-family:var(--disp); font-weight:800; font-size:16px; color:var(--teal-deep);
  opacity:0; transform:translateX(24px);
  transition:background .2s, opacity .45s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.menu-open .shd-links a{opacity:1; transform:none;}
.shd-links a .ic{
  flex:none; width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center;
  background:#fff; border:1px solid var(--line); color:var(--teal);
  transition:background .2s, color .2s;
}
.shd-links a .ic svg{width:20px; height:20px;}
.shd-links a .arrow{margin-inline-start:auto; color:rgba(10,53,56,.3); font-size:18px; transition:transform .25s, color .25s;}
.shd-links a:active, .shd-links a:hover{background:#fff;}
.shd-links a:hover .arrow{transform:translateX(-4px); color:var(--teal);}
.shd-links a.is-active{background:var(--teal-deep); color:#fff;}
.shd-links a.is-active .ic{background:rgba(255,255,255,.12); border-color:transparent; color:#fff;}
.shd-links a.is-active .arrow{color:rgba(255,255,255,.6);}
.shd-foot{padding:16px 18px 22px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:12px;}
.shd-foot .sh-cta{justify-content:center; padding:14px; font-size:15px;}
.shd-social{display:flex; gap:8px; justify-content:center;}
.shd-social a{width:42px; height:42px; border-radius:12px; background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--teal-deep); text-decoration:none; transition:background .2s, color .2s, transform .2s;}
.shd-social a:hover{background:var(--teal); color:#fff; transform:translateY(-2px);}
.shd-social svg{width:18px; height:18px;}
body.menu-open{overflow:hidden;}

@media (max-width:1100px){
  .sh-nav{display:none;}
  .sh-burger{display:block;}
}
@media (max-width:620px){
  .site-header{padding:8px 12px 0;}
  .sh-bar{padding:10px 14px; gap:10px;}
  .site-header.is-scrolled .sh-bar{padding:8px 12px;}
  .sh-brand img{height:38px;}
  .site-header.is-scrolled .sh-brand img{height:34px;}
  .sh-name b{font-size:15px;} .sh-name small{font-size:11px;}
  .sh-actions .sh-lib, .sh-actions .sh-cta{display:none;}
}
@media (max-width:360px){ .sh-name{display:none;} }
@media (prefers-reduced-motion:reduce){
  .site-header, .sh-bar, .sh-indicator, .sh-drawer, .shd-links a{transition:none !important;}
  .sh-cta::after{animation:none;}
}
