/* Project gallery / photo layout.
 * Loaded after style.css, so it refines the photo sizes that were previously
 * hard-coded for every viewport. */

/* Main project photo: fixed 3:2 box, the image is cropped with object-fit.
 * aspect-ratio reserves the space before the image loads (no layout jump). */
.section-project-img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    max-height: 460px;
    background: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
}

.section-project-img picture,
.project-slider-item picture,
.card-image picture {
    display: block;
    width: 100%;
    height: 100%;
}

.section-project-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Thumbnail slider: thumbnails keep the 3:2 proportion of the "mini"
 * profile (240x160) instead of being stretched to a tall fixed height. */
.project-slider {
    padding-top: 12px;
}

.project-slider .swiper-slide {
    height: auto;
}

.project-slider-item {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    background: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
}

.project-slider-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Project cards on the catalogue page. */
.card-image {
    position: relative;
    display: block;
    background: #f5f5f5;
}

.card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Fancybox: keep the viewer above the site header/modals (z-index 200). */
.fancybox__container {
    z-index: 10050;
}

.fancybox__slide.has-image > .fancybox__content > picture > img {
    max-height: calc(100vh - 120px);
    object-fit: contain;
}
