/* ملفات إسلام يونس — ستايل مشترك لصفحات المكتبة وصفحات الملفات */
:root{
  --bg:#0A1315;
  --card:#101E20;
  --line:#22383A;
  --ink:#ECF3F1;
  --mut:#9DB3B0;
  --teal:#3BC6B4;
  --teal-dim:#2A9A8C;
  --gold:#E0B368;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
/* حزام أمان: أي عنصر يخرج عن العرض ميعملش سكرول أفقي */
html,body{overflow-x:clip;max-width:100%}

/* إخفاء آمن لحقل مصيدة السبام.
   مهم: ممنوع استخدام left:-9999px في صفحة RTL — الشمال فيها اتجاه النهاية
   فبيتحول لمساحة سكرول حقيقية بتمطّ الصفحة لآلاف البكسلات. */
.hp{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);
  white-space:nowrap;border:0;
}
body{
  font-family:'Alexandria','IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif;
  background:var(--bg);
  color:var(--ink);
  line-height:1.8;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.wrap{max-width:960px;margin:0 auto;padding:0 20px}

/* الهيدر */
.site-header{
  display:flex;align-items:center;justify-content:space-between;
  padding-block:18px;border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.05rem}
.brand img{height:44px;width:auto;object-fit:contain}
/* رابط الرجوع — نص بس من غير سهم */
.back-link{color:var(--mut);font-size:.9rem;transition:color .2s}
.back-link:hover{color:var(--teal)}

/* عناوين الصفحات */
.page-head{text-align:center;padding:56px 0 40px}
.page-head .eyebrow{
  color:var(--teal);font-size:.85rem;font-weight:600;
  letter-spacing:.5px;margin-bottom:12px;
}
.page-head h1{font-size:clamp(1.6rem,4vw,2.4rem);font-weight:800;line-height:1.4}
.page-head p{color:var(--mut);max-width:560px;margin:14px auto 0;font-size:1rem}

/* شبكة كروت المكتبة */
.grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:22px;padding-bottom:70px;
}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:16px;
  overflow:hidden;transition:transform .2s,border-color .2s;
  display:flex;flex-direction:column;
}
.card:hover{transform:translateY(-4px);border-color:var(--teal-dim)}
.card .thumb{position:relative;aspect-ratio:16/9;background:#000}
.card .thumb img{width:100%;height:100%;object-fit:cover;opacity:.9}
.card .thumb .play{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
}
.card .thumb .play span{
  width:52px;height:52px;border-radius:50%;background:rgba(10,19,21,.75);
  border:1px solid var(--teal);display:flex;align-items:center;justify-content:center;
  color:var(--teal);font-size:1.1rem;padding-inline-start:4px;
}
.card .body{padding:18px 18px 20px;display:flex;flex-direction:column;gap:10px;flex:1}
.card .tag{color:var(--gold);font-size:.75rem;font-weight:600}
.card h2{font-size:1.1rem;font-weight:700;line-height:1.5}
.card p{color:var(--mut);font-size:.88rem;flex:1}
.card .cta{
  color:var(--teal);font-weight:700;font-size:.9rem;
  display:inline-flex;align-items:center;gap:6px;
}

/* صفحة الملف الواحد */
.file-page{padding-block:48px 80px}
.file-page .eyebrow{color:var(--teal);font-weight:600;font-size:.85rem;margin-bottom:10px}
.file-page h1{font-size:clamp(1.5rem,3.5vw,2.2rem);font-weight:800;line-height:1.45;margin-bottom:14px}
.file-page .lead{color:var(--mut);max-width:640px;margin-bottom:34px}

.video-frame{
  position:relative;aspect-ratio:16/9;border-radius:16px;overflow:hidden;
  border:1px solid var(--line);background:#000;margin-bottom:40px;
}
.video-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

.file-layout{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start}

.inside{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:26px}
.inside h2{font-size:1.05rem;color:var(--gold);margin-bottom:16px}
.inside ul{list-style:none;display:flex;flex-direction:column;gap:14px}
.inside li{display:flex;gap:10px;font-size:.92rem}
.inside li::before{content:"✓";color:var(--teal);font-weight:800;flex-shrink:0}
.inside li b{color:var(--ink)}
.inside li span{color:var(--mut)}

/* الفورم */
.optin{
  background:linear-gradient(160deg,var(--card),#0C2325);
  border:1px solid var(--teal-dim);border-radius:16px;padding:26px;
}
.optin h2{font-size:1.1rem;margin-bottom:6px}
.optin .sub{color:var(--mut);font-size:.85rem;margin-bottom:18px}
.optin input[type=email]{
  width:100%;padding:13px 16px;border-radius:10px;border:1px solid var(--line);
  background:var(--bg);color:var(--ink);font-family:inherit;font-size:.95rem;
  margin-bottom:14px;transition:border-color .2s;
}
.optin input[type=email]:focus{outline:none;border-color:var(--teal)}
/* اقتراح تصحيح الإيميل — بيقترح ومبيمنعش */
.typo-hint{
  display:none;font-size:.82rem;color:var(--gold);
  margin:-6px 0 12px;line-height:1.6;
}
/* لازم تكون أدق من .optin button عشان متاخدش شكل الزرار الرئيسي */
.optin .typo-hint button{
  display:inline;width:auto;background:none;border:0;padding:0;
  margin-inline-start:4px;color:var(--teal);
  font-family:inherit;font-size:1em;font-weight:700;
  cursor:pointer;text-decoration:underline;
}
.optin .typo-hint button:hover{filter:none;color:var(--ink)}
/* The opt-in was a muted grey line under the email field and people were
   missing it entirely. It is a real choice, so it gets the weight of one —
   its own bordered card that reacts to hover and to being ticked. Still
   unticked by default: the box is easier to see, never easier to trip. */
.optin .consent{
  display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;
  padding:14px 15px;border:1px solid var(--line);border-radius:12px;
  background:rgba(59,198,180,.05);cursor:pointer;user-select:none;
  transition:border-color .18s,background .18s;
}
.optin .consent:hover{border-color:var(--teal);background:rgba(59,198,180,.1)}
.optin .consent:has(input:checked){border-color:var(--teal);background:rgba(59,198,180,.14)}
.optin .consent input{
  margin-top:1px;width:20px;height:20px;accent-color:var(--teal);cursor:pointer;flex-shrink:0;
}
.optin .consent b{
  display:block;font-size:.9rem;font-weight:600;color:var(--ink);margin-bottom:4px;line-height:1.5;
}
.optin .consent em{
  display:block;font-style:normal;font-size:.78rem;color:var(--mut);line-height:1.65;
}
.optin button{
  width:100%;padding:14px;border:0;border-radius:10px;cursor:pointer;
  background:var(--teal);color:#06211E;font-family:inherit;font-size:1rem;font-weight:800;
  transition:filter .2s;
}
.optin button:hover{filter:brightness(1.1)}
.optin button:disabled{filter:grayscale(.6);cursor:wait}
.optin .privacy{font-size:.75rem;color:var(--mut);text-align:center;margin-top:12px}
.optin .success{
  display:none;text-align:center;padding:26px 10px;
}
.optin .success h3{
  color:var(--teal);margin-bottom:6px;
  opacity:0;animation:rise-in .5s ease .55s forwards;
}
.optin .success p{
  color:var(--mut);font-size:.88rem;
  opacity:0;animation:rise-in .5s ease .75s forwards;
}
.optin .success p b{color:var(--ink)}

/* علامة الصح المتحركة */
.check{width:74px;height:74px;margin:0 auto 14px;display:block}
.check-circle{
  fill:none;stroke:var(--teal);stroke-width:3;
  stroke-dasharray:176;stroke-dashoffset:176;
  transform:rotate(-90deg);transform-origin:center;
  animation:draw .6s ease-out forwards;
}
.check-mark{
  fill:none;stroke:var(--teal);stroke-width:4;
  stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:40;stroke-dashoffset:40;
  animation:draw .35s ease-out .5s forwards;
}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes rise-in{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}
@media(prefers-reduced-motion:reduce){
  .check-circle,.check-mark{animation-duration:.01s;animation-delay:0s}
  .optin .success h3,.optin .success p{animation-duration:.01s;animation-delay:0s}
}
.optin .error-msg{
  display:none;color:#E58B8B;font-size:.82rem;margin-bottom:12px;text-align:center;
}

/* الفوتر */
.site-footer{
  border-top:1px solid var(--line);padding:26px 0;text-align:center;
  color:var(--mut);font-size:.85rem;
}
.site-footer a{color:var(--teal)}

/* ===== تابلت (لحد 900px) ===== */
@media(max-width:900px){
  .file-layout{grid-template-columns:1fr;gap:20px}
  .page-head{padding:44px 0 32px}
  .file-page{padding-block:36px 60px}
  .grid{gap:18px}
}

/* ===== موبايل (لحد 560px) ===== */
@media(max-width:560px){
  body{line-height:1.75}
  .wrap{padding:0 16px}

  .site-header{padding-block:14px}
  .brand img{height:34px}
  .back-link{font-size:.82rem}

  .page-head{padding:32px 0 26px}
  .page-head h1{font-size:1.45rem}
  .page-head p{font-size:.9rem}

  .grid{grid-template-columns:1fr;gap:16px;padding-bottom:48px}
  .card .body{padding:15px 15px 17px}

  .file-page{padding-block:26px 48px}
  .file-page h1{font-size:1.35rem}
  .file-page .lead{font-size:.92rem;margin-bottom:24px}

  .video-frame{border-radius:12px;margin-bottom:26px}

  .inside,.optin{padding:20px 16px;border-radius:12px}
  .inside li{font-size:.88rem}
  .optin input[type=email]{padding:12px 14px;font-size:16px}
  .optin button{padding:13px;font-size:.95rem}

  .site-footer{padding:20px 0;font-size:.8rem}
}
