/* =========================================
   LISTE + BLOC A (colonne gauche + panneau)
   ========================================= */

/* Variables */
:root {
    --news-row-h: 68px;
    /* hauteur approx d'une ligne de liste */
    --radius: 12px;
    --border: #e5e7eb;
    --bg: #fff;
    --text: #111827;
    --muted: #6b7280;
}

/* Réduction d’animations si demandée par l’utilisateur */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* === Layout principal : marges 10%, liste 30%, bloc A 60%, bloc B dessous === */
.actu-layout {
    width: 100%;
    display: grid;
    grid-template-columns: 45% 55%;
    grid-template-areas:
        "liste bloc-a"
        "bloc-b bloc-b";
    column-gap: 2rem;
    row-gap: 1.25rem;
    align-items: start;
}

.liste-actus {
    grid-area: liste;
    margin: 0 5%;
}

.bloc-a {
    grid-area: bloc-a;
    margin: 0 5%;
}

.bloc-b {
    grid-area: bloc-b;
}

/* Empilement sur mobile */
@media (max-width: 768px) {
    .actu-layout {
        margin-left: 5%;
        margin-right: 5%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "liste"
            "bloc-a"
            "bloc-b";
        column-gap: 0;
    }
}

/* === Bloc A (panneau de lecture) === */
.bloc-a {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 220px;
    height: 100%;
}

/* === En-tête de la liste (titre + filtre) === */
.liste-actus {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.liste-actus__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.liste-actus__header h2 {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.liste-actus__controls {
    position: relative;
    flex-shrink: 0;
}

.liste-actus__controls select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: .9rem;
    color: #1f2937;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 34px 8px 12px;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.liste-actus__controls select:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.liste-actus__controls select:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.liste-actus__controls::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: .9rem;
    color: #6b7280;
}

/* === Liste scrollable === */
.liste-actus__items {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-height: calc(var(--news-row-h) * 4);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        /* dégradé bas collé au conteneur (compatible) */
        linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96)) bottom/100% 22px no-repeat,
        var(--bg);
    background-attachment: local;

    scrollbar-width: auto;
    scrollbar-color: #6b7280 #f1f5f9;
}

/* Scrollbar WebKit */
.liste-actus__items::-webkit-scrollbar {
    width: 12px;
}

.liste-actus__items::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--border);
}

.liste-actus__items::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #9ca3af, #6b7280);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

/* === Items (Catégorie | Titre | Date) === */
.item {
    border-top: 1px solid #f2f3f5;
}

.item:first-child {
    border-top: 0;
}

.item__link {
    min-block-size: var(--news-row-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    text-decoration: none;
    color: inherit;
}

.item__link:hover {
    background: #f8fafc;
}

.item.is-active .item__link {
    background: #eef6ff;
}

.item.is-active .item__title {
    font-weight: 700;
}

.item__title {
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item__time {
    font-size: .92rem;
    opacity: .75;
    white-space: nowrap;
}

.item__link:focus-visible {
    outline: 2px solid #4c9ffe;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Badge de catégorie */
.item__link::before {
    content: attr(data-category);
    font: 600 .78rem/1 "Montserrat", system-ui, sans-serif;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.item__link[data-category="Ouverture vacances"]::before {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.item__link[data-category="Fermeture exceptionnelle"]::before {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.item__link[data-category="Stage Vacances"]::before {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.item__link[data-category="Information"]::before {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.item__link[data-category="Autre"]::before {
    background: #f3f4f6;
    color: var(--text);
    border-color: var(--border);
}

/* === Contenu (Bloc A) === */
.news-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    color: var(--muted);
}

.news-date {
    font-variant-numeric: tabular-nums;
}

.news-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font: 600 .8rem/1 "Montserrat", system-ui, sans-serif;
}

.news-badge[data-cat="Ouverture vacances"] {
    background: #ecfdf5;
    color: #065f46;
}

.news-badge[data-cat="Fermeture exceptionnel"] {
    background: #fef2f2;
    color: #991b1b;
}

.news-badge[data-cat="Stage Vacances"] {
    background: #eff6ff;
    color: #1e40af;
}

.news-badge[data-cat="Information"] {
    background: #f5f3ff;
    color: #5b21b6;
}

.news-badge[data-cat="Autre"] {
    background: #f3f4f6;
    color: var(--text);
}

.news-title {
    margin: 6px 0 6px;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(1.05rem, 0.8rem + .6vw, 1.4rem);
}

.news-paragraphs p {
    margin: 0 0 10px;
    font-family: "Open Sans", sans-serif;
    line-height: 1.55;
}

/* === Responsive micro (petits écrans) === */
@media (max-width: 480px) {
    .liste-actus__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .liste-actus__controls select {
        width: 100%;
        font-size: .85rem;
    }

    .item__link {
        gap: 10px;
        padding: 0 10px;
        min-block-size: 60px;
    }

    .item__title {
        font-size: .95rem;
    }

    .item__time {
        font-size: .85rem;
    }

    .item__link::before {
        font-size: .7rem;
        padding: 5px 8px;
    }
}