/* ===== Gallery Page Styles ===== */

/* Hero - shorter version for inner pages */
.gallery-hero {
    position: relative;
    height: 50vh;
    min-height: 350px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background-color: hsl(var(--foreground) / 0.6);
    z-index: 1;
}

.gallery-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1.5rem;
}

.gallery-hero h1 {
    font-weight: 600 !important;
}

/* ===== Masonry Gallery Grid (Goodview Project style) ===== */
.gallery-section {
    padding: 4rem 0;
    background-color: hsl(var(--background));
}

@media (min-width: 768px) {
    .gallery-section {
        padding: 6rem 0;
    }
}

@media (min-width: 1024px) {
    .gallery-section {
        padding: 8rem 0;
    }
}

/* Masonry container using CSS columns for true mosaic/masonry layout */
.gallery-masonry {
    column-count: 1;
    column-gap: 12px;
    padding: 0 5%;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-masonry.ready {
    opacity: 1;
}

@media (min-width: 640px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 14px;
        padding: 0 10%;
    }
}

@media (min-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
        column-gap: 16px;
        padding: 0 10%;
    }
}

/* Individual gallery item */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .gallery-item {
        margin-bottom: 14px;
    }
}

@media (min-width: 1024px) {
    .gallery-item {
        margin-bottom: 16px;
    }
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition:
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* ===== Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: none;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
    padding: 1rem;
    transition: opacity 0.3s;
}

.lightbox-nav:hover {
    opacity: 0.7;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}
