/* Extracted from header.php */
body {
    margin: 0;
    font-family: JF-Flat, sans-serif;
}

header {
    height: 72px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.homepage-hero-excerpt {
    content-visibility: auto;
    contain: layout paint;
}

/* Critical CSS for Header & Hero */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(15, 20, 32, 0.85);
    min-height: 72px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.container {
    width: 100%;
    padding-right: var(--bs-gutter-x, .75rem);
    padding-left: var(--bs-gutter-x, .75rem);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Hero Critical */
.homepage-hero {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
    background: #0a0a0a;
    border-radius: 12px;
}

@media (min-width: 769px) {
    .homepage-hero {
        min-height: 720px;
        height: auto;
        aspect-ratio: 16/9;
    }
}

.homepage-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.homepage-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.homepage-hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 0;
}

/* Lazy Load Styles */
.lazy-load-container {
    min-height: 100px;
}

.lazy-placeholder {
    animation: pulse 1.5s infinite;
}

.lazy-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.skeleton-item {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    padding: 15px;
}

.skeleton-line {
    height: 12px;
    background: #444;
    border-radius: 4px;
    margin: 8px 0;
}

.skeleton-btn {
    height: 36px;
    background: #444;
    border-radius: 4px;
}

.skeleton-image {
    height: 200px;
    background: #444;
    border-radius: 8px;
    margin-bottom: 10px;
}

.lazy-loading-text {
    text-align: center;
    color: #888;
    margin-top: 10px;
    font-size: 14px;
}

.lazy-loaded {
    animation: fadeIn 0.3s ease-in;
}

.lazy-error {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

img:is([sizes=auto i], [sizes^="auto," i]) {
    contain-intrinsic-size: 3000px 1500px;
}

/* Constants from WordPress Classic Theme Styles (just in case) */
.wp-block-button__link {
    color: #fff;
    background-color: #32373c;
    border-radius: 9999px;
    box-shadow: none;
    text-decoration: none;
    padding: calc(.667em + 2px) calc(1.333em + 2px);
    font-size: 1.125em;
}

.wp-block-file__button {
    background: #32373c;
    color: #fff;
    text-decoration: none;
}

/* Extracted from footer.php (Ad Styles) */
.side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 9999;
    display: block !important;
}

.side-ad-right {
    right: 10px;
}

.side-ad-left {
    left: 10px;
}

/* Mobile: Stack at bottom instead of hiding */
@media (max-width: 1000px) {
    .side-ad {
        display: flex !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 20px auto !important;
        justify-content: center !important;
        padding-bottom: 20px;
    }

    .side-ad-left,
    .side-ad-right {
        left: auto;
        right: auto;
    }
}

/* Extracted from single-post.php */
.select.radio .items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 99999 !important;
    border: 1px solid #ddd;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    max-height: 250px;
    overflow-y: auto;
}

.select.radio .items li,
.select.radio .items li label {
    color: #000 !important;
    background: #fff !important;
    text-align: right !important;
    padding: 10px 15px !important;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #eee;
}

.select.radio .items li:hover {
    background: #f5f5f5 !important;
}

.select.radio.visible .items {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure parent containers don't clip */
.drama-episodes-head,
.display-options {
    overflow: visible !important;
}

/* Breadcrumbs */
.breadcrumbs {
    z-index: 20 !important;
    position: relative !important;
}

@media (max-width: 768px) {
    .breadcrumbs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 10px 0 !important;
    }

    .breadcrumbs::-webkit-scrollbar {
        display: none;
    }
}

/* 
 * Extracted from single-episodes.php
 * Date: 2026-01-29
 */

/* Page Backdrop */
.page-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    /* Cover top 60% */
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.page-backdrop .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(16, 20, 29, 0.4) 0%, #10141d 100%);
    z-index: 2;
}

.page-backdrop .backdrop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0px);
    opacity: 0.5;
    transform: scale(1.1);
}

/* Season Select Dropdown */
#carousel-season-select {
    position: relative;
    display: inline-block;
}

#carousel-season-select .anchor {
    background: #12161f;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}

#carousel-season-select .items {
    display: none;
    position: absolute;
    background: #12161f;
    z-index: 100;
    list-style: none;
    padding: 10px;
    margin: 0;
    border: 1px solid #333;
    min-width: 120px;
}

#carousel-season-select .items li {
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.2s;
}

#carousel-season-select .items li:hover {
    background: #252a35;
}

#carousel-season-select .items li.selected {
    color: #ffc107;
    font-weight: bold;
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Bilingual Card Titles */
.movie-title .title-en {
    display: block;
    font-size: 0.85em;
    color: #9ca3af;
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-title .title-ar {
    display: block;
    color: #fff;
    font-weight: 500;
}

/* Play Button Overlay (Updated) */
.drama-ep-item:hover .play-overlay {
    opacity: 1;
}

.drama-ep-thumb .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(245, 193, 108, .9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
    color: #fff;
    font-size: 2rem;
}

.play-overlay,
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: rgba(239, 171, 45, .9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 40px rgba(239, 171, 45, .4);
    z-index: 20;
    backdrop-filter: blur(5px);
    color: #fff;
}

.play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #efab2d;
    box-shadow: 0 15px 50px rgba(239, 171, 45, .6);
}

/* Visual optical adjustment */

/* Fix Single Post Poster Dimensions */
.drama-poster img {
    aspect-ratio: 2/3;
    object-fit: cover;
    width: 100%;
    height: auto;
}