/* =========================================================================
   MODERN UI EXTENSION (BENTO GRID, DARK MODE, GLASSMORPHISM)
   ========================================================================= */

/* Dark Mode Theme Variables */
:root {
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg-main: #0B0F19;
    --bg-card: #151A28;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border-color: #1F2937;
    --primary-color: #FF3333;
    --primary-dark: #CC0000;
}

/* Base Adjustments */
body {
    font-family: 'Inter', sans-serif;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

.top-bar, .main-header {
    transition: background-color var(--transition-smooth);
}
[data-theme="dark"] .top-bar { background-color: #06090F; border-bottom: 1px solid #1F2937; }
[data-theme="dark"] .main-header { background-color: rgba(21, 26, 40, 0.85); }
[data-theme="dark"] .news-card, [data-theme="dark"] .trending-item { background-color: var(--bg-card); color: var(--text-main); }
[data-theme="dark"] .news-card h3, [data-theme="dark"] .trending-info h4 { color: var(--text-light); }
[data-theme="dark"] .secondary-nav { background-color: var(--bg-main); border-bottom-color: var(--border-color); }

/* Red Glassmorphism Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(220, 0, 0, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(180, 0, 0, 0.3);
}

/* Featured Story Cards System (Detikcom Style - Image 2) */
.bento-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 24px;
    margin-bottom: 40px;
}

.bento-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    background: #111827;
    height: 325px; /* Aesthetic portrait aspect ratio for desktop */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
}

.bento-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s ease;
}

.bento-item:hover img {
    transform: scale(1.06);
}

/* Top bar with category badge & circular play button */
.bento-card-top {
    position: relative;
    z-index: 2;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 100%);
}

.bento-card-top .badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.bento-play-icon {
    color: #ffffff;
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.bento-item:hover .bento-play-icon {
    transform: scale(1.18);
    opacity: 1;
}

/* Bottom Overlay with gradient */
.bento-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 65%, transparent 100%);
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* White Content Box with Red Left Bar (Detikcom signature look) */
.bento-title-box {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
}

.bento-item:hover .bento-title-box {
    transform: translateY(-2px);
}

.bento-red-bar {
    width: 6px;
    background-color: var(--primary-color, #E30613);
    flex-shrink: 0;
}

.bento-title-text {
    margin: 8px 10px;
    padding: 0;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #111827 !important; /* Crisp black text on white box */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

[data-theme="dark"] .bento-title-text {
    color: #111827 !important; /* Keep white box readable in dark mode */
}

.bento-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

@media (max-width: 992px) {
    .bento-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .bento-item {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .bento-container { 
        display: flex; 
        flex-direction: row; 
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 6px;
        padding: 8px 4px 20px 4px;
        -webkit-overflow-scrolling: touch;
        margin-right: 0;
        margin-left: 0;
    }
    .bento-container::-webkit-scrollbar {
        display: none;
    }
    .bento-item { 
        flex: 0 0 145px; /* Kartu lebih mungil */
        height: 260px; 
        scroll-snap-align: start;
        border-radius: 12px;
    }
    .bento-title-text {
        font-size: 11.5px !important;
        margin: 5px 6px;
        padding: 0;
        -webkit-line-clamp: 3 !important;
    }
}

/* Scroll Revel Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Dark Mode Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
}
.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}
.theme-switch input { display: none; }
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(24px); }
.theme-icon { margin-left: 8px; font-size: 14px; color: var(--text-muted); }
[data-theme="dark"] .theme-icon { color: #FBBF24; }

/* Layout Main & Sidebar */
.content-sidebar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    margin-bottom: 48px;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

@media (max-width: 992px) {
    .content-sidebar-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .sticky-sidebar {
        position: static;
        margin-top: 32px;
    }
}

/* Trending Sidebar Styling */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}
.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background-color: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
.trending-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.trending-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 24px;
    text-align: center;
}
.trending-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.trending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.trending-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trending-date {
    font-size: 11px;
    color: var(--text-muted);
}




/* MOBILE HEADER ACTIONS */
.mobile-header-actions {
    display: none;
    align-items: center;
    gap: 16px;
}
.mobile-header-actions button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-header-actions button:hover {
    color: #ffd700;
}
@media (max-width: 992px) {
    .mobile-header-actions {
        display: flex;
    }

}
.mobile-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
    border-top: 1px solid rgba(0,0,0,0.05);
}
[data-theme="dark"] .mobile-search-dropdown {
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.mobile-search-dropdown.active {
    display: flex;
    gap: 10px;
    animation: slideDown 0.3s ease forwards;
}
.mobile-search-dropdown input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    outline: none;
    background: #f5f5f5;
    color: #333;
}
[data-theme="dark"] .mobile-search-dropdown input {
    background: #1F2937;
    border-color: #374151;
    color: white;
}
.mobile-search-dropdown button.mobile-search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- BLOCK 1 MAIN HEADLINE CARD (INSPIRASI KALBAR THEME RED STYLE) --- */
.news-card.main-headline-blue,
.news-card.main-headline-red,
.news-card.main-headline-theme {
    background: linear-gradient(180deg, var(--accent-color, #E30613) 0%, var(--primary-dark, #8B0000) 100%) !important;
    border-radius: 16px !important;
    border: none !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(227, 6, 19, 0.3) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.news-card.main-headline-blue:hover,
.news-card.main-headline-red:hover,
.news-card.main-headline-theme:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 14px 32px rgba(227, 6, 19, 0.45) !important;
}

.news-card.main-headline-blue .card-image,
.news-card.main-headline-red .card-image,
.news-card.main-headline-theme .card-image {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16/10 !important;
    overflow: hidden !important;
    background-color: var(--primary-dark, #8B0000) !important;
}

.news-card.main-headline-blue .card-image::after,
.news-card.main-headline-red .card-image::after,
.news-card.main-headline-theme .card-image::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important; 
    left: 0 !important; 
    right: 0 !important;
    height: 50% !important;
    background: linear-gradient(to top, var(--accent-color, #E30613) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.news-card.main-headline-blue .card-body,
.news-card.main-headline-red .card-body,
.news-card.main-headline-theme .card-body {
    background: transparent !important;
    padding: 24px 22px 22px 22px !important;
    color: #ffffff !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
}

.news-card.main-headline-blue .card-body h3,
.news-card.main-headline-red .card-body h3,
.news-card.main-headline-theme .card-body h3 {
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    line-height: 1.38 !important;
    margin-bottom: 12px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

@media (min-width: 992px) {
    .news-cards-grid.magazine-layout .news-card.main-headline-blue .card-body h3,
    .news-cards-grid.magazine-layout .news-card.main-headline-red .card-body h3,
    .news-cards-grid.magazine-layout .news-card.main-headline-theme .card-body h3 {
        font-size: 26px !important;
        line-height: 1.32 !important;
        margin-bottom: 16px !important;
    }
    .news-cards-grid.magazine-layout .news-card.main-headline-blue .card-body,
    .news-cards-grid.magazine-layout .news-card.main-headline-red .card-body,
    .news-cards-grid.magazine-layout .news-card.main-headline-theme .card-body {
        padding: 32px 28px 28px 28px !important;
    }
}

.news-card.main-headline-blue .card-meta,
.news-card.main-headline-red .card-meta,
.news-card.main-headline-theme .card-meta {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: auto !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    display: flex !important;
    gap: 16px !important;
}

.news-card.main-headline-blue .card-meta span,
.news-card.main-headline-red .card-meta span,
.news-card.main-headline-theme .card-meta span {
    color: rgba(255, 255, 255, 0.85) !important;
}

@media (max-width: 768px) {
    .news-card.main-headline-theme {
        width: 100% !important;
        min-height: 385px !important;
        margin-bottom: 20px !important;
        border-radius: 18px !important;
    }
    .news-card.main-headline-theme .card-image {
        aspect-ratio: 16/11 !important;
        min-height: 190px !important;
    }
    .news-card.main-headline-theme .card-body {
        padding: 24px 20px 22px 20px !important;
    }
    .news-card.main-headline-theme .card-body h3 {
        font-size: 19px !important;
        line-height: 1.38 !important;
        margin-bottom: 14px !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   STICKY PORTRAIT SIDE BANNERS (LEFT & RIGHT FLANKING ADS)
══════════════════════════════════════════════════════════════ */
.sticky-side-banner {
    display: none; /* Hidden by default on screens < 1400px */
    position: fixed;
    top: 210px;
    width: 160px;
    z-index: 99;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

[data-theme="dark"] .sticky-side-banner {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Position pushed completely to screen edges so it never overlaps the 1080px body content */
@media (min-width: 1366px) {
    .sticky-side-banner {
        display: block;
        width: 130px;
    }
    .left-banner {
        left: 8px;
    }
    .right-banner {
        right: 8px;
    }
    .banner-title {
        font-size: 11px;
        margin-bottom: 6px;
    }
    .banner-desc {
        font-size: 9.5px;
        margin-bottom: 10px;
    }
    .banner-features span {
        font-size: 9px;
    }
    .banner-cta {
        font-size: 10px;
        padding: 7px 8px;
    }
}

@media (min-width: 1440px) {
    .sticky-side-banner {
        width: 150px;
    }
    .left-banner {
        left: 15px;
    }
    .right-banner {
        right: 15px;
    }
    .banner-title {
        font-size: 12px;
        margin-bottom: 8px;
    }
    .banner-desc {
        font-size: 10.5px;
        margin-bottom: 12px;
    }
    .banner-features span {
        font-size: 10px;
    }
    .banner-cta {
        font-size: 11px;
        padding: 8px 10px;
    }
}

@media (min-width: 1550px) {
    .sticky-side-banner {
        width: 160px;
    }
    .left-banner {
        left: calc(50% - 715px);
    }
    .right-banner {
        right: calc(50% - 715px);
    }
    .banner-title {
        font-size: 13px;
    }
    .banner-desc {
        font-size: 11px;
    }
    .banner-cta {
        padding: 9px 12px;
    }
}

@media (min-width: 1680px) {
    .sticky-side-banner {
        width: 180px;
    }
    .left-banner {
        left: calc(50% - 745px);
    }
    .right-banner {
        right: calc(50% - 745px);
    }
}

.banner-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.banner-close-btn:hover {
    background: #ef4444;
    color: white;
}

[data-theme="dark"] .banner-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

[data-theme="dark"] .banner-close-btn:hover {
    background: #ef4444;
    color: white;
}

.banner-content {
    padding: 18px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

[data-theme="dark"] .banner-content {
    background: linear-gradient(180deg, #1f1215 0%, #111827 100%);
}

.banner-content.right-theme {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

[data-theme="dark"] .banner-content.right-theme {
    background: linear-gradient(180deg, #111a2e 0%, #111827 100%);
}

.banner-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #dc2626;
    color: white;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.banner-badge.blue-badge {
    background: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.banner-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15);
}

.banner-icon-wrapper.blue-icon {
    background: #dbeafe;
    color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .banner-icon-wrapper {
    background: rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .banner-icon-wrapper.blue-icon {
    background: rgba(37, 99, 235, 0.2);
}

.banner-title {
    font-size: 13px;
    font-weight: 850;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

[data-theme="dark"] .banner-title {
    color: #f9fafb;
}

.banner-desc {
    font-size: 11px;
    color: #4b5563;
    margin: 0 0 14px 0;
    line-height: 1.4;
}

[data-theme="dark"] .banner-desc {
    color: #9ca3af;
}

.banner-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-bottom: 16px;
    text-align: left;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .banner-features {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.banner-features span {
    font-size: 10px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .banner-features span {
    color: #d1d5db;
}

.banner-features span i {
    color: #16a34a;
    font-size: 11px;
}

.banner-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    background: #dc2626;
    color: white !important;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.banner-cta:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
}

.banner-cta.blue-cta {
    background: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.banner-cta.blue-cta:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.banner-footer-note {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 6px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

[data-theme="dark"] .banner-footer-note {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.08);
    color: #64748b;
}



