/* =============================================================================
   BLOCKS - MHB Theme
   Styles pour les blocs ACF personnalises
   ============================================================================= */

/* =============================================================================
   BLOC COLONNES
   ============================================================================= */

.mhb-columns {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.mhb-column {
    min-width: 0;
    /* Permet le shrink des enfants flex */
}

.mhb-column > * {
    max-width: 100%;
}

/* Dans les colonnes, les médias ne doivent jamais hériter des styles
   "débordement" du bloc Contenu. */
.mhb-content__inner .mhb-columns .mhb-column img,
.mhb-content__inner .mhb-columns .mhb-column iframe,
.mhb-content__inner .mhb-columns .mhb-column video,
.mhb-content__inner .mhb-columns .mhb-column embed,
.mhb-content__inner .mhb-columns .mhb-column object,
.mhb-content__inner .mhb-columns .mhb-column .wp-block-image,
.mhb-content__inner .mhb-columns .mhb-column .wp-block-uagb-image,
.mhb-content__inner .mhb-columns .mhb-column .wp-block-embed,
.mhb-content__inner .mhb-columns .mhb-column .wp-block-uagb-image__figure {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.mhb-content__inner .mhb-columns .mhb-column img {
    display: block;
    height: auto;
}

/* =============================================================================
   LAYOUTS - Dispositions des colonnes
   ============================================================================= */

/* 1 colonne */
.mhb-columns--layout-100 .mhb-column {
    width: 100%;
}

/* 2 colonnes - 50/50 */
.mhb-columns--layout-50-50 .mhb-column {
    width: 50%;
}

/* 2 colonnes - 40/60 */
.mhb-columns--layout-40-60 .mhb-column:nth-child(1) {
    width: 40%;
}

.mhb-columns--layout-40-60 .mhb-column:nth-child(2) {
    width: 60%;
}

/* 2 colonnes - 60/40 */
.mhb-columns--layout-60-40 .mhb-column:nth-child(1) {
    width: 60%;
}

.mhb-columns--layout-60-40 .mhb-column:nth-child(2) {
    width: 40%;
}

/* 2 colonnes - 25/75 */
.mhb-columns--layout-25-75 .mhb-column:nth-child(1) {
    width: 25%;
}

.mhb-columns--layout-25-75 .mhb-column:nth-child(2) {
    width: 75%;
}

/* 2 colonnes - 75/25 */
.mhb-columns--layout-75-25 .mhb-column:nth-child(1) {
    width: 75%;
}

.mhb-columns--layout-75-25 .mhb-column:nth-child(2) {
    width: 25%;
}

/* 2 colonnes - 33/67 */
.mhb-columns--layout-33-67 .mhb-column:nth-child(1) {
    width: 33.333%;
}

.mhb-columns--layout-33-67 .mhb-column:nth-child(2) {
    width: 66.666%;
}

/* 2 colonnes - 67/33 */
.mhb-columns--layout-67-33 .mhb-column:nth-child(1) {
    width: 66.666%;
}

.mhb-columns--layout-67-33 .mhb-column:nth-child(2) {
    width: 33.333%;
}

/* 3 colonnes - 33/33/33 */
.mhb-columns--layout-33-33-33 .mhb-column {
    width: 33.333%;
}

/* 3 colonnes - 25/50/25 */
.mhb-columns--layout-25-50-25 .mhb-column:nth-child(1),
.mhb-columns--layout-25-50-25 .mhb-column:nth-child(3) {
    width: 25%;
}

.mhb-columns--layout-25-50-25 .mhb-column:nth-child(2) {
    width: 50%;
}

/* 3 colonnes - 50/25/25 */
.mhb-columns--layout-50-25-25 .mhb-column:nth-child(1) {
    width: 50%;
}

.mhb-columns--layout-50-25-25 .mhb-column:nth-child(2),
.mhb-columns--layout-50-25-25 .mhb-column:nth-child(3) {
    width: 25%;
}

/* 3 colonnes - 25/25/50 */
.mhb-columns--layout-25-25-50 .mhb-column:nth-child(1),
.mhb-columns--layout-25-25-50 .mhb-column:nth-child(2) {
    width: 25%;
}

.mhb-columns--layout-25-25-50 .mhb-column:nth-child(3) {
    width: 50%;
}

/* 4 colonnes - 25/25/25/25 */
.mhb-columns--layout-25-25-25-25 .mhb-column {
    width: 25%;
}

/* =============================================================================
   GAPS - Espacement entre colonnes
   ============================================================================= */

.mhb-columns--gap-none {
    gap: 0;
}

.mhb-columns--gap-small {
    gap: 15px;
}

.mhb-columns--gap-medium {
    gap: 30px;
}

.mhb-columns--gap-large {
    gap: 50px;
}

/* Ajustement largeurs avec gap */
.mhb-columns--gap-small .mhb-column,
.mhb-columns--gap-medium .mhb-column,
.mhb-columns--gap-large .mhb-column {
    /* Le flex-basis compense le gap */
}

/* 2 colonnes avec gap */
.mhb-columns--gap-small.mhb-columns--layout-50-50 .mhb-column {
    width: calc(50% - 7.5px);
}

.mhb-columns--gap-medium.mhb-columns--layout-50-50 .mhb-column {
    width: calc(50% - 15px);
}

.mhb-columns--gap-large.mhb-columns--layout-50-50 .mhb-column {
    width: calc(50% - 25px);
}

/* 3 colonnes avec gap */
.mhb-columns--gap-small.mhb-columns--layout-33-33-33 .mhb-column {
    width: calc(33.333% - 10px);
}

.mhb-columns--gap-medium.mhb-columns--layout-33-33-33 .mhb-column {
    width: calc(33.333% - 20px);
}

.mhb-columns--gap-large.mhb-columns--layout-33-33-33 .mhb-column {
    width: calc(33.333% - 33.333px);
}

/* 4 colonnes avec gap */
.mhb-columns--gap-small.mhb-columns--layout-25-25-25-25 .mhb-column {
    width: calc(25% - 11.25px);
}

.mhb-columns--gap-medium.mhb-columns--layout-25-25-25-25 .mhb-column {
    width: calc(25% - 22.5px);
}

.mhb-columns--gap-large.mhb-columns--layout-25-25-25-25 .mhb-column {
    width: calc(25% - 37.5px);
}

/* =============================================================================
   ALIGNEMENT VERTICAL
   ============================================================================= */

.mhb-columns--valign-top {
    align-items: flex-start;
}

.mhb-columns--valign-center {
    align-items: center;
}

.mhb-columns--valign-bottom {
    align-items: flex-end;
}

.mhb-columns--valign-stretch {
    align-items: stretch;
}

/* =============================================================================
   BLOC BOUTON - WRAPPER
   ============================================================================= */

.mhb-button-wrapper {
    display: flex;
    margin: 15px 0;
}

.mhb-button-wrapper--align-left {
    justify-content: flex-start;
}

.mhb-button-wrapper--align-center {
    justify-content: center;
}

.mhb-button-wrapper--align-right {
    justify-content: flex-end;
}

/* =============================================================================
   BLOC BOUTON - Icones Dashicons
   ============================================================================= */

.mhb-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    margin-right: 5px;
}

.mhb-btn--sm .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.mhb-btn--lg .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* =============================================================================
   RESPONSIVE - Mobile
   ============================================================================= */

@media (max-width: 768px) {

    /* Stack sur mobile si active */
    .mhb-columns--stack-mobile {
        flex-direction: column;
    }

    .mhb-columns--stack-mobile .mhb-column {
        width: 100% !important;
    }

    .mhb-columns--stack-mobile.mhb-columns--gap-small,
    .mhb-columns--stack-mobile.mhb-columns--gap-medium,
    .mhb-columns--stack-mobile.mhb-columns--gap-large {
        gap: 25px;
    }

    /* Boutons plus petits sur mobile */
    .mhb-button-wrapper {
        margin: 10px 0;
    }
}

/* =============================================================================
   EDITEUR GUTENBERG - Styles specifiques
   ============================================================================= */

/* Dans l'editeur, afficher les colonnes correctement */
.editor-styles-wrapper .mhb-columns {
    display: flex;
}

.editor-styles-wrapper .mhb-column {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    min-height: 100px;
    padding: 10px;
}

.editor-styles-wrapper .mhb-column:empty::before {
    content: 'Ajoutez du contenu';
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
}

/* Bouton dans l'editeur */
.editor-styles-wrapper .mhb-button-wrapper {
    margin: 15px 0;
}

/* =============================================================================
   BLOC VIDEOS - 2 colonnes (62/38)
   ============================================================================= */

.mhb-videos-block {
    display: flex;
    gap: 40px;
    align-items: center;
}

/* Colonne gauche - Vidéo à la une (62%) */
.mhb-videos-block__featured {
    width: 62%;
    margin-left: 30px;
}

.mhb-featured-video {
    display: block;
}

.mhb-featured-video__player {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.mhb-featured-video__player iframe {
    border-radius: 12px;
}

.mhb-featured-video__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.mhb-featured-video__player:hover .mhb-featured-video__thumbnail {
    transform: scale(1.03);
}

.mhb-featured-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mhb-blue-dark, #002855);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mhb-featured-video__player:hover .mhb-featured-video__play {
    background: var(--mhb-orange, #F26522);
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

.mhb-featured-video__play svg {
    margin-left: 5px;
}

/* Colonne droite - 3 vidéos (38%) */
.mhb-videos-block__sidebar {
    width: 38%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.mhb-video-card-small {
    display: flex;
    gap: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mhb-video-card-small:hover {
    opacity: 0.85;
}

.mhb-video-card-small__thumbnail {
    width: 50%;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
}

.mhb-video-card-small__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mhb-video-card-small:hover .mhb-video-card-small__thumbnail img {
    transform: scale(1.05);
}

.mhb-video-card-small__content {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mhb-video-card-small__date {
    font-weight: 500;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.mhb-video-card-small__title {
    font-family: 'Formula Condensed', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================================================
   BLOC VIDEOS - RESPONSIVE
   ============================================================================= */

@media (max-width: 1200px) {
    .mhb-video-card-small__title {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .mhb-videos-block {
        flex-direction: column;
        gap: 25px;
        align-items: stretch;
    }

    .mhb-videos-block__featured {
        width: 100%;
        margin-left: 0;
    }

    .mhb-videos-block__sidebar {
        width: 100%;
    }

    .mhb-videos-block__sidebar {
        flex-direction: row;
        gap: 20px;
    }

    .mhb-video-card-small {
        flex: 1;
        flex-direction: column;
        gap: 12px;
    }

    .mhb-video-card-small__thumbnail,
    .mhb-video-card-small__content {
        width: 100%;
    }

    .mhb-video-card-small__title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 768px) {
    .mhb-videos-block {
        gap: 20px;
    }

    .mhb-featured-video__play {
        width: 60px;
        height: 60px;
    }

    .mhb-featured-video__play svg {
        width: 40px;
        height: 40px;
    }

    .mhb-videos-block__sidebar {
        flex-direction: column;
        gap: 15px;
    }

    .mhb-video-card-small {
        flex-direction: row;
        gap: 15px;
    }

    .mhb-video-card-small__thumbnail {
        width: 40%;
    }

    .mhb-video-card-small__content {
        width: 60%;
    }

    .mhb-video-card-small__title {
        font-size: 18px;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 480px) {
    .mhb-video-card-small__date {
        font-size: 12px;
    }

    .mhb-video-card-small__title {
        font-size: 16px;
    }
}

/* =============================================================================
   BLOC PARTENAIRES
   ============================================================================= */

.mhb-partners-block {
    /* Container */
}

.mhb-partners-category {
    margin-bottom: 60px;
}

.mhb-partners-category:last-child {
    margin-bottom: 0;
}

.mhb-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.mhb-partner-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mhb-partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.mhb-partner-card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.mhb-partner-card__logo img {
    max-width: 160px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* =============================================================================
   BLOC PARTENAIRES - RESPONSIVE
   ============================================================================= */

@media (max-width: 1024px) {
    .mhb-partners-category {
        margin-bottom: 50px;
    }

    .mhb-partners-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 25px;
    }

    .mhb-partner-card {
        min-height: 130px;
        padding: 15px;
    }

    .mhb-partner-card__logo img {
        max-width: 140px;
        max-height: 80px;
    }
}

@media (max-width: 768px) {
    .mhb-partners-category {
        margin-bottom: 40px;
    }

    .mhb-partners-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .mhb-partner-card {
        min-height: 120px;
        padding: 15px;
    }

    .mhb-partner-card__logo img {
        max-width: 120px;
        max-height: 70px;
    }
}

@media (max-width: 480px) {
    .mhb-partners-category {
        margin-bottom: 30px;
    }

    .mhb-partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .mhb-partner-card {
        min-height: 100px;
        padding: 12px;
    }

    .mhb-partner-card__logo img {
        max-width: 100px;
        max-height: 60px;
    }
}
