/* ===============================================
   VARIABEL WARNA & FONT
=============================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --bg-color: #f0f2f5;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --border-color: #ddd;
    --header-bg: #ffffff;
    --nav-bg: #1a1a1a;
    --nav-text: #ffffff;
    --red-accent: #c00;
    --shadow-color: rgba(0,0,0,0.05);
}

body.dark-mode {
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #444;
    --header-bg: #1e1e1e;
    --nav-bg: #1a1a1a;
    --nav-text: #ffffff;
    --red-accent: #e53935;
    --shadow-color: rgba(0,0,0,0.2);
}

/* ===============================================
   GAYA GLOBAL & BODY
=============================================== */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden; /* Mencegah layar bisa digeser ke kanan-kiri */
}
a { text-decoration: none; color: var(--text-color); }
a:hover { color: var(--red-accent); }
h1, h2, h3, h4, h5, h6 { margin-top: 0; }

/* ===============================================
   HEADER, THEME SWITCHER & LOGO
=============================================== */
.main-header { 
    width: 100%;
    padding: 0 20px;
    background-color: var(--header-bg); 
    border-bottom: 1px solid var(--border-color); 
    box-sizing: border-box;
    transition: background-color 0.3s;
}
.header-content-wrapper {
    display: flex; 
    justify-content: space-between; /* Menjauhkan logo dan menu kanan */
    align-items: center; 
    max-width: 1200px; 
    margin: 0 auto;
    height: 70px; 
    width: 100%;
}
.logo-container img { height: 60px; display: block; }
.search-container.desktop-search { flex-grow: 1; margin: 0 25px; max-width: 400px; }
.search-container input { border: 1px solid var(--border-color); padding: 8px; border-right: none; background-color: var(--bg-color); color: var(--text-color); width: 100%; box-sizing: border-box; }
.search-container button { border: 1px solid var(--border-color); background-color: #eee; padding: 8px 12px; cursor: pointer; }
body.dark-mode .search-container button { background-color: #333; color: #fff; }

.header-kanan { display: flex; align-items: center; gap: 20px; }
.user-auth { display: flex; align-items: center; gap: 15px; font-size: 14px; }
.user-auth span { font-weight: bold; color: var(--text-color); }
.user-auth .auth-link { text-decoration: none; font-weight: bold; padding: 8px 12px; border-radius: 5px; transition: background-color 0.3s; color: var(--text-color); }
.user-auth .auth-link.logout { background-color: #555; color: white; }
.user-auth .auth-link.register { background-color: var(--red-accent); color: white; }
body.dark-mode .user-auth .auth-link { color: #e0e0e0; }

/* Gaya Theme Switcher */
.theme-switcher { display: flex; align-items: center; }
.theme-switcher input[type="checkbox"] { height: 0; width: 0; visibility: hidden; display: none; }
.theme-switcher .slider { cursor: pointer; text-indent: -9999px; width: 50px; height: 26px; background: grey; display: block; border-radius: 100px; position: relative; }
.theme-switcher .slider:after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 90px; transition: 0.3s; }
.theme-switcher input:checked + .slider { background: var(--red-accent); }
.theme-switcher input:checked + .slider:after { left: calc(100% - 3px); transform: translateX(-100%); }

/* ===============================================
   TOMBOL HAMBURGER (PERBAIKAN)
=============================================== */
.hamburger-btn { 
    display: none; /* Sembunyikan di desktop */
    flex-direction: column; 
    justify-content: space-between; 
    width: 28px; 
    height: 20px; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
    z-index: 1001; 
}
/* Definisi bentuk garis hamburger WAJIB ADA di sini */
.hamburger-btn span { 
    width: 100%; 
    height: 3px; 
    background-color: var(--text-color); 
    border-radius: 5px; 
    transition: all 0.3s ease; 
}
.hamburger-btn.is-active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger-btn.is-active span:nth-child(2) { opacity: 0; }
.hamburger-btn.is-active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ===============================================
   NAVIGASI UTAMA
=============================================== */
.main-nav { background-color: var(--nav-bg); width: 100%; border-bottom: 3px solid var(--red-accent); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; max-width: 1200px; margin: 0 auto; }
.main-nav ul li { position: relative; }
.main-nav ul li a { color: var(--nav-text); padding: 14px 15px; display: block; font-weight: bold; font-size: 14px; text-transform: uppercase; }
.main-nav ul li a:hover { background-color: var(--red-accent); color: white; }
.mobile-search { display: none; }
.main-nav .dropdown-arrow { font-size: 10px; margin-left: 5px; display: inline-block; transition: transform 0.3s; }
.menu-item-has-children > a { cursor: pointer; }
.sub-menu { display: none; position: absolute; top: 100%; left: 0; background-color: #333; list-style: none; padding: 0; margin: 0; min-width: 200px; z-index: 100; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
.main-nav ul li.sub-menu-active > .sub-menu { display: block; }
.main-nav ul li.sub-menu-active .dropdown-arrow { transform: rotate(180deg); }
.sub-menu li { width: 100%; }
.sub-menu li a { padding: 12px 15px; border-bottom: 1px solid #444; text-transform: none; font-size: 13px; }
.sub-menu li:last-child a { border-bottom: none; }

/* ===============================================
   GAYA NEWS TICKER (PERBAIKAN AGAR TIDAK MENONJOL)
=============================================== */
.news-ticker-container { 
    width: 100%; /* Wajib 100% */
    max-width: 1200px; 
    margin: 0 auto; 
    background-color: var(--card-bg-color); 
    display: flex; 
    align-items: center; 
    padding: 0; 
    border-bottom: 1px solid var(--border-color); 
    height: 45px; 
    box-sizing: border-box; 
    transition: background-color 0.3s; 
    overflow: hidden; /* INI KUNCI AGAR TIDAK BOCOR KE KANAN */
}
.ticker-label { background-color: var(--red-accent); color: white; padding: 0 15px; font-weight: bold; font-size: 14px; text-transform: uppercase; flex-shrink: 0; height: 100%; display: flex; align-items: center; box-sizing: border-box; position: relative; z-index: 10; }
.ticker-wrap { flex-grow: 1; overflow: hidden; margin-left: 15px; height: 100%; width: calc(100% - 100px); }
.ticker-move { display: inline-flex; white-space: nowrap; animation: ticker 50s linear infinite; height: 100%; align-items: center; }
.ticker-item { padding: 0 15px; border-right: 1px solid var(--border-color); display: flex; align-items: center; height: 100%; }
.ticker-item a { color: var(--text-color); text-decoration: none; font-size: 14px; transition: color 0.3s; }
.ticker-item a:hover { color: var(--red-accent); }
.ticker-wrap:hover .ticker-move { animation-play-state: paused; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===============================================
   LAYOUT UTAMA & KONTEN
=============================================== */
.main-content { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; padding: 25px 20px; max-width: 1200px; margin: 0 auto; box-sizing: border-box; }
.content-area { display: flex; flex-direction: column; gap: 25px; overflow: hidden; }
.sidebar-area { display: flex; flex-direction: column; gap: 25px; }

/* ... (Sisa kode CSS Anda dari Headline, Latest News, Sidebar, dll tetap) ... */
.headline-slideshow { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background-color: #eee; box-shadow: 0 4px 12px var(--shadow-color); }
.slides-container { width: 100%; height: 100%; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.6s ease-in-out; z-index: 1; }
.slide.active { opacity: 1; visibility: visible; z-index: 2; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide .headline-caption { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); color: white; padding: 25px; z-index: 3; }
.slide .headline-caption h2 { margin: 5px 0 0 0; font-size: 28px; line-height: 1.25; }
.slide .headline-caption .category { background-color: var(--red-accent); padding: 5px 10px; font-size: 12px; font-weight: bold; color: white; border-radius: 3px; text-transform: uppercase; }

.latest-news h3, .popular-posts h3, .sidebar-opini h3, .sidebar-wanita h3 { border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }
.latest-news-list .news-item { display: flex; gap: 15px; margin-bottom: 20px; }
.latest-news-list .news-item img { width: 160px; height: 110px; object-fit: cover; border-radius: 5px; }
.latest-news-list .news-item-text h4 { margin: 0 0 8px 0; font-size: 18px; line-height: 1.3; }
.latest-news-list .news-item-text .category { color: white; background-color: var(--red-accent); font-weight: bold; font-size: 11px; margin-bottom: 5px; padding: 4px 8px; border-radius: 3px; display: inline-block; text-transform: uppercase; }
.latest-news-list .news-item-text small { font-size: 12px; color: #777; }

.popular-posts, .iklan-box, .sidebar-opini, .sidebar-wanita { background-color: var(--card-bg-color); padding: 20px; border-radius: 5px; box-shadow: 0 1px 3px var(--shadow-color); }
.popular-posts ul, .sidebar-opini ul, .sidebar-wanita ul { list-style: none; padding: 0; margin: 0; }
.popular-posts li, .sidebar-opini li, .sidebar-wanita li { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.popular-posts img { width: 80px; height: 60px; object-fit: cover; border-radius: 5px; }
.sidebar-opini img, .sidebar-wanita img { width: 65px; height: 65px; border-radius: 50%; object-fit: cover; }
.popular-posts a, .sidebar-opini a, .sidebar-wanita a { font-weight: bold; font-size: 14px; }
.popular-posts small { font-size: 11px; color: #777; display: block; margin-top: 4px; }
.iklan-box { padding: 0; overflow: hidden; line-height: 0; }
.iklan-box img, .iklan-box video { width: 100%; height: auto; display: block; }
.iklan-box-placeholder { height: 250px; background-color: #333; color: white; display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: bold; border-radius: 5px; }

.category-showcase-title { font-size: 20px; font-weight: bold; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; position: relative; padding-left: 15px; }
.category-showcase-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 20px; width: 5px; background-color: var(--red-accent); }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.category-card { display: block; background-color: var(--card-bg-color); border-radius: 5px; overflow: hidden; box-shadow: 0 1px 4px var(--shadow-color); }
.category-card:hover { transform: translateY(-5px); transition: transform 0.2s ease-in-out; }
.card-image-container { position: relative; }
.card-image-container img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card-category-tag { position: absolute; top: 10px; left: 10px; background-color: rgba(28, 150, 73, 0.9); color: white; padding: 4px 8px; font-size: 11px; font-weight: bold; border-radius: 3px; text-transform: uppercase; }
.card-content { padding: 15px; }
.card-content h4 { margin: 0; font-size: 16px; line-height: 1.4; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; }
.pagination a { color: var(--text-color); padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 5px; background-color: var(--card-bg-color); transition: background-color 0.3s, color 0.3s; }
.pagination a.active { background-color: var(--red-accent); color: white; border-color: var(--red-accent); font-weight: bold; }

.main-footer { padding: 25px; margin-top: 20px; background-color: #1a1a1a; color: #aaa; font-size: 14px; }
.footer-content { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-nav { margin-bottom: 20px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: #ddd; text-decoration: none; font-weight: bold; transition: color 0.3s; }
.footer-nav a:hover { color: white; }
.footer-socials { margin-bottom: 20px; display: flex; justify-content: center; gap: 15px; }
.footer-socials a { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; background-color: #333; border-radius: 50%; transition: background-color 0.3s; }
.footer-socials a:hover { background-color: var(--red-accent); }
.footer-socials svg { width: 18px; height: 18px; fill: white; }


/* ===============================================
   ATURAN RESPONSIVE (Untuk Layar HP) PERBAIKAN
=============================================== */
@media (max-width: 992px) {
    .search-container.desktop-search { display: none; }
}

@media (max-width: 768px) {
    /* Perbaikan Jarak Utama */
    .main-content { grid-template-columns: 1fr; padding: 15px; gap: 20px; }
    .main-header { padding: 0 15px; }
    
    /* Penyesuaian Header Kanan di HP */
    .header-kanan { gap: 10px; }
    .user-auth span { display: none; } /* Sembunyikan teks sapaan agar muat */
    
    /* Tampilkan Tombol Hamburger */
    .hamburger-btn { display: flex; margin-left: 10px; }
    
    /* Pastikan Ticker tidak tumpah */
    .news-ticker-container { width: 100%; max-width: 100vw; overflow: hidden; }
    .ticker-wrap { width: calc(100% - 90px); }
    
    /* Gaya Menu Mobile (Tersembunyi ke Kiri) */
    .main-nav { position: fixed; top: 0; left: -100%; width: 80%; height: 100vh; background-color: var(--nav-bg); z-index: 1000; transition: left 0.3s ease-in-out; padding-top: 60px; overflow-y: auto; }
    .main-nav.mobile-active { left: 0; }
    .mobile-search { display: flex; padding: 15px; border-bottom: 1px solid #444; width: 100%; box-sizing: border-box; }
    .main-nav ul { flex-direction: column; align-items: flex-start; padding: 0; width: 100%; }
    .main-nav ul li { width: 100%; }
    .main-nav ul li a { padding: 15px 20px; border-bottom: 1px solid #333; display: block; }
    .sub-menu { position: static; box-shadow: none; background-color: transparent; padding-left: 15px; border-left: 3px solid var(--red-accent); }
    .sub-menu li a { border-bottom: 1px dashed #333; padding: 10px 15px; }

    /* Penyesuaian Elemen Lainnya */
    .logo-container img { max-height: 35px; }
    .slide .headline-caption h2 { font-size: 20px; }
    .category-grid { display: flex; overflow-x: auto; padding-bottom: 15px; gap: 15px; }
    .category-grid .category-card { flex: 0 0 85%; max-width: 300px; }
    .latest-news-list .news-item { flex-direction: row; align-items: flex-start; }
    .latest-news-list .news-item img { width: 120px; height: 90px; }
    .latest-news-list .news-item-text h4 { font-size: 15px; }
}