/* ==========================================================================
   1. RESET GLOBAL & VARIABLE SYSTEM
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e53935;     /* Merah khas portal berita */
    --text-dark: #1a1a1a;         /* Warna teks utama */
    --text-muted: #555555;        /* Warna teks abu-abu */
    --bg-light: #f8f9fa;          /* Latar belakang abu-abu sangat muda */
    --border-color: #e9ecef;      /* Warna garis pembatas */
    --transition-speed: 0.3s;     /* Kecepatan transisi efek */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: var(--text-dark);
}

/* ==========================================================================
   2. SITE HEADER (NAVIGASI DESKTOP)
   ========================================================================== */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.site-logo span {
    color: var(--primary-color);
}

.main-navigation {
    display: flex;
    align-items: center;
}

.menu-list {
    display: flex;
    list-style: none;
    gap: 25px;
}

.menu-list a {
    text-decoration: none;
    color: #4a4a4a;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-speed) ease;
}

.menu-list a:hover,
.menu-list a.active {
    color: var(--primary-color);
}

/* Menyembunyikan tombol mobile di desktop */
.menu-toggle,
.menu-close,
.menu-overlay {
    display: none;
}

/* ==========================================================================
   3. HERO HEADLINE SECTION (DESKTOP)
   ========================================================================== */
.hero-headline {
    padding: 30px 20px;
    background-color: #ffffff;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    /* Rasio 65% banding 35% membuat area kanan (sidebar) tampak lebar & proporsional */
    grid-template-columns: 65% 35%; 
    gap: 28px;
}

/* Elemen Pembantu Utama */
.hero-badge {
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.hero-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

/* SISI KIRI: Headline Utama */
.hero-main {
    display: flex;
    flex-direction: column;
}

.hero-main-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; 
    overflow: hidden;
    border-radius: 8px;
    background-color: #f0f0f0;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.hero-main-link:hover .hero-image {
    transform: scale(1.03);
}

.hero-image-wrapper .hero-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-main-content {
    margin-top: 20px;
}

.hero-main-title {
    font-size: 1.85rem;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 800;
    transition: color var(--transition-speed) ease;
}

.hero-main-link:hover .hero-main-title {
    color: var(--primary-color);
}

.hero-main-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* SISI KANAN: Pilihan Redaksi */
.hero-sidebar {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 24px;
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
}

.sidebar-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-item {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 16px;
}

.sidebar-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-badge {
    background-color: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 6px;
}

.sidebar-item-title {
    margin-top: 4px;
    margin-bottom: 6px;
}

.sidebar-item-title a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.05rem;
    line-height: 1.45;
    font-weight: 700;
    
    /* Memotong tulisan otomatis menjadi maksimal 3 baris */
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    transition: color var(--transition-speed) ease;
}

.sidebar-item-title a:hover {
    color: var(--primary-color);
}


/* ==========================================================================
   4. MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

/* Mode Tablet & Mobile (< 992px) */
@media (max-width: 991px) {
    .hero-container {
        grid-template-columns: 1fr; /* Layout berubah menjadi 1 kolom vertikal */
        gap: 30px;
    }
    
    .hero-main-title {
        font-size: 1.6rem;
    }
}

/* Khusus Header Mobile (< 768px) */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .menu-toggle .bar {
        width: 100%;
        height: 3px;
        background-color: #1a1a1a;
        border-radius: 2px;
        transition: var(--transition-speed);
    }

    .menu-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 2rem;
        background: transparent;
        border: none;
        color: #1a1a1a;
        cursor: pointer;
    }

    /* Menu laci menyamping dari kanan */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        display: block;
        padding: 60px 20px 20px 20px;
        transition: right var(--transition-speed) ease-in-out;
        z-index: 1001;
    }

    .main-navigation.active {
        right: 0;
    }

    .menu-list {
        flex-direction: column;
        gap: 20px;
    }

    .menu-list a {
        display: block;
        font-size: 1.1rem;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-speed) ease;
    }

    .menu-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mode Ponsel Kecil (< 576px) */
@media (max-width: 575px) {
    .hero-headline {
        padding: 15px 12px;
    }
    
    .hero-main-title {
        font-size: 1.4rem;
    }
    
    .hero-main-excerpt {
        font-size: 0.9rem;
    }
    
    .hero-sidebar {
        padding: 18px;
    }
}

/* ==========================================================================
   5. STYLING GLOBAL SECTION UTILITY
   ========================================================================== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title-global {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: -0.3px;
    position: relative;
    padding-left: 15px;
    margin-bottom: 24px;
}

.section-title-global::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 5px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* ==========================================================================
   6. STYLING SECTION KATEGORI
   ========================================================================== */
.categories-section {
    padding: 40px 0;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card-item {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: all var(--transition-speed) ease;
}

.category-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.category-card-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-card-item p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   7. STYLING SECTION BERITA TERBARU
   ========================================================================== */
.latest-news-section {
    padding: 50px 0;
    background-color: #fcfdfe;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header-flex .section-title-global {
    margin-bottom: 0;
}

.see-all-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform var(--transition-speed) ease;
}

.see-all-link:hover {
    transform: translateX(4px);
}

.latest-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.news-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #eaeaea;
}

.news-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.news-card:hover .news-card-media img {
    transform: scale(1.04);
}

.news-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 5;
}

.news-card-body {
    padding: 18px;
}

.news-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-speed) ease;
}

.news-card:hover .news-card-title {
    color: var(--primary-color);
}

.news-card-excerpt {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   8. STYLING SECTION NEWSLETTER
   ========================================================================== */
.newsletter-section {
    padding: 60px 20px;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.newsletter-inner {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.newsletter-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.newsletter-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #ccd0d4;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-speed) ease;
}

.newsletter-input:focus {
    border-color: var(--primary-color);
}

.newsletter-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--transition-speed) ease;
}

.newsletter-btn:hover {
    opacity: 0.9;
}

.newsletter-message {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.newsletter-message.success {
    color: #2e7d32;
}

/* ==========================================================================
   9. MEDIA QUERIES RESPONSIVE (TAMBAHAN)
   ========================================================================== */
@media (max-width: 991px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .latest-news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 650px) {
    .newsletter-form {
        flex-direction: column;
    }
    .newsletter-btn {
        width: 100%;
    }
}

@media (max-width: 575px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .latest-news-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-title {
        font-size: 1.35rem;
    }
}


/* ==========================================================================
   11. STYLING SITE FOOTER
   ========================================================================== */
.site-footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 60px 0 0 0;
    border-top: 5px solid var(--primary-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #aaaaaa;
}

.footer-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 8px;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #aaaaaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed) ease, padding-left var(--transition-speed) ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-socials a {
    color: #aaaaaa;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color var(--transition-speed) ease;
    display: inline-block;
}

.footer-socials a:hover {
    color: #ffffff;
}

/* Copyright Bar */
.footer-copyright {
    background-color: #111111;
    padding: 20px 20px;
    border-top: 1px solid #2d2d2d;
    text-align: center;
}

.copyright-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-copyright p {
    font-size: 0.8rem;
    color: #888888;
}

/* ==========================================================================
   12. STYLING BACK TO TOP BUTTON
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    opacity: 0;
    visibility: hidden;
    z-index: 99;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #1a1a1a;
    transform: translateY(-3px);
}

/* ==========================================================================
   13. RESPONSIVE UTILITY (FOOTER)
   ========================================================================== */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
