/* =============================================================================
   CONTENT WRAPPER - MHB Theme
   Bloc de contenu libre pour pages (texte, images, vidéos...)
   ============================================================================= */

/* =============================================================================
   BASE
   ============================================================================= */

.mhb-content {
    background: var(--mhb-bg-dark, #001025);
}

.mhb-content__inner {
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
    line-height: 1.8;
}

/* =============================================================================
   LARGEURS
   ============================================================================= */

.mhb-content--width-normal .mhb-content__inner {
    max-width: 800px;
    padding-left: 20px;
    padding-right: 20px;
}

.mhb-content--width-large .mhb-content__inner {
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
}

.mhb-content--width-full .mhb-content__inner {
    max-width: 100%;
    padding-left: var(--mhb-content-padding-x, 20px);
    padding-right: var(--mhb-content-padding-x, 20px);
}

/* =============================================================================
   ESPACEMENTS (Padding Top)
   ============================================================================= */

.mhb-content--pt-none {
    padding-top: 0;
}

.mhb-content--pt-small {
    padding-top: 20px;
}

.mhb-content--pt-normal {
    padding-top: 40px;
}

.mhb-content--pt-large {
    padding-top: 80px;
}

/* =============================================================================
   ESPACEMENTS (Padding Bottom)
   ============================================================================= */

.mhb-content--pb-none {
    padding-bottom: 0;
}

.mhb-content--pb-small {
    padding-bottom: 20px;
}

.mhb-content--pb-normal {
    padding-bottom: 60px;
}

.mhb-content--pb-large {
    padding-bottom: 100px;
}

/* =============================================================================
   CONTENU - Styles Typography
   ============================================================================= */

/* Espacement entre les blocs */
.mhb-content__inner>* {
    margin-bottom: 30px;
}

.mhb-content__inner>*:last-child {
    margin-bottom: 0;
}

/* Titres H2 */
.mhb-content__inner h2 {
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--mhb-accent, #E95323);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-top: 50px;
    margin-bottom: 25px;
}

.mhb-content__inner h2:first-child {
    margin-top: 0;
}

/* Titres H3 */
.mhb-content__inner h3 {
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* Titres H4 */
.mhb-content__inner h4 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Paragraphes */
.mhb-content__inner p {
    margin-bottom: 25px;
}

/* Liens */
.mhb-content__inner a:not(.mhb-btn) {
    color: var(--mhb-accent, #E95323);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.mhb-content__inner a:not(.mhb-btn):hover {
    color: #ff6b3d;
}

/* =============================================================================
   CONTENU - Images
   ============================================================================= */

/* Images - Débordement pour largeur normale */
.mhb-content--width-normal .mhb-content__inner img {
    max-width: none;
    width: calc(100% + 100px);
    margin-left: -50px;
    margin-right: -50px;
    height: auto;
    border-radius: 12px;
}

.mhb-content--width-normal .mhb-content__inner .wp-block-image {
    margin: 40px 0;
}

.mhb-content--width-normal .mhb-content__inner .wp-block-image img {
    max-width: none;
    width: calc(100% + 100px);
    margin-left: -50px;
    margin-right: -50px;
}

/* Images - Largeur large et full */
.mhb-content--width-large .mhb-content__inner img,
.mhb-content--width-full .mhb-content__inner img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.mhb-content--width-large .mhb-content__inner .wp-block-image,
.mhb-content--width-full .mhb-content__inner .wp-block-image {
    margin: 40px 0;
}

/* Caption images */
.mhb-content__inner .wp-block-image figcaption {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 12px;
    font-style: italic;
}

/* Galerie */
.mhb-content--width-normal .mhb-content__inner .wp-block-gallery {
    margin: 40px -50px;
    width: calc(100% + 100px);
}

.mhb-content--width-large .mhb-content__inner .wp-block-gallery,
.mhb-content--width-full .mhb-content__inner .wp-block-gallery {
    margin: 40px 0;
    width: 100%;
}

/* =============================================================================
   CONTENU - Citations
   ============================================================================= */

.mhb-content__inner blockquote {
    border-left: 4px solid var(--mhb-accent, #E95323);
    padding: 20px 30px;
    margin: 40px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 12px 12px 0;
}

.mhb-content__inner blockquote p {
    font-size: 20px;
    font-style: italic;
    color: #fff;
    margin-bottom: 10px;
}

.mhb-content__inner blockquote cite {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
}

/* =============================================================================
   CONTENU - Listes
   ============================================================================= */

.mhb-content__inner ul,
.mhb-content__inner ol {
    padding-left: 25px;
    margin-bottom: 25px;
}

.mhb-content__inner li {
    margin-bottom: 10px;
}

.mhb-content__inner ul li::marker {
    color: var(--mhb-accent, #E95323);
}

.mhb-content__inner ol li::marker {
    color: var(--mhb-accent, #E95323);
    font-weight: 600;
}

/* =============================================================================
   CONTENU - Vidéos embed
   ============================================================================= */

.mhb-content--width-normal .mhb-content__inner .wp-block-embed,
.mhb-content--width-normal .mhb-content__inner iframe {
    margin: 40px -50px;
    width: calc(100% + 100px);
    max-width: none;
}

.mhb-content--width-large .mhb-content__inner .wp-block-embed,
.mhb-content--width-large .mhb-content__inner iframe,
.mhb-content--width-full .mhb-content__inner .wp-block-embed,
.mhb-content--width-full .mhb-content__inner iframe {
    margin: 40px 0;
    width: 100%;
    max-width: 100%;
}

.mhb-content__inner .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.mhb-content__inner .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 12px;
}

.mhb-content__inner .mhb-video-embed {
    width: 100%;
    margin: 40px 0;
}

.mhb-content__inner .mhb-video-embed__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
}

.mhb-content__inner .mhb-video-embed__frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.mhb-content__inner .mhb-video-embed__frame iframe,
.mhb-content__inner .mhb-video-embed__frame video,
.mhb-content__inner .mhb-video-embed__frame embed,
.mhb-content__inner .mhb-video-embed__frame object {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    border: 0;
}

/* Spectra Image Gallery - reset lightbox inside content blocks */
.mhb-content__inner .spectra-image-gallery__control-lightbox {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mhb-content__inner .spectra-image-gallery__control-lightbox .swiper-slide,
.mhb-content__inner .spectra-image-gallery__control-lightbox .swiper-slide img,
.mhb-content__inner .spectra-image-gallery__control-lightbox .swiper-slide picture,
.mhb-content__inner .spectra-image-gallery__control-lightbox .swiper-slide figure {
    margin: 0 !important;
}

.mhb-content__inner .spectra-image-gallery__control-lightbox--main .swiper-slide img {
    display: block;
    width: auto !important;
    max-width: min(80vw, 1600px) !important;
    height: auto !important;
    max-height: 70vh !important;
    margin: 0 !important;
    border-radius: 0;
    object-fit: contain;
}

.mhb-content__inner .spectra-image-gallery__control-lightbox--thumbnails .swiper-slide img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 3px;
    object-fit: cover;
}

/* Spectra Image Gallery - fallback styles once the lightbox is moved to body */
body.mhb-spectra-lightbox-open {
    overflow: hidden;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000000000 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(5, 10, 20, 0.92) !important;
    backdrop-filter: blur(10px);
    isolation: isolate;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main {
    flex: 1 1 auto;
    min-height: 0;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-wrapper,
body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-slide {
    align-items: center;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-slide {
    display: flex;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-slide img {
    display: block;
    width: auto !important;
    max-width: min(82vw, 1600px) !important;
    height: auto !important;
    max-height: calc(100dvh - 180px) !important;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--thumbnails-wrapper {
    flex: 0 0 auto;
    padding: 0 32px 28px;
    background: linear-gradient(180deg, rgba(6, 12, 24, 0) 0%, rgba(6, 12, 24, 0.88) 100%);
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--count,
body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close {
    position: fixed;
    top: 24px;
    z-index: 20;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--count {
    left: 24px;
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    backdrop-filter: blur(10px);
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close {
    right: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background 0.2s ease, transform 0.2s ease;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close:hover {
    background: rgba(233, 83, 35, 0.95);
    transform: scale(1.04);
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: #fff;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-button-prev,
body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-button-next {
    color: #fff;
}

body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--caption {
    padding: 24px 32px 20px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(5, 10, 20, 0.82) 100%);
}

/* =============================================================================
   CONTENU - Tableaux
   ============================================================================= */

.mhb-content__inner table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.mhb-content__inner th,
.mhb-content__inner td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mhb-content__inner th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: #fff;
}

.mhb-content__inner tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* =============================================================================
   CONTENU - Boutons
   ============================================================================= */

.mhb-content__inner .wp-block-button__link {
    background: var(--mhb-accent, #E95323);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: var(--mhb-font-display, 'Formula Condensed', sans-serif);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.mhb-content__inner .wp-block-button__link:hover {
    background: #ff6b3d;
    transform: translateY(-2px);
    color: #fff;
}

/* Bouton outline */
.mhb-content__inner .wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid var(--mhb-accent, #E95323);
    color: var(--mhb-accent, #E95323);
}

.mhb-content__inner .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--mhb-accent, #E95323);
    color: #fff;
}

/* =============================================================================
   CONTENU - Colonnes
   ============================================================================= */

.mhb-content__inner .wp-block-columns {
    gap: 30px;
}

.mhb-content__inner .wp-block-column {
    margin-bottom: 0;
}

/* Une image en colonne reste dans sa grille et ne reprend pas le bleed éditorial. */
.mhb-content--width-normal .mhb-content__inner .wp-block-columns .wp-block-image,
.mhb-content--width-normal .mhb-content__inner .wp-block-columns .wp-block-column img {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 900px) {

    .mhb-content--width-normal .mhb-content__inner img,
    .mhb-content--width-normal .mhb-content__inner .wp-block-image img,
    .mhb-content--width-normal .mhb-content__inner .wp-block-gallery,
    .mhb-content--width-normal .mhb-content__inner .wp-block-embed,
    .mhb-content--width-normal .mhb-content__inner iframe {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-slide {
        padding: 20px 16px;
    }

    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--main .swiper-slide img {
        max-width: calc(100vw - 32px) !important;
        max-height: calc(100dvh - 170px) !important;
    }

    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--thumbnails-wrapper {
        padding: 0 16px 18px;
    }

    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--count,
    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close {
        top: 16px;
    }

    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--count {
        left: 16px;
    }

    body > .spectra-image-gallery__control-lightbox[data-mhb-lightbox-moved="true"] .spectra-image-gallery__control-lightbox--close {
        right: 16px;
    }

    .mhb-content--pt-normal {
        padding-top: 30px;
    }

    .mhb-content--pt-large {
        padding-top: 50px;
    }

    .mhb-content--pb-normal {
        padding-bottom: 40px;
    }

    .mhb-content--pb-large {
        padding-bottom: 60px;
    }

    .mhb-content__inner h2 {
        font-size: 26px;
    }

    .mhb-content__inner h3 {
        font-size: 20px;
    }

    .mhb-content__inner {
        font-size: 16px;
    }

    .mhb-content__inner blockquote p {
        font-size: 18px;
    }

    .mhb-content__inner .wp-block-columns {
        flex-direction: column;
    }
}
