/* DDPC v1.4.0 — carrousel accueil reconstruit de zéro. */

.home-gallery-v2 {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.home-gallery-v2-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.home-gallery-v2-heading {
    max-width: 46rem;
}

.home-gallery-v2-heading h2 {
    margin: 0 0 .5rem;
    color: var(--home-navy, #102a43);
    font-weight: 900;
    letter-spacing: -.035em;
}

.home-gallery-v2-heading p {
    margin: 0;
    color: var(--home-muted, #66788a);
    line-height: 1.7;
}

.home-gallery-v2-controls {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex: 0 0 auto;
}

.home-gallery-v2-counter {
    min-width: 5.4rem;
    color: var(--home-muted, #66788a);
    font-size: .84rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.home-gallery-v2-arrow {
    width: 2.85rem;
    height: 2.85rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(16, 42, 67, .14);
    border-radius: 50%;
    color: var(--home-navy, #102a43);
    background: #fff;
    box-shadow: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.home-gallery-v2-arrow:hover,
.home-gallery-v2-arrow:focus-visible {
    color: #0f7442;
    border-color: rgba(0, 193, 82, .75);
    background: #f5fff7;
}

.home-gallery-v2-arrow:disabled {
    opacity: .35;
    cursor: default;
}

.home-gallery-v2-viewport {
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.home-gallery-v2-track {
    --home-gallery-v2-gap: 1rem;
    display: flex;
    gap: var(--home-gallery-v2-gap);
    align-items: stretch;
    transform: translate3d(0, 0, 0);
    transition: transform .46s cubic-bezier(.22, .72, .25, 1);
    will-change: transform;
}

.home-gallery-v2-track.is-dragging {
    transition: none;
}

.home-gallery-v2-card {
    flex: 0 0 calc((100% - (2 * var(--home-gallery-v2-gap))) / 3);
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(16, 42, 67, .11);
    border-radius: 1rem;
    color: inherit;
    background: #fff;
    box-shadow: none !important;
    text-align: left;
    transform: none !important;
    animation: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.home-gallery-v2-media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #eef5f0;
}

.home-gallery-v2-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: none !important;
    animation: none !important;
    filter: none;
    pointer-events: none;
}

.home-gallery-v2-open {
    position: absolute;
    right: .8rem;
    bottom: .8rem;
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    color: #fff;
    background: rgba(7, 28, 45, .68);
    backdrop-filter: blur(7px);
}

.home-gallery-v2-caption {
    min-height: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    padding: .9rem 1rem 1rem;
}

.home-gallery-v2-caption strong {
    color: var(--home-navy, #102a43);
    font-size: .96rem;
    line-height: 1.3;
}

.home-gallery-v2-caption span {
    color: var(--home-muted, #66788a);
    font-size: .84rem;
    line-height: 1.45;
}

.home-gallery-v2-empty {
    padding: 2rem;
    border: 1px dashed rgba(16, 42, 67, .2);
    border-radius: 1rem;
    color: var(--home-muted, #66788a);
    text-align: center;
}

/* Carrousel plein écran v1.4.1 — aucune navigation vers une page image. */
.home-gallery-v2-lightbox[hidden] {
    display: none !important;
}

.home-gallery-v2-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overflow: hidden;
    background: rgba(3, 12, 20, .96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.home-gallery-v2-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.home-gallery-v2-lightbox-shell {
    position: relative;
    width: min(1180px, 100%);
    height: min(860px, calc(100dvh - 2rem));
    max-height: calc(100dvh - 2rem);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: .85rem;
}

.home-gallery-v2-lightbox-main {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
    align-items: center;
    gap: .8rem;
}

.home-gallery-v2-lightbox-stage {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 1rem;
    background: #071c2d;
}

.home-gallery-v2-lightbox-stage img {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: block;
    object-fit: contain;
    background: #071c2d;
    user-select: none;
    -webkit-user-drag: none;
}

.home-gallery-v2-lightbox-nav,
.home-gallery-v2-lightbox-close {
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .26);
    color: #fff;
    background: rgba(7, 28, 45, .92);
    box-shadow: none !important;
    cursor: pointer;
}

.home-gallery-v2-lightbox-nav {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
}

.home-gallery-v2-lightbox-nav:hover,
.home-gallery-v2-lightbox-nav:focus-visible,
.home-gallery-v2-lightbox-close:hover,
.home-gallery-v2-lightbox-close:focus-visible {
    border-color: rgba(255, 255, 255, .72);
    background: #0f7442;
}

.home-gallery-v2-lightbox-close {
    position: absolute;
    z-index: 5;
    top: .6rem;
    right: .6rem;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
}

.home-gallery-v2-lightbox-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.6rem;
    color: #fff;
}

.home-gallery-v2-lightbox-text {
    min-width: 0;
}

.home-gallery-v2-lightbox-text strong,
.home-gallery-v2-lightbox-text span {
    display: block;
}

.home-gallery-v2-lightbox-text strong {
    font-size: .98rem;
    line-height: 1.35;
}

.home-gallery-v2-lightbox-text span {
    margin-top: .18rem;
    color: rgba(255, 255, 255, .68);
    font-size: .86rem;
    line-height: 1.45;
}

.home-gallery-v2-lightbox-counter {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .74);
    font-size: .86rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.home-gallery-v2-lightbox-thumbs {
    display: flex;
    gap: .55rem;
    padding: .15rem .05rem .2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.home-gallery-v2-lightbox-thumb {
    flex: 0 0 5.4rem;
    width: 5.4rem;
    height: 3.8rem;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: .7rem;
    background: #102a43;
    opacity: .55;
    scroll-snap-align: center;
    transition: opacity .15s ease, border-color .15s ease;
}

.home-gallery-v2-lightbox-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.home-gallery-v2-lightbox-thumb.is-active,
.home-gallery-v2-lightbox-thumb:hover,
.home-gallery-v2-lightbox-thumb:focus-visible {
    opacity: 1;
    border-color: #00C152;
}

body.home-gallery-v2-modal-open {
    overflow: hidden !important;
}

@media (max-width: 991.98px) {
    .home-gallery-v2-card {
        flex-basis: calc((100% - var(--home-gallery-v2-gap)) / 2);
    }
}

@media (max-width: 639.98px) {
    .home-gallery-v2-header {
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .home-gallery-v2-controls {
        gap: .4rem;
    }

    .home-gallery-v2-counter {
        display: none;
    }

    .home-gallery-v2-arrow {
        width: 2.55rem;
        height: 2.55rem;
    }

    .home-gallery-v2-track {
        --home-gallery-v2-gap: .75rem;
    }

    .home-gallery-v2-card {
        flex-basis: 100%;
    }

    .home-gallery-v2-caption {
        min-height: 4.5rem;
    }

    .home-gallery-v2-lightbox {
        padding:
            max(.5rem, env(safe-area-inset-top))
            max(.5rem, env(safe-area-inset-right))
            max(.5rem, env(safe-area-inset-bottom))
            max(.5rem, env(safe-area-inset-left));
    }

    .home-gallery-v2-lightbox-shell {
        height: calc(100dvh - 1rem);
        max-height: calc(100dvh - 1rem);
        gap: .55rem;
    }

    .home-gallery-v2-lightbox-main {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .home-gallery-v2-lightbox-stage {
        border-radius: .75rem;
    }

    .home-gallery-v2-lightbox-nav {
        position: absolute;
        z-index: 4;
        top: 50%;
        width: 2.8rem;
        height: 2.8rem;
        transform: translateY(-50%);
        background: rgba(7, 28, 45, .78);
    }

    .home-gallery-v2-lightbox-prev {
        left: .45rem;
    }

    .home-gallery-v2-lightbox-next {
        right: .45rem;
    }

    .home-gallery-v2-lightbox-close {
        top: .45rem;
        right: .45rem;
        width: 2.7rem;
        height: 2.7rem;
    }

    .home-gallery-v2-lightbox-footer {
        padding: 0 .1rem;
    }

    .home-gallery-v2-lightbox-thumb {
        flex-basis: 4.35rem;
        width: 4.35rem;
        height: 3.1rem;
    }
}
