/* Styling CSS untuk YouTube Video Feed */

/* Container Utama Grid */
.yt-video-feed-container {
    display: grid;
    gap: 30px; /* DITINGKATKAN untuk jarak antar video yang lebih lega */
    margin: 20px 0;
}

/* Penyesuaian Kolom (Menggunakan data dari WPBakery) */
/* Default untuk Mobile */
.yt-video-feed-container {
    grid-template-columns: repeat(1, 1fr);
}

/* Desktop: Penyesuaian Kolom */
@media (min-width: 992px) {
    .yt-video-feed-container.yt-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .yt-video-feed-container.yt-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .yt-video-feed-container.yt-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Styling Post Individu */
.yt-video-post {
    border: 1px solid #eee;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* Area Thumbnail: Fleksibel untuk Shorts dan Video Normal */
.yt-video-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* Rasio 16:9 */
    overflow: hidden;
    display: block;
}

.yt-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* KRUSIAL untuk Shorts */
    display: block;
}

/* Konten (Judul, Channel, Deskripsi) */
.yt-video-content {
    padding: 15px; /* DITINGKATKAN untuk jarak yang lebih lega */
    flex-grow: 1; 
}
.yt-video-content h3 {
    font-size: 18px;
    margin: 8px; /* SPASI LEBIH BAIK */
    font-weight: bold;
}
.yt-video-content h3 a {
    /* Menghilangkan garis bawah default link tema, bisa diaktifkan jika perlu */
    text-decoration: none; 
}
.yt-video-content .channel-name {
    font-size: 14px;
    color: #666;
    margin: 12px 8px; /* SPASI LEBIH BAIK */
}

/* Styling untuk pesan error/info */
.ytvc-error-message {
    padding: 15px;
    border: 1px solid red;
    background-color: #ffeaea;
    color: #cc0000;
    font-weight: bold;
    border-radius: 4px;
}

/* ------------------------------------------------ */
/* A. Styling untuk Fitur View More/Less (Toggle Deskripsi) */
/* ------------------------------------------------ */
.video-description {
    line-height: 1.6; /* KRUSIAL: Jarak antar baris lebih tinggi untuk keterbacaan */
    font-size: 13px;
    color: #333;
    margin: 8px;
}

.ytvc-hidden-text {
    display: none;
}

.ytvc-toggle-desc {
    display: inline-block;
    margin-left: 5px;
    color: #0073aa; 
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

.ytvc-toggle-desc:hover {
    text-decoration: underline;
}

/* ------------------------------------------------ */
/* B. Styling untuk Lightbox (Modal Video Popup) */
/* ------------------------------------------------ */

/* Mencegah scroll pada body saat lightbox terbuka */
body.ytvc-lightbox-open {
    overflow: hidden;
}

#ytvc-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Latar belakang gelap */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Pastikan selalu di atas konten lain */
    opacity: 1;
    transition: opacity 0.3s;
}

/* Menyembunyikan lightbox secara total saat tidak digunakan */
.ytvc-lightbox-hidden {
    display: none !important;
    opacity: 0;
}

.ytvc-lightbox-content {
    position: relative;
    max-width: 90%;
    width: 900px; /* Lebar maksimum video */
    background: transparent;
}

/* Teknik Video Responsif (Rasio 16:9) */
.ytvc-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* (9 / 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    border: 5px solid white; /* Border putih di sekeliling video */
}

.ytvc-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tombol Tutup (X) */
.ytvc-lightbox-close {
    position: absolute;
    top: -30px;
    right: 0;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    z-index: 100000;
}

.ytvc-lightbox-close:hover {
    color: #f00;
}