/* 
  Theme: Forestry Official (Replika)
  Font: Roboto / Inter like
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4a7c59;
    /* Hijau logo */
    --primary-dark: #3a6345;
    --accnet-light: #e8f5e9;
    /* Hijau muda background icon */
    --text-main: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --bg-light: #f8f9fa;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);

    /* Background: Gradient Hitam di Bawah + Kayu Baru */
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.9) 100%),
        url('../images/kayux2.png');

    /* Gradient Full Screen (cover/100%), Gambar Kayu Ukuran Asli (auto) */
    background-size: 100% 100%, auto;

    /* Gradient JANGAN repeat, Gambar Kayu MESTI repeat */
    background-repeat: no-repeat, repeat;

    /* Keduanya tetap diam saat scroll */
    background-attachment: fixed, fixed;

    background-position: center top;
    /* Mulai dari atas tengah */

    line-height: 1.5;
}

/* Style untuk area tengah (Kertas) */
.paper-canvas {
    background-color: #ffffff;
    max-width: 1280px;
    /* Sedikit lebih lebar */
    margin: 0 auto;
    /* Tengah */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    /* Shadow gelap agar kontras dengan kayu */
    min-height: 100vh;
    padding-bottom: 2rem;
    position: relative;
    overflow: visible !important;
}

/* Daun Global di Kiri dan Kanan Seluruh Halaman */
.global-leaf {
    position: fixed;
    top: 0;
    width: 500px;
    height: 100vh;
    object-fit: contain;
    object-position: top center;
    pointer-events: none;
    z-index: 999;
    opacity: 1;
    display: block !important;
}

.global-leaf-left {
    left: calc((100vw - 1280px) / 2 - 350px);
    height: 100vh;
}

.global-leaf-right {
    right: calc((100vw - 1280px) / 2 - 350px);
    height: 100vh;
}

@media (max-width: 1600px) {
    .global-leaf-left {
        left: -200px;
    }
    
    .global-leaf-right {
        right: -200px;
    }
}

@media (max-width: 1400px) {
    .global-leaf {
        width: 400px;
    }
    .global-leaf-left {
        left: -150px;
    }
    
    .global-leaf-right {
        right: -150px;
    }
}

@media (max-width: 1200px) {
    .global-leaf {
        width: 350px;
    }
    .global-leaf-left {
        left: -100px;
    }
    
    .global-leaf-right {
        right: -100px;
    }
}

/* --- HEADER --- */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 99999 !important;
    position: relative;
    overflow: visible !important;
}

/* Pastikan header tidak memotong dropdown */
header,
header * {
    overflow: visible !important;
}

/* Pastikan semua container tidak memotong dropdown */
.paper-canvas header,
.paper-canvas .header-inner,
.paper-canvas nav,
.paper-canvas nav ul,
.paper-canvas nav ul li,
.paper-canvas .has-dropdown {
    overflow: visible !important;
}

/* Pastikan dropdown selalu di atas semua elemen */
.has-dropdown {
    z-index: 10002 !important;
}

/* Hapus position fixed karena akan merusak layout */
/* .has-dropdown .dropdown {
    z-index: 99999 !important;
    position: fixed !important;
} */

/* Hitung posisi dropdown dengan JavaScript akan dihandle */
.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Daun Dekoratif di Kiri dan Kanan Header */
.header-leaf {
    position: absolute;
    top: 0;
    width: 600px !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
    display: block !important;
}

.header-leaf-left {
    display: none !important;
}

.header-leaf-right {
    display: none !important;
}

/* Pastikan konten header di atas gambar daun */
.header-inner {
    position: relative;
    z-index: 1;
}

/* Daun di Slider Area */
.hero-slider {
    position: relative;
    overflow: visible;
}

.slider-leaf {
    position: absolute;
    top: 0;
    width: 600px !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    display: block !important;
}

.slider-leaf-left {
    display: none !important;
}

.slider-leaf-right {
    display: none !important;
}

@media (max-width: 1400px) {
    .header-leaf,
    .slider-leaf {
        width: 500px;
    }
    .header-leaf-left,
    .slider-leaf-left {
        left: -400px;
    }
    .header-leaf-right,
    .slider-leaf-right {
        right: -400px;
    }
}

@media (max-width: 1200px) {
    .header-leaf,
    .slider-leaf {
        width: 400px;
        opacity: 0.9;
    }
    .header-leaf-left,
    .slider-leaf-left {
        left: -320px;
    }
    .header-leaf-right,
    .slider-leaf-right {
        right: -320px;
    }
}

@media (max-width: 768px) {
    .header-leaf,
    .hero-slider::before,
    .hero-slider::after {
        display: none;
    }
}

.top-bar-info {
    font-size: 11px;
    background: #f1f1f1;
    padding: 5px 0;
    text-align: right;
    color: #888;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1001;
    overflow: visible !important;
}

nav {
    position: relative;
    z-index: 1002;
    overflow: visible !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.logo img {
    height: 40px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text span.brand {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text span.sub {
    font-size: 11px;
    color: #888;
}

nav > ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav > ul > li {
    position: relative;
    z-index: 1001;
}

nav > ul > li.has-dropdown {
    z-index: 1002;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

/* Dropdown Menu */
.has-dropdown {
    position: relative;
    z-index: 100000 !important;
}

.has-dropdown > a {
    cursor: pointer;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: -25px;
    background: #ffffff;
    min-width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    margin-top: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000000 !important;
    list-style: none;
    display: block;
    overflow: visible !important;
    max-height: none !important;
    clip: none !important;
    clip-path: none !important;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
    margin: 0;
    display: block;
    padding: 0;
}

.dropdown li:first-child a {
    margin-top: 0;
}

.dropdown li:last-child a {
    margin-bottom: 0;
}
}

.dropdown a {
    display: block;
    padding: 0.85rem 1.5rem 0.85rem 2rem;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    line-height: 1.5;
    margin: 0.2rem 0.5rem;
    border-radius: 4px;
}

.dropdown a:hover {
    background: #f0fdf4;
    color: var(--primary);
    padding-left: 2.3rem;
    border-left-color: var(--primary);
}


/* --- HERO --- */
.hero-wrapper {
    width: 100%;
    height: 500px;
    overflow: hidden;
    position: relative;
    margin-bottom: 3rem;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


/* --- SECTIONS COMMON --- */
/* Pastikan konten halaman tidak menutupi dropdown */
main {
    position: relative;
    z-index: 1 !important;
}

section {
    position: relative;
    z-index: 1 !important;
}

h1, h2, h3, h4, h5, h6 {
    position: relative;
    z-index: 1 !important;
}

article, .content, .post-content {
    position: relative;
    z-index: 1 !important;
}

.section-container {
    position: relative;
    z-index: 1 !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    position: relative;
    z-index: 1;
}

.section-title {
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Garis vertikal hijau di sebelah judul */
.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 32px;
    background-color: var(--primary);
    border-radius: 2px;
}

.btn-lihat-semua {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
}

/* --- STATS CARDS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 4rem;
}

.stat-card {
    background: var(--white);
    border-radius: 24px;
    /* Lebih bulat */
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Shadow lebih lembut tapi tebal */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Icon tengah */
    justify-content: center;
    min-height: 320px;
    /* Kartu jadi tinggi besar */
    border: 1px solid #f0f0f0;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon-circle {
    width: 140px;
    /* Icon Raksasa */
    height: 140px;
    background-color: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: #4a7c59;
}

.stat-icon-circle svg {
    width: 64px;
    /* Icon di dalam juga diperbesar */
    height: 64px;
}

/* Container text di bawah icon */
.stat-info {
    text-align: left;
    /* Teks rata kiri */
    width: 100%;
}

.stat-label {
    font-size: 16px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    /* Angka Besar */
    font-weight: 800;
    /* Lebih tebal */
    color: #333;
    line-height: 1.2;
}

.stat-unit {
    font-size: 18px;
    font-weight: 500;
    color: #777;
    margin-left: 2px;
}


/* --- NEWS (BERITA) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* Style Card Berita */
.news-item {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    transform: translateY(-5px);
}

.news-thumb {
    height: 180px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    position: relative;
}

.news-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.news-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin-bottom: auto;
    /* Push content up */
}

/* --- FOOTER --- */
footer {
    background-color: #698f72;
    /* Warna hijau lembut footer sesuai gambar */
    padding: 4rem 2rem;
    color: #fff;
    text-align: center;
    margin-top: 4rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 60px;
    filter: brightness(0) invert(1);
    /* Logo jadi putih */
}

.footer-brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
}

.footer-address {
    font-size: 13px;
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: background 0.3s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {

    .stats-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .stats-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        font-size: 12px;
    }
}

/* --- VIDEO SECTION --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.video-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumb-wrapper {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layer gelap di atas gambar agar tulisan play kontras */
.video-thumb-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

.video-card:hover .video-thumb-wrapper::before {
    background: rgba(0, 0, 0, 0.1);
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, background 0.3s;
}

.video-card:hover .play-icon {
    transform: scale(1.1);
    background: #fff;
}

.video-play-triangle {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid var(--primary);
    margin-left: 4px;
    /* Biar terlihat pas tengah secara optik */
}

.video-body {
    padding: 1.5rem;
    background: #f8f9fa;
    /* Background agak abu seperti referensi */
    flex-grow: 1;
}

.video-tag {
    display: inline-block;
    background: #3a6345;
    /* Dark Green */
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.video-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* --- GALERI FOTO --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    padding: 1.5rem;
    color: #fff;
}

.gallery-overlay h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- PROGRAM UNGGULAN --- */
.program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
}

.program-card {
    background: #fff;
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.program-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.program-icon {
    width: 80px;
    height: 80px;
    background: var(--accnet-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s;
}

.program-card:hover .program-icon {
    background: var(--primary);
    color: #fff;
    transform: rotateY(360deg);
}

.program-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.program-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .program-grid {
        grid-template-columns: 1fr;
    }
}

/* --- PUBLIKASI --- */
.publikasi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.publikasi-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s;
}

.publikasi-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.publikasi-icon {
    width: 60px;
    height: 60px;
    background: var(--accnet-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.publikasi-content {
    flex: 1;
}

.publikasi-type {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.publikasi-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.publikasi-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 1rem;
}

.publikasi-link {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.publikasi-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .publikasi-grid {
        grid-template-columns: 1fr;
    }
}