/* ============================================================
   ACTUALITÉS — vues par défaut (liste, carte, fiche en fenêtre)
   modules/news/news.css · codia-modules (paquet « news »)
   ============================================================
   Neutre : couleurs, polices et angles viennent des tokens du projet
   (var(--…, repli)). Un site qui a ses propres vues (news.project.js) a son
   style dans news.project.css ; ces règles ne visent que les classes news-*.
   Variables propres au module (facultatives, dans tokens.css) :
     --news-card-radius, --news-card-shadow, --news-grid-min, --news-tint
   ============================================================ */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--news-grid-min, 280px), 1fr));
  gap: 24px;
  margin-top: 24px;
}

.news-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-paper, transparent);
  color: var(--c-ink, inherit);
  border: 1px solid var(--c-line, currentColor);
  border-radius: var(--news-card-radius, var(--r-lg, 0));
  text-decoration: none;
  transition: transform .25s var(--ease, ease), box-shadow .25s var(--ease, ease);
}
.news-card:hover, .news-card:focus-visible { transform: translateY(-3px); box-shadow: var(--news-card-shadow, none); }
.news-card:focus-visible { outline: 2px solid var(--c-focus, currentColor); outline-offset: 2px; }

.news-card-visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--news-tint, var(--c-soft, transparent));
  overflow: hidden;
}
.news-card-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--c-highlight, var(--c-accent, currentColor));
  color: var(--c-paper, inherit);
  border-radius: var(--r-sm, 0);
}

.news-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.news-card-category { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent, inherit); }
.news-card-title { font-family: var(--f-display, inherit); font-size: 20px; line-height: 1.25; color: var(--c-primary, inherit); }
.news-card-excerpt { font-size: 14px; color: var(--c-ink, inherit); }
.news-card-meta { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--c-mute, inherit); }

[data-news-more] { display: flex; justify-content: center; margin-top: 28px; }
.news-more-count { opacity: .7; }
.news-end, .news-empty { font-style: italic; color: var(--c-mute, inherit); }
.news-error { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---------- fiche en fenêtre ---------- */
.news-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4vh var(--gutter, 20px);
  overflow-y: auto;
  background: var(--news-overlay-bg, var(--c-line, transparent));
  opacity: 0;
  transition: opacity .2s var(--ease, ease);
}
.news-overlay.is-open { opacity: 1; }
body.news-overlay-open { overflow: hidden; }

.news-dialog {
  position: relative;
  width: 100%;
  max-width: 820px;
  background: var(--c-paper, transparent);
  color: var(--c-ink, inherit);
  border-radius: var(--r-lg, 0);
  box-shadow: var(--news-card-shadow, none);
  outline: none;
}
.news-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--c-paper, transparent);
  color: var(--c-ink, inherit);
  cursor: pointer;
}
.news-dialog-close svg { width: 20px; height: 20px; }
.news-dialog-body { padding: 0 0 32px; }

.news-article-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg, 0) var(--r-lg, 0) 0 0; }
.news-article-head, .news-article-lede, .news-article-body, .news-article-gallery, .news-article--missing { padding: 0 clamp(18px, 5vw, 48px); }
.news-article-head { padding-top: 32px; }
.news-article-title { font-family: var(--f-display, inherit); font-size: clamp(26px, 4vw, 40px); line-height: 1.15; margin: 8px 0; color: var(--c-primary, inherit); }
.news-article-meta { font-size: 13px; color: var(--c-mute, inherit); }
.news-article-lede { font-size: 18px; font-weight: 600; margin: 20px 0; }
.news-article-body p, .news-article-body ul, .news-article-body ol, .news-article-body blockquote { margin: 0 0 14px; }
.news-article-body h2, .news-article-body h3 { font-family: var(--f-display, inherit); margin: 24px 0 10px; }
.news-article-body a { color: var(--c-accent, inherit); }
.news-article-body img { max-width: 100%; height: auto; }
.news-article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.news-article-gallery img { width: 100%; border-radius: var(--r-md, 0); display: block; }
.news-article--missing { padding-top: 40px; }

@media (max-width: 720px) {
  .news-grid { gap: 16px; }
  .news-overlay { padding: 0; }
  .news-dialog { min-height: 100%; border-radius: 0; }
}
