/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #1a5f3a;
    --primary-dark: #0f3d22;
    --primary-light: #2d8659;
    --secondary-color: #f39c12;
    --secondary-light: #f5b041;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #95a5a6;
    --border-color: #ecf0f1;
    --light-bg: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--primary-light) 100%);
    color: white;
    padding: clamp(60px, 10vw, 100px) 0 clamp(50px, 10vw, 80px);
    margin-bottom: clamp(40px, 8vw, 60px);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-30px) translateX(20px); }
}

.hero-galeri-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(15px, 3vw, 24px);
}

.hero-galeri-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-galeri-content h1 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(10px, 2vw, 15px);
}

.hero-galeri-content h1 i {
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-galeri-content p {
    font-size: clamp(14px, 2vw, 18px);
    opacity: 0.95;
    line-height: 1.8;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(15px, 3vw, 24px) clamp(40px, 8vw, 60px);
}

/* ==================== GALLERY GRID ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(20px, 3vw, 30px);
    margin-bottom: clamp(30px, 6vw, 50px);
}

/* ==================== GALLERY ITEM ==================== */
.gallery-item {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out backwards;
    border: 1px solid var(--border-color);
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ==================== GALLERY MEDIA CONTAINER ==================== */
.gallery-media {
    position: relative;
    overflow: hidden;
    background: var(--light-bg);
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.gallery-item:hover .gallery-media img {
    transform: scale(1.1);
}

/* Placeholder untuk gambar kosong */
.placeholder-image {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.placeholder-image i {
    font-size: 48px;
    color: #999;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .gallery-item img,
    .placeholder-image {
        height: 220px;
    }
}

/* ==================== EMBED BADGES ==================== */
.embed-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.embed-badge i {
    font-size: 13px;
}

.embed-badge.youtube {
    background: rgba(255, 0, 0, 0.9);
    color: white;
}

.embed-badge.tiktok {
    background: rgba(0, 0, 0, 0.9);
    color: white;
}

.embed-badge.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.embed-badge.embed {
    background: rgba(102, 126, 234, 0.9);
    color: white;
}

.gallery-item:hover .embed-badge {
    transform: scale(1.05);
}

/* ==================== GALLERY CAPTION ==================== */
/* DEFAULT untuk SEMUA device */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 70%, transparent 100%);
    color: white;
    padding: 50px 15px 15px 15px;
    z-index: 5;
}

.gallery-caption h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.4;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gallery-caption .date {
    font-size: 12px;
    color: white;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gallery-caption .date::before {
    content: '📅';
    font-size: 12px;
}

/* DESKTOP: Hover effect */
@media (min-width: 769px) {
    .gallery-caption {
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .gallery-item:hover .gallery-caption {
        transform: translateY(0);
    }

    .gallery-caption h3 {
        font-size: 16px;
    }

    .gallery-caption .date {
        font-size: 13px;
    }
}

/* MOBILE: Always visible at bottom */
@media (max-width: 768px) {
    .gallery-caption {
        transform: translateY(0);
        transition: none;
    }
    
    .gallery-caption h3 {
        font-size: 14px;
    }
    
    .gallery-caption .date {
        font-size: 11px;
    }
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    z-index: 10;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-content iframe {
    width: clamp(320px, 90vw, 800px);
    height: clamp(240px, 50vh, 450px);
    border: none;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Lightbox Info */
.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 30px 20px 20px;
    border-radius: 0 0 8px 8px;
}

.lightbox-info h3 {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 700;
    margin-bottom: 8px;
}

.lightbox-info .date {
    font-size: clamp(12px, 1.5vw, 14px);
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-info .date::before {
    content: '📅';
}

/* Lightbox Close Button */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* Lightbox Navigation */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .gallery-item img,
    .gallery-item > div {
        height: 180px;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-content iframe {
        width: 90vw;
        height: 50vh;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-item {
        max-width: 500px;
        margin-inline: auto;
    }

    .gallery-item img,
    .gallery-item > div {
        height: 220px;
    }

    .embed-badge {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 10px;
    }

    .embed-badge i {
        font-size: 11px;
    }

    .gallery-caption {
        padding: 12px;
    }

    .gallery-caption h3 {
        font-size: 14px;
    }

    .gallery-caption .date {
        font-size: 11px;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-info {
        padding: 20px 15px 15px;
    }

    .lightbox-info h3 {
        font-size: 15px;
    }

    .lightbox-info .date {
        font-size: 12px;
    }
}

/* ==================== LOADING STATE ==================== */
.gallery-item.loading {
    pointer-events: none;
    opacity: 0.6;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== EMPTY STATE ==================== */
.empty-gallery {
    text-align: center;
    padding: clamp(60px, 10vw, 100px) 20px;
    color: var(--text-muted);
}

.empty-gallery i {
    font-size: clamp(48px, 8vw, 72px);
    margin-bottom: 20px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

.empty-gallery p {
    font-size: clamp(14px, 2vw, 16px);
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.gallery-item:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
    outline: 3px solid rgba(243, 156, 18, 0.8);
    outline-offset: 3px;
}

/* ==================== SMOOTH SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}