/* HERO */
.hero-video[xtype="video"] {
    aspect-ratio: auto;
    height: 800px;
    background: transparent;
    object-fit: cover;
}

/* SERVIZI */
.services-block {
    min-height: 700px;
}

.service-slide {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3rem;
}

.service-slide[hidden] {
    display: none !important;
}

.service-slide > div:first-child {
    grid-column: span 3 / span 3;
    height: 700px;
    min-width: 0;
}

.service-slide > div:first-child img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.service-slide__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.service-slide > div:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 68px;
    font-size: 1.25rem;
    line-height: 1.5;
}

.service-slide > div:last-child > h3 {
    position: absolute;
    z-index: 40;
    top: 33.333%;
    right: 50px;
    width: 50%;
    transform: translateY(-50%);
    color: #7d7d7d;
    font-family: "Cormorant Garamond", serif;
    font-size: 6rem;
    font-weight: 300;
    line-height: 0.9;
    text-transform: uppercase;
}

.service-slide > div:last-child > h3 > span {
    display: block;
    margin-bottom: 2rem;
    color: #201714;
    font-family: Roboto, sans-serif;
    font-size: 1.25rem;
    line-height: 1.4;
    text-transform: none;
}

.service-slide__title-link {
    color: inherit;
}

.service-slide__landing-link {
    align-self: flex-start;
    margin-top: 1.5rem;
    border-bottom: 1px solid currentColor;
    padding-bottom: 0.2rem;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.services-carousel-counter {
    position: absolute;
    top: 0;
    right: 0;
}

.services-carousel-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    width: calc((100% - 9rem) / 4);
    justify-content: flex-start;
    gap: 1rem;
}

.services-carousel-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 44px;
    color: #201714;
    cursor: pointer;
}

.services-carousel-controls button:first-child svg {
    transform: rotate(180deg);
}

.service-slide > div:last-child > div a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.service-slide > div:first-child,
.service-slide > div:last-child > h3,
.service-slide > div:last-child > div,
.service-slide__landing-link,
.services-carousel-counter {
    transition: opacity 500ms ease;
}

.services-carousel.is-transitioning .service-slide:not([hidden]) > div:first-child,
.services-carousel.is-transitioning .service-slide:not([hidden]) > div:last-child > h3,
.services-carousel.is-transitioning .service-slide:not([hidden]) > div:last-child > div,
.services-carousel.is-transitioning .service-slide:not([hidden]) .service-slide__landing-link,
.services-carousel.is-transitioning .services-carousel-counter {
    opacity: 0;
}

.services-block[contenteditable="true"] {
    min-height: 0;
}

.services-block[contenteditable="true"] > .service-slide {
    display: grid !important;
    margin-bottom: 4rem;
}

.services-block[contenteditable="true"] ~ .services-carousel-controls,
.services-block[contenteditable="true"] ~ .services-carousel-counter {
    display: none;
}

/* RESPONSIVE */
@media all and (max-width: 47.99rem) {
    .hero-video[xtype="video"] {
        height: 400px;
    }

    .services-block {
        min-height: 0;
    }

    .service-slide,
    .services-block[contenteditable="true"] > .service-slide {
        display: block;
    }

    .service-slide > div:first-child {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
    }

    .service-slide > div:last-child {
        display: flex;
        flex-direction: column;
        padding-top: 5.5rem;
        padding-bottom: 0;
    }

    .services-carousel-controls {
        top: calc((100vw - 3rem) * 1.25 + 1.5rem);
        right: 0;
        bottom: auto;
        left: 0;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .service-slide > div:last-child > h3 {
        position: static;
        order: 2;
        width: auto;
        margin: 0.5rem 0 1.5rem;
        transform: none;
        font-size: 3rem;
        line-height: 1;
    }

    .service-slide > div:last-child > h3 > span {
        margin-bottom: 1rem;
    }

    .services-carousel-counter {
        top: calc((100vw - 3rem) * 1.25 + 2.15rem);
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .service-slide > div:last-child > div {
        order: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-slide > div:first-child,
    .service-slide > div:last-child > h3,
    .service-slide > div:last-child > div,
    .services-carousel-counter {
        transition: none;
    }
}
