/* collab.ma4.media — امتداد لهوية ma4.media
   القاعدة اللي اتأكدنا منها بالحساب: --brand (#9D25CD) تباينه على الخلفية
   الغامقة 3.46:1 — ساقط للنص. فبنستخدمه للخلفيات المملوءة بس،
   و --brand-300 (#C56BE6، تباين 6.39:1) لأي نص بنفسجي. */

:root{
  --ink:        #07050B;
  --ink-2:      #0E0A15;
  --ink-3:      #171022;
  --line:       rgba(255,255,255,.12);
  --text:       #F4F2EE;
  --muted:      #A9A7A3;
  --faint:      #7E7B78;
  --brand:      #9D25CD;
  --brand-600:  #8A1FB6;
  --brand-300:  #C56BE6;
  --r-lg:       18px;
  --r-pill:     48px;
  --f-ar: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-en: 'Sora', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:
    radial-gradient(1100px 620px at 50% -14%, rgba(157,37,205,.15), transparent 68%),
    var(--ink);
  color:var(--text);
  font-family:var(--f-ar);
  -webkit-font-smoothing:antialiased;
  min-height:100dvh;
}
img{max-width:100%;display:block}
a{color:inherit}

.wrap{max-width:1180px;margin:0 auto;padding:0 16px 64px}

/* ═══════════════════════════════════════════════════ الهيدر */

.top{
  max-width:1180px;margin:0 auto;
  padding:34px 16px 26px;
  text-align:center;
  position:relative;
}
.top__logo{display:inline-block;transition:opacity .2s}
.top__logo img{height:44px;width:auto;margin:0 auto}
.top__logo:hover{opacity:.78}
.top__title{
  margin:22px 0 0;
  font-size:clamp(1.55rem, 4.4vw, 2.3rem);
  font-weight:700;line-height:1.35;letter-spacing:-.01em;
}
.top__sub{
  margin:9px auto 0;max-width:46ch;
  color:var(--muted);font-size:.97rem;line-height:1.75;
}

.share{
  margin-top:20px;
  display:inline-flex;align-items:center;gap:9px;
  padding:10px 20px;
  background:transparent;color:var(--brand-300);
  border:1px solid var(--line);border-radius:var(--r-pill);
  font-family:inherit;font-size:.88rem;font-weight:600;
  cursor:pointer;transition:background .2s,border-color .2s;
}
.share:hover{background:var(--ink-2);border-color:var(--brand-300)}
.share svg{width:17px;height:17px;flex:none}
.share.done{color:#7BD88F;border-color:rgba(123,216,143,.4)}

/* ═══════════════════════════════════════════════════ البحث */

.search{max-width:380px;margin:0 auto 30px}
.search input{
  width:100%;padding:13px 20px;
  background:var(--ink-2);color:var(--text);
  border:1px solid var(--line);border-radius:var(--r-pill);
  font-family:inherit;font-size:.95rem;text-align:center;
  transition:border-color .2s;
}
.search input::placeholder{color:var(--faint)}
.search input:focus{outline:none;border-color:var(--brand-300)}

/* ═══════════════════════════════════════════════════ الشبكة */

.grid{
  display:grid;gap:20px;
  grid-template-columns:repeat(auto-fill, minmax(215px, 1fr));
}
.solo{max-width:330px;margin:0 auto}

.card{
  background:var(--ink-2);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  overflow:hidden;
  display:flex;flex-direction:column;
  transition:border-color .2s, transform .2s;
}
.card:hover{border-color:rgba(197,107,230,.38);transform:translateY(-3px)}

/* 4:5 ثابت لكل الكروت — aspect-ratio مع object-fit بيمنع أي صورة تتمط
   أو تكسّر صف الشبكة مهما كان مقاسها الأصلي. */
/* flex:none مهمة: من غيرها الكارت الأقصر في الصف بيمطّ صورته عشان
   يلحق أطول كارت، فالنسبة 4:5 بتضيع والصور تبان بمقاسات مختلفة. */
.card__media{display:block;flex:none;aspect-ratio:4/5;background:var(--ink-3);overflow:hidden}
.card__media img{width:100%;height:100%;object-fit:cover}
.card__ph{
  width:100%;height:100%;
  display:grid;place-items:center;
  color:var(--brand-300);font-family:var(--f-en);
  font-size:3rem;font-weight:700;opacity:.5;
}

.card__body{padding:15px 15px 16px;display:flex;flex-direction:column;gap:3px;flex:1}
.card__ar{margin:0;font-size:1.03rem;font-weight:700;line-height:1.45}
.card__ar a{text-decoration:none}
.card__ar a:hover{color:var(--brand-300)}
.card__en{
  margin:0;color:var(--muted);
  font-family:var(--f-en);font-size:.79rem;font-weight:500;
  letter-spacing:.02em;direction:ltr;text-align:right;
}
.card__total{margin:10px 0 0;display:flex;flex-direction:column;gap:1px}
.card__total b{
  font-family:var(--f-en);font-size:1.05rem;color:var(--brand-300);
  font-variant-numeric:tabular-nums;line-height:1.2;
}
.card__total span{color:var(--faint);font-size:.68rem;line-height:1.3}

.card__links{display:flex;flex-wrap:wrap;gap:7px;margin-top:13px}
.sl{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 12px;
  background:var(--ink-3);
  border:1px solid var(--line);border-radius:var(--r-pill);
  text-decoration:none;color:var(--text);
  font-family:var(--f-en);font-size:.76rem;font-weight:600;
  font-variant-numeric:tabular-nums;direction:ltr;
  transition:background .2s,border-color .2s,color .2s;
}
.sl svg{width:15px;height:15px;flex:none}
.sl:hover{background:var(--brand);border-color:var(--brand);color:#fff}
/* الأيقونة لوحدها من غير رقم تبقى دايرة مضبوطة */
.sl:not(:has(span)){padding:7px 9px}

.back{margin:0 0 20px}
.back a{
  color:var(--muted);text-decoration:none;font-size:.9rem;
  transition:color .2s;
}
.back a:hover{color:var(--brand-300)}

.empty{text-align:center;padding:70px 20px;color:var(--muted)}
.empty h2{font-size:1.1rem;font-weight:600;margin:0 0 14px;color:var(--text)}
.nores{text-align:center;color:var(--muted);padding:40px 0;margin:0}

.btn{
  display:inline-block;padding:11px 24px;
  background:var(--brand);color:#fff;
  border-radius:var(--r-pill);text-decoration:none;
  font-size:.9rem;font-weight:600;
  transition:background .2s;
}
.btn:hover{background:var(--brand-600)}

/* ═══════════════════════════════════════════════════ الفوتر */

.foot{
  max-width:1180px;margin:0 auto;
  padding:26px 16px 40px;
  display:flex;align-items:center;justify-content:center;gap:12px;
  border-top:1px solid var(--line);
  color:var(--faint);font-size:.83rem;
}
.foot a{color:var(--brand-300);text-decoration:none;font-family:var(--f-en)}
.foot a:hover{text-decoration:underline}

/* ═══════════════════════════════════════════════════ الموبايل */

@media (max-width:640px){
  .grid{grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));gap:13px}
  .top{padding:24px 16px 20px}
  .top__logo img{height:36px}
  .card__body{padding:12px 12px 13px}
  .card__ar{font-size:.93rem}
  .card__en{font-size:.72rem}
  /* الزرار لازم يبقى أضيق من نص عرض الكارت عشان يدخل اتنين في الصف */
  .card__links{gap:5px}
  .sl{padding:5px 8px;font-size:.68rem;gap:4px}
  .sl svg{width:13px;height:13px}
  .card__total b{font-size:.97rem}
  .wrap{padding-bottom:44px}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
}
