/* ممر الأسرار - Frontend */
.sp-platform,
.sp-single-wrap {
    --sp-accent: #ff0033;
    --sp-text: #0f0f0f;
    --sp-muted: #606060;
    --sp-border: #e5e5e5;
    --sp-bg: #fff;
    --sp-soft: #f7f7f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--sp-text);
    box-sizing: border-box;
}
.sp-platform *, .sp-single-wrap * { box-sizing: border-box; }

.sp-platform {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 18px;
    background: var(--sp-bg);
}
.sp-topbar {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 18px;
}
.sp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 21px;
}
.sp-brand-icon {
    width: 34px;
    height: 24px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sp-accent);
    color: #fff;
    font-size: 13px;
}
.sp-search {
    display: flex;
    max-width: 620px;
    flex: 1;
    margin: 0 auto;
}
.sp-search input {
    min-width: 0;
    flex: 1;
    height: 44px;
    border: 1px solid #ccc;
    border-radius: 0 22px 22px 0;
    padding: 0 18px;
    outline: none;
    background: #fff;
}
.sp-search input:focus { border-color: #888; }
.sp-search button {
    height: 44px;
    border: 1px solid #ccc;
    border-right: 0;
    border-radius: 22px 0 0 22px;
    padding: 0 22px;
    background: #f8f8f8;
    cursor: pointer;
}
.sp-categories {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 5px 0 18px;
    scrollbar-width: thin;
}
.sp-chip {
    background: #f2f2f2;
    color: #111;
    border-radius: 9px;
    padding: 8px 15px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
}
.sp-chip:hover, .sp-chip.active {
    background: #111;
    color: #fff;
}
.sp-featured {
    margin: 8px 0 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #111;
}
.sp-featured a {
    color: #fff;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    text-decoration: none;
}
.sp-featured-image {
    position: relative;
    aspect-ratio: 16 / 8;
    overflow: hidden;
}
.sp-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-featured-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.72);
    font-size: 23px;
}
.sp-featured-copy {
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sp-kicker {
    color: #bbb;
    font-size: 13px;
    margin-bottom: 12px;
}
.sp-featured-copy h2 {
    color: #fff;
    margin: 0 0 12px;
    font-size: clamp(22px, 3vw, 38px);
    line-height: 1.25;
}
.sp-featured-copy p { color: #bbb; line-height: 1.8; margin: 0; }
.sp-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 25px 0 15px;
}
.sp-section-heading h1, .sp-section-heading h2 { margin: 0; font-size: 25px; }
.sp-section-heading a { color: #555; text-decoration: none; font-size: 14px; }
.sp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 17px;
}
.sp-card { min-width: 0; }
.sp-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #eee;
    border-radius: 10px;
    text-decoration: none;
}
.sp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s ease;
}
.sp-card:hover .sp-thumb img { transform: scale(1.025); }
.sp-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #777;
    background: linear-gradient(135deg,#eee,#d9d9d9);
}
.sp-thumb-placeholder .dashicons { font-size: 45px; width: 45px; height: 45px; }
.sp-play-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(0,0,0,.75);
    color: #fff;
    border-radius: 5px;
    font-size: 11px;
    padding: 5px 7px;
}
.sp-card-body { padding: 10px 2px 0; }
.sp-card-body h3 {
    font-size: 16px;
    line-height: 1.45;
    margin: 0 0 7px;
    font-weight: 650;
}
.sp-card-body h3 a { color: inherit; text-decoration: none; }
.sp-card-meta {
    display: flex;
    gap: 10px;
    color: var(--sp-muted);
    font-size: 12px;
    flex-wrap: wrap;
}
.sp-card-body p {
    color: #777;
    font-size: 13px;
    line-height: 1.6;
    margin: 7px 0 0;
}
.sp-empty {
    padding: 50px 20px;
    text-align: center;
    color: #777;
    grid-column: 1 / -1;
    background: var(--sp-soft);
    border-radius: 12px;
}

/* Single */
.sp-single-wrap {
    max-width: 1500px;
    margin: 0 auto;
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
}
.sp-player {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 22px rgba(0,0,0,.12);
}
.sp-player-inner {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    background: #000;
}
.sp-player iframe,
.sp-native-video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}
.sp-player-error {
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    padding: 20px;
    text-align: center;
}
.sp-video-title-row { padding: 17px 0 0; }
.sp-video-title-row h1 {
    font-size: clamp(22px, 3vw, 31px);
    line-height: 1.35;
    margin: 0 0 9px;
}
.sp-single-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    color: #606060;
    font-size: 13px;
}
.sp-single-meta a { color: #333; }
.sp-description {
    margin-top: 18px;
    padding: 18px;
    background: #f7f7f7;
    border-radius: 10px;
    line-height: 1.9;
}
.sp-description p:last-child { margin-bottom: 0; }
.sp-excerpt { font-weight: 600; }
.sp-view-count {
    padding: 15px 0;
    color: #666;
    font-size: 13px;
}
.sp-view-count strong { color: #111; }
.sp-sidebar h3 { margin: 0 0 15px; font-size: 19px; }
.sp-related { margin-bottom: 15px; }
.sp-related a {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 10px;
    text-decoration: none;
    color: #111;
}
.sp-related img, .sp-related-placeholder {
    width: 145px;
    height: 82px;
    object-fit: cover;
    border-radius: 7px;
    background: #eee;
}
.sp-related-placeholder {
    display: grid;
    place-items: center;
    color: #777;
}
.sp-related strong {
    display: block;
    font-size: 14px;
    line-height: 1.45;
}
.sp-related small {
    display: block;
    color: #777;
    margin-top: 5px;
    font-size: 11px;
}
.sp-pagination { margin-top: 30px; }
.sp-pagination ul {
    display: flex;
    gap: 7px;
    list-style: none;
    padding: 0;
    justify-content: center;
}
.sp-pagination a, .sp-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    text-decoration: none;
    color: #333;
}
.sp-pagination .current { background: #111; color: #fff; }

@media (max-width: 1100px) {
    .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-single-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
    .sp-topbar { flex-wrap: wrap; gap: 14px; }
    .sp-brand { width: 100%; }
    .sp-search { max-width: none; width: 100%; }
    .sp-featured a { grid-template-columns: 1fr; }
    .sp-featured-copy { padding: 22px; }
    .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .sp-platform, .sp-single-wrap { padding: 12px; }
}
@media (max-width: 520px) {
    .sp-grid { grid-template-columns: 1fr; }
    .sp-card-body h3 { font-size: 15px; }
    .sp-related a { grid-template-columns: 125px 1fr; }
    .sp-related img, .sp-related-placeholder { width: 125px; height: 70px; }
}

/* Archive: استخدم نفس واجهة البطاقات الخاصة بـ [secret_passage] */
.sp-video-archive-page {
    width: 100%;
    margin: 0;
    padding: 0;
}
.sp-video-archive-page .sp-platform {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}
.sp-video-archive-page .sp-grid {
    align-items: start;
}

/* أرشيف ممر الأسرار: خلفية كاملة بعرض الشاشة بدون ظهور المحتوى داخل صندوق */
body.sp-video-platform:has(.sp-video-archive-page),
body.sp-video-platform:has(.sp-video-archive-page) #page,
body.sp-video-platform:has(.sp-video-archive-page) #content,
body.sp-video-platform:has(.sp-video-archive-page) .site-content,
body.sp-video-platform:has(.sp-video-archive-page) .content-area {
    background: #fff !important;
}

.sp-video-archive-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
}

.sp-video-archive-page .sp-platform.sp-archive {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 24px clamp(18px, 3vw, 48px) 45px !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* يبقى محتوى الأرشيف منظمًا بدل تمدد البطاقات بشكل مبالغ فيه */
.sp-video-archive-page .sp-platform.sp-archive > * {
    width: 100%;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

.sp-video-archive-page .sp-platform.sp-archive .sp-grid {
    max-width: 1500px;
}

@media (max-width: 767px) {
    .sp-video-archive-page .sp-platform.sp-archive {
        padding: 15px 12px 30px !important;
    }
}
