/* =========================================================
   RESET & GLOBAL FIX
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FDFBF7, #eef7f1);
    color: #333;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
   TOPBAR
========================================================= */
.topbar {
    background: #006633;
    color: white;
    padding: 5px 12px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

/* =========================================================
   HEADER
========================================================= */
header.header {
    background: linear-gradient(135deg, #004d00, #00802b);
    color: white;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: auto;
    gap: 10px;
}

.logo-kemendes,
.header-logo img {
    width: 45px;
    height: auto;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header-text h1 {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.header-text p {
    font-size: 11px;
    opacity: 0.85;
}

/* =========================================================
   NAVBAR
========================================================= */
.navbar {
    background: #d71920;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar a {
    color: white;
    padding: 12px 15px;
    text-decoration: none;
    font-weight: 600;
}

.navbar a:hover {
    background: #b51218;
}

/* =========================================================
   SLIDER
========================================================= */
.slider-container {
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.slider {
    display: flex;
    width: 300%;
    animation: slide 15s infinite;
}

.slider img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

@keyframes slide {
    0%, 20% { margin-left: 0; }
    33%, 53% { margin-left: -100%; }
    66%, 86% { margin-left: -200%; }
    100% { margin-left: 0; }
}

/* =========================================================
   LAYOUT
========================================================= */
.container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    padding: 0 10px;
}

/* =========================================================
   NEWS GRID
========================================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-card p {
    padding: 10px;
    font-size: 13px;
    color: #666;
}

.news-card a {
    display: block;
    background: #27ae60;
    color: white;
    text-align: center;
    padding: 8px;
    text-decoration: none;
}

/* =========================================================
   SIDEBAR
========================================================= */
.sidebar-box {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
}

/* =========================================================
   KATEGORI
========================================================= */
.kategori-cepat {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
}

.kategori-cepat a {
    background: #004080;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
}

/* =========================================================
   IKLAN
========================================================= */
.iklan-slider-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 10px;
    position: relative;
}

.iklan-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.iklan-slide.active {
    opacity: 1;
}

/* =========================================================
   RESPONSIVE HP
========================================================= */
@media (max-width: 768px) {

    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .logo-kemendes,
    .header-logo img {
        width: 40px;
    }

    .header-text h1 {
        font-size: 14px;
    }

    .header-text p {
        font-size: 10px;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .slider-container {
        height: 160px;
    }

    .slider img {
        height: 160px;
    }

    .news-card {
        display: flex;
        gap: 10px;
        padding: 10px;
    }

    .news-card img {
        width: 90px;
        height: 70px;
        object-fit: cover;
    }

    .news-card p {
        display: none;
    }

    .iklan-slider-container {
        height: 160px;
    }
}
/* =========================
   FIX RESPONSIVE FINAL
========================= */

.container{
    display:flex;
    gap:20px;
    max-width:1200px;
    margin:auto;
    padding:10px;
}

main{flex:3;}
.sidebar{flex:1;}

/* NEWS CARD */
.news-card{
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:0 2px 8px rgba(0,0,0,0.1);
}

.news-thumb{
    width:100%;
    height:180px;
    object-fit:cover;
}

/* MOBILE */
@media(max-width:768px){

    .container{
        flex-direction:column;
    }

    .news-grid{
        grid-template-columns:1fr !important;
    }

    .news-card{
        display:block;
    }

    .news-thumb{
        height:160px;
    }

    .sidebar{
        position:relative;
    }

    .slider-container{
        height:160px !important;
    }

    .slider img{
        height:160px !important;
    }
}