/* =========================
   RESET & DASAR UTAMA
========================= */
:root{
    --primary:#4f46e5;
    --primary-hover:#4338ca;
    --dark:#0f172a;
    --text:#475569;
    --border:#e2e8f0;
    --bg:#f8fafc;
    --white:#ffffff;
    --radius:14px;
    --shadow:0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.6;
}

img{
    max-width:100%;
    display:block;
}

a{
    text-decoration:none;
    color:inherit;
}

.container{
    width:min(1200px, 94%);
    margin:auto;
}

/* =========================
   HEADER & MENU NAVIGATION
========================= */
.header{
    position:sticky;
    top:0;
    z-index:999;
    background:rgba(255,255,255,0.96);
    backdrop-filter:blur(8px);
    border-bottom:1px solid var(--border);
}

.header-wrap{
    height:70px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.logo{
    font-size:22px;
    font-weight:700;
    color:var(--dark);
}

.nav{
    display:flex;
    gap:25px;
}

.nav a{
    color:var(--text);
    font-weight:500;
    transition:0.2s;
}

.nav a:hover{
    color:var(--primary);
}

.header-actions{
    display:flex;
    align-items:center;
    gap:14px;
}

.search-btn{
    width:38px;
    height:38px;
    border:1px solid var(--border);
    border-radius:50%;
    background:var(--white);
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
}

.avatar{
    width:38px;
    height:38px;
    border-radius:50%;
    object-fit:cover;
    border:2px solid var(--primary);
    display:none;
}

.auth-btn{
    border:none;
    background:var(--dark);
    color:var(--white);
    padding:10px 18px;
    border-radius:20px;
    cursor:pointer;
    font-weight:600;
    font-size:14px;
}

.menu-btn{
    display:none; 
    background:none;
    border:none;
    font-size:26px;
    cursor:pointer;
    color:var(--dark);
}

.mobile-menu{
    display:none;
}

/* =========================
   HERO STYLE
========================= */
.hero{
    padding:55px 0 35px 0;
    text-align:center;
    background:var(--white);
    border-bottom:1px solid var(--border);
}

.badge{
    background:#eef2ff;
    color:var(--primary);
    padding:4px 12px;
    border-radius:50px;
    font-size:12px;
    font-weight:600;
}

.hero h1{
    font-size:36px;
    color:var(--dark);
    margin:14px 0;
    font-weight:800;
}

.hero p{
    max-width:600px;
    margin:0 auto;
    color:var(--text);
}

/* =========================
   GRID LAYOUT & SIDEBAR STICKY
========================= */
.main-layout{
    display:grid;
    grid-template-columns:2.7fr 1fr;
    gap:35px;
    margin-top:35px;
}

.section-title {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 700;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.featured-main{
    position:relative;
    border-radius:var(--radius);
    overflow:hidden;
    height:380px;
    box-shadow:var(--shadow);
    margin-bottom:35px;
}

.featured-main img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.featured-overlay{
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    padding:24px;
    background:linear-gradient(180deg, transparent 0%, rgba(15,23,42,0.9) 100%);
    color:var(--white);
}

/* DAFTAR TUTORIAL BARU (DESKTOP DEFAULT 3 KOLOM) */
.posts-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:20px;
}

.post-card{
    background:var(--white);
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:var(--shadow);
    display:flex;
    flex-direction:column;
    border:1px solid #f1f5f9;
}

.post-card img{
    width:100%;
    height:150px;
    object-fit:cover;
}

.post-content{
    padding:16px;
    display:flex;
    flex-direction:column;
    flex-grow:1;
}

.post-category{
    font-size:11px;
    font-weight:600;
    color:var(--primary);
    text-transform:uppercase;
}

.post-content h3{
    font-size:14px;
    color:var(--dark);
    margin:6px 0;
    line-height:1.4;
}

.post-content p{
    font-size:13px;
    color:var(--text);
}

/* SIDEBAR STICKY */
.sidebar-sticky{
    position:sticky;
    top:90px;
    display:flex;
    flex-direction:column;
    gap:24px;
}

.sidebar-widget{
    background:var(--white);
    padding:20px;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    border:1px solid #f1f5f9;
}

.sidebar-widget h3{
    font-size:15px;
    color:var(--dark);
    margin-bottom:12px;
    border-bottom:2px solid var(--bg);
    padding-bottom:6px;
}

.widget-links li{
    list-style:none;
    padding:8px 0;
    border-bottom:1px solid var(--bg);
    font-size:13px;
}

.mini-post-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.mini-post{
    display:flex;
    gap:12px;
}

.mini-post img{
    width:50px;
    height:50px;
    border-radius:8px;
    object-fit:cover;
}

.mini-post h3{
    font-size:13px;
    color:var(--dark);
}

.adsense-box{
    min-height:250px;
    background:#f1f5f9;
    border:2px dashed #cbd5e1;
    display:flex;
    align-items:center;
    justify-content:center;
}

.ads-label{
    font-size:12px;
    color:#94a3b8;
}

/* PAGINATION */
.pagination{
    display:flex;
    gap:8px;
    margin:35px 0;
}

.pagination a{
    padding:6px 12px;
    border-radius:6px;
    background:var(--white);
    border:1px solid var(--border);
    font-size:13px;
}

.pagination a.active{
    background:var(--primary);
    color:var(--white);
    border-color:var(--primary);
}

/* =========================
   FOOTER STYLE CARD
========================= */
.footer{
    background:#f1f5f9;
    margin-top:50px;
    padding:35px 0 20px 0;
}

.footer-cards{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:20px;
    padding-bottom:25px;
}

.footer-card{
    background:var(--white);
    padding:20px;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.footer-card h3{
    font-size:15px;
    color:var(--dark);
    margin-bottom:12px;
    border-bottom:2px solid var(--bg);
    padding-bottom:4px;
}

.footer-card ul li{
    list-style:none;
    margin-bottom:6px;
    font-size:13px;
}

.copyright{
    text-align:center;
    font-size:12px;
    color:#94a3b8;
    padding-top:15px;
    border-top:1px solid var(--border);
}

/* =========================
   MODAL WINDOW
========================= */
.search-modal{
    position:fixed;
    inset:0;
    background:rgba(15,23,42,0.4);
    backdrop-filter:blur(4px);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:1000;
}

.search-modal.active{
    display:flex;
}

.search-modal-content{
    background:var(--white);
    padding:25px;
    border-radius:var(--radius);
    width:min(450px, 90%);
    position:relative;
}

#closeSearch{
    position:absolute;
    top:15px;
    right:15px;
    background:none;
    border:none;
    font-size:16px;
    cursor:pointer;
}

.search-modal-content input{
    width:100%;
    padding:10px 14px;
    border:1px solid var(--border);
    border-radius:8px;
    outline:none;
    margin-top:12px;
}

/* =========================
   RESPONSIVE DESIGN (HP)
========================= */
@media (max-width:992px){
    .main-layout{
        grid-template-columns:1fr;
    }
    .posts-grid{
        grid-template-columns:repeat(2, 1fr);
    }
}

@media (max-width:768px){
    /* Hilangkan nav desktop & tombol auth asli komputer */
    .nav, .auth-btn {
        display:none !important;
    }

    /* Mengaktifkan Hamburger di paling kiri */
    .menu-btn{
        display:block;
        order:-1; 
    }

    .header-wrap{
        justify-content:flex-start;
        gap:16px;
    }

    .header-actions{
        margin-left:auto;
    }

    /* FIX REKUES: DAFTAR TUTORIAL TERBARU MENJADI 2 KOLOM DI HP */
    .posts-grid{
        grid-template-columns:repeat(2, 1fr);
        gap: 12px;
    }
    
    .post-card img {
        height: 120px; /* Ukuran gambar disesuaikan agar proporsional */
    }

    .footer-cards{
        grid-template-columns:1fr;
    }

    /* Buka laci seluler */
    .mobile-menu{
        position:fixed;
        top:70px;
        left:0;
        right:0;
        background:var(--white);
        padding:20px;
        display:none;
        flex-direction:column;
        gap:14px;
        border-bottom:1px solid var(--border);
        z-index:99;
        box-shadow:var(--shadow);
    }

    .mobile-menu.show{
        display:flex;
    }

    .mobile-auth-btn{
        width:100%;
        padding:12px;
        background:var(--primary);
        color:var(--white);
        border:none;
        border-radius:8px;
        font-weight:600;
        cursor:pointer;
    }
}

/* Penyesuaian khusus untuk HP yang layarnya sangat kecil */
@media (max-width:480px){
    .posts-grid{
        grid-template-columns:repeat(2, 1fr);
        gap: 8px;
    }
    .post-content {
        padding: 10px;
    }
    .post-content h3 {
        font-size: 13px;
    }
    .post-content p {
        display: none; /* Sembunyikan deskripsi pendek di layar super kecil agar rapi */
    }
}