/* Masonry layout for gallery to preserve original image sizes */
.gallery-page .gallery-grid {
    display: block; /* Overrides display: grid */
    column-count: 3;
    column-gap: 1.5rem;
    padding: 2rem 0;
}

.gallery-page .gallery-item {
    display: inline-block; /* Prevent column breaks inside the item */
    width: 100%;
    margin-bottom: 1.5rem;
    aspect-ratio: auto !important; /* Override forced aspect ratios */
    break-inside: avoid;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background-color: var(--color-bg-alt);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gallery-page .image-wrapper {
    width: 100%;
    height: auto;
    position: relative;
}

.gallery-page .image-wrapper img {
    display: block;
    width: 100%;
    height: auto; /* Preserve original image height */
    object-fit: unset !important; /* Override object-fit: cover */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (max-width: 900px) {
    .gallery-page .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-page .gallery-grid {
        column-count: 1;
    }
}
