/* ==========================================================
   إضافات الموقع (بتتحمل بعد site.css)
   ========================================================== */

/* ---------- متغيرات التصميم ---------- */
:root {
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 30px;
    --shadow-sm: 0 6px 18px -10px rgba(35, 30, 22, .25);
    --shadow-md: 0 18px 38px -18px rgba(35, 30, 22, .32);

    /* ألوان الرياضات (هتتستخدم في كروت الرياضات والمدربين) */
    --sport-swimming: #2f7fa8;
    --sport-gymnastics: #b5527a;
    --sport-martial: #b3402f;
    --sport-fitness: #c07a1f;

    /* تباين أعلى للنصوص الصغيرة في الوضع الفاتح (الداكن ليه قيمه في site.css) */
    --muted: #6f695f;
    --gold: #7a5c30;
}

html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
::selection { background: var(--gold-soft); color: #141414; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* ---------- تخطي للمحتوى ---------- */
.skip-link {
    position: absolute;
    top: -80px;
    inset-inline-start: 12px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: #252321;
    color: #fff;
    font-weight: 700;
    transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- زر واتساب العائم (ديسكتوب) ---------- */
.wa-float {
    position: fixed;
    inset-inline-end: 18px;
    bottom: 18px;
    z-index: 60;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45);
    transition: transform .25s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }

/* ---------- زر الحجز في الهيدر ---------- */
.topbar-cta { display: none; }
@media (min-width: 1180px) {
    .topbar-cta { display: inline-flex; }
}

/* ---------- الفوتر ---------- */
.footer { border-top: 3px solid var(--gold-soft); }
.footer-hours { white-space: pre-line; }
.footer .socials { flex-wrap: wrap; }
.footer .socials .social-btn { width: 44px; height: 44px; }
.social-btn svg:not(.icon) { width: 20px; height: 20px; fill: currentColor; }
.footer-contact a { text-underline-offset: 4px; }

/* ---------- الشريط السفلي (موبايل) ---------- */
.mobile-bar { display: none; }

@media (max-width: 900px) {
    .wa-float { display: none; }

    .site-body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

    .mobile-bar {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 60;
        display: flex;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .94);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, .08);
    }

    :root[data-theme="dark"] .mobile-bar {
        background: rgba(23, 23, 21, .94);
        border-top-color: rgba(255, 255, 255, .1);
    }

    .mobile-bar-primary {
        flex: 1;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 0 18px;
        border-radius: 999px;
        background: #252321;
        color: #fff;
        font-weight: 700;
        text-decoration: none;
    }

    :root[data-theme="dark"] .mobile-bar-primary { background: #E5DED5; color: #1B1917; }

    .mobile-bar-btn {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        border: 1px solid rgba(112, 103, 92, .3);
        color: inherit;
        text-decoration: none;
    }

    .mobile-bar-btn.is-wa { background: #25D366; border-color: #25D366; color: #fff; }
    .mobile-bar-btn svg { width: 22px; height: 22px; }
    .mobile-bar-btn.is-wa svg { fill: currentColor; }
}

/* ==========================================================
   إصلاحات الوضع الداكن
   (في الداكن --ink فاتح، فأي نص #fff فوقه كان بيختفي)
   ========================================================== */
:root[data-theme="dark"] .nav a.is-active,
:root[data-theme="dark"] .chip[aria-pressed="true"],
:root[data-theme="dark"] .session-time,
:root[data-theme="dark"] .today-badge,
:root[data-theme="dark"] .step-num,
:root[data-theme="dark"] .home-sport-icon,
:root[data-theme="dark"] .sport-level > span,
:root[data-theme="dark"] .sports-quiz-icon,
:root[data-theme="dark"] .home-achievement-card > img,
:root[data-theme="dark"] .home-achievement-icon,
:root[data-theme="dark"] .social-btn:hover {
    color: var(--on-ink);
}

:root[data-theme="dark"] .footer .socials .social-btn:hover { color: #141414; }

:root[data-theme="dark"] .btn-primary:hover { background: #fff; }

:root[data-theme="dark"] .article-body,
.article-body { color: var(--ink); }

:root[data-theme="dark"] .cta-card {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
}
:root[data-theme="dark"] .cta-card p { color: var(--ink-2); }
:root[data-theme="dark"] .cta-card .btn-primary { background: var(--ink); color: var(--on-ink); }
:root[data-theme="dark"] .cta-card .btn-primary:hover { background: #fff; color: #141414; }

:root[data-theme="dark"] .sports-quiz-banner { background: var(--card); }

:root[data-theme="dark"] .alert-ok { background: rgba(125, 202, 146, .14); }
:root[data-theme="dark"] .alert-error { background: rgba(239, 145, 135, .14); }

:root[data-theme="dark"] .champ-year { background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .policy-toc a:hover { background: rgba(255, 255, 255, .08); }

/* ---------- أيقونات التواصل ---------- */
.socials { flex-wrap: wrap; }
.footer-socials { margin-top: 14px; }
.social-btn { transition: background .2s, border-color .2s, color .2s, transform .2s; }
.social-btn:hover { transform: translateY(-2px); }
.socials .social-btn.is-whatsapp:hover,
.footer .socials .social-btn.is-whatsapp:hover { background: #25D366; border-color: #25D366; color: #fff; }
.socials .social-btn.is-instagram:hover,
.footer .socials .social-btn.is-instagram:hover { background: #E1306C; border-color: #E1306C; color: #fff; }
.socials .social-btn.is-snapchat:hover,
.footer .socials .social-btn.is-snapchat:hover { background: #FFFC00; border-color: #FFFC00; color: #141414; }
.socials .social-btn.is-facebook:hover,
.footer .socials .social-btn.is-facebook:hover { background: #1877F2; border-color: #1877F2; color: #fff; }

/* ---------- أرقام الأقسام (صفحة تواصل معنا) ---------- */
.dept-card { padding: 22px; }
.dept-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dept-head h3 { font-size: 20px; }
.dept-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dept-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2);
}
.dept-number { font-size: 18px; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.dept-number:hover { color: var(--gold); }
.dept-actions { display: flex; gap: 8px; }
.dept-act {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--line); color: inherit; text-decoration: none;
    transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.dept-act:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); transform: translateY(-2px); }
.dept-act.is-whatsapp:hover { background: #25D366; border-color: #25D366; color: #fff; }

/* ==========================================================
   أقسام الرئيسية: الأسعار، المواعيد، الآراء، الفروع
   ========================================================== */
.hx-grid { gap: 18px; }

.hx-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 22px);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
}

.hx-meta { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 14px; }
.hx-meta .icon { color: var(--gold); }

/* --- الأسعار --- */
.hx-price { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.hx-price:hover { transform: translateY(-5px); border-color: var(--gold-soft); box-shadow: var(--shadow-md, 0 18px 38px -18px rgba(35, 30, 22, .32)); }
.hx-kicker { font-size: 18px; font-weight: 800; }
.hx-from { color: var(--muted); font-size: 13px; }
.hx-amount { display: inline-flex; align-items: baseline; gap: 6px; }
.hx-amount strong { font-size: clamp(34px, 4vw, 44px); line-height: 1.1; }
.hx-amount span { color: var(--ink-2); font-weight: 700; }
.hx-old { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.hx-old em {
    font-style: normal; font-weight: 800; font-size: 12px; padding: 2px 10px; border-radius: 999px;
    background: rgba(30, 122, 70, .14); color: var(--ok);
}
.hx-price .home-card-link { margin-top: auto; padding-top: 10px; }

/* --- المواعيد --- */
.hx-session { gap: 6px; }
.hx-session.is-today { border-color: var(--gold-soft); }
.hx-session-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-bottom: 4px; }
.hx-day {
    padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 800;
    background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2);
}
.hx-session.is-today .hx-day { background: var(--gold-soft); border-color: var(--gold-soft); color: #141414; }
.hx-time { font-weight: 800; font-size: 15px; }
.hx-session-title { font-size: 19px; }

/* --- الآراء --- */
.hx-quote { gap: 14px; }
.hx-stars { display: inline-flex; gap: 2px; color: var(--gold-soft); }
.rm-star { fill: none; }
.rm-star.is-on { fill: currentColor; }
.hx-quote blockquote { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.9; }
.hx-quote figcaption { display: flex; flex-direction: column; margin-top: auto; }
.hx-quote figcaption span { color: var(--muted); font-size: 14px; }

/* --- الفروع --- */
.hx-branch { padding: 0; overflow: hidden; }
.hx-branch-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hx-branch-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; padding: 20px 22px 22px; }
.hx-branch-body h3 { font-size: 20px; }
.hx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }

:root[data-theme="dark"] .hx-session.is-today .hx-day { color: #141414; }

/* ==========================================================
   تخفيف الهيدر (كان زحمة على الشاشات المتوسطة)
   ========================================================== */
.topbar .container { max-width: 1320px; }
.topbar-inner { gap: 12px; }
.nav { margin-inline-start: 6px; gap: 0; }
.nav a, .nav summary { padding: 8px 11px; font-size: 14.5px; }
.topbar-actions { flex: none; gap: 8px; }
.topbar-actions a,
.topbar-actions .btn,
.topbar-actions .btn-quiz,
.topbar-actions .link-plain { white-space: nowrap; }

/* زر الحجز في الهيدر بيظهر بس على الشاشات الواسعة جدًا */
.topbar-cta { display: none; }
@media (min-width: 1700px) { .topbar-cta { display: inline-flex; } }

/* بين 1180 و1340 بكسل: القايمة تتحول لزر ☰ بدل ما تضغط */
@media (min-width: 1180px) and (max-width: 1339px) {
    .nav { display: none; }
    .nav-toggle { display: inline-flex !important; }
    .nav-open .drawer { display: block !important; }
}

/* ==========================================================
   صفحتا الاعتمادات والشركاء
   ========================================================== */
.tr-grid { gap: 18px; }
.tr-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.tr-card:hover { transform: translateY(-4px); border-color: var(--gold-soft); box-shadow: var(--shadow-md, 0 18px 38px -18px rgba(35, 30, 22, .32)); }
.tr-media { display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); }
.tr-accreditation .tr-media { aspect-ratio: 4 / 3; padding: 14px; }
.tr-partner .tr-media { aspect-ratio: 3 / 2; padding: 22px; }
.tr-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tr-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px 20px; }
.tr-body h2 { font-size: 19px; }
.tr-body p { color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.tr-link { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 6px; color: var(--gold); font-weight: 800; text-decoration: none; }
.tr-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ==========================================================
   صفحتا الاعتمادات والشركاء
   ========================================================== */
.tr-grid { gap: 18px; }
.tr-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.tr-card:hover { transform: translateY(-4px); border-color: var(--gold-soft); box-shadow: var(--shadow-md, 0 18px 38px -18px rgba(35, 30, 22, .32)); }
.tr-media { display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); }
.tr-accreditation .tr-media { aspect-ratio: 4 / 3; padding: 14px; }
.tr-partner .tr-media { aspect-ratio: 3 / 2; padding: 22px; }
.tr-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tr-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px 20px; }
.tr-body h2 { font-size: 19px; }
.tr-body p { color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.tr-link { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 6px; color: var(--gold); font-weight: 800; text-decoration: none; }
.tr-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- شريط شعارات الشركاء (الرئيسية) ---------- */
.hx-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hx-logo {
    display: grid; place-items: center; aspect-ratio: 3 / 2; padding: 18px;
    border: 1px solid var(--line); border-radius: 18px; background: #fff; color: #141414;
    font-weight: 800; text-align: center; text-decoration: none;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.hx-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(1); opacity: .82; transition: filter .25s, opacity .25s; }
.hx-logo:hover { transform: translateY(-3px); border-color: var(--gold-soft); box-shadow: var(--shadow-sm, 0 6px 18px -10px rgba(35, 30, 22, .25)); }
.hx-logo:hover img { filter: none; opacity: 1; }
@media (max-width: 560px) { .hx-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.hx-logos { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.hx-logo { position: relative; height: 120px; min-height: 0; padding: 0; aspect-ratio: auto; overflow: hidden; }
.hx-logo img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); max-width: none; max-height: none; object-fit: contain; filter: none; opacity: 1; }
.hx-logo:hover img { filter: none; opacity: 1; }
@media (max-width: 560px) { .hx-logo { height: 100px; } }

/* كارت الشركاء بنفس أبعاد كارت الاعتمادات (في الرئيسية وصفحة الشركاء) */
.tr-partner .tr-media { aspect-ratio: 4 / 3; padding: 14px; }
.tr-partner .tr-media img { inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); }

/* ==========================================================
   الموبايل: الكروت تتسحب بالجنب بدل ما تتعرض تحت بعض
   - بيشتغل تلقائي على أقسام الصفحة الرئيسية
   - ولأي مجموعة كروت تانية: ضيف الكلاس h-scroll على الـ grid
   ========================================================== */
@media (max-width: 700px) {
    .h-scroll,
    .rm-home :is(.home-sports-grid, .home-coaches-grid, .home-achievements-grid, .home-news-grid, .home-photo-grid, .hx-grid, .tr-grid) {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 14px;
        margin-inline: -20px;
        padding: 6px 20px 22px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 20px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .h-scroll::-webkit-scrollbar,
    .rm-home :is(.home-sports-grid, .home-coaches-grid, .home-achievements-grid, .home-news-grid, .home-photo-grid, .hx-grid, .tr-grid)::-webkit-scrollbar {
        display: none;
    }

    .h-scroll > *,
    .rm-home :is(.home-sports-grid, .home-coaches-grid, .home-achievements-grid, .home-news-grid, .home-photo-grid, .hx-grid, .tr-grid) > * {
        flex: 0 0 85%;
        min-width: 0;
        max-width: 360px;
        scroll-snap-align: start;
    }

    /* كروت المدربين أضيق عشان الصورة ما تبقاش كبيرة */
    .rm-home .home-coaches-grid > * { flex-basis: 76%; max-width: 300px; }

    /* الصور مربعة وأصغر شوية */
    .rm-home .home-photo-grid { align-items: flex-start; }
    .rm-home .home-photo-grid > * { flex-basis: 64%; max-width: 280px; }

    /* من غير حركة ظهور، عشان الكروت اللي برا الشاشة ما تفضلش مخفية */
    .rm-home.rm-js :is(.home-sports-grid, .home-coaches-grid, .home-achievements-grid, .home-news-grid, .home-photo-grid, .hx-grid, .tr-grid) .rm-reveal {
        opacity: 1;
        transform: none;
        transition-delay: 0s;
    }
}
