/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --gap: 24px;
    --main-width: 800px; 
    --single-width: 900px; 
    --header-height: 60px;
    --radius: 12px;
    --primary: #1e1e1e;
    --accent: #27ae60; /* Hijau Tani */
    --bg-body: #F5F5F5; /* Abu-abu Terang */
    --bg-card: #FFFFFF;
    --text-main: #333;
    --text-sec: #666;
    --border: #E5E5E5;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    font-size: 16px;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* =========================================
   2. HEADER NAVIGATION (STICKY)
   ========================================= */
.main-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible !important; /* Agar dropdown tidak kepotong */
}

.header-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible !important;
}

.site-title { font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; }
.site-title img { height: 32px; width: auto; }

/* Group Tombol Kanan (Search + Hamburger) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =========================================
   3. FITUR PENCARIAN (SEARCH LUP)
   ========================================= */
.search-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 5px;
    display: flex;
    align-items: center;
    transition: 0.2s;
}
.search-trigger:hover { color: var(--accent); transform: scale(1.1); }

/* Overlay Hitam Fullscreen */
.search-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    padding-top: 100px;
    backdrop-filter: blur(5px);
}
.search-overlay.active { opacity: 1; visibility: visible; }

/* Kotak Input */
.search-container {
    width: 100%; max-width: 600px; background: transparent; padding: 0 20px;
}
.search-header {
    position: relative; margin-bottom: 20px; border-bottom: 2px solid rgba(255,255,255,0.2);
}
#searchInput {
    width: 100%; background: transparent; border: none; color: white;
    font-size: 1.5rem; padding: 15px 50px 15px 0; outline: none; font-weight: 600;
}
#searchInput::placeholder { color: rgba(255,255,255,0.4); }

.close-search {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: rgba(255,255,255,0.6);
    font-size: 2rem; cursor: pointer;
}
.close-search:hover { color: white; }

/* Hasil Pencarian */
.search-results { max-height: 60vh; overflow-y: auto; }
.search-item {
    display: block; background: white; padding: 15px; border-radius: 8px;
    margin-bottom: 10px; text-decoration: none; transition: transform 0.2s;
}
.search-item:hover { transform: translateX(5px); background: #f0fdf4; }
.search-title { display: block; font-weight: bold; color: #111; font-size: 1rem; margin-bottom: 4px; }
.search-desc { display: block; font-size: 0.85rem; color: #666; }
.no-result { color: rgba(255,255,255,0.6); font-style: italic; }

/* =========================================
   4. NAVIGASI DROPDOWN (DESKTOP)
   ========================================= */
.main-nav { display: flex; align-items: center; gap: 20px; }
.nav-link { font-weight: 500; color: var(--text-main); font-size: 0.95rem; padding: 10px 0; position: relative; }
.nav-link:hover { color: var(--accent); }

/* Dropdown Container */
.nav-item { position: relative; }
.dropdown-menu { position: relative; display: inline-block; padding: 10px 0; }
.dropdown-toggle {
    font-weight: 600; color: var(--text-main); cursor: pointer;
    font-size: 0.95rem; display: inline-flex; align-items: center; gap: 4px;
}
.dropdown-toggle:hover { color: var(--accent); }

/* Isi Dropdown (Kotak Putih) */
.dropdown-content {
    display: none; position: absolute; top: 100%; left: -10px;
    background-color: #ffffff; min-width: 220px;
    max-height: 400px; overflow-y: auto; /* Scrollable */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px; z-index: 9999; padding: 8px 0; border: 1px solid #eee;
    animation: slideDown 0.2s ease;
}
/* Logic Hover Desktop */
@media (min-width: 769px) {
    .nav-item:hover .dropdown-content { display: block; }
}

.dropdown-content a {
    color: #444; padding: 12px 20px; text-decoration: none; display: block;
    font-size: 0.9rem; border-bottom: 1px solid #f9f9f9; transition: all 0.2s;
}
.dropdown-content a:hover { background-color: #f0fdf4; color: var(--accent); padding-left: 25px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   5. STYLE BERANDA (PAPERMOD)
   ========================================= */
.papermod-container { max-width: var(--main-width); margin: 40px auto; padding: 0 20px; }
.intro-section { margin-bottom: 40px; }
.intro-section h1 { font-size: 2rem; margin-bottom: 10px; line-height: 1.2; }
.post-entry {
    background: var(--bg-card); padding: 24px; border-radius: var(--radius);
    margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    position: relative; transition: transform 0.2s; border: 1px solid transparent;
}
.post-entry:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); border-color: #eee; }
.entry-header h2 { margin: 0 0 10px 0; font-size: 1.5rem; line-height: 1.3; }
.entry-content { color: var(--text-sec); margin-bottom: 12px; font-size: 1rem; }
.entry-footer { font-size: 0.85rem; color: #999; }
.entry-link { position: absolute; inset: 0; }
.pagination { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; }
.pagination a { background: #222; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; }
.pagination a:hover { background: var(--accent); }

/* =========================================
   6. STYLE SINGLE POST (HERO)
   ========================================= */
.single-post-container { max-width: var(--single-width); margin: 30px auto 60px; padding: 0 20px; }
.nav-back { margin-bottom: 20px; }
.nav-back a { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.hero-wrapper {
    position: relative; width: 100%; height: 450px;
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: -50px; /* Overlap */
    z-index: 1; background: #333;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-gradient {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 90%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    z-index: 2;
}
.hero-title-content {
    position: absolute; bottom: 90px; left: 0; width: 100%; padding: 0 40px;
    z-index: 3; display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-title-content h1 {
    color: white; font-size: 2.4rem; line-height: 1.25; margin: 0 0 15px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    white-space: normal; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%;
}
.hero-meta {
    font-size: 0.95rem; font-weight: 600; letter-spacing: 0.5px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    color: #ffeba7; text-shadow: 0 2px 4px rgba(0,0,0,0.9);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-sep { color: rgba(255,255,255,0.6); font-size: 1.2rem; line-height: 0; }
.meta-cat-link { color: #ffeba7; text-decoration: none; border-bottom: 1px dotted #ffeba7; transition: 0.2s; }
.meta-cat-link:hover { color: #fff; border-bottom: 1px solid #fff; }

.post-body-card {
    background: var(--bg-card); padding: 80px 50px 40px; border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); position: relative; z-index: 2;
}
.post-content { font-size: 1.125rem; color: #2c3e50; font-family: 'Georgia', 'Times New Roman', serif; line-height: 1.8; }
.post-content img { border-radius: 8px; margin: 2em auto; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.post-tags { margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; }
.tags-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-item { background: #f0f0f0; padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; color: #555; }

.post-navigation {
    display: flex; justify-content: space-between; gap: 20px;
    margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee;
}
.nav-btn {
    flex: 1; display: flex; flex-direction: column; padding: 15px 20px;
    background: #f9f9f9; border-radius: 10px; border: 1px solid #eee;
    max-width: 48%; transition: 0.2s;
}
.nav-btn:hover { background: #fff; border-color: var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.nav-btn.next { text-align: right; align-items: flex-end; }
.nav-title { font-size: 1rem; font-weight: 600; color: var(--primary); line-height: 1.3; }
.nav-btn:hover .nav-title { color: var(--accent); }
.nav-placeholder { flex: 1; max-width: 48%; }

.main-footer { text-align: center; padding: 40px 0; color: #999; font-size: 0.9rem; margin-top: 50px; border-top: 1px solid #eee; }

/* =========================================
   7. RESPONSIVE MOBILE (SIDEBAR & LAYOUT)
   ========================================= */
@media (max-width: 768px) {
    /* Hamburger */
    .hamburger-btn {
        display: flex; flex-direction: column; justify-content: space-between;
        width: 30px; height: 21px; background: none; border: none; cursor: pointer; padding: 0; z-index: 2000;
    }
    .hamburger-btn .bar { width: 100%; height: 3px; background-color: var(--primary); border-radius: 3px; }

    /* Sidebar Slide */
    .sidebar-overlay {
        display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); opacity: 0; visibility: hidden; transition: 0.3s; z-index: 2000;
    }
    .sidebar-overlay.active { opacity: 1; visibility: visible; }

    .main-nav {
        position: fixed; top: 0; left: -100%; width: 75%; height: 100vh;
        background: white; flex-direction: column; align-items: flex-start;
        padding: 0; gap: 0; transition: 0.3s ease-in-out; z-index: 2001;
        overflow-y: auto; box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    .main-nav.active { left: 0; }

    /* Sidebar Header */
    .sidebar-header {
        display: flex; justify-content: space-between; align-items: center; width: 100%;
        padding: 20px; background: #f8f9fa; border-bottom: 1px solid #eee;
    }
    .sidebar-title { font-weight: bold; font-size: 1.1rem; }
    .close-btn { font-size: 1.5rem; background: none; border: none; cursor: pointer; color: #555; }

    /* Mobile Links */
    .nav-link, .dropdown-toggle { width: 100%; padding: 15px 20px; border-bottom: 1px solid #f5f5f5; font-size: 1rem; display: flex; justify-content: space-between; }
    .nav-item { width: 100%; }

    /* Mobile Dropdown (Accordion) */
    .dropdown-content {
        position: static; width: 100%; box-shadow: none; border: none;
        background: #fafafa; display: none; padding-left: 15px; max-height: none;
    }
    .nav-item.open .dropdown-content { display: block; }

    /* Search Mobile */
    .search-overlay { padding-top: 20px; background: #fff; }
    #searchInput { color: #333; font-size: 1.2rem; border-bottom: 1px solid #ddd; }
    .close-search { color: #333; }
    .search-header { border: none; }

    /* Hero Fixes */
    .hero-wrapper { height: 320px; margin-bottom: -30px; }
    .hero-title-content { padding: 0 20px; bottom: 60px; }
    .hero-title-content h1 { font-size: 1.5rem; }
    .post-body-card { padding: 50px 20px 30px; }
    .post-navigation { flex-direction: column; gap: 15px; }
    .nav-btn, .nav-placeholder { max-width: 100%; text-align: center; align-items: center; }
}

@media (min-width: 769px) {
    .hamburger-btn, .sidebar-overlay, .sidebar-header { display: none; }
}


/* =========================================
   GAYA LINK DI DALAM ARTIKEL (ANCHOR TEXT)
   ========================================= */

/* 1. Keadaan Normal */
.post-content a {
    color: var(--accent); /* Warna Hijau (sesuai tema) */
    font-weight: 600;     /* Agak tebal biar jelas */
    text-decoration: none; /* Hilangkan garis bawah standar yang jelek */
    
    /* Garis Bawah Modern (Border) */
    border-bottom: 2px solid rgba(39, 174, 96, 0.3); /* Garis hijau transparan */
    transition: all 0.2s ease-in-out;
}

/* 2. Saat Mouse Diarahkan (Hover) */
.post-content a:hover {
    color: #fff; /* Teks jadi putih */
    background-color: var(--accent); /* Background jadi hijau */
    border-bottom-color: var(--accent); /* Garis jadi hijau solid */
    border-radius: 4px; /* Sudut melengkung dikit */
    padding: 0 4px; /* Ada jarak napas */
    box-decoration-break: clone; /* Agar rapi kalau linknya panjang 2 baris */
    -webkit-box-decoration-break: clone;
}

/* =========================================
   BREADCRUMBS (Navigasi Atas Artikel)
   ========================================= */
.breadcrumbs {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
    font-weight: 500;
}
.breadcrumbs a {
    color: var(--text-sec);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}
.breadcrumbs a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.breadcrumbs .sep { margin: 0 8px; color: #ccc; }
.breadcrumbs .current { color: #aaa; }

/* =========================================
   TOMBOL SCROLL TO TOP
   ========================================= */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 1.2rem;
    border: none;
    outline: none;
    background-color: var(--primary); /* Warna Hitam/Gelap */
    color: white;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 50%; /* Bulat */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0; /* Sembunyi dulu */
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

#scrollTopBtn:hover {
    background-color: var(--accent); /* Jadi Hijau pas dihover */
    transform: translateY(-3px);
}

/* Muncul saat ada class .show */
#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Di HP, tombol agak kecil dan geser dikit */
@media (max-width: 768px) {
    #scrollTopBtn { bottom: 20px; right: 20px; padding: 10px 15px; }
}

/* =========================================
   8. TAMBAHAN PENTING (HASIL AUDIT)
   ========================================= */

/* A. Agar scroll halaman terasa halus */
html {
    scroll-behavior: smooth;
}

/* B. CSS TOMBOL SHARE (YANG HILANG) */
.share-section {
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #eee;
    text-align: center;
}

.share-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-share:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-share.wa {
    background-color: #25D366; /* Hijau WhatsApp */
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}
.btn-share.wa:hover { background-color: #128C7E; }

.btn-share.fb {
    background-color: #1877F2; /* Biru Facebook */
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3);
}
.btn-share.fb:hover { background-color: #0e5abe; }

/* C. Perbaikan Aksesibilitas (Focus State) */
/* Agar orang yang pakai keyboard (Tab) tahu posisi kursor */
a:focus, button:focus, input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* =========================================
   FIX DROPDOWN MENU DI MOBILE (ACCORDION)
   ========================================= */

@media (max-width: 768px) {
    /* 1. Reset Container Navigasi */
    .nav-item {
        display: block !important;
        width: 100%;
        margin: 0;
    }

    /* 2. Area Klik Menu (Toggle) */
    .dropdown-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        cursor: pointer;
        background: transparent;
        font-weight: 600;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
    }

    /* 3. Sub-menu Container (Perbaikan Utama) */
    .dropdown-content {
        display: none; /* Sembunyi default */
        background-color: #f9f9f9;
        padding-left: 0;
        
        /* INI YANG SEBELUMNYA SALAH POSISI */
        position: static !important; /* Jangan melayang */
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* 4. Link di dalam sub-menu */
    .dropdown-content a {
        padding: 12px 20px 12px 40px; /* Indentasi */
        display: block;
        font-size: 0.95rem;
        color: #555;
        border-bottom: 1px solid #fff;
    }
    
    .dropdown-content a:hover {
        background-color: #e8f5e9;
        color: var(--accent);
    }

    /* 5. LOGIKA UNTUK MENAMPILKAN MENU */
    /* Saat parent punya class 'open', dropdown-content muncul */
    .nav-item.open .dropdown-content {
        display: block !important;
        animation: slideDownMobile 0.3s ease;
    }

    /* 6. Animasi Panah Berputar */
    .arrow-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }
    .nav-item.open .arrow-icon {
        transform: rotate(180deg);
    }
}

/* Animasi Halus */
@keyframes slideDownMobile {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}