@charset "utf-8";
/* ===================================================== */
/* STYLE-INDEX-PUBLICATION.CSS — page d'accueil, section 4*/
/* « Dernière publication » : sous le titre, un bloc de   */
/* la même largeur que le titre, en 2 colonnes : petite   */
/* vignette paysage à gauche, titre + description à       */
/* droite (contenu géré dans admin-publication.php, lu    */
/* par scripts/index-publication.js).                     */
/* Le titre garde sa place et ses couleurs : ce fichier   */
/* ne touche NI aux chevrons, NI au GSAP.                 */
/* ===================================================== */

:root {
    --pub-vignette: 150px;          /* largeur de la vignette (ordinateur) */
}

/* Bloc à la largeur du titre : width 0 + min-width 100 %
   = il remplit la largeur du titre sans jamais l'élargir */
#s4 .s4-pub {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    width: 0;
    min-width: 100%;
    margin-top: 14px;
    text-align: left !important;
}

/* Vignette */
.s4-pub-image {
    flex: 0 0 auto;
    display: block;
    pointer-events: auto;          /* le titre de section ignore la souris */
}
#s4 .inner .s4-pub-image img {
    display: block !important;
    width: var(--pub-vignette) !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transition: opacity 0.3s ease;
}
a.s4-pub-image:hover img { opacity: 0.85; }

/* Texte */
.s4-pub-texte {
    flex: 1 1 auto;
    min-width: 0;
}
#s4 .s4-pub-titre {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-align: left !important;
}
#s4 .s4-pub-titre a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}
#s4 .s4-pub-titre a:hover { text-decoration: underline; text-underline-offset: 4px; }
#s4 .s4-pub-description {
    margin: 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    white-space: pre-line;          /* retours à la ligne saisis dans l'administration */
    text-align: left !important;
    opacity: 0.85;
}

/* Tablette */
@media (max-width: 1024px) {
    :root { --pub-vignette: 130px; }
    #s4 .s4-pub-titre { font-size: 20px; }
    #s4 .s4-pub-description { font-size: 15px; }
}

/* Mobile */
@media (max-width: 768px) {
    /* Une seule colonne : titre, puis vignette sur toute la largeur
       du bloc (recadrée en 16:10 si besoin), puis le texte, centré */
    #s4 .s4-pub {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-top: 14px;
        text-align: center !important;
    }
    #s4 .inner .s4-pub-image img {
        width: 100% !important;
        aspect-ratio: 16 / 10;
        height: auto !important;
        object-fit: cover !important;
    }
    #s4 .s4-pub-titre,
    #s4 .s4-pub-description {
        text-align: center !important;
    }
    /* Titre de section sur une seule ligne */
    html body #s4 .section-title h1 { font-size: 30px !important; line-height: 1.25 !important; }
    #s4 .s4-pub-titre { font-size: 18px !important; }
    #s4 .s4-pub-description { font-size: 14px !important; line-height: 1.5; }

    /* Bloc remonté : il démarre sous le menu (ou un peu plus bas sur les
       grands téléphones) au lieu d'être posé au-dessus du chevron
       (sélecteur renforcé : style-index-mobile.css fixe top et
       transform en !important) */
    html body #s4 .section-title {
        top: max(80px, calc(50% - 230px)) !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
    }
}

/* Petits téléphones peu hauts (iPhone SE…) : vignette moins haute */
@media (max-width: 768px) and (max-height: 620px) {
    #s4 .inner .s4-pub-image img { aspect-ratio: 2 / 1; }
    html body #s4 .section-title h1 { font-size: 26px !important; }
}
