:root {
      --fond: #ffffff;
      --texte: #2b2132;
      --blanc: #ffffff;
      --border: rgba(43, 33, 50, 0.08);

      /* Couleurs pleines */
      --neutre-bordeaux: #713643;
      --neutre-bleu: #5c82b5;
      --neutre-vert: #c0c7ad;
      --adn-jaune: #f2e24d;

      /* Versions RGB pour les ombres transparentes */
      --bordeaux-rgb: 113, 54, 67;
      --bleu-rgb: 92, 130, 181;
      --vert-rgb: 192, 199, 173;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--fond);
      color: var(--texte);
      font-family: 'Manrope', sans-serif;
      display: flex;
      flex-direction: column;
    }

    .actualites-page {
      width: min(1200px, 100% - 48px);
      margin: clamp(20px, 4vh, 46px) auto clamp(70px, 10vh, 130px);
      flex: 1;
    }

    .news-search {
      margin-bottom: clamp(28px, 4vw, 42px);
      display: flex;
      justify-content: center;
    }

    .news-search input {
      width: min(680px, 100%);
      padding: 16px 20px;
      border-radius: 999px;
      border: 1px solid var(--border);
      font: inherit;
      color: var(--texte);
      background: var(--blanc);
      box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.04);
    }

    .news-search input::placeholder {
      color: rgba(43, 33, 50, 0.45);
    }
    /* H1 invisible pour le référencement */
    .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    }

    /* --- LA GRILLE ÉDITORIALE --- */
    .news-grid {
      display: block;
    }

    /* Zone d'expansion pour les articles du carrousel */
    .active-article-container {
      display: grid;
      grid-template-columns: 1fr;
    }
    
    .active-article-container:not(:empty) {
      margin-top: 32px;
    }

    .news-carousel-section {
      margin-top: clamp(32px, 4vw, 42px);
    }

    .news-carousel-header {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
      margin-bottom: 18px;
    }

    .news-carousel-title {
      margin: 0;
      font-size: clamp(22px, 2.2vw, 28px);
      font-family: 'Oswald', sans-serif;
      text-transform: uppercase;
      color: var(--texte);
    }

    .news-carousel-container {
      position: relative;
    }

    .news-carousel-track-wrapper {
      overflow-x: auto;
      overflow-y: hidden;
      width: 100%;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
    }

    .news-carousel-track {
      display: flex;
      gap: 24px;
      padding-bottom: 8px;
      scroll-snap-type: x mandatory;
    }

    .news-carousel-track .news-card {
      scroll-snap-align: start;
      min-width: min(340px, 100%);
      flex: 0 0 min(340px, 100%);
    }

    .news-carousel-header > div {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .carousel-control {
      position: relative;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: none;
      background: var(--blanc);
      color: var(--texte);
      box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0;
    }

    .carousel-control:hover {
      background: rgba(242, 226, 77, 0.15);
    }

    @media (max-width: 980px) {
      .news-carousel-track { gap: 18px; }
    }

    @media (max-width: 760px) {
      .news-search { margin-bottom: 24px; }
      .news-carousel-header { flex-direction: column; align-items: stretch; }
      .news-carousel-title { width: 100%; }
      .carousel-control { width: 38px; height: 38px; }
    }

    /* --- LA CARTE DE BASE --- */
    .news-card {
      background: var(--blanc);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      height: 100%;
      position: relative;
      transition: box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease;
    }

    .news-card[data-theme="bordeaux"]:hover { 
      box-shadow: 0 12px 30px rgba(var(--bordeaux-rgb), 0.3);
      transform: translateY(-4px);
    }
    .news-card[data-theme="bleu"]:hover { 
      box-shadow: 0 12px 30px rgba(var(--bleu-rgb), 0.3);
      transform: translateY(-4px);
    }
    .news-card[data-theme="vert"]:hover { 
      box-shadow: 0 12px 30px rgba(var(--vert-rgb), 0.4);
      transform: translateY(-4px);
    }

    /* --- STYLE DU COPYRIGHT --- */
    .photo-credit {
      display: block;
      font-size: 11px;
      color: var(--neutre-bleu);
      opacity: 0.6;
      margin-bottom: 8px;
      font-style: italic;
      transition: opacity 0.3s ease;
    }

    .news-card:hover .photo-credit {
      opacity: 1; 
    }

    .news-tag {
      display: inline-block;
      padding: 4px 10px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-radius: 4px;
      margin-bottom: 14px;
      color: var(--blanc);
    }

    .news-card[data-theme="bordeaux"] .news-tag { background: var(--neutre-bordeaux); }
    .news-card[data-theme="bleu"] .news-tag { background: var(--neutre-bleu); }
    .news-card[data-theme="vert"] .news-tag { background: var(--neutre-vert); color: #141414; }

    /* --- MÉDIAS ET CONTENUS --- */
    .news-media {
      margin: 0;
      overflow: hidden;
      aspect-ratio: 16 / 10;
      position: relative;
    }

    .news-media img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.6s ease;
    }

    .news-card:hover .news-media img {
      transform: scale(1.05);
    }

    .news-content {
      padding: 24px;
      display: flex;
      flex-direction: column;
      flex: 1;
      position: relative; 
    }

    /* --- LA CROIX JAUNE EN HAUT À DROITE --- */
    .btn-close-top {
      position: absolute;
      top: 16px;
      right: 16px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: none;
      background: rgba(0, 0, 0, 0.07);
      color: var(--texte);
      font-size: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease, background 0.2s ease;
      z-index: 10;
    }

    .btn-close-top:hover {
      background: rgba(43, 33, 50, 0.15);
    }

    .news-card.is-expanded .btn-close-top {
      opacity: 1;
      pointer-events: auto;
    }

    .news-meta {
      font-size: 13px;
      color: #646161;
      margin-bottom: 8px;
      font-weight: 600;
    }

    .news-title {
      margin: 0 0 12px;
      font-size: clamp(20px, 2vw, 24px);
      font-weight: 700;
      line-height: 1.2;
      color: var(--texte);
      font-family: 'Oswald', sans-serif;
      text-transform: uppercase;
    }

    .news-text {
      margin: 0;
      font-size: 15px;
      line-height: 1.6;
      color: #4a4a4a;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      line-clamp: 3;
      overflow: hidden;
      transition: opacity 0.3s ease;
    }

    /* --- SECTION DÉROULANTE (EXPANDED) --- */
    .news-expanded-wrapper {
      display: grid;
      grid-template-rows: 0fr;
      transition: grid-template-rows 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .news-expanded {
      overflow: hidden;
    }

    .news-expanded-inner {
      padding-top: 24px;
      margin-top: 24px;
      border-top: 1px dashed var(--border);
      font-size: 16px;
      line-height: 1.75;
      color: #2b2132;
      opacity: 0;
      transform: translateY(10px);
      transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    }

    .news-expanded-inner p { margin: 0 0 16px; }

    .btn-fermer {
      border: none;
      background: transparent;
      font-family: 'Manrope', sans-serif;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 13px;
      cursor: pointer;
      padding: 10px 0;
      margin-top: 10px;
      color: #646161;
      transition: color 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn-fermer:hover { color: var(--texte); }

    /* --- ÉTATS SPÉCIFIQUES & CORRECTION DE L'ANIMATION DE FERMETURE --- */

    /* "La Une" ET la carte téléportée se comportent pareil (évite l'image énorme à la fermeture) */
    .news-card.featured,
    .active-article-container .news-card {
      grid-column: 1 / -1; 
      flex-direction: row; 
    }

    .news-card.featured .news-media,
    .active-article-container .news-card .news-media {
      flex: 0 0 50%;
      aspect-ratio: auto;
    }

    .news-card.featured .news-content,
    .active-article-container .news-card .news-content {
      padding: clamp(32px, 4vw, 48px);
      justify-content: center;
    }

    .news-card.featured .news-title,
    .active-article-container .news-card .news-title {
      font-size: clamp(28px, 3.5vw, 42px);
      margin-bottom: 16px;
    }

    .news-card.featured .news-text,
    .active-article-container .news-card .news-text {
      font-size: 17px;
      -webkit-line-clamp: 4;
      line-clamp: 4;
      display: -webkit-box; /* S'assure que le résumé revient pendant la fermeture */
    }

    /* 2. L'état ouvert */
    .news-card.is-expanded {
      grid-column: 1 / -1; 
      flex-direction: row; 
      cursor: default;
      transform: translateY(0); 
      min-width: 100% !important;
      flex: 0 0 100% !important;
      max-width: 100% !important;
    }

    .news-card.is-expanded[data-theme="bordeaux"] { 
      border-color: var(--neutre-bordeaux);
      box-shadow: 0 24px 60px rgba(var(--bordeaux-rgb), 0.5); 
    }
    .news-card.is-expanded[data-theme="bleu"] { 
      border-color: var(--neutre-bleu);
      box-shadow: 0 24px 60px rgba(var(--bleu-rgb), 0.5); 
    }
    .news-card.is-expanded[data-theme="vert"] { 
      border-color: var(--neutre-vert);
      box-shadow: 0 24px 60px rgba(var(--vert-rgb), 0.5); 
    }

    .news-card.is-expanded .news-media {
      flex: 0 0 45%;
      min-width: 45%;
      aspect-ratio: auto;
    }

    .news-card.is-expanded .news-content {
      min-width: 0;
    }

    .news-card.is-expanded .news-text {
      display: none; 
    }

    .news-card.is-expanded .news-expanded-wrapper {
      grid-template-rows: 1fr;
    }

    .news-card.is-expanded .news-expanded-inner {
      opacity: 1;
      transform: translateY(0);
    }

    /* Classe spéciale de fondu juste avant le retour dans le carrousel */
    .news-card.is-fading-out {
      opacity: 0 !important;
      transition: opacity 0.2s ease !important;
    }

    /* --- SECTION MENTIONS MÉDIAS --- */
    .media-mentions-section {
      margin-top: clamp(48px, 6vw, 70px);
    }

    .media-mentions-list {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .media-mention-item {
      background: var(--blanc);
      border: 1px solid var(--border);
      border-radius: 8px;
      transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }

    .media-mention-item:hover {
      transform: translateX(6px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      border-color: var(--neutre-bleu);
    }

    .media-mention-link {
      text-decoration: none;
      color: inherit;
      padding: 16px 20px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }

    .media-mention-title {
      margin: 0 0 4px;
      font-size: 15px;
      font-weight: 700;
      color: var(--texte);
      line-height: 1.4;
    }

    .media-mention-host {
      font-size: 13px;
      color: var(--neutre-bleu);
      font-weight: 600;
      display: block;
    }

    .media-mention-date {
      font-size: 12px;
      color: #646161;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }

    /* --- RESPONSIVE MOBILE (La Une + Carte Active) --- */
    @media (max-width: 850px) {
      .news-grid { grid-template-columns: 1fr; }
      
      .news-card.featured, 
      .active-article-container .news-card,
      .news-card.is-expanded {
        flex-direction: column;
      }
      
      .news-card.featured .news-media,
      .active-article-container .news-card .news-media,
      .news-card.is-expanded .news-media {
        aspect-ratio: 16 / 10;
        flex: none;
      }
    }
