/* Databoks Lite - Core Styles (Refined) */
*,
::before,
::after {
    box-sizing: border-box;
}

:root {
    --primary: #0056b3;
    --secondary: #6c757d;
    --success: #198754;
    --bg: #f8f9fa;
    --text: #404040;
    --text-muted: #757575;
    --card-bg: #ffffff;
    --border: #dee2e6;
    --container-width: 1320px;
}

body {
    font-family: 'Inter', sans-serif;
    background: #fff;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* Base Responsive Fixes */
img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Header & Navigation */
header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle {
    background: transparent;
    border: none;
    color: #404040;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.search-toggle:hover {
    color: var(--primary);
}

.desktop-search-item {
    display: none;
}

@media (min-width: 769px) {
    .mobile-search-btn {
        display: none;
    }

    .desktop-search-item {
        display: block;
    }
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111;
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Nav Menu (Desktop) */
.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

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

.nav-menu .login-btn {
    color: var(--primary);
    font-weight: 700;
    border: 1px solid var(--primary);
    padding: 6px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-menu .login-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Hamburger Menu (Hidden by default) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    /* Above mobile menu overlay */
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    overflow-y: auto;
    padding: 20px 0;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay .search-container {
    width: 100%;
    max-width: 800px;
    padding: 0 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease-in-out;
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

.search-form {
    display: flex;
    gap: 10px;
    border-bottom: 3px solid #333;
    padding-bottom: 15px;
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 2.5rem;
    font-weight: 700;
    outline: none;
    color: #333;
}

.search-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 30px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.1rem;
}

.search-close {
    position: absolute;
    top: -100px;
    right: 40px;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.search-close:hover {
    color: #333;
}

@media (max-width: 768px) {
    .search-overlay .search-container {
        padding: 0 20px;
    }

    .search-form {
        border-bottom-width: 2px;
    }

    .search-form input {
        font-size: 1.5rem;
    }

    .search-form button {
        padding: 5px 15px;
        font-size: 0.9rem;
    }

    .search-close {
        top: -60px;
        right: 20px;
    }
}

/* Typography */
h1 {
    font-weight: 700;
    color: #404040;
    line-height: 1.3;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Category Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.category-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    align-items: start;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.category-item:last-child {
    border-bottom: none;
}

.item-thumb {
    width: 100%;
    height: 150px;
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-badge {
    display: inline-block;
    background-color: #f3b01a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    width: fit-content;
}

.item-title {
    font-size: 20px;
    font-weight: 600;
    color: #404040;
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s;
}

.item-meta {
    font-size: 14px;
    color: var(--text-muted);
}

/* Single Layout */
.single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 3rem;
    margin-top: 2rem;
    width: 100%;
}

.post-title {
    font-size: 28px;
    font-weight: 700;
    color: #404040;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.meta-box {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on mobile */
    gap: 1.5rem;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Prevent widget content from bleeding out */
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #404040;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* --- RESPONSIVE STYLES --- */

/* Tablet & Mobile Breakpoint */
@media (max-width: 992px) {
    .category-item {
        grid-template-columns: 1fr;
        /* Stack thumb and content */
        gap: 1rem;
    }

    .item-thumb {
        height: 200px;
    }

    .single-layout {
        grid-template-columns: 1fr;
        /* Stack main content and sidebar */
        gap: 2rem;
        /* Reduce gap */
    }

    .sidebar-widget {
        background: #f8f9fa;
        /* Slight distinct bg for sidebar on mobile */
        border: none;
        border-top: 1px solid #dee2e6;
    }
}

/* Mobile Navigation Breakpoint */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        /* Reduce horizontal padding */
    }

    .menu-toggle {
        display: flex;
        /* Show Hamburger */
    }

    /* Drawer Style from Right */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden off-screen right */
        width: 250px;
        /* Drawer width */
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 80px;
        /* Space for clear top */
        transition: right 0.3s ease-in-out;
        z-index: 1001;
        display: flex;
        flex-direction: column;
    }

    .nav-menu.active {
        right: 0;
        /* Slide in */
    }

    /* Menu List Vertical */
    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        width: 100%;
        background: #fff;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        color: #333;
    }

    .nav-menu .login-btn {
        margin: 20px;
        display: block;
        text-align: center;
        width: auto;
    }

    /* Hamburger Animation to X */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Overlay (Pseudo Element on Body when active) */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }
}

@media (max-width: 992px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* User Dropdown Menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.user-dropdown-toggle:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    z-index: 100;
    overflow: visible;
    /* Penting agar ::before di luar kotak tetap bisa di-hover */
}

/* Jembatan Transparan (Fix Hover) */
.user-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -15px;
    /* Menutupi area gap di atas menu */
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}


.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* Mobile Dropdown Adjustment */
@media (max-width: 768px) {
    .user-dropdown {
        width: 100%;
        margin-top: 10px;
    }

    .user-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .user-dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        margin-top: 0;
    }
}