:root {
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: rgb(122,122,122);
    --dark-gray: #333333;
    --icon-gray: rgb(122,122,122);
    --border-gray: #e0e0e0;
    --gap: 1.5rem;
    /* Images can shrink to keep 3-up until ~768px */
    --image-size: clamp(220px, calc((100% - 2 * var(--gap)) / 3), 300px);
    /* Video width keeps parity with three images */
    --video-width: calc((3 * var(--image-size) + var(--gap)) / 2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Mukta', sans-serif;
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges; /* keep layout from shifting due to scrollbar */
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2.25rem 2rem 2.5rem;
    position: relative;
    background: var(--white);
    animation: fadeInDown 0.8s ease-out;
}

.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
}

.header-content {
    margin-bottom: 1.25rem; /* slightly more space before gallery */
}

.logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    animation: fadeInScale 1s ease-out;
}

.tagline {
    font-size: clamp(2rem, 2vw, 2rem);
    color: var(--medium-gray);
    font-weight: 300;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
    margin-top: -0.6rem; /* pull tagline closer to the logo */
}

.social-links {
    position: absolute;
    top: 0.25rem;
    right: 3rem;
    display: flex;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

.social-icon {
    color: var(--icon-gray);
    transition: all 0.3s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.social-icon:hover {
    color: var(--dark-gray);
    background: var(--light-gray);
}

.footer {
    text-align: center;
    padding: 1.5rem 1rem 4rem;
}

.footer-text {
    font-size: clamp(1.3rem, 1.3vw, 1.3rem);
    color: var(--medium-gray);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Gallery Container */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

/* Gallery Row */
.gallery-row {
    display: flex;
    justify-content: center;
    gap: var(--gap);
    flex-wrap: wrap;
}

/* All items - base styling */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--light-gray);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    opacity: 0.8;
}

/* Hover overlay for images */
.gallery-item .hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
    pointer-events: none; /* let clicks fall through to the item */
}

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

.hover-overlay .magnify-icon {
    width: 30px;
    height: 30px;
    color: rgba(0, 0, 0, 0.7);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}

/* Image items: square (1:1) */
.image-row .gallery-item {
    flex: 0 0 auto;
    width: var(--image-size);
    max-width: var(--image-size);
    aspect-ratio: 1 / 1;  /* Square images */
}

/* Video items: standard video ratio (16:9) */
/* Width calculated so row content widths match */
/* Video width = (3 × 300px + 1.5rem) / 2 = 462px */
/* Video height = 462px ÷ (16/9) = 260px */
.video-row .gallery-item {
    flex: 0 0 auto;
    width: var(--video-width);
    max-width: var(--video-width);
    aspect-ratio: 16 / 9;  /* Standard video aspect ratio */
}

/* When only 1 video in row, use same size */
.video-row .gallery-item:only-child {
    width: var(--video-width);
    max-width: var(--video-width);
    aspect-ratio: 16 / 9;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Play Button */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gallery-item:hover .play-button {
    background: rgba(255, 255, 255, 0.9);
}

.play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 12px solid var(--dark-gray);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 2px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-image,
.lightbox-video {
    width: 90vw;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-video {
    display: none;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 3rem 1.5rem 2rem;
    }

    .social-links {
        top: 1rem;
        right: 1rem;
        gap: 1rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    /* All items single column on mobile, full width */
    .video-row .gallery-item,
    .image-row .gallery-item {
        width: 100%;
        max-width: 100%;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .play-button {
        width: 60px;
        height: 60px;
    }

    .play-button::after {
        border-left: 18px solid var(--dark-gray);
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
    }
}

/* Loading Animation */
.gallery-item {
    animation: fadeInGalleryItem 0.6s ease-out backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(n+7) { animation-delay: 0.4s; }

@keyframes fadeInGalleryItem {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
