/* ── Base & Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Plus Jakarta Sans', sans-serif; overflow-x: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0B132B; }
::-webkit-scrollbar-thumb { background: #F59E0B; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #D97706; }

/* Navbar */
#navbar { position: fixed; z-index: 1000; transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s; }
#navbar.scrolled { background: rgba(255,255,255,0.95); backdrop-filter: blur(16px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.dark #navbar.scrolled { background: rgba(11,19,43,0.95); }

.nav-link { position: relative; font-weight: 600; transition: color 0.25s; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2.5px;
    background: #F59E0B;
    transition: width 0.3s ease;
    border-radius: 999px;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: #df1520; }
.nav-link:hover { color: #F59E0B; }

/* Hero Glow */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    opacity: 0.3;
}

/* Card Hover */
.card-hover { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.card-hover:hover { transform: translateY(-8px); box-shadow: 0 24px 48px -12px rgba(0,0,0,0.25); }

/* Glow Button */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from 0deg, #F59E0B, #FBBF24, #D97706, #F59E0B);
    border-radius: inherit;
    z-index: -1;
    animation: spin 4s linear infinite;
    opacity: 1;
    transition: opacity 0.4s;
}
.btn-glow:hover::before { opacity: 1; }
.btn-glow::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile Menu */
#mobile-menu {
    transition: max-height 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease, padding 0.3s ease;
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
}
#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
    padding: 1rem 0 1.5rem;
}
@media (max-width: 767px) {
    #mobile-menu.open {
        display: block !important;
        visibility: visible !important;
        max-height: 500px !important;
        opacity: 1 !important;
        padding: 1rem 0 1.5rem !important;
        transition: none !important;
    }
}

/* ── Progress Bar ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #F59E0B, #FBBF24, #D97706);
    z-index: 999;
    width: 0%;
    transition: width 0.1s linear;
}

/* Forms */
.form-input { transition: border-color 0.3s, box-shadow 0.3s; }
.form-input:focus { border-color: #F59E0B; box-shadow: 0 0 0 4px rgba(245,158,11,0.15); outline: none; }
.form-input.error { border-color: #EF4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.12); }
.form-input.success { border-color: #22C55E; box-shadow: 0 0 0 4px rgba(34,197,94,0.12); }

/* Toast */
#toast { transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s ease; }
#toast.hidden-toast { transform: translateY(120px); opacity: 0; pointer-events: none; }

/* Skip Link */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #F59E0B;
    color: #0B132B;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 12px 12px;
    font-weight: 700;
    z-index: 9999;
    transition: top 0.3s ease;
}
.skip-link:focus { top: 0; }

/* Section Label */
.section-label { color: #df1520; font-weight: 600; font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; }
.underline-gradient {
    background: linear-gradient(90deg, #F59E0B, #df1520);
    height: 6px;
    border-radius: 9999px;
    width: 5rem;
    margin: 1rem auto 0;
}

/* ── Carousel ── */
.carousel {
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.carousel-item {
    display: flex;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    inset: 0;
    transform: translateX(2rem);
    transition: transform 0.6s ease;
}
.carousel-item.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}
.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #F59E0B;
    transition: background 0.3s, transform 0.3s;
    flex-shrink: 0;
    cursor: pointer;
}
.carousel-dot.active {
    background: #df1520;
    transform: scale(1.3);
}
.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 8px 12px;
    flex-wrap: wrap;
}
.carousel-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F59E0B;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 14px;
}
.carousel-control-btn:hover {
    background: #D97706;
    transform: scale(1.1);
}
.carousel-control-btn.stop-btn.active {
    background: #df1520;
}
.carousel-status {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
}
.carousel-status.playing { color: #10B981; }
.carousel-status.paused { color: #F59E0B; }
.carousel-status.stopped { color: #ef4444; }

/* ── Leaflet Map Customization ── */
#distribusi { position: relative; z-index: 0; }
#map { position: relative; z-index: 0; width: 100%; height: 600px; border-radius: 1rem; box-shadow: 0 20px 50px -12px rgba(0,0,0,0.25); }
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ── Pulse Markers ── */
.pulse-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #df1520;
    box-shadow: 0 0 0 rgba(223,21,32,0.6);
    animation: pulse-red 2s infinite;
}
.pulse-marker.gold { background: #F59E0B; animation: pulse-gold 2s infinite; }
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(223,21,32,0.7); }
    70% { box-shadow: 0 0 0 12px rgba(223,21,32,0); }
    100% { box-shadow: 0 0 0 0 rgba(223,21,32,0); }
}
@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.7); }
    70% { box-shadow: 0 0 0 12px rgba(245,158,11,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

/* ── AOS Override ── */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: auto; }

/* ── Article Specific ── */
.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #0F172A;
}
.dark .article-body h2 { color: white; }
.article-body p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 1.25rem;
}
.dark .article-body p { color: #cbd5e1; }
.article-body blockquote {
    border-left: 4px solid #df1520;
    padding-left: 1rem;
    font-style: italic;
    margin: 2rem 0;
    color: #64748b;
}
.dark .article-body blockquote { color: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .hero-title { font-size: 2.25rem; line-height: 1.2; }
    .carousel { min-height: 85vh; }
}
section[id] { scroll-margin-top: 5rem; }