/* ─── lmdm/texte-image ────────────────────────────────────────────────────── */

/* ── Fond noir ──────────────────────────────────────────────────────────────── */

.lmdm-texte-image--bg-dark {
    background-color: #000000;
}

.lmdm-texte-image--bg-dark .lmdm-texte-image__content,
.lmdm-texte-image--bg-dark .lmdm-texte-image__content p,
.lmdm-texte-image--bg-dark .lmdm-texte-image__content li {
    color: var(--wp--preset--color--white) !important;
}

.lmdm-texte-image--bg-dark .lmdm-texte-image__subtitle {
    color: rgba(255, 255, 255, 0.7) !important;
}

.lmdm-texte-image__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.lmdm-texte-image--img-left .lmdm-texte-image__media {
    order: -1;
}

/* ── Ratio image ────────────────────────────────────────────────────────────── */

.lmdm-texte-image__media--square .lmdm-texte-image__img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    width: 100% !important;
    height: auto !important;
}

.wp-block-lmdm-texte-image.lmdm-texte-image--no-pad-top {
    padding-top: 0 !important;
}

/* ── Titre ───────────────────────────────────────────────────────────────── */

.lmdm-texte-image__title {
    font-family: var(--wp--preset--font-family--heading);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--wp--preset--color--gold);
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0 0 1.5rem;
}

.lmdm-texte-image__title strong {
    font-weight: 700;
}

/* ── Titre centré (au-dessus de la grille) ───────────────────────────────── */

.lmdm-texte-image__title--center {
    text-align: center;
    margin-bottom: 1rem;
}

.lmdm-texte-image__title--center + .lmdm-texte-image__subtitle--center {
    margin-bottom: 2.5rem;
}

/* ── Sous-titre ──────────────────────────────────────────────────────────── */

.lmdm-texte-image__subtitle {
    font-family: var(--wp--preset--font-family--heading);
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--wp--preset--color--gray-dark);
    margin: 0 0 1.5rem;
}

.lmdm-texte-image__subtitle--center {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Vidéo (iframe responsive) ───────────────────────────────────────────── */

.lmdm-texte-image__video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.lmdm-texte-image__video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ── Carrousel (CSS scroll-snap, zéro JS) ───────────────────────────────── */

.lmdm-texte-image__carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.lmdm-texte-image__carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
}

.lmdm-texte-image__carousel-track::-webkit-scrollbar {
    display: none;
}

.lmdm-texte-image__carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    object-fit: cover;
    scroll-snap-align: start;
    display: block;
}

/* ── Boutons prev/next ───────────────────────────────────────────────────── */

.lmdm-texte-image__carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--wp--preset--color--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 2;
    opacity: 0;
}

.lmdm-texte-image__carousel:hover .lmdm-texte-image__carousel-btn {
    opacity: 1;
}

.lmdm-texte-image__carousel-btn:hover {
    background: var(--wp--preset--color--gold);
    color: #fff;
}

.lmdm-texte-image__carousel-btn--prev {
    left: 12px;
}

.lmdm-texte-image__carousel-btn--next {
    right: 12px;
}

.lmdm-texte-image__carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.lmdm-texte-image__carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wp--preset--color--gray-medium);
    opacity: 0.4;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.lmdm-texte-image__carousel-dot--active {
    background: var(--wp--preset--color--gold);
    opacity: 1;
}

/* ── Contenu ─────────────────────────────────────────────────────────────── */

.lmdm-texte-image__content {
    font-family: var(--wp--preset--font-family--body);
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--wp--preset--color--primary);
    margin-bottom: 1.5rem;
}

.lmdm-texte-image__content p {
    margin: 0 0 1rem;
}

.lmdm-texte-image__content strong {
    font-weight: 600;
}

/* ── Image ───────────────────────────────────────────────────────────────── */

.lmdm-texte-image__img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .lmdm-texte-image__layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lmdm-texte-image__media {
        order: -1;
    }

    .lmdm-texte-image__title {
        font-size: 1.5rem;
    }
}
