/* ==========================================================================
   channel.css — قناة المتجر بتصميم احترافي على نمط قنوات واتساب:
   • معاينة فيديو حقيقية في البطاقات (لا أيقونة فقط).
   • شريط معلومات أسفل المعاينة فيه القلوب والمشاهدات — ظاهر دائماً.
   • عناصر لا تغطّي الفيديو: شارة تشغيل صغيرة في الزاوية فقط.
   تُحمَّل بعد ملفات القوالب في الـ4 قوالب لتتفوّق على أنماطها.
   ========================================================================== */

/* ---------- رأس صفحة القناة ---------- */
.chan-page { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.15rem 2.6rem; }
.chan-page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chan-page__kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--brand, #0066cc); font-weight: 800; font-size: .8rem; letter-spacing: .06em; }
.chan-page__title { margin: 2px 0 6px; font-family: var(--font-title, "Reem Kufi", sans-serif); font-size: clamp(1.7rem, 5vw, 2.35rem); color: var(--plum, #2b1d2f); }
.chan-page__lead { margin: 0; color: var(--mute, #7a6a75); font-size: .92rem; line-height: 1.75; max-width: 60ch; }
.chan-page__count {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
    background: rgba(var(--brand-rgb, 0, 102, 204), .1); color: var(--brand, #0066cc);
    font-weight: 800; font-size: .82rem; white-space: nowrap;
}

/* ---------- شبكة القصص ---------- */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.chan-card { position: relative; display: grid; gap: 8px; padding: 0; border: 0; background: none; text-align: start; }
.chan-card__open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.chan-card__media {
    position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden;
    background: linear-gradient(160deg, #2b1d2f, #4a2b46);
    box-shadow: 0 14px 30px rgba(24, 12, 26, .22);
    transition: transform .3s ease, box-shadow .3s ease;
}
.chan-card:hover .chan-card__media { transform: translateY(-4px); box-shadow: 0 22px 42px rgba(24, 12, 26, .3); }
.chan-card__media video,
.chan-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.chan-card__ph { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-size: 2rem; opacity: .65; }

/* شارة تشغيل صغيرة في الزاوية — لا تغطّي الفيديو */
.chan-card__play {
    position: absolute; inset-inline-start: 10px; bottom: 42px; z-index: 3;
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(12, 8, 14, .58); color: #fff; font-size: 1rem;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .32);
}
/* شريط المعلومات أسفل المعاينة: قلوب + مشاهدات (ظاهر دائماً) */
.chan-card__info {
    position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
    display: flex; align-items: center; gap: 12px;
    padding: 26px 11px 9px; color: #fff; font-size: .78rem; font-weight: 800;
    background: linear-gradient(180deg, transparent, rgba(10, 6, 12, .84));
}
.chan-card__info span { display: inline-flex; align-items: center; gap: 4px; }
.chan-card__likes { color: #ffd0de; }
.chan-card__views { margin-inline-start: auto; color: rgba(255, 255, 255, .9); }

.chan-card__new {
    position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3;
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #0d8a4a); color: #fff; font-size: .68rem; font-weight: 800;
    box-shadow: 0 6px 14px rgba(13, 138, 74, .45);
}
.chan-card__badge {
    position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3;
    max-width: calc(100% - 90px); display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px; background: rgba(12, 8, 14, .6); color: #fff;
    font-size: .68rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chan-card__cap {
    font-size: .84rem; font-weight: 700; line-height: 1.6; color: var(--ink-soft, #4b3a44);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chan-card__acts { display: flex; align-items: center; gap: 8px; }
.chan-card__act {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .08); background: #fff; color: var(--plum, #2b1d2f);
    cursor: pointer; font-size: 1rem; text-decoration: none;
}
.chan-card__act:hover { background: rgba(var(--brand-rgb, 0, 102, 204), .1); border-color: transparent; }
.chan-card__act[href] { color: #1f9e55; }

/* ---------- شريط القصص في الرئيسية ---------- */
.chan { max-width: 1080px; margin: 0 auto 18px; padding-inline: 12px; }
.chan__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chan__title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.chan__title i { color: var(--brand, #0066cc); }
.chan__all { color: var(--brand, #0066cc); font-weight: 800; font-size: .85rem; text-decoration: none; }
.chan__all:hover { text-decoration: underline; }
.chan-rail { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.chan-rail::-webkit-scrollbar { display: none; }
.chan-rail__item { flex: none; width: 94px; background: none; border: 0; padding: 0; cursor: pointer; display: grid; gap: 6px; justify-items: center; scroll-snap-align: center; }
.chan-rail__ring {
    position: relative; width: 84px; height: 84px; border-radius: 50%; padding: 3px;
    background: conic-gradient(from 210deg, var(--brand, #0066cc), #e8c56b, var(--brand, #0066cc));
    box-shadow: 0 8px 20px rgba(24, 12, 26, .16);
}
.chan-rail__ring img,
.chan-rail__ring video,
.chan-rail__ph {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
    border: 3px solid #fff; background: #2b1d2f; color: #fff; pointer-events: none;
}
.chan-rail__play {
    position: absolute; inset-inline-end: 1px; bottom: 3px; z-index: 3;
    display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(12, 8, 14, .62); color: #fff; font-size: .72rem;
}
.chan-rail__likes {
    position: absolute; inset-inline-start: -4px; bottom: 0; z-index: 4;
    display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px;
    background: #fff; color: #e11d48; font-size: .68rem; font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.chan-rail__new {
    position: absolute; top: -2px; inset-inline-end: 0; z-index: 5;
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #0d8a4a); color: #fff; font-size: .7rem; border: 2px solid #fff;
}
.chan-rail__cap { font-size: .74rem; font-weight: 700; color: var(--ink-soft, #4b3a44); max-width: 94px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- استجابة الشاشات ---------- */
@media (max-width: 620px) {
    .chan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .chan-page { padding: 1.1rem 12px 2.2rem; }
    .chan-page__lead { display: none; }
    .chan-card__cap { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
    .chan-card__media { transition: none; }
    .chan-card:hover .chan-card__media { transform: none; }
}
