/* ============================================================
   Custom Slider — slider.css
   Specificità volutamente bassa per consentire override da
   Avada o child theme.
   ============================================================ */

/* ----- Container — segue la site_width di Avada ----- */
.cs-container {
    max-width: var(--site_width, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 30px;
    padding-right: 30px;
    width: 100%;
    box-sizing: border-box;
}

/* ----- Contenitore slider ----- */
.cs-slider {
    width: 100%;
    overflow: hidden;
    --swiper-navigation-sides-offset: 0;
}

/* ----- Slide base ----- */
.cs-slide {
    display: flex;
    align-items: center;
    width: 100%;
    aspect-ratio: 2;
}

/* ============================================================
   Layout 1 — Sfondo a tutta larghezza
   ============================================================ */
.cs-slide--bg {
    position: relative;
    overflow: hidden;
}

.cs-slide__bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    z-index: 0;
}

/* Copy centrato verticalmente sopra l'immagine */
.cs-slide--bg .cs-slide__content--center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 2rem;
    color: #ffffff;
    text-align: end;
}
.cs-slide--bg .cs-slide__content--center .cs-container {
    margin-top: 25%;
}
.cs-slide--bg .cs-slide__title {
    font-size: clamp(30px, 4.5vw, 90px);
    line-height: 1;
}
.cs-slide--bg .cs-slide__subtitle {
    font-size: clamp(18px, 2vw, 32px);
    font-weight: 600;
}

/* ============================================================
   Layout 2 — Due colonne
   ============================================================ */
.cs-slide--twocol {
    overflow: hidden;
}

/*
 * cs-slide__inner centra il contenuto entro site_width
 * mantenendo le colonne affiancate.
 * align-self: stretch sovrascrive l'align-items: center
 * del genitore, portando l'inner a piena altezza.
 */
.cs-slide__inner {
    max-width: var(--site_width, 1200px);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    display: flex;
    align-self: stretch;
}

.cs-slide__col {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.cs-slide__col--right {
    width: 60%;
    padding: 0;
    align-items: center;
    z-index: 1;
}

.cs-slide__col--right img {
    position: absolute;
    max-width: none;
    width: auto;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cs-slide__logo {
    max-width: 320px;
    height: auto;
    position: absolute;
    top: 2rem;
}

/* ============================================================
   Elementi testuali e CTA (comuni ai due layout)
   ============================================================ */
.cs-slide__title {
    margin: 0 0 0.25em;
    font-size: 3.2rem;
    line-height: 1.2;
    font-weight: 800;
}

.cs-slide__subtitle {
    margin: 0 0 1.5rem;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 800;
}

.cs-slide__cta {
    display: inline-block;
    padding: 10px 20px;
    background: var(--cs-btn-bg, #ffffff);
    color: var(--cs-btn-color, #000000);
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.2s ease;
    align-self: flex-start;
    font-size: 16px;
}

.cs-slide__cta:hover {
    background: var(--cs-btn-bg-hover, var(--cs-btn-bg, #ffffff));
    color: var(--cs-btn-color-hover, var(--cs-btn-color, #000000));
    opacity: 0.85;
}

/* ============================================================
   Swiper — paginazione e frecce (override minimale)
   ============================================================ */
.cs-slider .swiper-button-prev,
.cs-slider .swiper-button-next {
    font-size: 48px;
    width: 1em;
    height: 1em;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    transition: ease-in-out all 250ms;
}
.cs-slider .swiper-button-prev:hover,
.cs-slider .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.8);
}
.cs-slider .swiper-button-prev::after,
.cs-slider .swiper-button-next::after {
    font-size: 0.4em;
}

.cs-slider .swiper-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.cs-slider .swiper-pagination-bullet {
    border-radius: 0;
    background: #ffffff;
    opacity: 0.5;
    flex-shrink: 0;
}

.cs-slider .swiper-pagination-bullet-active {
    background: #ffffff;
    opacity: 1;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .cs-slider .swiper-button-prev,
    .cs-slider .swiper-button-next {
        font-size: 32px;
    }
    .cs-slide--bg .cs-slide__content--center .cs-container {
        margin-top: 40%;
    }
    .cs-slide {
        aspect-ratio: 1.5;
    }
    .cs-slide__logo {
        max-width: 180px;
        position: relative;
        top: auto;
        margin-bottom: 2rem;
    }
    .cs-slide__bg-img {
        object-position: left;
    }
    .cs-slide .cs-slide__title {
        font-size: clamp(20px, 4vw, 32px);
        line-height: 1;
        margin: 0 0 0.5em;
    }
    .cs-slide .cs-slide__subtitle {
        font-size: clamp(16px, 2vw, 24px);
    }
    .cs-slide__col {
        padding: 50px;
    }
    .cs-slide__col--left {
        width: 50%;
    }
    .cs-slide__col--right {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .cs-slider .swiper-slide {
        height: auto;
    }
    .cs-slide--bg .cs-slide__content--center {
        padding: 1.25rem;
        position: relative;
        width: 100%;
    }
    .cs-slide--bg .cs-slide__content--center .cs-container {
        margin-top: 75%;
    }
    .cs-slide__bg-img {
        height: 50%;
    }
    .cs-slide {
        aspect-ratio: initial;
        height: 100%;
    }

    .cs-slide__inner {
        flex-direction: column;
    }

    .cs-slide__col {
        width: 100%;
    }
    .cs-slide .cs-slide__title {
        font-size: 32px;
        margin: 0 0 0.75em;
    }
    .cs-slide__subtitle {
        font-size: 20px;
    }
    .cs-slide__col--right {
        height: auto;
    }
    .cs-slide__col--right img {
        position: relative;
        object-fit: initial;
        display: block;
        width: 100%;
        height: auto;
    }
    .cs-slide__title {
        font-size: 20px;
    }
    .cs-slide__col--right,
    .cs-slide__col {
        width: 100%;
    }
}
