/* Theme Name: Journal Paper
Author: Drix
Description: Premium Clean Responsive Diary Theme with Drill-down Mobile Menu.
Version: 1.3
*/

/* --- 1. ROOT & BASIC SETUP --- */
:root {
    --accent-color: #d4af37; /* Default Gold */
    --paper-white: #ffffff;
    --text-main: #2d3436;
    --text-light: #636e72;
    --main-font: 'Lora', serif; /* Pastikan variabel ini sinkron dengan functions.php */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #fdfcf8;
    color: var(--text-main);
    line-height: 1.8;
}

/* --- 2. NAVIGATION CONTAINER --- */
.top-nav-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.main-navigation {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Penting untuk koordinat sub-menu mobile */
}

/* --- 3. LOGO STYLING --- */
.nav-logo img {
    max-height: 60px; 
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.nav-logo img:hover { transform: scale(1.05); }

.custom-logo-link { display: inline-block; line-height: 0; }

/* --- 4. DESKTOP MENU (Default) --- */
.nav-menu-top {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-menu-top li { position: relative; }

.nav-menu-top li a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s;
}

/* Desktop Dropdown */
.nav-menu-top .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    padding: 15px 0;
    list-style: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 4px;
    border-top: 3px solid var(--accent-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
}

.nav-menu-top li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu-top .sub-menu li a {
    padding: 10px 25px;
    text-transform: none;
    font-size: 0.9rem;
    color: #555;
}

.nav-menu-top .sub-menu li a:hover {
    background: #f9f9f9;
    color: var(--accent-color);
    padding-left: 30px;
}

/* Sembunyikan tombol BACK di Desktop */
.go-back-item { display: none !important; }

/* --- 5. HAMBURGER ICON --- */
.menu-toggle {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 10001;
}

/* --- HAMBURGER ICON ANIMATION FIX --- */
.menu-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--text-main);
    border-radius: 9px;
    opacity: 1;
    left: 0;
    /* We make the transition handle width and rotation smoothly */
    transition: transform 0.25s ease-in-out, top 0.25s ease-in-out, opacity 0.2s ease, width 0.2s ease, left 0.2s ease;
}

.menu-toggle span:nth-child(1) { top: 0px; }
.menu-toggle span:nth-child(2) { top: 10px; width: 100%; } 
.menu-toggle span:nth-child(3) { top: 20px; }

/* The new, smooth X animation */
.menu-toggle.open span:nth-child(1) { top: 10px; transform: rotate(135deg); }
/* Shrinks to the center instead of sliding way out to the left */
.menu-toggle.open span:nth-child(2) { opacity: 0; width: 0; left: 50%; } 
.menu-toggle.open span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

/* --- 6. NOTEBOOK LAYOUT --- */
.notebook-container {
    max-width: 850px;
    margin: -80px auto 100px;
    background-color: #ffffff; 
    background-image: linear-gradient(#efefef 1px, transparent 1px);
    background-size: 100% 35px;
    padding: 100px 80px;
    position: relative;
    box-shadow: 0 40px 100px rgba(0,0,0,0.07);
    border-radius: 4px;
    line-height: 35px; 
}

.notebook-container::before {
    content: '';
    position: absolute;
    top: 0; left: 60px;
    height: 100%;
    width: 2px;
    background: rgba(255, 0, 0, 0.1);
    z-index: 1;
}

.post-entry { margin-bottom: 80px; }

.post-metadata {
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-category a {
    color: var(--accent-color); 
    text-decoration: none;
    font-weight: bold;
}

.entry-title { margin-bottom: 25px; line-height: 1.2; }
.entry-title a { text-decoration: none; color: var(--text-main); font-size: 2.8rem; }
.entry-content { margin-top: 30px; font-size: 1.1rem; color: #444; }


/* --- 7. MOBILE DRILL-DOWN MENU (Max-Width 768px) --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-logo img { max-height: 45px; }

    /* Main Menu Container */
    .nav-menu-top {
        position: fixed;
        left: 0; top: 70px;
        width: 100%; height: 0;
        background: white;
        flex-direction: column;
        overflow-y: auto; overflow-x: hidden;
        transition: height 0.4s ease;
        z-index: 10000;
    }

    .main-navigation.toggled .nav-menu-top { height: calc(100vh - 70px); }

    /* Default Menu Items */
    .nav-menu-top > li { width: 100%; border-bottom: 1px solid #f0f0f0; }
    .nav-menu-top > li > a { padding: 20px 30px; display: block; }

    /* Sub-menu defaults to hidden */
    
/* Sub-menu defaults to hidden, but we MUST reset the desktop invisible styles! */
    .nav-menu-top .sub-menu { 
        display: none; 
        position: static; /* Overrides the desktop absolute positioning */
        opacity: 1 !important; /* Forces the text to be visible */
        visibility: visible !important; /* Overrides the desktop hidden state */
        transform: none; /* Stops the desktop sliding animation from glitching it */
        box-shadow: none;
        border: none;
        margin: 0; 
        padding: 0; 
        list-style: none; 
    }

    .nav-menu-top .sub-menu li a { padding: 15px 30px; border-bottom: 1px solid #f9f9f9; display: block; font-size: 0.95rem; }

    /* --- THE MAGIC FIX: DISPLAY TOGGLE LOGIC --- */
    
    /* 1. When sub-menu is open, hide all main menu items */
    .nav-menu-top.sub-menu-open > li { display: none; }

    /* 2. Except the one that we clicked (the parent) */
    .nav-menu-top.sub-menu-open > li.active-sub { display: block; border-bottom: none; }

    /* 3. Hide the parent link title so only the children show */
    .nav-menu-top.sub-menu-open > li.active-sub > a { display: none; }

    /* 4. Show the actual sub-menu dengan animasi yang JAUH lebih smooth */
    .nav-menu-top.sub-menu-open > li.active-sub > .sub-menu {
        display: block;
        /* Menggunakan timing function cubic-bezier agar mulus di akhir (easing) */
        animation: slideInSubMenu 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    /* Hapus @keyframes fadeIn yang lama, ganti dengan ini: */
    @keyframes slideInSubMenu {
        from { 
            opacity: 0; 
            transform: translateX(30px); /* Mulai dari sedikit sebelah kanan */
        }
        to { 
            opacity: 1; 
            transform: translateX(0); /* Berhenti di posisi pas */
        }
    }

    /* The Back Button */
    .go-back-item { background: #fdfcf8; border-bottom: 2px solid var(--accent-color) !important; }
    .go-back-item a { color: var(--accent-color) !important; font-weight: bold; }
    .go-back-item a::before { content: '← '; }

    /* General Spacing Fixes */
    .notebook-container { margin: 20px; padding: 60px 30px; }
    .notebook-container::before { left: 25px; }
    .entry-title a { font-size: 2.2rem; }
    .post-metadata { flex-wrap: wrap; gap: 5px; }
    .post-separator { display: none; }

/* Center the text for all menu links, sub-menu links, and the Back button */
    .nav-menu-top > li > a,
    .nav-menu-top .sub-menu li a,
    .go-back-item a {
        text-align: center !important;
    }

    /* Keep the dropdown arrow right next to the text instead of floating to the right side */
    .menu-item-has-children > a::after {
        float: none !important;
        margin-left: 8px;
        display: inline-block;
    }

    /* Force the hamburger/X toggle to the far right */
    .menu-toggle { 
        display: block; 
        margin-left: auto !important; 
    }


}


/* --- 8. COMMENTS SECTION --- */
.comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px dashed #ddd;
}

.comments-title, .comment-reply-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-main);
}

.comment-list { list-style: none; padding: 0; margin-bottom: 50px; }

.comment-list li.comment {
    margin-bottom: 30px;
    padding: 25px;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
}

.comment-author .avatar {
    border-radius: 50%;
    float: left;
    margin-right: 15px;
    border: 2px solid var(--accent-color);
}

.comment-content { clear: both; margin-top: 15px; font-size: 1rem; }

.comment-reply-link {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    text-transform: uppercase;
}

/* --- 9. COMMENT FORM --- */
.comment-form-flex { display: flex; gap: 20px; }
.comment-form-author, .comment-form-email, .comment-form-comment { margin-bottom: 15px; flex: 1; }

.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f9f9f9;
    font-family: inherit;
}

.comment-form input:focus, .comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
}

.submit-btn {
    display: inline-block;
    color: #ffffff !important;
    background-color: var(--accent-color);
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .comment-form-flex { flex-direction: column; gap: 0; }
}

/* --- STYLING BLOCKQUOTE (Classic Block) --- */
.entry-content blockquote {
    margin: 40px 0 40px 40px;
    padding: 15px 30px;
    border-left: 4px solid var(--accent-color);
    background: rgba(212, 175, 55, 0.03); /* Warna aksen yang sangat tipis */
    position: relative;
    font-style: italic;
}

/* Mengatur teks paragraf di dalam blockquote */
.entry-content blockquote p {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Opsional: Menambahkan ikon kutipan di awal */
.entry-content blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: -20px;
    font-family: 'Dancing Script', cursive; /* Menggunakan font artistik */
    font-size: 4rem;
    color: var(--accent-color);
    opacity: 0.3;
}

/* Penyesuaian di Mobile */
@media (max-width: 768px) {
    .entry-content blockquote {
        margin: 30px 0 30px 20px;
        padding: 10px 20px;
    }
}