/**
 * Stylesheet Khusus Halaman Galeri Foto & Video Kegiatan Al-Fajr
 * Disesuaikan dengan palet warna tema dasar Ysweb (Hijau, Kuning, & Putih)
 *
 * @package Ysweb
 * @since 2.0.0
 */

/* ==========================================
   1. Hero Banner Halaman Galeri
   ========================================== */
.galeri-hero {
    position: relative;
    width: 100%;
    padding: 5.5rem 2rem;
    text-align: center;
    color: var(--white, #ffffff);
    background-color: var(--ys-green, #2e7d32);
    background-image:
        linear-gradient(135deg, rgba(27, 94, 32, 0.92) 0%, rgba(46, 125, 50, 0.90) 100%),
        url('https://images.unsplash.com/photo-1577896851231-70ef18881754?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.galeri-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.galeri-hero-badge {
    display: inline-block;
    background-color: var(--ys-yellow, #ffb300);
    color: #212121;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.45rem 1.35rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.galeri-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--white, #ffffff);
    line-height: 1.25;
    margin: 0 0 1.25rem 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.galeri-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.75;
    max-width: 720px;
    margin: 0 auto;
}

/* ==========================================
   2. Container & Section Header Galeri
   ========================================== */
.galeri-main-wrapper {
    background-color: var(--ys-bg, #fdfdfd);
    padding: 4.5rem 0 5.5rem;
}

.galeri-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 2rem;
}

.galeri-section-block {
    margin-bottom: 5rem;
}

.galeri-section-block:last-child {
    margin-bottom: 0;
}

.galeri-section-header {
    text-align: center;
    margin-bottom: 2.75rem;
}

.galeri-pill-subtitle {
    display: inline-block;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: var(--ys-green, #2e7d32);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.4rem 1.15rem;
    border-radius: 50px;
    margin-bottom: 0.9rem;
}

.galeri-section-header h2 {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--ys-text, #2c3e50);
    margin: 0 0 0.6rem 0;
    line-height: 1.25;
}

.galeri-section-header p {
    color: #64748b;
    font-size: 1rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Filter Tab Navigasi (Semua, Foto, Video) */
.galeri-filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.galeri-filter-btn {
    background: var(--white, #ffffff);
    color: var(--ys-text, #2c3e50);
    border: 1px solid #e2e8f0;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.galeri-filter-btn:hover {
    border-color: var(--ys-green, #2e7d32);
    color: var(--ys-green, #2e7d32);
}

.galeri-filter-btn.active {
    background: var(--ys-green, #2e7d32);
    color: var(--white, #ffffff);
    border-color: var(--ys-green, #2e7d32);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25);
}

/* ==========================================
   3. Grid & Kartu Galeri (Sesuai Desain Gambar & Warna Tema)
   ========================================== */
.galeri-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.galeri-card {
    background: var(--white, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    border-bottom: 4px solid var(--ys-green, #2e7d32);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeri-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(46, 125, 50, 0.14);
}

/* Area Thumbnail Foto / Video */
.galeri-media-box {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #1b5e20;
    cursor: pointer;
}

.galeri-media-box img,
.galeri-media-box video,
.galeri-media-box iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.45s ease;
}

.galeri-card:hover .galeri-media-box img {
    transform: scale(1.06);
}

/* Badge Nomor Kuning di Kiri Atas (01, 02, 03...) */
.galeri-num-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    background-color: var(--ys-yellow, #ffb300);
    color: #212121;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    line-height: 1.2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

/* Badge Jenis Media di Kanan Atas */
.galeri-type-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    background: rgba(27, 94, 32, 0.82);
    backdrop-filter: blur(4px);
    color: var(--white, #ffffff);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.28rem 0.75rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Overlay Tombol Play untuk Video & Zoom untuk Foto */
.galeri-play-overlay,
.galeri-zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 94, 32, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.galeri-zoom-overlay {
    opacity: 0;
}

.galeri-card:hover .galeri-zoom-overlay {
    opacity: 1;
}

.galeri-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ys-yellow, #ffb300);
    color: #212121;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, background 0.25s ease;
}

.galeri-card:hover .galeri-play-btn {
    transform: scale(1.1);
    background: var(--white, #ffffff);
    color: var(--ys-green, #2e7d32);
}

.galeri-play-btn svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

.galeri-zoom-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ys-green, #2e7d32);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.galeri-zoom-icon svg {
    width: 22px;
    height: 22px;
}

/* Body Kartu (Judul Hijau Tema & Deskripsi) */
.galeri-card-body {
    padding: 1.5rem 1.65rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.galeri-card-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--ys-green, #2e7d32);
    margin: 0 0 0.65rem 0;
    line-height: 1.35;
}

.galeri-card-desc {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.68;
    margin: 0;
}

/* ==========================================
   4. Lightbox Modal (Preview Foto & Pemutar Video)
   ========================================== */
.galeri-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.galeri-lightbox.active {
    display: flex;
}

.galeri-lightbox-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    background: var(--white, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-bottom: 4px solid var(--ys-green, #2e7d32);
}

.galeri-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ys-yellow, #ffb300);
    color: #212121;
    border: none;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.galeri-lightbox-close:hover {
    background: var(--ys-yellow-hover, #ffa000);
}

.galeri-lightbox-media {
    width: 100%;
    background: #000000;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeri-lightbox-media img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.galeri-lightbox-media .video-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.galeri-lightbox-media .video-embed-container iframe,
.galeri-lightbox-media .video-embed-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.galeri-lightbox-caption {
    padding: 1.25rem 1.75rem;
    background: var(--white, #ffffff);
}

.galeri-lightbox-caption h3 {
    font-size: 1.2rem;
    color: var(--ys-green, #2e7d32);
    margin: 0 0 0.35rem 0;
}

.galeri-lightbox-caption p {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
}

/* ==========================================
   5. Responsif Tablet & Mobile
   ========================================== */
@media (max-width: 992px) {
    .galeri-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .galeri-hero h1 {
        font-size: 2.2rem;
    }

    .galeri-section-header h2 {
        font-size: 1.85rem;
    }
}

@media (max-width: 640px) {
    .galeri-hero {
        padding: 4rem 1.25rem;
    }

    .galeri-hero h1 {
        font-size: 1.75rem;
    }

    .galeri-main-wrapper {
        padding: 3rem 0 4rem;
    }

    .galeri-container {
        padding: 0 1.25rem;
    }

    .galeri-grid {
        grid-template-columns: 1fr;
    }

    .galeri-section-header h2 {
        font-size: 1.55rem;
    }
}
