/* GUMA V9 — Présentation premium du Président */

/* Section de l'accueil */
body.is-home #mot-du-president {
    padding-block: clamp(64px, 7vw, 110px);
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(102, 49, 143, .07),
            transparent 38%
        ),
        linear-gradient(135deg, #fff 0%, #faf7fc 100%);
}

body.is-home #mot-du-president .guma-president-layout {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    align-items: center;
    gap: clamp(30px, 5vw, 80px);
}

body.is-home #mot-du-president .guma-president-portrait {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #eee8f2;
    box-shadow: 0 24px 55px rgba(40, 17, 62, .12);
}

body.is-home #mot-du-president .guma-president-portrait img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    object-position: center;
}

body.is-home #mot-du-president .guma-president-message {
    min-width: 0;
}

body.is-home #mot-du-president .guma-president-content {
    max-width: 640px;
}

body.is-home #mot-du-president .guma-president-content h2 {
    font-size: clamp(2rem, 3.1vw, 3.4rem);
    line-height: 1.14;
    letter-spacing: -.035em;
    margin-bottom: 24px;
}

body.is-home #mot-du-president .guma-president-content > p:not(.guma-eyebrow) {
    font-size: clamp(1rem, 1.3vw, 1.14rem);
    line-height: 1.8;
    max-width: 58ch;
}

/* Fenêtre modale : cadrage correct du portrait */
.guma-president-modal__panel {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    width: min(1120px, calc(100vw - 40px));
    max-height: min(88vh, 900px);
    overflow: hidden;
}

.guma-president-modal__image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #f4eff7;
}

.guma-president-modal__image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center !important;
}

.guma-president-modal__content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(28px, 4vw, 58px);
    overscroll-behavior: contain;
}

.guma-president-official-text {
    line-height: 1.85;
}

.guma-president-official-text p {
    margin-bottom: 1.15em;
}

/* Adaptation mobile */
@media (max-width: 760px) {
    body.is-home #mot-du-president .guma-president-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    body.is-home #mot-du-president .guma-president-portrait {
        max-width: 480px;
        margin-inline: auto;
    }

    .guma-president-modal__panel {
        display: block;
        width: calc(100vw - 24px);
        max-height: 92vh;
        overflow-y: auto;
    }

    .guma-president-modal__image {
        height: 300px;
    }

    .guma-president-modal__image img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
    }

    .guma-president-modal__content {
        overflow: visible;
        padding: 28px 22px;
    }
}

/*
 * GUMA V9-P3
 * Correction du portrait dans la fenêtre du Président.
 * Le portrait de l'accueil n'est pas concerné.
 */

.guma-president-modal:not([hidden]) .guma-president-modal__panel {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    align-items: stretch;
}

.guma-president-modal:not([hidden]) .guma-president-modal__image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    background: #f2edf5;
}

.guma-president-modal:not([hidden]) .guma-president-modal__image img {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

@media (max-width: 760px) {
    .guma-president-modal:not([hidden]) .guma-president-modal__panel {
        display: block;
    }

    .guma-president-modal:not([hidden]) .guma-president-modal__image {
        height: 280px;
    }

    .guma-president-modal:not([hidden]) .guma-president-modal__image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
}


/* GUMA V9-P8 — DESKTOP MODAL LAYOUT */

/*
 * La grille est portée par le panneau.
 * Le portrait remplit réellement sa colonne.
 * Le texte défile indépendamment.
 */

@media (min-width: 761px) {

    .guma-president-modal:not([hidden])
    .guma-president-modal__panel {
        display: grid !important;
        grid-template-columns: minmax(0, 40%) minmax(0, 60%) !important;
        align-items: stretch !important;
        width: min(1120px, calc(100vw - 48px)) !important;
        height: min(84vh, 820px) !important;
        max-height: 820px !important;
        overflow: hidden !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__image {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        background: #eee8f3 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__image img {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center top !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__content {
        min-width: 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: clamp(32px, 4vw, 58px) !important;
        background: #fff !important;
    }
}

@media (max-width: 760px) {

    .guma-president-modal:not([hidden])
    .guma-president-modal__panel {
        display: block !important;
        width: calc(100vw - 24px) !important;
        height: auto !important;
        max-height: 92dvh !important;
        overflow-y: auto !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__image {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 280px !important;
        min-height: 280px !important;
        overflow: hidden !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__image img {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 25% !important;
    }

    .guma-president-modal:not([hidden])
    .guma-president-modal__content {
        height: auto !important;
        overflow: visible !important;
        padding: 28px 22px 36px !important;
    }
}
