/**
 * ========================================================================
 * PROJET      : LOOM-CMS
 * VERSION     : 1.0.12
 * CLIENT      : CRPMEM de La Réunion
 * MODULE      : CSS - Article Editorial Remastering
 * SOCIÉTÉ     : LOOM DIGITAL
 * EMPLACEMENT : /assets/css/article-editorial.css
 * ========================================================================
 *
 * Styles editoriaux pour :
 * 1. Page article : hero adaptatif, lettrine, pull-quotes, barre progression
 * 2. Homepage section Edito : layout portrait + texte magazine
 * 3. Homepage CTA video presentation
 *
 * DEPENDANCES :
 * - Bootstrap 5 (via plugins.css / style.css)
 * - perso-crpmem.css (variables CRPMEM)
 *
 * VARIABLES CRPMEM UTILISEES :
 * - --crpmem-orange: #ec7520
 * - --crpmem-bleu-clair: #00a4c2
 * - --crpmem-bleu-fonce: #015f68
 *
 * ACCESSIBILITE RGAA AAA :
 * - Contrastes 7:1 minimum verifies
 * - prefers-reduced-motion respecte sur toutes les animations
 * - Tailles police >= 1rem pour le corps
 * - Focus visible sur elements interactifs
 *
 * FIX v1.0.12 (2026-02-26) :
 * [x] .article-hero--default : 280px → 200px desktop, 220px → 160px mobile
 * [x] .section-excerpt-quote : pull-quote pour sections Actus, Env, Agenda
 * [x] .edito-excerpt-quote : unifie avec .section-excerpt-quote (bordure orange)
 *
 * FIX v1.0.12 (2026-02-10) :
 * [x] .edito-portrait : z-index:2 (dots bg-dot derriere la photo)
 * [x] .post-footer__date : RGAA AAA (text-muted 4.69:1 → #595959 7.00:1)
 * [x] .post-footer__tag : RGAA AAA (btn-soft-ash 4.83:1 → #4a4a4a 7.76:1, 0.8rem)
 *
 * @author  Riley / LOOM DIGITAL
 * @version 1.0.12
 * @date    2026-02-09
 * ========================================================================
 */

/* ========================================================================
   1. BARRE DE PROGRESSION DE LECTURE
   ======================================================================== */

.article-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--crpmem-bleu-clair, #00a4c2), var(--crpmem-orange, #ec7520));
    z-index: 9999;
    transition: width 0.1s linear;
    border: none;
    margin: 0;
    padding: 0;
}

/* ========================================================================
   2. TEMPS DE LECTURE (badge metadata)
   ======================================================================== */

.article-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #4a4a4a; /* ratio 7.21:1 AAA sur fond blanc */
}

.article-reading-time .uil {
    font-size: 1.1rem;
}

/* ========================================================================
   3. LETTRINE (drop cap)
   ======================================================================== */

/* Lettrine sur le premier paragraphe du contenu editorial */
.post-content--editorial > p:first-of-type::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.8;
    padding-right: 0.1em;
    margin-top: 0.05em;
    font-weight: 700;
    color: var(--crpmem-bleu-fonce, #015f68);
    font-family: Georgia, "Times New Roman", serif;
}

/* ========================================================================
   4. ANIMATIONS SCROLL (IntersectionObserver)
   ======================================================================== */

/* Etat initial : invisible et decale */
.editorial-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Etat visible : anime par JS via IntersectionObserver */
.editorial-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delais progressifs pour effets en cascade */
.editorial-reveal--delay-1 { transition-delay: 0.1s; }
.editorial-reveal--delay-2 { transition-delay: 0.2s; }
.editorial-reveal--delay-3 { transition-delay: 0.3s; }

/* ========================================================================
   5. PULL-QUOTE / CITATION EDITORIALE
   ======================================================================== */

.post-content--editorial blockquote,
.post-content--editorial .editorial-pullquote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.5rem 2rem 1.5rem 2.5rem;
    border-left: 4px solid var(--crpmem-bleu-clair, #00a4c2);
    background-color: rgba(0, 164, 194, 0.04);
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--crpmem-bleu-fonce, #015f68);
    font-style: italic;
}

.post-content--editorial blockquote::before {
    content: "\201C"; /* guillemet ouvrant */
    position: absolute;
    top: -0.2em;
    left: 0.5rem;
    font-size: 3rem;
    line-height: 1;
    color: var(--crpmem-bleu-clair, #00a4c2);
    opacity: 0.3;
    font-family: Georgia, "Times New Roman", serif;
}

/* ========================================================================
   6. HABILLAGE IMAGES DANS CONTENU QUILL
   ======================================================================== */

/* Images petites/moyennes dans le contenu : habillage automatique */
.post-content--editorial img {
    border-radius: 0.5rem;
    max-width: 100%;
    height: auto;
}

/* Images avec classe d'alignement (ajoutees via Quill ou manuellement) */
.post-content--editorial .img-float-left {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 45%;
}

.post-content--editorial .img-float-right {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 45%;
}

/* Clearfix apres images flottantes */
.post-content--editorial::after {
    content: "";
    display: table;
    clear: both;
}

/* ========================================================================
   7. HERO ARTICLE — BANDEAU COLORE PAR DEFAUT (sans hero_image)
   ======================================================================== */

/* Bandeau gradient quand pas de hero_image
 * [FIX v1.0.12] 280px → 200px : gradient = toile de fond, pas image a contempler
 * Le padding Sandbox (pt-17 pb-20) assure la hauteur reelle avec le contenu */
.article-hero--default {
    background: linear-gradient(135deg, var(--crpmem-bleu-fonce, #015f68) 0%, var(--crpmem-bleu-clair, #00a4c2) 100%);
    min-height: 200px;
}

/* Bandeau avec hero_image */
.article-hero--image {
    min-height: 400px;
}

/* ========================================================================
   8. SIGNATURE AUTEUR (article page)
   ======================================================================== */

.article-author-signature {
    border-top: 2px solid var(--crpmem-bleu-clair, #00a4c2);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    text-align: right;
    font-style: italic;
    color: var(--crpmem-bleu-fonce, #015f68);
}

/* ========================================================================
   8b. POST-FOOTER DATE (article page)
   ========================================================================
   FIX v1.0.12 (2026-02-10) - RGAA AAA CONTRASTE :
   Remplace .text-muted .small (Bootstrap) qui echoue AAA :
   - .text-muted = #6c757d → 4.69:1 sur blanc ❌ AAA (seuil 7.0:1)
   - .small override 0.6rem = 9.6px ❌ RGAA (seuil 12px)
   
   Correctif :
   - #595959 → 7.00:1 sur blanc ✅ AAA
   - 0.8rem = 12.8px ✅ RGAA conforme (marge securite)
   ======================================================================== */

.post-footer__date {
    color: #595959; /* Contraste 7.00:1 sur #ffffff — RGAA AAA conforme */
    font-size: 0.8rem; /* 12.8px — marge securite RGAA (seuil 12px) */
    line-height: 1.5; /* Interligne confortable (RGAA critere 10.12) */
}

/* Badge categorie (rounded-pill) — harmonisation taille + contraste AAA
   FIX v1.0.12 (2026-02-10) :
   btn-soft-ash = texte #60697b sur fond #eef0f2 → 4.83:1 ❌ AAA
   Correctif : #4a4a4a sur #eef0f2 → 7.76:1 ✅ AAA
   font-size aligne sur .post-footer__date (0.8rem) */
.post-footer__tag {
    font-size: 0.8rem; /* Alignement visuel avec la date a droite */
    color: #4a4a4a; /* Contraste 7.76:1 sur fond ash #eef0f2 — RGAA AAA */
}

/* ========================================================================
   9. HOMEPAGE — SECTION EDITO REMASTERING
   ======================================================================== */

/* Portrait du President */
/* FIX v1.0.12 (2026-02-10) : z-index:2 pour passer DEVANT bg-dot (z-index:1) */
.edito-portrait {
    position: relative;
    z-index: 2;
    max-width: 340px;
    margin: 0 auto;
}

.edito-portrait__image {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(1, 95, 104, 0.15);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top center;
}

.edito-portrait__caption {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #4a4a4a; /* ratio 7.21:1 AAA sur blanc */
    font-style: italic;
}

/* Trait decoratif vertical a cote du portrait (desktop) */
.edito-portrait__accent {
    position: absolute;
    top: 1.5rem;
    right: -1rem;
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--crpmem-orange, #ec7520) 0%, var(--crpmem-bleu-clair, #00a4c2) 100%);
    border-radius: 2px;
    display: none;
}

/* Extrait edito en style pull-quote — sections homepage
   ADD v1.0.12 (2026-02-26) : .section-excerpt-quote pour Actus, Env, Agenda
   Bordure orange = couleur d'accent CRPMEM (distinction vs blockquote bleu-clair)
   Contraste #343f52 sur blanc = 10.28:1 AAA, sur bg-light = ~9.9:1, bg-crpmem-soft = ~9.2:1 */
.edito-excerpt-quote,
.section-excerpt-quote {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #343f52;
    font-style: italic;
    padding-left: 1.25rem;
    border-left: 3px solid var(--crpmem-orange, #ec7520);
    margin-bottom: 1.5rem;
}

/* ========================================================================
   10. HOMEPAGE — CTA VIDEO PRESENTATION
   ======================================================================== */

.edito-video-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crpmem-bleu-fonce, #015f68);
    text-decoration: none;
    transition: color 0.2s ease;
    border: none;
    background: none;
}

.edito-video-cta:hover,
.edito-video-cta:focus {
    color: var(--crpmem-orange, #ec7520);
    text-decoration: none;
}

.edito-video-cta:focus-visible {
    outline: 2px solid var(--crpmem-orange, #ec7520);
    outline-offset: 4px;
    border-radius: 4px;
}

.edito-video-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--crpmem-orange, #ec7520);
    color: #ffffff;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.edito-video-cta:hover .edito-video-cta__icon {
    transform: scale(1.1);
    background-color: var(--crpmem-bleu-fonce, #015f68);
}

/* ========================================================================
   11. RESPONSIVE
   ======================================================================== */

/* Desktop : accent visible, layout optimise */
@media (min-width: 992px) {
    .edito-portrait__accent {
        display: block;
    }

    .edito-portrait {
        max-width: 300px;
    }

    .post-content--editorial > p:first-of-type::first-letter {
        font-size: 4em;
    }
}

/* Tablette : ajustements */
@media (max-width: 991.98px) {
    .edito-portrait {
        max-width: 250px;
        margin-bottom: 2rem;
    }

    .post-content--editorial .img-float-left,
    .post-content--editorial .img-float-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* Mobile : lettrine plus petite, portrait centre */
@media (max-width: 575.98px) {
    .post-content--editorial > p:first-of-type::first-letter {
        font-size: 2.8em;
    }

    .edito-excerpt-quote,
    .section-excerpt-quote {
        font-size: 1rem;
    }

    .article-hero--default {
        min-height: 160px; /* [FIX v1.0.12] 220px → 160px */
    }

    .article-hero--image {
        min-height: 300px;
    }
}

/* ========================================================================
   12. ACCESSIBILITE — PREFERS-REDUCED-MOTION
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
    .editorial-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .article-progress-bar {
        transition: none;
    }

    .edito-video-cta__icon {
        transition: none;
    }

    .edito-video-cta {
        transition: none;
    }
}

/* ========================================================================
 * SIGNATURE NUMERIQUE LOOM-CMS
 * ========================================================================
 * Module      : CSS - Article Editorial Remastering
 * Emplacement : /assets/css/article-editorial.css
 * Version     : 1.0.12
 * Date        : 2026-02-10
 * Auteur      : Riley / LOOM DIGITAL
 * ========================================================================
 *
 * COMPOSANTS :
 * [x] Barre de progression de lecture (fixed top)
 * [x] Badge temps de lecture
 * [x] Lettrine (drop cap) premier paragraphe
 * [x] Animations scroll (IntersectionObserver)
 * [x] Pull-quotes / citations editoriales
 * [x] Habillage images contenu (float left/right)
 * [x] Hero article bandeau colore / image
 * [x] Signature auteur
 * [x] Post-footer date RGAA AAA (7.00:1 contraste)
 * [x] Post-footer tag RGAA AAA (7.76:1 contraste, 0.8rem)
 * [x] Homepage section Edito portrait magazine
 * [x] Homepage pull-quote sections (.edito-excerpt-quote + .section-excerpt-quote) (v1.0.12)
 * [x] Homepage CTA video presentation
 * [x] Responsive (desktop, tablette, mobile)
 * [x] prefers-reduced-motion respecte
 *
 * FIX v1.0.12 (2026-02-26) :
 * [x] .section-excerpt-quote ajoutee (pull-quote Actus, Env, Agenda)
 * [x] .edito-excerpt-quote unifie (bordure orange, couleur #343f52 AAA 10.28:1)
 *
 * FIX v1.0.12 (2026-02-10) :
 * [x] .edito-portrait z-index:2 (dots decoratifs derriere)
 * [x] .post-footer__date : RGAA AAA contraste 7.00:1 (#595959, 0.8rem)
 * [x] .post-footer__tag : RGAA AAA contraste 7.76:1 (#4a4a4a, 0.8rem)
 *
 * Hash : SHA256-ARTICLE-EDITORIAL-CSS-HERO-COMPACT-20260226
 * ========================================================================
 */
