/* ------------------------------- Accueil ------------------------------- */

/* Rotation « À la une » : coquille fixe (.featured-frame) portant le look
   « carte » (bordure, fond, libellé) ; seul le contenu des diapos glisse
   de droite à gauche à l'intérieur (featured-rotation.js). */
.featured-frame {
    padding: 1.4rem 1.6rem;
    border: 1px solid var(--section-border, var(--border-soft));
    border-left: 4px solid var(--section-accent, var(--color-primary));
    border-radius: 10px;
    background: var(--section-faint, var(--surface-subtle));
    box-shadow: 0 4px 14px rgba(45, 111, 159, .08);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--section-accent, var(--color-primary)) 8%, transparent);
}

.featured-frame:focus-within {
    border-color: var(--section-accent, var(--color-primary));
}

/* Les diapos deviennent des blocs nus : la carte est portée par le cadre.
   Sans JavaScript : seul le premier article épinglé est affiché (statique). */
.featured-rotator > .article-featured {
    display: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.featured-rotator > .article-featured:first-child {
    display: block;
}

/* Avec JavaScript : diapos empilées (hauteur = la plus haute),
   l'entrante arrive par la droite, la sortante part à gauche. */
.featured-rotator.is-animated {
    display: grid;
    overflow: hidden;
}

.featured-rotator.is-animated > .article-featured {
    display: block;
    grid-area: 1 / 1;
    transform: translateX(105%);
    opacity: 0;
    visibility: hidden;
    transition: transform .7s ease, opacity .7s ease, visibility 0s linear .7s;
}

.featured-rotator.is-animated > .article-featured.is-active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform .7s ease, opacity .7s ease, visibility 0s;
}

.featured-rotator.is-animated > .article-featured.is-exit {
    transform: translateX(-105%);
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .featured-rotator.is-animated > .article-featured {
        transition: none;
    }
}

/* ---------------------- Modale « L'éditorial » ---------------------- */

.editorial-modal {
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    width: min(760px, calc(100vw - 2rem));
    max-height: 86vh;
    color: var(--ink);
}

.editorial-modal::backdrop {
    background: rgba(15, 25, 45, .55);
}

/* Identité « éditorial » : accent vert et fond surligné, distincts du reste. */
.editorial-modal-card {
    max-height: 86vh;
    overflow-y: auto;
    padding: 2rem 2.2rem;
    border: 1px solid var(--border-soft);
    border-top: 4px solid var(--color-success);
    border-radius: 12px;
    background: var(--surface-highlight);
    box-shadow: 0 18px 50px rgba(15, 25, 45, .35);
}

.editorial-modal-header {
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.editorial-modal-header h2 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.25;
    color: var(--text-title);
}

.editorial-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
}

.editorial-modal-actions form {
    margin: 0;
}

.editorial-modal[open] {
    animation: editorial-modal-in .25s ease;
}

@keyframes editorial-modal-in {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {
    .editorial-modal-card {
        padding: 1.2rem 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .editorial-modal[open] {
        animation: none;
    }
}

/* Flèche décorative en fin d'extrait, dessinée en CSS (tige ::before,
   pointe ::after) : la tige s'allonge de gauche à droite au survol ou au
   focus clavier de la carte, la pointe la suit, retour à la sortie.
   L'animation n'est active qu'avec JavaScript (is-animated, arrow-animation.js). */
.article-card .arrow {
    display: inline-block;
    position: relative;
    width: 1.9rem;
    height: .8rem;
    vertical-align: middle;
    color: var(--section-accent, var(--color-primary));
}

.article-card .arrow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1rem;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transform: translateY(-50%);
    transition: width .25s ease;
}

.article-card .arrow::after {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    border: .34rem solid transparent;
    border-left-color: currentColor;
    transform: translateY(-50%);
    transition: left .25s ease;
}

.article-card:hover .arrow.is-animated::before,
.article-card:focus-within .arrow.is-animated::before {
    width: 1.5rem;
}

.article-card:hover .arrow.is-animated::after,
.article-card:focus-within .arrow.is-animated::after {
    left: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .article-card .arrow::before,
    .article-card .arrow::after {
        transition: none;
    }
}

/* À l'impression : toutes les diapos sont dépliées dans le flux,
   chacune avec son propre encadré (le cadre fixe s'efface). */
@media print {
    .featured-frame {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .featured-rotator,
    .featured-rotator.is-animated {
        display: block;
        overflow: visible;
    }

    .featured-rotator.is-animated > .article-featured {
        display: block;
        transform: none;
        opacity: 1;
        visibility: visible;
    }

    .featured-rotator > .article-featured {
        margin-bottom: 1rem;
        padding: .6rem;
        border: 1px solid #bbb;
        background: #fff;
    }
}
