:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-xdark: #065f46;
    --primary-light: #d1fae5;
    --accent: #F59E0B;
    --accent-light: #fef3c7;
    --bg: #F8FAF9;
    --text-dark: #111827;
    --text-mid: #374151;
    --text-gray: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 50px;
    --nav-h: 68px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =====================
           READING PROGRESS BAR
           ===================== */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.06);
}

.read-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* =====================
           NAVBAR
           ===================== */
.navbar {
    height: var(--nav-h);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(5, 150, 105, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.nav-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-mid);
    background: #F3F4F6;
    transition: all var(--transition);
    border: 1.5px solid var(--border);
}

.btn-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(-3px);
}

/* =====================
           ARTICLE LAYOUT
           ===================== */
.article-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Main Article Column */
.article-main {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
}

.article-hero {
    position: relative;
    overflow: hidden;
}

.article-hero-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.article-hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.article-body-wrap {
    padding: 2.5rem 3rem;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.3rem;
}

.article-title {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.7rem, 3.5vw, 2.6rem);
    line-height: 1.25;
    color: var(--text-dark);
    margin-bottom: 1.8rem;
}

/* Author / Meta Row */
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1.2rem 1.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.author-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.author-info strong {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.author-info span {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.meta-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    color: var(--text-gray);
    font-weight: 500;
}

.meta-chip i {
    color: var(--primary);
}

/* =====================
           ARTICLE CONTENT
           ===================== */
.article-content {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text-mid);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.article-content h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 2rem 0 0.8rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 2rem 0;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
    transition: text-decoration-color var(--transition);
}

.article-content a:hover {
    text-decoration-color: var(--primary);
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    background: var(--accent-light);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-mid);
}

.article-content iframe {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 2rem 0;
    display: block;
    aspect-ratio: 16/9;
    width: 100%;
    border: none;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Article Footer */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-gray);
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 1.5px solid var(--border);
    color: var(--text-gray);
    transition: all var(--transition);
    cursor: pointer;
    background: white;
}

.share-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* =====================
           SIDEBAR
           ===================== */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
}

.sidebar-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.88rem;
    color: var(--text-mid);
}

.sidebar-info-item i {
    width: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Back to top */
.btn-back-to-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    width: 100%;
    justify-content: center;
}

.btn-back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
}

.btn-go-home {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-mid);
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition);
    border: 1.5px solid var(--border);
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.btn-go-home:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* =====================
           MOBILE BOTTOM NAV
           ===================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.mobile-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.mobile-bar-progress {
    width: 100px;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.mobile-bar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 99px;
    width: 0%;
    transition: width 0.1s;
}

.mobile-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.mobile-bar-home {
    background: var(--bg);
    color: var(--text-mid);
    border: 1.5px solid var(--border);
}

.mobile-bar-home:hover {
    background: var(--primary-light);
}

/* =====================
           RESPONSIVE — TABLET
           ===================== */
@media (max-width: 1024px) {
    .article-page {
        grid-template-columns: 1fr;
        max-width: 800px;
    }

    .article-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-card {
        flex: 1;
        min-width: 250px;
    }
}

/* =====================
           RESPONSIVE — MOBILE
           ===================== */
@media (max-width: 768px) {
    :root {
        --nav-h: 62px;
    }

    .article-page {
        padding: 1rem 0 5rem;
        gap: 1rem;
    }

    .article-main {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .article-body-wrap {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content {
        font-size: 1.05rem;
    }

    .article-meta {
        padding: 1rem;
        gap: 10px;
    }

    .meta-divider {
        display: none;
    }

    /* Menampilkan sidebar di bawah artikel untuk layar Mobile */
    /* .article-sidebar {
        display: flex;
        flex-direction: column;
        padding: 0 1.5rem; 
        margin-top: 1.5rem; 
        gap: 1.5rem;
    } */

    /* Hide sidebar on mobile, use bottom bar */
    .mobile-bottom-bar {
        display: flex;
    }

    .navbar {
        padding: 0 4%;
    }

    .nav-brand {
        font-size: 1.3rem;
    }

    .btn-back span {
        display: none;
    }

    /* Icon only on mobile */
}

@media (max-width: 480px) {
    .article-body-wrap {
        padding: 1.2rem;
    }

    .article-hero-img {
        max-height: 220px;
    }
}

/* =====================
           CUSTOM CURSOR (read)
           ===================== */
/* * {
    cursor: none;
}

@media (pointer: coarse) {
    * {
        cursor: auto;
    }
} */
/* 
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    will-change: left, top;
}

.cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(5, 150, 105, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, border-color 0.3s;
    will-change: left, top;
}

.cursor-dot.hov {
    width: 14px;
    height: 14px;
    background: var(--accent);
}

.cursor-ring.hov {
    width: 56px;
    height: 56px;
    border-color: rgba(245, 158, 11, 0.5);
} */

@media (pointer: coarse) {

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
}

/* =====================
           TABLE OF CONTENTS
           ===================== */
.toc-card .toc-list {
    list-style: none;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-card .toc-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 0.84rem;
    color: var(--text-gray);
    transition: all var(--transition);
    text-decoration: none;
    border-left: 2px solid transparent;
}

.toc-card .toc-item a:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

.toc-card .toc-item a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.toc-card .toc-item a .toc-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    flex-shrink: 0;
}

.toc-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* =====================
           READING TIME BADGE
           ===================== */
.read-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 1.2rem;
}

/* =====================
           FLOATING SHARE TOOLBAR (text selection)
           ===================== */
#floatShare {
    position: fixed;
    z-index: 5000;
    background: #1F2937;
    color: white;
    border-radius: 10px;
    padding: 7px 10px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#floatShare.show {
    display: flex;
}

.float-share-label {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
    padding-right: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.float-share-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-share-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

#floatShare::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom: none;
    border-top-color: #1F2937;
}

@keyframes popIn {
    from {
        transform: scale(0.7) translateY(6px);
        opacity: 0
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1
    }
}

/* =====================
           LIGHTBOX
           ===================== */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

#lightbox.open {
    display: flex;
    animation: lbIn 0.3s ease;
}

@keyframes lbIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

#lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: lbScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: zoom-out;
}

@keyframes lbScale {
    from {
        transform: scale(0.8)
    }

    to {
        transform: scale(1)
    }
}

.lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lb-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.article-content img {
    cursor: zoom-in !important;
}

/* =====================
           CONFETTI BURST
           ===================== */
.confetti-piece {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 99999;
    animation: confettiFall 1s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(120px) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* =====================
           PARAGRAPH HIGHLIGHT while reading
           ===================== */
.article-content p.reading-now {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.05), transparent);
    border-left: 3px solid rgba(5, 150, 105, 0.3);
    padding-left: 14px;
    margin-left: -17px;
    border-radius: 0 4px 4px 0;
    transition: all 0.4s ease;
}

/* =====================
           RIPPLE ON SHARE BTNS
           ===================== */
.share-btn {
    position: relative;
    overflow: hidden;
}

.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripGo 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripGo {
    to {
        transform: scale(5);
        opacity: 0
    }
}

/* =====================
           IMAGE REVEAL on scroll
           ===================== */
.article-content img {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.article-content img.img-revealed {
    opacity: 1;
    transform: scale(1);
}

/* =====================
           LEAVE OVERLAY (read)
           ===================== */
.leave-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #065f46, #059669);
    transform: scaleY(0);
    transform-origin: bottom;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.leave-overlay.go {
    transform: scaleY(1);
}

