/* 1. BASE — conteneur transparent, couleurs des cartes */
.mbcae {
    --mbcae-blue: #061d31;
    --mbcae-orange: #DA5824;
    --mbcae-border: #375671;
    width: 100%; min-width: 0; padding: 12px 0;
    background: transparent; color: #fff; font-family: inherit;
}
.mbcae, .mbcae * { box-sizing: border-box; }
.mbcae .mbcae__title {
    margin: 0 0 28px; color: #fff; text-align: center;
    font-size: clamp(26px, 3vw, 40px); line-height: 1.2;
}

/* 2. DISPOSITION — une colonne par défaut (mobile/tablette portrait).
 * Deux colonnes dès 1025 px, ou dès 768 px en paysage. */
.mbcae__sections { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1025px), (min-width: 768px) and (orientation: landscape) {
    .mbcae__sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 3. CARTES ET PHOTOS — format carré 1:1, sans déformation. */
.mbcae .mbcae__card {
    min-width: 0; overflow: hidden; position: relative;
    display: flex; flex-direction: column;
    border: 1px solid var(--mbcae-border); border-radius: 16px;
    background: var(--mbcae-blue);
}
.mbcae__photo {
    position: relative; width: 100%; height: auto; aspect-ratio: 3 / 2; flex: 0 0 auto;
    background: linear-gradient(135deg, #244a69, #061d31);
}
.mbcae .mbcae__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.mbcae__photo::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(6,29,49,.35) 65%, #061d31 100%);
}
.mbcae__content {
    position: relative; margin-top: -48px; padding: 0 26px 26px;
    display: flex; flex-direction: column; flex: 1;
}

/* 4. TEXTES — titres blancs et surtitres orange */
.mbcae .mbcae__eyebrow {
    display: flex; align-items: center; gap: 12px; margin: 0 0 10px;
    color: var(--mbcae-orange); font-size: 12px; font-weight: 700;
    letter-spacing: .12em; line-height: 1.4; text-transform: uppercase;
}
.mbcae__eyebrow::after { content: ''; width: 32px; height: 1px; background: currentColor; }
.mbcae .mbcae__heading {
    margin: 0 0 12px; padding: 0; color: #fff; font-family: var(--e-global-typography-primary-font-family, inherit);
    font-size: clamp(26px, 2.5vw, 34px); font-weight: 700; line-height: 1.2;
    letter-spacing: normal; text-transform: none;
}
.mbcae .mbcae__description { margin: 0 0 22px; color: #cad6e3; font-size: 16px; line-height: 1.55; }

/* 5. LIENS — noms réels des pages WordPress */
.mbcae .mbcae__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; list-style: none; margin: auto 0 0; padding: 0; }
.mbcae .mbcae__item { min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; }
.mbcae .mbcae__link {
    display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
    min-height: 52px; padding: 10px 12px 10px 16px;
    border: 1px solid #3a5c7a; border-radius: 30px;
    background: #0b2541; color: #fff; text-decoration: none;
    font-size: 15px; font-weight: 600; line-height: 1.35;
    transition: background-color .18s, border-color .18s;
}
.mbcae__people { flex: 0 0 24px; }
.mbcae__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mbcae .mbcae__arrow {
    display: flex; justify-content: center; align-items: center; flex: 0 0 30px;
    width: 30px; height: 30px; border-radius: 50%; background: var(--mbcae-orange);
    color: #061d31; font-size: 23px; font-weight: 400; line-height: 1;
}
.mbcae .mbcae__empty { margin: auto 0 0; color: #cad6e3; font-size: 14px; }
@media (hover: hover) {
    .mbcae .mbcae__link:hover { background: #133858; border-color: var(--mbcae-orange); color: #fff; }
}
.mbcae .mbcae__link:focus-visible { outline: 3px solid var(--mbcae-orange); outline-offset: 3px; }

/* 6. LIENS INTERNES — sans containment, pour conserver une largeur
 * naturelle dans les widgets Elementor ajustés au contenu. */
@media (min-width: 1200px) {
    .mbcae__card--jeunes .mbcae__grid,
    .mbcae__card--ecole .mbcae__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Le widget contenant cet annuaire occupe la largeur disponible.
 * Ces sélecteurs ne visent que les widgets qui contiennent .mbcae. */
.elementor-widget-shortcode:has(.mbcae),
.elementor-widget-shortcode:has(.mbcae) > .elementor-widget-container,
.elementor-shortcode:has(.mbcae) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    align-self: stretch;
}
@media (max-width: 600px) {
    .mbcae__sections { gap: 20px; }
    .mbcae__content { padding: 0 20px 22px; }
    .mbcae .mbcae__description { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .mbcae .mbcae__link { transition: none; }
}
