/* ========================================
   GALERI FOTO - CSS STYLESHEET
   ======================================== */

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

/* ========================================
   GALLERY SECTION
   ======================================== */
.gallery-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 50%, #eff6ff 100%);
    padding: 100px 20px 80px;
    position: relative;
    overflow: hidden;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.gallery-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ========================================
   HEADER SECTION
   ======================================== */
.gallery-header {
    text-align: center;
    margin-bottom: 60px;
    animation: slideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.gallery-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-underline {
    width: 120px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 20px auto;
    border-radius: 3px;
    box-shadow: var(--shadow-md);
}

.gallery-description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 750px;
    margin: 0 auto;
    font-weight: 500;
}

/* ========================================
   FILTER SECTION
   ======================================== */
.filter-section {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 60px;
    flex-wrap: wrap;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-sm);
}

.filter-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.filter-btn:hover i {
    transform: scale(1.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   PHOTO GRID SECTION
   ======================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.photo-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeIn 0.6s ease;
}

.photo-card.hidden {
    display: none;
}

.photo-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.photo-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-card:hover .photo-wrapper img {
    transform: scale(1.15);
}

/* ========================================
   PHOTO OVERLAY
   ======================================== */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-info h3 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
}

.photo-card:hover .photo-info h3 {
    transform: translateY(0);
}

.photo-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 12px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.15s;
}

.photo-card:hover .photo-info p {
    transform: translateY(0);
}

.photo-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
}

.photo-card:hover .photo-date {
    transform: translateY(0);
}

.view-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0);
    transition: all 0.3s ease;
}

.photo-card:hover .view-btn {
    transform: scale(1);
}

.view-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.15);
}

/* ========================================
 /* ========================================
   CATEGORY BADGES (FINAL)
======================================== */

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;

    display: inline-flex;        /* ⬅️ kunci agar tidak memanjang */
    align-items: center;

    padding: 6px 14px;
    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;         /* teks tetap satu baris */

    width: fit-content;          /* modern browser */
    max-width: max-content;

    box-shadow: var(--shadow-md);
    z-index: 2;
}

/* ===== KATEGORI ===== */

.category-badge.kegiatan {
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--accent-color)
    );
    color: #ffffff;
}

.category-badge.prestasi {
    background: linear-gradient(
        135deg,
        var(--success-color),
        #059669
    );
    color: #ffffff;
}

.category-badge.fasilitas {
    background: linear-gradient(
        135deg,
        var(--warning-color),
        #d97706
    );
    color: #ffffff;
}

/* ===== PEMBELAJARAN (TRANSPARAN TAPI TERBACA) ===== */

.category-badge.pembelajaran {
    background: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.15),
        rgba(124, 58, 237, 0.35)
    );
    color: #f4f1f9;
    border: 1px solid rgba(124, 58, 237, 0.4);
    backdrop-filter: blur(2px);
}



/* ========================================
   LOAD MORE SECTION
   ======================================== */
.load-more-section {
    text-align: center;
    margin-top: 60px;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-load-more i {
    font-size: 1.1rem;
}

/* ========================================
   LIGHTBOX MODAL
   ======================================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
}

.lightbox-caption {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    max-width: 600px;
}

.lightbox-caption h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.lightbox-caption p {
    color: var(--text-light);
    margin-bottom: 12px;
}

.lightbox-caption span {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close {
    top: 30px;
    right: 30px;
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .gallery-title {
        font-size: 2.8rem;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .photo-wrapper {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 80px 15px 60px;
    }

    .gallery-title {
        font-size: 2.2rem;
    }

    .gallery-description {
        font-size: 1rem;
    }

    .filter-section {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 18px;
    }

    .photo-wrapper {
        height: 220px;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 70px 15px 50px;
    }

    .header-badge {
        padding: 8px 18px;
        font-size: 0.8rem;
    }

    .gallery-title {
        font-size: 1.8rem;
    }

    .gallery-description {
        font-size: 0.95rem;
    }

    .filter-btn span {
        display: none;
    }

    .filter-btn {
        padding: 10px;
        width: 45px;
        height: 45px;
        justify-content: center;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .photo-wrapper {
        height: 250px;
    }

    .btn-load-more {
        padding: 14px 32px;
        font-size: 0.95rem;
    }

    .lightbox-content img {
        max-height: 50vh;
    }

    .lightbox-caption {
        padding: 20px;
        margin-top: 15px;
    }

    .lightbox-caption h3 {
        font-size: 1.1rem;
    }

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }
}