/**
 * Halaman Galeri — /gallery
 * Pondok Pesantren Assalam
 */

:root {
    --gal-blue: #1b7cbd;
    --gal-blue-dark: #145a8a;
    --gal-blue-light: #2a9fd6;
    --gal-blue-pale: #e8f4fb;
    --gal-blue-tint: #f0f7fc;
}

/* ── Intro ── */
.gallery-intro {
    background: linear-gradient(135deg, #f0f7fc 0%, #e8f4fb 50%, #f9f9f9 100%);
    position: relative;
    overflow: hidden;
}

.gallery-intro::before,
.gallery-intro::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.gallery-intro::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(27, 124, 189, 0.08) 0%, transparent 70%);
    top: -100px;
    right: -60px;
    animation: gal-blob 16s ease-in-out infinite;
}

.gallery-intro::after {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(27, 124, 189, 0.06) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
    animation: gal-blob 14s ease-in-out infinite reverse;
}

@keyframes gal-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(16px, -10px) scale(1.04); }
}

.gallery-section-subtitle {
    text-align: center;
    max-width: 680px;
    margin: -8px auto 32px;
    color: color-mix(in srgb, var(--default-color), transparent 18%);
    line-height: 1.75;
}

/* ── Stats row ── */
.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.gallery-stat-card {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    text-align: center;
    padding: 22px 16px;
    background: linear-gradient(145deg, #fff 0%, var(--gal-blue-pale) 100%);
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--gal-blue), transparent 85%);
    box-shadow: 0 6px 24px rgba(27, 124, 189, 0.08);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.gallery-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(27, 124, 189, 0.14);
}

.gallery-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gal-blue-dark), var(--gal-blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.gallery-stat-card h4 {
    font-size: 30px;
    font-weight: 800;
    color: var(--gal-blue);
    margin-bottom: 2px;
}

.gallery-stat-card p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
}

/* ── Gallery list ── */
.gallery-list-section {
    background: var(--gal-blue-tint);
}

.gallery-activity {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid color-mix(in srgb, var(--gal-blue), transparent 88%);
    box-shadow: 0 8px 32px rgba(27, 124, 189, 0.07);
    transition: box-shadow 0.45s ease;
}

.gallery-activity:last-child {
    margin-bottom: 0;
}

.gallery-activity:hover {
    box-shadow: 0 14px 45px rgba(27, 124, 189, 0.12);
}

.gallery-activity-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid color-mix(in srgb, var(--gal-blue), transparent 88%);
    background: linear-gradient(135deg, #fff 0%, var(--gal-blue-pale) 100%);
}

.gallery-activity-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.gallery-activity-title i {
    color: var(--gal-blue);
    font-size: 22px;
    margin-top: 2px;
    flex-shrink: 0;
}

.gallery-activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    font-weight: 600;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
    margin-bottom: 12px;
}

.gallery-activity-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gallery-activity-meta i {
    color: var(--gal-blue);
}

.gallery-activity-desc {
    font-size: 14px;
    line-height: 1.7;
    color: color-mix(in srgb, var(--default-color), transparent 10%);
    margin: 0;
}

/* ── Photo grid ── */
.gallery-photos {
    padding: 24px 28px 28px;
}

.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--gal-blue-pale);
}

.gallery-photo-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.gallery-photo-item:hover img {
    transform: scale(1.07);
}

.gallery-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 90, 138, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.gallery-photo-item:hover .gallery-photo-overlay {
    opacity: 1;
}

.gallery-photo-overlay i {
    color: #fff;
    font-size: 32px;
    transform: scale(0.8);
    transition: transform 0.35s ease;
}

.gallery-photo-item:hover .gallery-photo-overlay i {
    transform: scale(1);
}

.gallery-photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(20, 90, 138, 0.8), transparent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    z-index: 2;
    pointer-events: none;
}

.gallery-no-photos {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    margin: 0 28px 24px;
    background: color-mix(in srgb, var(--gal-blue), transparent 94%);
    border-radius: 10px;
    border-left: 3px solid var(--gal-blue);
    font-size: 14px;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
}

.gallery-no-photos i {
    color: var(--gal-blue);
    font-size: 20px;
}

/* ── Filter bar ── */
.gallery-filter-bar {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--gal-blue), transparent 82%);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: 0 4px 18px rgba(20, 90, 138, 0.06);
}

.gallery-filter-bar .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gal-blue-dark);
    margin-bottom: 6px;
}

.gallery-filter-bar .form-select {
    border-color: color-mix(in srgb, var(--gal-blue), transparent 75%);
}

.gallery-filter-bar .form-select:focus {
    border-color: var(--gal-blue);
    box-shadow: 0 0 0 0.2rem rgba(27, 124, 189, 0.15);
}

/* ── Empty state ── */
.gallery-empty {
    text-align: center;
    padding: 64px 28px;
    background: linear-gradient(135deg, #fff, var(--gal-blue-pale));
    border-radius: 16px;
    border: 2px dashed color-mix(in srgb, var(--gal-blue), transparent 70%);
    max-width: 480px;
    margin: 0 auto;
}

.gallery-empty i {
    font-size: 52px;
    color: var(--gal-blue);
    margin-bottom: 16px;
    display: block;
}

.gallery-empty p {
    margin: 0;
    color: color-mix(in srgb, var(--default-color), transparent 25%);
}

@media (max-width: 767px) {
    .gallery-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-activity-header,
    .gallery-photos {
        padding: 20px;
    }

    .gallery-no-photos {
        margin: 0 20px 20px;
    }

    .gallery-stats {
        gap: 12px;
    }

    .gallery-stat-card {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .gallery-photo-grid {
        grid-template-columns: 1fr;
    }
}
