/**
 * css/ebookfree-alert-modal.css
 * Modal "limite de fascicules gratuits atteinte" (DIENSHOP/ebook-fich.php).
 * Feuille externe et dédiée : à modifier librement sans toucher au CSS global.
 *
 * Contenu piloté par eBooksOrders/ebookfree-alert-{LANG}.json → pages[0].blocks[].
 * Chaque bloc devient : .efa-block > .efa-block-img / .efa-block-title / .efa-block-text / .efa-block-cta
 *
 * Position de l'image = champ JSON "img1_pos" du bloc ("left" par défaut, ou "right") :
 *   - Desktop (> 640px) : image en colonne fixe à GAUCHE (img1_pos=left) ou À DROITE (img1_pos=right)
 *     du bloc, alignée avec le titre + texte + lien.
 *   - Mobile (≤ 640px) :
 *       img1_pos = "left"  → image pleine largeur, SOUS le titre (au-dessus du texte)
 *       img1_pos = "right" → image en vignette, À DROITE du titre, texte pleine largeur en dessous
 *   Pas d'image sur un bloc → aucune colonne réservée (efa-block--no-img).
 *
 * Pour changer où l'image tombe sur mobile : change juste "img1_pos" dans le JSON,
 * ou modifie directement les grid-template-areas ci-dessous (bloc "Mobile").
 */

.efa-content {
    max-width: 850px;
    background: #D9D6D0;
    border: 4px solid #ADA087;
}
.efa-title {
    text-align: center;
    text-transform: uppercase;
}
.efa-subtitle {
    text-align: center;
    color: #007abd;
    font-weight: 600;
    font-size: 1.05rem;
    margin: -6px 0 18px;
}
.efa-intro {
    color: #555;
    line-height: 1.7;
    margin-bottom: 8px;
}
.efa-intro p { margin: 0 0 12px; }

/* ── Bloc ─────────────────────────────────────────────────────────────── */

.efa-block {
    display: grid;
    column-gap: 18px;
    row-gap: 6px;
    padding: 18px 0;
    border-top: 1px solid rgba(0, 0, 0, .08);
}
.efa-block:first-of-type {
    border-top: none;
    padding-top: 6px;
}

.efa-block-img  { grid-area: img; }
.efa-block-title{ grid-area: tit; align-self: start; }
.efa-block-text { grid-area: txt; }
.efa-block-cta  { grid-area: cta; align-self: start; }
.efa-block-img img {
    /* width: 150px; */
    /* height: 150px; */
    object-fit: contain;
    display: block;
}
.efa-block-title {
    font-size: 1rem;
    font-weight: 700;
    color: #990033;
    margin: 0;
    line-height: 1.3;
}
.efa-block-text {
    color: #041118;
    line-height: 1.45;
    margin: 0;
}
.efa-block-text p { margin: 0 0 10px; }
.efa-block-text p:last-child { margin-bottom: 0; }
.efa-block-cta {
    display: inline-block;
    color: #990033;
    text-decoration: none;
    border: 1px solid #007abd;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: .9rem;
    justify-self: start;
    background: #E7E6E5 !important;
}
.efa-block-cta:hover {
    background: #cddff7 !important;
    color: #021129;
}

/* Pas d'image → une seule colonne pleine largeur */
.efa-block--no-img {
    grid-template-columns: 1fr;
    grid-template-areas:
        "tit"
        "txt"
        "cta";
}

/* ── Desktop (> 640px) : image en colonne fixe, gauche ou droite ────────── */
@media (min-width: 641px) {
    .efa-block--img-left {
        grid-template-columns: 210px 1fr;
        grid-template-areas: "img tit" "img txt" "img cta";
    }
    .efa-block--img-right {
        grid-template-columns: 1fr 210px;
        grid-template-areas:
            "tit img"
            "txt img"
            "cta img";
    }
}

/* ── Mobile (≤ 640px) : piloté par img1_pos ──────────────────────────────
   left  → image pleine largeur SOUS le titre
   right → image en vignette À DROITE du titre, texte pleine largeur ensuite
*/
@media (max-width: 640px) {
    .efa-block {
        grid-template-columns: 1fr;
    }

    .efa-block--img-left {
        grid-template-areas:
            "tit"
            "img"
            "txt"
            "cta";
    }
    .efa-block--img-left .efa-block-img img {
        width: 100%;
        height: auto;
        max-height: 220px;
        border-radius: 12px;
    }

    .efa-block--img-right {
        grid-template-columns: 1fr 64px;
        grid-template-areas:
            "tit img"
            "txt txt"
            "cta cta";
        align-items: start;
    }
    .efa-block--img-right .efa-block-img img {
        width: 64px;
        height: 64px;
        border-radius: 50%;
    }
}
