/* Ajout box-sizing par sécurité */
html {
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}

:root {
    --slide-height: 50vh; /* Hauteur initiale des slides */
    --slide-spacing: 1rem; /* Espace entre les slides */
    --slide-size: 90%; /* Taille initiale des slides */
}

.home-slider {
    background-color: #E8F2F3;
    padding-top: 4rem;
    padding-bottom: 1rem;
}

.embla {
    max-width: 75rem;
    margin: auto;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.embla button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.embla button:hover,
.embla button:focus,
.embla button:active {
    background-color: transparent;
}

.embla__viewport {
    overflow: hidden;
    width: 100%;
}

.embla__container {
    display: flex;
    /* touch-action: pan-y pinch-zoom; */ /* Peut être ajouté si besoin */
    margin-left: calc(var(--slide-spacing) * -1);
    height: var(--slide-height); /* Assurer que le conteneur a la bonne hauteur */
}

.embla__slide {
    transform: translate3d(0, 0, 0); /* Peut aider la performance de l'animation */
    flex: 0 0 var(--slide-size);
    min-width: 0;
    padding-left: var(--slide-spacing);
    position: relative; /* Gardé pour le positionnement du contenu */
}

.embla__parallax {
    border-radius: 1.9rem;
    height: 100%;
    overflow: hidden;
}

.embla__parallax__layer {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: #5D878C;
}

.embla__parallax__img {
    border-radius: 1.9rem;
    display: block;
    height: 100%; 
    width: 100%;
    object-fit: cover;
    max-width: none;
    flex: 0 0 calc(115% + (var(--slide-spacing) * 2)); 
}

.embla__slide-content {
    position: absolute;
    bottom: 0;
    left: var(--slide-spacing);
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(93, 135, 140, 0.9) 0%, rgba(93, 135, 140, 0.7) 30%, rgba(93, 135, 140, 0.4) 60%, rgba(93, 135, 140, 0) 100%);
    color: white;
    z-index: 2;
    border-radius: 0 0 1.8rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.embla__slide-title {
    font-size: 3.2rem !important;
    font-weight: 900 !important;
    letter-spacing: 1.5px !important;
    text-shadow: 0 0 50px rgba(0, 0, 0, 0.3) !important;
    margin-bottom: 0 !important;
}

.embla__slide-description {
    font-size: 1.3rem !important;
    line-height: 1.5;
    font-weight: 500 !important;
}

.embla__slide-button {
    display: inline-flex !important;
    padding: 0.9rem 1.8rem !important;
    background: #5D878C !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 25px !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    letter-spacing: 1.5px !important;
    transition: all 0.3s ease !important;
    margin-top: auto;
    align-self: flex-end;
    box-shadow: 0 0 45px rgba(255, 255, 255, 0.1) !important;
}

.embla__slide-button:hover {
    background: #557d81 !important;
    color: #fff !important;
}

.embla__controls {
    width: var(--slide-size);
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.embla__buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    align-items: center;
}

.embla__button {
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    touch-action: manipulation;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    padding: 0;
    margin: 0;
    background-color: #5D878C !important;
    width: 2.2rem !important;
    height: 2.2rem !important;
    z-index: 1;
    border-radius: 50%;
    color: #333; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.embla__button:hover {
    background-color: #4B6D71 !important;
}

.embla__button:disabled {
    color: #ddd;
    opacity: 0.5;
    cursor: default;
}

.embla__button__svg {
    width: 85%;
    height: 85%;
    color: white !important;
}

.embla__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.embla__dot {
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    touch-action: manipulation;
    display: inline-flex;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    padding: 0 !important;
    margin: 0 !important;
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

.embla__dot:after {
    box-shadow: inset 0 0 0 0.1rem #ccc;
    width: 1.2rem !important;
    height: 1.2rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    content: '';
}

.embla__dot--selected:after {
    box-shadow: inset 0 0 0 0.2rem #5D878C !important;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --slide-height: 60vh; /* Hauteur augmentée sur mobile */
        --slide-size: 95%; /* Taille augmentée sur mobile */
    }

    .home-slider {
        padding-top: 2rem; /* Réduction de la marge supérieure */
        padding-bottom: 1rem;
    }

    .embla__slide-title {
        font-size: 1.8rem;
    }

    .embla__slide-description {
        font-size: 1rem;
    }

    .embla__controls {
        grid-template-columns: 1fr;
        gap: 1rem;
        justify-items: center;
    }

    .embla__buttons {
        display: none; /* Masquer les boutons de navigation sur mobile */
    }

    .embla__dots {
        justify-content: center;
        margin-top: 0.5rem;
    }
} 