/* YCM Hero – diaporama plein écran (Yacht Club de Morlaix) */

.ycm-hero,
.ycm-hero * {
    box-sizing: border-box;
}

.ycm-hero {
    position: relative;
    width: 100%;
    height: 85svh;
    min-height: 460px;
    max-height: 960px;
    margin: 0;
    overflow: hidden;
    background: #0b1d2e;
    color: #fff;
}

.ycm-hero__swiper,
.ycm-hero .swiper-wrapper,
.ycm-slide {
    height: 100%;
}

.ycm-slide {
    position: relative;
    overflow: hidden;
}

/* Image */
.ycm-slide__media {
    position: absolute;
    inset: 0;
    margin: 0;
}

.ycm-slide__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1);
    transform-origin: center center;
    will-change: transform;
}

.ycm-slide__media--top .ycm-slide__img { object-position: center top; }
.ycm-slide__media--bottom .ycm-slide__img { object-position: center bottom; }

/* Ken Burns : uniquement sur la slide active */
@keyframes ycm-kenburns {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

.ycm-hero .swiper-slide-active .ycm-slide__img {
    animation: ycm-kenburns 9s linear forwards;
}

/* Dégradé sombre en bas pour la lisibilité */
.ycm-slide__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 12, 22, 0.6) 0%, rgba(4, 12, 22, 0.3) 45%, rgba(4, 12, 22, 0.08) 80%, rgba(4, 12, 22, 0) 100%);
    pointer-events: none;
}

/* Texte en surimpression : centré verticalement (un peu sous le milieu) pour rester visible à l'arrivée */
.ycm-slide__content {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-42%);
    z-index: 2;
    /* Aligné sur le conteneur des rangées Divi (Options du thème › largeur du contenu) */
    width: var(--content-width, 80%);
    max-width: var(--content-max-width, 1080px);
    margin: 0 auto;
    padding: 0;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.ycm-slide__surtitle {
    margin: 0 0 12px;
    font-size: clamp(12px, 1.2vw, 15px);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.ycm-slide__title {
    margin: 0;
    font-size: clamp(30px, 5.2vw, 66px);
    font-weight: 700;
    line-height: 1.05;
    color: #fff;
    text-wrap: balance;
    max-width: 18ch;
}

.ycm-slide__desc {
    margin: 16px 0 0;
    font-size: clamp(15px, 1.5vw, 19px);
    line-height: 1.5;
    max-width: 60ch;
    color: rgba(255, 255, 255, 0.92);
}

.ycm-slide__btn {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 30px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-shadow: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ycm-slide__btn:hover {
    background: #fff;
    color: #0b1d2e;
}

/* Flèches */
.ycm-hero__arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(4, 12, 22, 0.4);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.ycm-hero__arrow:hover { background: rgba(4, 12, 22, 0.7); }
.ycm-hero__arrow--prev { left: 20px; }
.ycm-hero__arrow--next { right: 20px; }
.ycm-hero__arrow.swiper-button-disabled { opacity: 0.35; cursor: default; }

/* Pagination */
.ycm-hero__pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ycm-hero__pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    margin: 0;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 999px;
    background: transparent;
    opacity: 0.85;
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.ycm-hero__pagination .swiper-pagination-bullet-active {
    width: 32px;
    background: #fff;
    opacity: 1;
}

/* Focus clavier visible */
.ycm-hero__arrow:focus-visible,
.ycm-slide__btn:focus-visible,
.ycm-hero__pagination .swiper-pagination-bullet:focus-visible {
    outline: 3px solid #ffd166;
    outline-offset: 3px;
}

/* Mouvement réduit : pas de Ken Burns, pas de transitions décoratives */
@media (prefers-reduced-motion: reduce) {
    .ycm-hero .swiper-slide-active .ycm-slide__img,
    .ycm-slide__img {
        animation: none !important;
        transform: none !important;
    }
    .ycm-slide__btn,
    .ycm-hero__arrow,
    .ycm-hero__pagination .swiper-pagination-bullet {
        transition: none;
    }
}

/* Diaporama sous la barre de menu sticky (classe posée par ycmHeroFit quand le diaporama suit directement l'en-tête).
   Le haut de l'image passe sous la barre : quand celle-ci rétrécit au scroll, la zone libérée montre la photo et non du blanc. */
.ycm-hero--under-header {
    margin-top: calc(-1 * var(--ycm-header-h, 0px));
    height: calc(85svh + var(--ycm-header-h, 0px));
    min-height: calc(460px + var(--ycm-header-h, 0px));
    max-height: calc(960px + var(--ycm-header-h, 0px));
}

.ycm-hero--under-header .ycm-slide__content,
.ycm-hero--under-header .ycm-hero__arrow {
    top: calc(50% + var(--ycm-header-h, 0px) / 2);
}

.et-tb-has-header .et-l--header {
    position: relative;
    z-index: 100;
}

/* Mobile */
@media (max-width: 767px) {
    .ycm-hero { height: 80svh; min-height: 420px; }
    .ycm-hero--under-header { height: calc(80svh + var(--ycm-header-h, 0px)); min-height: calc(420px + var(--ycm-header-h, 0px)); }
    .ycm-hero__arrow { width: 40px; height: 40px; top: auto; bottom: 16px; transform: none; }
    .ycm-hero__arrow--prev { left: 16px; }
    .ycm-hero__arrow--next { right: 16px; }
    .ycm-slide__content { transform: translateY(-50%); }
    .ycm-slide__title { max-width: none; }
}

/* Intégration Divi : le module Code ne doit pas contraindre le diaporama */
.et_pb_code_inner > .ycm-hero,
.et_pb_fullwidth_code .ycm-hero {
    width: 100%;
}
