/* Gallery carousel — shared component (home + inner pages) */
.gallery-carousel img {
    width: 100%;
    border-radius: 20px;
    object-fit: cover;
}

.gallery-carousel {
    --about-main-image-width: 590px;
    --about-main-image-height: 438px;
    width: 100%;
}

.gallery-carousel .gallery-preview {
    width: min(var(--about-main-image-width), 100%);
    height: var(--about-main-image-height);
    border-radius: 20px;
    overflow: hidden;
}

.gallery-carousel .gallery-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: object-position 0.35s ease;
}

.gallery-carousel .thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
    width: min(var(--about-main-image-width), 100%);
}

.gallery-carousel .thumb {
    cursor: pointer;
    width: 100%;
    height: 80px;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.gallery-carousel .thumb[src*="cafe.jpeg"] {
    object-position: 40% 32%;
}

.gallery-carousel .thumb.active {
    opacity: 1;
}

/* Inner pages: fit inside service-detail media without changing page layout */
.service-detail-media .gallery-carousel {
    --about-main-image-width: 100%;
    --about-main-image-height: clamp(260px, 36vw, 400px);
}

body.layout-split .service-detail-media .gallery-carousel .gallery-preview img {
    min-height: 100%;
    max-height: none;
    border-radius: 20px;
}

body.layout-split .service-detail-media .gallery-carousel .thumb {
    border-radius: 20px;
    min-height: auto;
    max-height: none;
    height: 80px;
}

.page-sobre .service-detail-media:has(.gallery-carousel) {
    aspect-ratio: auto;
    max-width: min(520px, 100%);
}

@media screen and (max-width: 900px) {
    .gallery-carousel .gallery-preview {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .gallery-carousel .thumb {
        height: 64px;
    }

    body.layout-split .service-detail-media .gallery-carousel .gallery-preview img,
    body.layout-split .service-detail-media .gallery-carousel .thumb {
        min-height: auto;
        max-height: none;
        height: auto;
    }

    body.layout-split .service-detail-media .gallery-carousel .thumb {
        height: 64px;
    }
}
