@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&display=swap');

/* ── Dot-grid background overlay ─────────────────────────────── */
.gallery {
    position: relative;
    min-height: 100vh;
    padding: 10rem 0 6rem;
}

.gallery::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0, 171, 240, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.gallery-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* ── Section headings ─────────────────────────────────────────── */
.gallery-container .heading {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    color: var(--main-color);
    text-align: left;
    margin: 5rem 0 2.5rem;
    padding-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border-bottom: 1px solid rgba(0, 171, 240, 0.18);
}

.gallery-container .heading::before {
    content: '//';
    color: rgba(0, 171, 240, 0.32);
    font-size: 1.7rem;
    font-weight: 500;
    letter-spacing: 0.05rem;
}

/* ── Video grid ───────────────────────────────────────────────── */
.video-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.video-container .video {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    width: 100%;
    margin: 0;
    border-radius: 3px;
    overflow: hidden;
    background: #050d14;
    border: 1px solid rgba(0, 171, 240, 0.12);
    /* scroll reveal base state */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease,
                border-color 0.3s ease, box-shadow 0.3s ease;
}

.video-container .video.revealed {
    opacity: 1;
    transform: translateY(0);
}

.video-container .video:hover {
    border-color: rgba(0, 171, 240, 0.5);
    box-shadow: 0 0 28px rgba(0, 171, 240, 0.12);
}

.video-container .video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none;
    transform: none;
}

.video-container .video video:hover {
    transform: none;
}

/* ── Image gallery — bento grid ───────────────────────────────── */
.img-gallery {
    width: 100%;
    margin: 0 0 3rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 230px;
    gap: 10px;
}

/* Every 1st item in each 3-item group spans 2 columns */
.img-gallery .gallery-item:nth-child(3n + 1) {
    grid-column: span 2;
}

/* ── Gallery item wrapper ─────────────────────────────────────── */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    /* scroll reveal base state */
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
    border: 1px solid rgba(0, 171, 240, 0.08);
    filter: brightness(0.82) saturate(0.85);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover img {
    border-color: var(--main-color);
    box-shadow: 0 0 0 1px var(--main-color), 0 0 30px rgba(0, 171, 240, 0.22);
    filter: brightness(1.05) saturate(1.15);
}


/* ── Lightbox nav buttons ─────────────────────────────────────── */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 60px;
    background: rgba(0, 171, 240, 0.08);
    border: 1px solid rgba(0, 171, 240, 0.3);
    color: var(--main-color);
    font-size: 3.6rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    z-index: 1;
}

.lightbox-prev { left: 2%; }
.lightbox-next { right: 2%; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 171, 240, 0.18);
    box-shadow: 0 0 20px rgba(0, 171, 240, 0.25);
}

/* ── Lightbox ─────────────────────────────────────────────────── */
.full-img {
    background: rgba(3, 9, 16, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.full-img img {
    max-width: 88vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 3px;
    border: 1px solid rgba(0, 171, 240, 0.25);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 171, 240, 0.12);
}

.full-img span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-color);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 4%;
    right: 4%;
    border: 1px solid rgba(0, 171, 240, 0.35);
    border-radius: 3px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.full-img span:hover {
    background: rgba(0, 171, 240, 0.12);
    box-shadow: 0 0 18px rgba(0, 171, 240, 0.3);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .img-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 195px;
    }

    .img-gallery .gallery-item:nth-child(3n + 1) {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .img-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 155px;
    }

    .img-gallery .gallery-item:nth-child(3n + 1) {
        grid-column: span 1;
    }

    .video-container {
        grid-template-columns: 1fr;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 48px;
        font-size: 2.8rem;
    }
}

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