/* ============================================
   FEATURED POST - MOBILE
   ============================================ */
.featured-post-wrapper {
    padding: 0;
}

.featured-post {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

/* PERBAIKAN: Gunakan Aspect Ratio 16:9 agar video full tampil */
.featured-post-image {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Rasio 16:9 (9 / 16 * 100) */
    height: 0;
    overflow: hidden;
    background: #000; /* Latar hitam agar rapi saat loading */
}

/* Pastikan gambar/video mengisi container secara sempurna */
.featured-post-image img,
.featured-post-image iframe,
.featured-post-image video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* PERBAIKAN: Content box mengikuti tinggi judul (compact) */
.featured-post-content {
    padding: 0 12px 16px;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-post-category {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    text-transform: capitalize;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.desktop-featured-post { 
    display: none; 
}

/* ============================================
   DESKTOP VERSION (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {
    body { max-width: 100%; }

    .featured-post-wrapper {
        display: none !important;
    }

    .desktop-featured-post {
        display: block;
        max-width: 1024px;
        margin: 0 auto;
        background: #000;
        border-radius: 6px;
        overflow: hidden;
        cursor: pointer;
         
    }

    /* PERBAIKAN: Gunakan Aspect Ratio 16:9 untuk Desktop juga */
    .desktop-featured-post-image {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%; /* Rasio 16:9 */
        height: 0;
        overflow: hidden;
        background: #000;
    }

    .desktop-featured-post-image img,
    .desktop-featured-post-image iframe,
    .desktop-featured-post-image video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.6s ease, filter 0.3s ease;
    }

    .desktop-featured-post:hover .desktop-featured-post-image img {
        transform: scale(1.05);
        filter: brightness(1.05);
    }

    /* Overlay tetap di atas video/gambar */
    .desktop-featured-post-image::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70%;
        background: linear-gradient(180deg, 
            rgba(0, 0, 0, 0) 0%, 
            rgba(0, 0, 0, 0.6) 40%, 
            rgba(0, 0, 0, 0.85) 100%);
        pointer-events: none;
        z-index: 1;
    }

    .desktop-featured-post-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 24px 28px;
        z-index: 2;
    }

    .desktop-featured-post-title {
        font-size: 24px;
        font-weight: 800;
        color: #ffffff;
        line-height: 1.3;
        margin-bottom: 10px;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .desktop-featured-post-meta {
        font-size: 13px;
        font-weight: 500;
    }

    .desktop-featured-post-meta .category {
        color: #e55225;
        font-weight: 600;
    }

    .desktop-featured-post-meta .time {
        color: #cccccc;
        margin-left: 4px;
    }

    .desktop-featured-post-bottom {
        display: flex;
        align-items: stretch;
        background: #ffffff;
        border-top: none;
    border-radius: 8px;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
    border-radius: 0 0 6px 6px;
    }

    .desktop-featured-post-label {
        background: #000;
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
        padding: 20px 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 100px;
        flex-shrink: 0;
    }

    .desktop-featured-post-news {
        flex: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-left: 1px solid #eee;
    }

    .desktop-featured-news-item {
        padding: 10px 14px;
        transition: background 0.2s ease;
    }

    .desktop-featured-news-item:last-child {
        border-right: none;
    }

    .desktop-featured-news-item:hover {
        background: #f8f8f8;
    }

    .desktop-featured-news-title {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        line-height: 1.4;
        letter-spacing: -0.2;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .desktop-featured-news-category {
        font-size: 13px;
        color: #1a73e8;
        font-weight: 600;
    }
}

/* ============================================
   CUSTOM YOUTUBE PLAYER (Tanpa Ikon Bawaan YouTube)
   ============================================ */
.custom-youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #000;
}

.custom-youtube-player .yt-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.3s ease;
}

/* Efek hover pada thumbnail */
.custom-youtube-player:hover .yt-thumbnail {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* Ikon Play Kustom di Tengah */
.custom-youtube-player .custom-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    transition: transform 0.2s ease;
    z-index: 2;
}

.custom-youtube-player:hover .custom-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.custom-youtube-player .custom-play-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* Untuk Mobile, buat ikon play sedikit lebih kecil */
@media (max-width: 1023px) {
    .custom-youtube-player .custom-play-icon {
        width: 50px;
        height: 36px;
    }
}

/* ============================================
   DUKUNGAN YOUTUBE SHORTS (RASIO VERTIKAL)
   ============================================ */

/* Ubah rasio container menjadi 9:16 jika itu adalah Shorts */
.featured-post-image.is-short,
.desktop-featured-post-image.is-short {
    padding-bottom: 177.77% !important; /* Rasio 9:16 (16 / 9 * 100) */
}

/* Pastikan thumbnail dan iframe mengisi area vertikal dengan sempurna */
.featured-post-image.is-short .yt-thumbnail,
.featured-post-image.is-short iframe,
.desktop-featured-post-image.is-short .yt-thumbnail,
.desktop-featured-post-image.is-short iframe {
    object-fit: cover; /* Memastikan tidak ada bar hitam */
}

/* Penyesuaian Overlay Teks untuk Shorts di Desktop */
/* Karena video sangat tinggi, kita pastikan teks tetap terbaca di bagian bawah */
.desktop-featured-post-image.is-short .desktop-featured-post-overlay {
    padding: 40px 28px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

/* Di Mobile, Shorts biasanya terlihat lebih baik jika memenuhi layar */
@media (max-width: 1023px) {
    .featured-post-image.is-short {
        padding-bottom: 150% !important; /* Sedikit lebih pendek dari 9:16 murni agar tidak terlalu panjang di HP */
    }
}

/* ============================================
   LAYOUT KHUSUS SAAT HERO ADALAH VIDEO
   ============================================ */

/* Ubah grid menjadi 3 kolom: 2 bagian untuk Judul Video, 1 bagian untuk masing-masing Related */
.desktop-featured-post-bottom.is-video .desktop-featured-post-news {
    grid-template-columns: 2fr 1fr 1fr !important;
}

/* Styling untuk Item Judul Video yang pindah ke bawah */
.desktop-featured-post-bottom.is-video .video-info-item {
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Sesuaikan warna dan ukuran teks agar cocok dengan background putih */
.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-news-title {
    color: #1a1a1a !important; /* Hitam pekat */
    font-size: 18px !important;
    margin-bottom: 10px !important;
    -webkit-line-clamp: 3 !important; /* Maksimal 3 baris */
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta {
    font-size: 13px;
    font-weight: 500;
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta .category {
    color: #e55225;
    font-weight: 600;
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta .time {
    color: #888;
    margin-left: 4px;
}

/* ============================================
   LAYOUT KHUSUS SAAT HERO ADALAH VIDEO
   ============================================ */

/* 1. MATIKAN OVERLAY GRADIENT saat ada video */
.desktop-featured-post.has-video .desktop-featured-post-image::after {
    display: none !important;
}

/* 2. Atur grid menjadi 1 kolom penuh untuk info video */
.desktop-featured-post-bottom.is-video .desktop-featured-post-news {
    grid-template-columns: 1fr !important;
}

/* 3. Styling untuk Item Info Video */
.desktop-featured-post-bottom.is-video .video-info-item {
    border-right: none !important; /* Hapus border kanan karena hanya 1 item */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 28px; /* Samakan padding dengan related item */
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-news-title {
    color: #1a1a1a !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
    -webkit-line-clamp: 3 !important;
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta {
    font-size: 13px;
    font-weight: 500;
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta .category {
    color: #e55225;
    font-weight: 600;
}

.desktop-featured-post-bottom.is-video .video-info-item .desktop-featured-post-meta .time {
    color: #888;
    margin-left: 4px;
}


/* ============================================
   CUSTOM UPLOADED VIDEO + KONTROL VERTIKAL
   ============================================ */
.custom-uploaded-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.custom-uploaded-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Kontrol Vertikal - SELALU TERLIHAT */
.video-controls-vertical {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column; /* Vertikal */
    gap: 12px;
    z-index: 10;
}

/* Tombol Kontrol Vertikal */
.video-control-btn-vertical {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.video-control-btn-vertical:hover {
    background: rgba(245, 166, 35, 0.9);
    border-color: #e55225;
    transform: scale(1.1);
    color: #ffffff;
}

.video-control-btn-vertical svg {
    width: 20px;
    height: 20px;
}

/* Ikon Fullscreen */
.icon-fullscreen-exit {
    display: none;
}

/* Pastikan overlay gradient tidak menutupi kontrol */
.desktop-featured-post-image::after {
    z-index: 1;
    pointer-events: none;
}

/* Mode Fullscreen */
.custom-uploaded-video-wrapper.fullscreen-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

.custom-uploaded-video-wrapper.fullscreen-active video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

.custom-uploaded-video-wrapper.fullscreen-active .video-controls-vertical {
    right: 24px;
    bottom: 24px;
}

/* Mobile: Ukuran tombol lebih kecil */
@media (max-width: 1023px) {
    .video-controls-vertical {
        right: 12px;
        bottom: 12px;
        gap: 8px;
    }
    
    .video-control-btn-vertical {
        width: 40px;
        height: 40px;
    }
    
    .video-control-btn-vertical svg {
        width: 18px;
        height: 18px;
    }
}

/* Share Modal/Popup (Opsional) */
.video-share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 6px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 300px;
}

.video-share-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.video-share-modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 700;
}

.video-share-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: #1a1a1a;
}

.video-share-option:hover {
    background: #e8e8e8;
}

.video-share-option svg {
    width: 24px;
    height: 24px;
}

.video-share-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-share-backdrop.active {
    opacity: 1;
    visibility: visible;
}
/* ============================================
   CUSTOM UPLOADED VIDEO + KONTROL LENGKAP
   ============================================ */
.custom-uploaded-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.custom-uploaded-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay Kontrol Video */
.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Tampilkan kontrol saat hover pada wrapper video */
.custom-uploaded-video-wrapper:hover .video-controls-overlay {
    opacity: 1;
}

/* Tombol Kontrol Video */
.video-control-btn {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}

.video-control-btn:hover {
    background: rgba(245, 166, 35, 0.9);
    border-color: #e55225;
    transform: scale(1.1);
    color: #ffffff;
}

.video-control-btn svg {
    width: 20px;
    height: 20px;
}

/* Ikon Fullscreen */
.icon-fullscreen-exit {
    display: none;
}

/* Pastikan overlay gradient tidak menutupi kontrol */
.desktop-featured-post-image::after {
    z-index: 1;
    pointer-events: none;
}

/* Mode Fullscreen */
.custom-uploaded-video-wrapper.fullscreen-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

.custom-uploaded-video-wrapper.fullscreen-active video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

.custom-uploaded-video-wrapper.fullscreen-active .video-controls-overlay {
    padding: 24px;
}

/* Tampilkan kontrol selalu saat fullscreen */
.custom-uploaded-video-wrapper.fullscreen-active .video-controls-overlay {
    opacity: 1;
}

/* Mobile: Kontrol selalu terlihat */
@media (max-width: 1023px) {
    .video-controls-overlay {
        opacity: 1;
        padding: 12px;
    }
    
    .video-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .video-control-btn svg {
        width: 18px;
        height: 18px;
    }
}
 

/* Pastikan video tidak ada controls default */
.custom-uploaded-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ============================================
   LOADING/BUFFERING SPINNER UNTUK YOUTUBE
   ============================================ */
.video-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    display: none; /* Tersembunyi secara default */
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

/* Muncul saat class 'loading' ditambahkan oleh JavaScript */
.custom-youtube-player.loading .video-loading-spinner {
    display: flex;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #e55225; /* Warna tema orange */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Efek visual saat loading: sembunyikan play icon & redupkan thumbnail */
.custom-youtube-player.loading .custom-play-icon {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-youtube-player.loading .yt-thumbnail {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Pastikan link di dalam judul featured post mewarisi warna dan tidak bergaris bawah */
.featured-post-title a,
.desktop-featured-post-title a,
.desktop-featured-news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Efek hover opsional agar user tahu itu bisa diklik */
.featured-post-title a:hover,
.desktop-featured-post-title a:hover,
.desktop-featured-news-title a:hover {
    color: #e55225; /* Warna orange tema Anda */
}

/* ============================================
   FEATURED POST MOBILE - DARK GRADIENT OVERLAY
   ============================================ */

/* Pastikan container gambar memiliki posisi relative */
.featured-post-image {
    position: relative;
}

/* Tambahkan Overlay Gradient Gelap di Bagian Bawah */
.featured-post-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%; /* Gradient menutupi 60% dari bawah */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 80%, rgb(0, 0, 0) 100%);
    pointer-events: none; /* Agar tidak menghalangi klik */
    z-index: 1;
}

/* Pastikan konten teks berada DI ATAS overlay */
.featured-post-content {
    position: relative;
    z-index: 2;
}

/* Opsional: Jika ada tombol play atau kontrol di mobile, pastikan juga di atas overlay */
.featured-post-image .custom-play-icon,
.featured-post-image .video-controls-overlay {
    position: relative;
    z-index: 2;
}

/* ============================================
   BREAKING NEWS BANNER (Label Rapat Sempurna)
   ============================================ */

.breaking-news-banner {
    display: flex;
    background-color: #000;
    border-radius: 6px 6px 0 0;
    padding: 7px 12px;
    margin-bottom: -7px;
    align-items: center;
    gap: 2px;
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
}

/* Label BREAKING - Rapat sempurna di kiri, atas, bawah */
.breaking-news-left {
    flex-shrink: 0;
    
    /* Gunakan negative margin untuk menarik ke tepi parent */
    margin: -8px 0 -8px -12px; /* Top, Right, Bottom, Left */
    
    /* Styling Dasar */
    color: #FFFFFF;
    background: #FF0E0E;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.2px;
    line-height: 1;
    
    /* Padding disesuaikan */
    padding: 10px 20px 10px 10px; 
    
    /* Sudut kiri melengkung mengikuti banner, kanan tajam */
    border-radius: 6px 0 0 0;

    /* KUNCI: Memotong sisi kanan agar miring ke atas */
    clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%);

    /* Shadow mengikuti bentuk clip-path */
    filter: drop-shadow(4px 8px 18px rgba(0, 0, 0, 0.5));
    
    z-index: 3;
    display: flex;
    align-items: center;
}

.breaking-news-left span {
    display: inline-block;
}

.breaking-news-right {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.breaking-news-title {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 15s linear infinite;
}

.breaking-news-title:hover {
    animation-play-state: paused;
}

.breaking-news-title a {
    color: #ffffff;
    text-decoration: none;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .breaking-news-banner {
        padding: 2px 10px;
        margin-bottom: -7px;
        gap: 2px;
    }

    .breaking-news-left {
      margin: -6px 0 -6px -10px;
    font-size: 12px;
    font-style: italic;
    letter-spacing: -0.2px;
    padding: 7px 20px 7px 8px;
    border-radius: 6px 0 0 0;
    clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    filter: drop-shadow(2px 4px 10px rgba(0, 0, 0, 0.4));
    }

    .breaking-news-title {
        font-size: 12px;
        font-weight: 600;
        animation-duration: 12s;
    }
}