/* ========================================
   CSS VARIABLES - Color Theme
======================================== */
:root {
    /* Natural earth tones with modern twist */
    --primary-green: #2d5016;
    --primary-green-light: #4a7c2c;
    --secondary-brown: #8b6f47;
    --accent-gold: #d4a574;
    --accent-sky: #7ba3cc;
    
    --bg-cream: #faf8f4;
    --bg-white: #ffffff;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #757575;
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 2px 20px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-display: 'Crimson Pro', serif;
    --font-body: 'Work Sans', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-cream);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-green);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

p {
    font-size: 1.05rem;
    color: var(--text-medium);
    max-width: 70ch;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   NAVIGATION - Sticky Header
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.navbar.scrolled {
    box-shadow: var(--shadow-soft);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dark);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-green);
    transition: var(--transition-smooth);
}

.visi-misi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.visi-box,
.misi-box {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.visi-box h3,
.misi-box h3 {
    margin-bottom: 15px;
    color: var(--primary-green);
}

.misi-box ul {
    padding-left: 20px;
}

.misi-box li {
    margin-bottom: 10px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .visi-misi-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   HERO SECTION - Full Width
======================================== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 70px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: linear-gradient(135deg, rgba(45, 80, 22, 0.85), rgba(74, 124, 44, 0.7)),
                url('../images/kantordesa1.jpeg');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    z-index: 1;
}

.hero-background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-cream), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 var(--spacing-md);
    animation: heroFadeIn 1.2s ease;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary-green);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-green);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.scroll-indicator svg {
    width: 30px;
    height: 30px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.map-container {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 20px;
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border: 0;
}

/* ========================================
   SECTION HEADERS
======================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-label {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-green-light);
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary-green-light);
    border-radius: 50px;
}

.section-title {
    margin-bottom: 1rem;
}

.section-description {
    margin: 0 auto;
    color: var(--text-medium);
}

/* ========================================
   STATS SECTION
======================================== */
.stats-section {
    background: white;
    margin: -80px auto 0;
    max-width: 1200px;
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    padding: var(--spacing-lg) var(--spacing-md);
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    text-align: center;
    padding: var(--spacing-md);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-green);
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-medium);
    margin-top: 0.5rem;
}

/* ========================================
   CARD GRID LAYOUTS
======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    border: 1px solid var(--border-subtle);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.card-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary-green-light), var(--accent-sky));
    position: relative;
    overflow: hidden;
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="2" fill="white" opacity="0.1"/></svg>');
    background-size: 60px 60px;
}

.card-content {
    padding: var(--spacing-md);
}

.card-category {
    font-size: 0.85rem;
    color: var(--primary-green-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.card-description {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-green);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-link:hover {
    gap: 1rem;
}

/* ========================================
   PROFILE SECTION
======================================== */
.profile-section {
    background: white;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.profile-image {
    width: 100%;
    height: 500px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--secondary-brown));
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.profile-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="80" height="80" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h80v80H0z" fill="none"/><path d="M40 0v80M0 40h80" stroke="white" stroke-width="0.5" opacity="0.1"/></svg>');
    background-size: 80px 80px;
}

.profile-content h2 {
    margin-bottom: 1.5rem;
}

.profile-content p {
    margin-bottom: 1.5rem;
}

.info-list {
    list-style: none;
    margin-top: 2rem;
}

.info-list li {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    min-width: 150px;
    color: var(--text-dark);
}

.info-value {
    color: var(--text-medium);
}

/* ========================================
   SERVICES SECTION
======================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 16px;
    border: 2px solid var(--border-subtle);
    transition: var(--transition-smooth);
    text-align: center;
}

.service-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: var(--transition-bounce);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(10deg);
}

.service-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* ========================================
   GOVERNMENT STRUCTURE
======================================== */
.government-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.official-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
}

.official-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-5px);
}

.official-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-sky), var(--primary-green-light));
    border: 4px solid var(--bg-cream);
    box-shadow: var(--shadow-soft);
}

.official-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.official-position {
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.official-contact {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========================================
   NEWS SECTION
======================================== */

.card img {
    max-height: 500px;
    object-fit: cover;
}

.slider {
    position: relative;
    max-width: 900px;
    margin: auto;
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.slider-track img {
    width: 100%;
    flex-shrink: 0;
    border-radius: 12px;
    user-select: none;
    pointer-events: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
}

.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }
.slider img {
    width: 100%;
    display: none;
}

.slider img.active {
    display: block;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.news-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-sky));
    position: relative;
}

.news-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-soft);
}

.news-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-category {
    font-size: 0.85rem;
    color: var(--primary-green-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.news-excerpt {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* ========================================
   GALLERY SECTION
======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 4/3;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-green-light), var(--accent-sky));
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 80, 22, 0.6);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    transform: translateY(100%);
    transition: var(--transition-smooth);
    z-index: 2;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* ========================================
   FOOTER
======================================== */
.footer {
    background: var(--primary-green);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.footer-section p,
.footer-section li {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.social-link:hover {
    background: white;
    color: var(--primary-green);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.21);
    padding-top: var(--spacing-md);
    text-align: center;
    color: rgba(154, 148, 148, 0.7);
    font-size: 0.9rem;
}
.footer-bottom p{
    display: flex;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: white;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-medium);
        transition: var(--transition-smooth);
        align-items: flex-start;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .card-grid,
    .services-grid,
    .government-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: var(--spacing-md) 0;
    }
    
    .stats-section {
        margin-top: -40px;
    }
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
