/* ========================================================= 
   1. DASAR TEMA & NAVBAR
   ========================================================= */
body { background-color: #f4f4f4; color: #333; }
.navbar-inverse { background-color: #850026; border: none; }
.btn-primary, .movie-view-all, .arrow-btn { background-color: #e91e63 !important; border: none; }
.navbar-inverse .navbar-toggle .icon-bar { background-color: #fff; }

/* ========================================================= 
   2. EFEK SKELETON GLOBAL (SHIMMER)
   ========================================================= */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #ddd !important; /* Warna dasar saat loading */
    background-image: linear-gradient(90deg, #ddd 0px, #e8e8e8 40px, #ddd 80px) !important;
    background-size: 600px 100% !important;
    animation: shine-loading 1.6s infinite linear !important;
}

/* Sembunyikan gambar sampai benar-benar termuat */
.skeleton img { 
    opacity: 0; 
    transition: opacity 0.4s ease-in-out;
}

@keyframes shine-loading {
    0% { background-position: -200px 0; }
    100% { background-position: 400px 0; }
}

/* ========================================================= 
   3. STRUKTUR SECTION & HEADER
   ========================================================= */
.movie-section-full { margin-bottom: 0px; clear: both; width: 100%; }

.movie-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.movie-title-black {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    color: #222 !important;
    margin: 0;
    padding-left: 12px;
    border-left: 5px solid #e91e63;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.movie-view-all {
    color: #fff !important;
    padding: 5px 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: 0.3s;
}

/* ========================================================= 
   4. POSTER & RASIO GAMBAR (GRID & SLIDER)
   ========================================================= */
/* Menyamakan semua poster menjadi rasio 2:3 */
.movie-poster, 
.slider-item figure {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #333;
    border-radius: 4px;
    margin: 0;
}

.movie-poster img, 
.slider-item figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================================= 
   5. SLIDER & GRID SYSTEM
   ========================================================= */
.movie-nav-wrapper { position: relative; width: 100%; }

.movie-scroll-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.movie-scroll-container::-webkit-scrollbar { display: none; }

.movie-flex-inner {
    display: flex;
    gap: 15px;
    padding: 5px 0 15px 0;
}

.movie-card-item { flex: 0 0 145px; width: 145px; }

/* Grid System untuk halaman archive/latest */
#mega-wrapper {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
}

/* ========================================================= 
   6. TEXT & BADGE
   ========================================================= */
.title-black, .movie-text h2 {
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    margin: 8px 0 4px;
    line-height: 1.4;
    height: 34px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.title-black a { color: inherit; text-decoration: none !important; }
.title-black a:hover { color: #e91e63; }

.badge-star, .badge-hd {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    top: 8px;
    z-index: 2;
}
.badge-star { left: 8px; background: rgba(0,0,0,0.8); color: #ffeb3b; }
.badge-hd { right: 8px; background: #4caf50; color: #fff; }

/* Tombol Navigasi Slider */
.arrow-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
}
.left-arrow { left: -18px; }
.right-arrow { right: -18px; }

/* ========================================================= 
   7. RESPONSIVE & STICKY SIDEBAR
   ========================================================= */
.row { display: flex; flex-wrap: wrap; align-items: flex-start; }

@media (max-width: 1200px) {
    #mega-wrapper { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 768px) {
    .movie-card-item { flex: 0 0 120px; width: 120px; }
    #mega-wrapper { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .arrow-btn { display: none !important; }
}

@media (min-width: 992px) {
    .sidebar.col-lg-3 {
        position: sticky;
        top: 20px;
        height: fit-content !important;
        z-index: 10;
    }
}


/* Penyesuaian Khusus Slider agar identik dengan Grid */
.slider-card {
    flex: 0 0 145px;
    width: 145px;
}

/* Judul Melayang di bagian bawah poster */
.poster-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 8px 8px; /* Padding atas lebih besar untuk gradien */
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    z-index: 3;
}

.slider-title {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Judul panjang jadi titik-titik */
}

/* Tombol Aksi Melayang di Tengah */
.poster-action-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    opacity: 0; /* Sembunyi */
    transition: opacity 0.3s ease;
    z-index: 4;
}

.movie-poster:hover .poster-action-overlay {
    opacity: 1; /* Tampil saat kursor masuk */
}

/* Style Tombol Kecil di Slider */
.btn-action {
    background: #4caf50; /* Hijau untuk Trailer */
    color: #fff;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 15px;
    width: 80%;
    text-align: center;
}

.btn-action:last-child {
    background: #e91e63; /* Pink untuk Movie */
}

/* Penyesuaian Panah agar pas di tengah gambar */
.slider .arrow-btn {
    top: 50% !important;
    transform: translateY(-50%);
}
.movie-scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth; /* Kunci agar gerakan geser tidak kaku */
    -webkit-overflow-scrolling: touch;
}
.hot-block {
    margin-bottom: 10px;
    background: #00000000;
    padding: 10px 5px;
}

/* Gaya Dasar Judul Grid */
.grid-title {
    margin: 0;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.3;
    height: 2.6em; /* Mengunci tinggi agar grid sejajar */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Potong teks jadi 2 baris dengan titik-titik (...) */
    -webkit-box-orient: vertical;
}

/* Gaya Link di Dalam Judul */
.grid-title a {
    color: #333; /* Warna standar abu-abu gelap */
    text-decoration: none;
    transition: color 0.3s ease; /* Efek transisi warna halus */
}

/* Efek HOVER saat mouse menyentuh judul */
.grid-title a:hover {
    color: #ff0055; /* Ubah warna ini sesuai selera (misal: merah pink) */
    text-decoration: none;
}

/* Menyiapkan background cadangan pada container poster */
.movie-poster a {
    display: block;
    background-color: #1a1a1a; /* Warna gelap dasar */
    /* Perbaikan: Menggunakan jalur langsung dari root domain */
    background-image: url('/wp-content/themes/Layarkaca21/assets/img/poster.png');
    background-size: cover;
    background-position: center;
    min-height: 200px; 
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3; 
    display: block;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.seo-description {
    display: none;
}

@media screen and (min-width: 1024px) {
    .movie-header-clean {
        display: flex; 
        flex-wrap: wrap;
        align-items: center;
    }

    .seo-description {
        display: block;
        flex-basis: 100%; 
        order: 2; 
        font-size: 13px;
        color: #666;
        margin-top: 2px; 
        margin-bottom: 2px;
        line-height: 1.5;
        text-transform: none; 
        font-weight: normal;
    }

    .movie-title-black {
        order: 1; 
    }

    .movie-view-all {
        order: 1; 
        margin-left: auto; 
    }
}