/* =====================
   BASE (PAGE)
===================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
}

/* =====================
   TITLE
===================== */
h1 {
    text-align: center;
    margin: 40px 0 20px;
}

/* =====================
   GALLERY (MASONRY)
===================== */
.gallery {
    column-count: 3;
    column-gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: block;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

/* Images */
.gallery-item img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

/* Videos */
.gallery-item video {
    width: 100%;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.gallery-item video:hover {
    filter: brightness(1.05);
}

/* Prevent overflow */
.gallery-item img,
.gallery-item video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================
   RESPONSIVE GALLERY
===================== */
@media (max-width: 768px) {
    .gallery {
        column-count: 2;
        column-gap: 12px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .gallery {
        column-count: 1;
        padding: 12px;
    }
}

/* =====================
   LIGHTBOX
===================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.lightbox.show {
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 10px;
}

.lightbox video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 10px;
}

/* Lightbox controls */
.lightbox button {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.lightbox .close {
    top: 20px;
    right: 30px;
}

.lightbox .prev {
    left: 30px;
}

.lightbox .next {
    right: 30px;
}


/* =====================
   GALLERY ANIMATIONS
===================== */
.gallery-item {
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.gallery-item.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

h1 {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

h1.show {
    opacity: 1;
    transform: translateY(0);
}