/* ── Modern Design System - Desa Kedungwinangun ────────────────── */

/* Scroll-reveal with improved timing */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Improved stagger animation */
    .dusun-list li {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        transition-delay: var(--delay, 0s);
    }

    .dusun-list.is-visible li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Smooth hover transitions */
    .hover-lift {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .hover-lift:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(21, 92, 27, 0.15);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .dusun-list li {
        opacity: 1;
        transform: none;
    }
}

/* ── Animations ─────────────────────────────────────────────────── */

/* Dot pulse animation */
@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.dot-active { animation: dotPulse 2s ease-in-out infinite; }

/* Hero image zoom on load */
@keyframes heroZoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

.hero-zoom { animation: heroZoom 8s ease-out both; }

/* Subtle float animation */
@keyframes subtleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}

.float-subtle { animation: subtleFloat 4s ease-in-out infinite; }

/* Spin animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin { animation: spin 1s linear infinite; }

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.animate-bounce { animation: bounce 1s ease-in-out infinite; }

/* Gradient shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ── Glassmorphism ──────────────────────────────────────────────── */

.glass {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.glass-dark {
    background: rgba(21, 92, 27, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ── Gradient Underline on Section Title ───────────────────────── */

.title-underline::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 64px;
    height: 5px;
    background: linear-gradient(90deg, #73AA0F, #155C1B);
    border-radius: 9999px;
}

/* Animated title underline */
.title-underline-animated {
    position: relative;
    display: inline-block;
}

.title-underline-animated::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #155C1B, #73AA0F);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-underline-animated:hover::after,
.title-underline-animated.active::after {
    width: 100%;
}

/* ── Ambient Orbs ───────────────────────────────────────────────── */

.orb-tr::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.13) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(40px);
}

.orb-bl::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -120px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(21, 92, 27, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(50px);
}

/* ── Gradient Border Ring (Map) ─────────────────────────────────── */

.map-ring {
    background: linear-gradient(135deg, #73AA0F 0%, #155C1B 55%, #3D8C40 100%);
    padding: 3px;
    border-radius: 22px;
}

/* ── Stat Card Gradient Bar ─────────────────────────────────────── */

.stat-bar {
    position: relative;
    overflow: hidden;
}

.stat-bar::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #73AA0F, #155C1B);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 14px 14px;
}

.stat-bar:hover::after { opacity: 1; }

/* ── Deco Corner Triangle ───────────────────────────────────────── */

.deco-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 180px;
    height: 180px;
    background: linear-gradient(225deg, rgba(115, 170, 15, 0.10) 0%, transparent 65%);
    border-radius: 0 28px 0 100%;
    pointer-events: none;
}

/* ── Improved Card Styles ──────────────────────────────────────── */

/* Skeleton shimmer for placeholder effect */
@keyframes shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e8f0e2 25%, #d4e6c8 50%, #e8f0e2 75%);
    background-size: 600px 100%;
    animation: shimmer 1.6s infinite linear;
    border-radius: 8px;
}

/* News card base - Enhanced */
.news-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(21, 92, 27, 0.07);
    box-shadow: 0 4px 16px rgba(21, 92, 27, 0.05), 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 52px rgba(21, 92, 27, 0.15), 0 4px 12px rgba(0,0,0,0.06);
    border-color: rgba(115, 170, 15, 0.3);
}

.news-card:hover .news-thumb img { transform: scale(1.08); }

/* Thumbnail zoom */
.news-thumb {
    overflow: hidden;
    position: relative;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient overlay on thumb */
.news-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(15, 91, 33, 0.45) 100%);
    pointer-events: none;
}

/* Category badge */
.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 9999px;
}

.badge-green  { background: #e8f5e0; color: #155C1B; }
.badge-blue   { background: #e0eeff; color: #1a4d8a; }
.badge-orange { background: #fff3e0; color: #b95c00; }
.badge-teal   { background: #e0f7f4; color: #0d6e5e; }

/* Read-more link arrow animation */
.news-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #155C1B;
    text-decoration: none;
    transition: gap 0.3s ease, color 0.3s ease;
}

.news-readmore:hover { gap: 12px; color: #73AA0F; }
.news-readmore svg { transition: transform 0.3s ease; }
.news-readmore:hover svg { transform: translateX(4px); }

/* Featured card label ribbon */
.featured-ribbon {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, #73AA0F, #155C1B);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 9999px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(21,92,27,0.4);
}

/* Divider between featured and grid */
.news-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(21,92,27,0.12), transparent);
    margin: 2rem 0;
}

/* "Lihat Semua" button - Enhanced */
.btn-all-news {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #155C1B, #2A6726);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 14px;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 4px 16px rgba(21,92,27,0.3);
}

.btn-all-news:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(21,92,27,0.4);
    background: linear-gradient(135deg, #0e4313, #1e4f1a);
}

/* ── Footer Styles ──────────────────────────────────────────────── */

.footer-link {
    position: relative;
    color: #d1fae5;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background: #73AA0F;
    transition: width 0.3s ease;
    transform: translateY(-50%);
}

.footer-link:hover {
    color: #ffffff;
    padding-left: 8px;
}

.footer-link:hover::before {
    width: 6px;
}

/* Social icon hover */
.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* ── Form Styles ────────────────────────────────────────────────── */

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #155C1B;
    box-shadow: 0 0 0 4px rgba(21, 92, 27, 0.1);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* ── Button Styles ──────────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-primary-green {
    background: linear-gradient(135deg, #155C1B, #2A6726);
    color: white;
    box-shadow: 0 4px 14px rgba(21, 92, 27, 0.3);
}

.btn-primary-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 92, 27, 0.4);
}

.btn-secondary {
    background: white;
    color: #155C1B;
    border: 2px solid #155C1B;
}

.btn-secondary:hover {
    background: #155C1B;
    color: white;
}

/* ── Loading Skeleton ───────────────────────────────────────────── */

.skeleton-wave {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: wave 1.5s infinite;
}

@keyframes wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Badge Styles ────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Responsive Utilities ───────────────────────────────────────── */

@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
    .hide-desktop { display: none !important; }
}

/* ── Print Styles ────────────────────────────────────────────────── */

@media print {
    nav, footer, .no-print { display: none !important; }
    body { background: white !important; color: black !important; }
}

/* Scroll-reveal */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Dusun list stagger */
    .dusun-list li {
        opacity: 0;
        transform: translateX(-8px);
        transition: opacity 0.45s ease, transform 0.45s ease;
        transition-delay: var(--delay, 0s);
    }

    .dusun-list.is-visible li {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .reveal,
    .dusun-list li {
        opacity: 1;
        transform: none;
    }
}

/* Dot pulse animation */
@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.dot-active {
    animation: dotPulse 2s ease-in-out infinite;
}

/* Hero image zoom on load */
@keyframes heroZoom {
    from {
        transform: scale(1.06);
    }

    to {
        transform: scale(1);
    }
}

.hero-zoom {
    animation: heroZoom 8s ease-out both;
}

/* Glassmorphism (not in Tailwind CDN by default) */
.glass {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* Gradient underline on section title */
.title-underline::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 64px;
    height: 5px;
    background: linear-gradient(90deg, #73AA0F, #155C1B);
    border-radius: 9999px;
}

/* Ambient orbs on content card */
.orb-tr::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.13) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(40px);
}

.orb-bl::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -120px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(21, 92, 27, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(50px);
}

/* Gradient border ring around map (padding-trick) */
.map-ring {
    background: linear-gradient(135deg, #73AA0F 0%, #155C1B 55%, #3D8C40 100%);
    padding: 3px;
    border-radius: 22px;
}

/* Stat card gradient bar on hover */
.stat-bar::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #73AA0F, #155C1B);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 14px 14px;
}

.stat-bar:hover::after {
    opacity: 1;
}

/* Deco corner triangle */
.deco-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 180px;
    height: 180px;
    background: linear-gradient(225deg, rgba(115, 170, 15, 0.10) 0%, transparent 65%);
    border-radius: 0 28px 0 100%;
    pointer-events: none;
}

/* Dusun pill hover invert */
.dusun-pill:hover {
    background: #155C1B;
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(21, 92, 27, 0.22);
    border-color: #155C1B;
}

/* Active nav link */
.nav-a.nav-active {
    color: #ffffff;
    font-weight: 700;
}

.nav-a:hover {
    color: #ffffff;
}

/* ── News Cards ──────────────────────────────────────────── */

/* Skeleton shimmer for placeholder effect */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        #e8f0e2 25%,
        #d4e6c8 50%,
        #e8f0e2 75%);
    background-size: 600px 100%;
    animation: shimmer 1.6s infinite linear;
    border-radius: 8px;
}

/* News card base */
.news-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(21, 92, 27, 0.07);
    box-shadow: 0 4px 16px rgba(21, 92, 27, 0.05),
                0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.35s cubic-bezier(.25,.8,.25,1),
                box-shadow 0.35s cubic-bezier(.25,.8,.25,1);
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(21, 92, 27, 0.13),
                0 4px 12px rgba(0,0,0,0.06);
}

.news-card:hover .news-thumb img {
    transform: scale(1.07);
}

/* Thumbnail zoom */
.news-thumb {
    overflow: hidden;
    position: relative;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(.25,.8,.25,1);
}

/* Gradient overlay on thumb */
.news-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(15, 91, 33, 0.45) 100%);
    pointer-events: none;
}

/* Category badge */
.news-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 9999px;
}

.badge-green  { background: #e8f5e0; color: #155C1B; }
.badge-blue   { background: #e0eeff; color: #1a4d8a; }
.badge-orange { background: #fff3e0; color: #b95c00; }
.badge-teal   { background: #e0f7f4; color: #0d6e5e; }

/* Read-more link arrow animation */
.news-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #155C1B;
    text-decoration: none;
    transition: gap 0.25s ease;
}

.news-readmore:hover { gap: 10px; }

.news-readmore svg {
    transition: transform 0.25s ease;
}

.news-readmore:hover svg {
    transform: translateX(3px);
}

/* Featured card label ribbon */
.featured-ribbon {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(90deg, #73AA0F, #155C1B);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 9999px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(21,92,27,0.35);
}

/* Divider between featured and grid */
.news-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(21,92,27,0.12), transparent);
    margin: 2rem 0;
}

/* "Lihat Semua" button */
.btn-all-news {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #155C1B, #2A6726);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 14px rgba(21,92,27,0.28);
}

.btn-all-news:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(21,92,27,0.38);
    background: linear-gradient(135deg, #0e4313, #1e4f1a);
}
