/* Sélecteurs propres à l’extension pour cohabiter avec BeTheme et le CSS MGestalt. */
.mgmc-grid, .mgmc-grid *, .mgmc-modal, .mgmc-modal * { box-sizing: border-box; }
.mgmc-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin: 26px 0 0;
}
.mgmc-grid > template { display: none !important; }
.mgmc-grid .mgmc-card {
    appearance: none;
    position: relative;
    isolation: isolate;
    grid-column: span 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 380px;
    height: auto;
    margin: 0;
    padding: 36px;
    overflow: hidden;
    border: 0 !important;
    border-radius: 20px;
    box-shadow: none;
    color: var(--mgmc-text, #202126) !important;
    background: var(--mgmc-background, #1f8a99) !important;
    text-align: left;
    text-transform: none;
    text-decoration: none;
    letter-spacing: normal;
    white-space: normal;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.mgmc-grid .mgmc-card::before, .mgmc-grid .mgmc-card::after { content: none !important; }
.mgmc-grid--objectifs.mgmc-grid--tail-2 .mgmc-card:nth-last-of-type(-n+2) { grid-column: span 3; }
.mgmc-grid--objectifs.mgmc-grid--tail-1 .mgmc-card:last-of-type { grid-column: 1 / -1; }
.mgmc-grid .mgmc-card--wide { grid-column: 1 / -1; min-height: 180px; }
.mgmc-grid .mgmc-card__title {
    display: block;
    margin: 0;
    padding: 0;
    color: inherit !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 3vw, 45px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -.035em;
    overflow-wrap: break-word;
    hyphens: auto;
}
.mgmc-card__mark {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font: 400 23px/1 Arial, sans-serif;
    opacity: .65;
}
.mgmc-card__preview {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 64px 36px 32px;
    color: inherit;
    background: var(--mgmc-background, #1f8a99);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.mgmc-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 400 20px/1.5 Georgia, "Times New Roman", serif;
}
.mgmc-card__read { font: 700 14px/1.4 Arial, sans-serif; }
.mgmc-grid .mgmc-card:focus-visible {
    outline: 3px solid #202126;
    outline-offset: 4px;
}
.mgmc-card:focus-visible .mgmc-card__preview { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
    .mgmc-grid .mgmc-card:hover { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(32,33,38,.12); }
    .mgmc-card:hover .mgmc-card__preview { opacity: 1; }
}
.mgmc-grid--approches .mgmc-card { min-height: 240px; padding: 30px; }
.mgmc-grid--approches .mgmc-card__title { font-size: clamp(22px, 2.1vw, 28px); line-height: 1.22; }
.mgmc-grid--approches .mgmc-card--wide { min-height: 180px; }
.mgmc-empty { padding: 20px; border-left: 3px solid #1f8a99; background: #f5f1ed; }
body.mgmc-modal-open { overflow: hidden; }
.mgmc-modal:not([open]) { display: none !important; }
.mgmc-modal[open] {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 24px;
    overflow: auto;
    border: 0;
    background: transparent;
}
.mgmc-modal::backdrop { background: rgba(26,22,28,.62); backdrop-filter: blur(4px); }
.mgmc-modal--fallback[open] { background: rgba(26,22,28,.62); }
.mgmc-modal__panel {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 48px;
    overflow: auto;
    overscroll-behavior: contain;
    border-top: 8px solid var(--mgmc-accent, #1f8a99);
    border-radius: 24px;
    background: #fffdfb;
    color: #60203a;
    box-shadow: 0 30px 90px rgba(0,0,0,.22);
}
.mgmc-modal .mgmc-modal__close {
    appearance: none;
    display: grid;
    place-items: center;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 1px solid #ded6d4;
    border-radius: 50%;
    color: #60203a;
    background: #fff;
    box-shadow: none;
    font: 400 28px/1 Arial, sans-serif;
    cursor: pointer;
}
.mgmc-modal__close::before, .mgmc-modal__close::after { content: none !important; }
.mgmc-modal__close:focus-visible { outline: 3px solid #1f8a99; outline-offset: 3px; }
.mgmc-modal .mgmc-modal__title {
    margin: 8px 24px 24px 0;
    color: #60203a;
    font: 400 clamp(27px, 3vw, 38px)/1.15 Georgia, "Times New Roman", serif;
    letter-spacing: -.025em;
    overflow-wrap: break-word;
}
.mgmc-modal__content { font: 400 18px/1.75 Georgia, "Times New Roman", serif; }
.mgmc-modal__content p, .mgmc-modal__content li { font-size: inherit; line-height: inherit; }
.mgmc-modal__content > :last-child { margin-bottom: 0; }
.mgmc-modal__content img { max-width: 100%; height: auto; }
.mgmc-modal__content a { color: #176a75; text-decoration: underline; }
@media (max-width: 900px) {
    .mgmc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .mgmc-grid .mgmc-card { grid-column: auto; min-height: 320px; padding: 30px; }
    .mgmc-grid--objectifs.mgmc-grid--tail-2 .mgmc-card:nth-last-of-type(-n+2),
    .mgmc-grid--objectifs.mgmc-grid--tail-1 .mgmc-card:last-of-type { grid-column: auto; }
    .mgmc-grid .mgmc-card--wide { grid-column: 1 / -1; min-height: 180px; }
    .mgmc-grid--approches .mgmc-card { min-height: 240px; }
}
@media (max-width: 600px) {
    .mgmc-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .mgmc-grid .mgmc-card { min-height: 270px; padding: 30px; }
    .mgmc-grid .mgmc-card__title { font-size: 32px; }
    .mgmc-grid--approches .mgmc-card { min-height: 220px; }
    .mgmc-grid--approches .mgmc-card__title { font-size: 25px; }
    .mgmc-grid .mgmc-card--wide { grid-column: auto; min-height: 180px; }
    .mgmc-modal[open] { padding: 15px; }
    .mgmc-modal__panel { padding: 48px 24px 28px; max-height: calc(100dvh - 30px); border-radius: 18px; }
    .mgmc-modal .mgmc-modal__title { margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .mgmc-grid .mgmc-card, .mgmc-card__preview { transition: none; }
    .mgmc-grid .mgmc-card:hover { transform: none; }
}
