/* ==========================================================================
   HODD GLOBAL — Actualités : page liste + page article
   Branch feature/articles-lab · 2026-10-26
   ========================================================================== */

/* ---------- Variables locales -------------------------------------------- */
:root {
  --w-line:    rgba(255, 255, 255, 0.09);
  --w-line-2:  rgba(255, 255, 255, 0.14);
  --w-text:    #d5deee;
  --w-muted:   #93a2be;
  --art-wide:  1180px;
  --art-rail:  12rem;
  --art-body:  46rem;
}

/* ---------- Accessibilité ------------------------------------------------ */
.skip-news {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-news:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--orange);
  color: #1a0f02;
  font-weight: 700;
  border-radius: 10px;
}

/* ---------- Commun -------------------------------------------------------- */
.news-page-body .nav-links a.active,
.news-page-body .nav-links a[aria-current="page"] {
  color: var(--orange);
}

/* ---------- Fil d'Ariane ------------------------------------------------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--w-muted);
}
.crumbs li { display: flex; min-width: 0; max-width: 100%; }
.crumbs li + li::before {
  content: "›";
  margin-right: 0.5rem;
  opacity: 0.5;
}
.crumbs a {
  color: inherit;
  text-decoration: none;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] {
  color: var(--w-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(44ch, 100%);
}

/* ========================================================================== */
/*  PAGE ARTICLE                                                               */
/* ========================================================================== */

.news-page {
  width: min(var(--art-wide), 100% - 2.5rem);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 3vw, 2.5rem) 4rem;
}

/* — 404 ------------------------------------------------------------------- */
.news-404 {
  max-width: 50rem;
  margin-inline: auto;
  text-align: center;
  padding-block: 2rem 3rem;
}
.news-404 h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: #fff;
  margin: 0.6rem 0 1rem;
}

/* — En-tête article ------------------------------------------------------- */
.article-head {
  max-width: 60rem;
  padding-bottom: 0;
}
.article-rule {
  display: block;
  height: 3px;
  width: 3.5rem;
  border-radius: 2px;
  background: var(--orange);
  margin: 1.4rem 0 1rem;
}
.article-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #fff;
  margin: 0.9rem 0 1rem;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.article-chapo {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  line-height: 1.6;
  color: var(--w-muted);
  margin: 0 0 1.4rem;
  max-width: 50rem;
}
.article-sep {
  border: none;
  border-top: 1px solid var(--w-line);
  margin: 1.5rem 0 0;
}

/* — Image hero ------------------------------------------------------------ */
.article-hero {
  margin: 2rem 0 0;
}
.article-hero img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}
.article-hero figcaption {
  padding-top: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--w-muted);
}

/* — Layout deux colonnes -------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: var(--art-rail) minmax(0, var(--art-body));
  gap: 3.5rem;
  justify-content: start;
  align-items: start;
  margin-top: 2.5rem;
}

/* — Rail ------------------------------------------------------------------ */
.article-rail {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--w-muted);
}
.article-rail .by {
  font-weight: 700;
  color: #fff;
}
.article-rail time { color: var(--w-muted); }
.article-rail .updated {
  font-size: 0.75rem;
  color: var(--w-muted);
  font-style: italic;
}
.article-rail .rule {
  border: none;
  border-top: 1px solid var(--w-line);
  margin: 0.25rem 0;
}

/* Partage */
.share {
  display: grid;
  gap: 0.5rem;
}
.share-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.1rem;
}
.share a,
.share button {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.85rem;
  border: 1px solid var(--w-line);
  border-radius: 10px;
  background: var(--card);
  color: #fff;
  font: 600 0.8rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  width: 100%;
}
.share a:hover,
.share button:hover {
  border-color: var(--w-line-2);
  background: var(--card-2);
}
.copy-status {
  font-size: 0.75rem;
  color: var(--orange);
  min-height: 1.2em;
  display: block;
}

/* — Corps article --------------------------------------------------------- */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--w-text);
  overflow-wrap: break-word;
}
.article-body p   { margin: 0 0 1.25rem; }
.article-body h2  {
  clear: both;
  margin: 2.75rem 0 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--orange);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}
.article-body ul {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}
.article-body li  { margin-bottom: 0.4rem; }
.article-body li::marker { color: var(--orange); }
.article-body blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--w-line);
  border-left: 4px solid var(--orange);
  border-radius: 14px;
  background: var(--card);
  font-weight: 600;
}
.article-body blockquote p { margin: 0; color: #fff; }
.article-body a {
  color: var(--orange-2);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
.article-body strong { color: #fff; font-weight: 700; }

/* Lien « Visiter » */
.article-visit {
  margin: 1.75rem 0 0;
}

/* — CTA ------------------------------------------------------------------- */
.article-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.6rem 1.8rem;
  margin-top: 3.5rem;
  border: 1px solid var(--w-line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--card-2), var(--card));
}
.article-cta h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  color: #fff;
}
.article-cta p  { margin: 0; color: var(--w-muted); }

/* — Paginateur ------------------------------------------------------------ */
.article-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.article-pager a {
  display: block;
  min-height: 44px;
  padding: 1rem 1.2rem;
  border: 1px solid var(--w-line);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  line-height: 1.35;
  transition: border-color 0.18s;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-pager a:hover  { border-color: var(--orange); }
.article-pager a small  {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.article-pager a.next  { text-align: right; }
.article-all {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
}
.article-all a {
  color: var(--w-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.article-all a:hover { color: #fff; }

/* ========================================================================== */
/*  PAGE LISTE ACTUALITÉS                                                      */
/* ========================================================================== */

.news-header {
  padding-block: clamp(2rem, 5vw, 3.5rem) 0;
  text-align: center;
}
.news-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  margin: 0.5rem 0 0.75rem;
}
.news-header p {
  color: var(--w-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 46ch;
  margin-inline: auto;
}

/* Article à la une */
.news-featured {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2rem;
  border: 1px solid var(--w-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  text-decoration: none;
  color: #fff;
  transition: border-color 0.2s, transform 0.2s;
  margin-block: clamp(1.5rem, 3vw, 2.5rem);
}
.news-featured:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
}
.news-featured--noimg {
  grid-template-columns: 1fr;
}
.fmedia {
  overflow: hidden;
  min-height: 280px;
}
.fmedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fbody {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 2rem 2rem 0;
}
.news-featured--noimg .fbody {
  padding: 2rem;
}
.fbody h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); color: #fff; line-height: 1.15; }
.fexcerpt { color: var(--w-muted); font-size: 0.97rem; line-height: 1.65; }

/* Grille de cartes */
.news-grid2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Carte */
.ncard {
  border: 1px solid var(--w-line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.ncard:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
}
.ncard--noimg .ncard-body { padding-top: 1.25rem; }
.ncard-media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.ncard-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem 1rem;
  flex: 1;
}
.ncard-body h3 { font-size: 0.97rem; color: #fff; line-height: 1.35; }
.ncard-excerpt { font-size: 0.875rem; color: var(--w-muted); line-height: 1.6; }
.ncard-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--w-muted);
  margin-top: auto;
  padding-top: 0.5rem;
}
.nread { color: var(--orange); font-weight: 600; font-size: 0.8rem; }

/* Méta date + badge */
.nmeta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--w-muted);
  flex-wrap: wrap;
}

/* Lien article */
.nlink { text-decoration: none; color: inherit; }
.nlink:hover { color: var(--orange); }

/* Badge Nouveau */
.badge-new {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--orange);
  color: #1a0f02;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}
/* JS masque tous les badges puis les révèle article par article */
.js .badge-new                      { visibility: hidden; }
.js [data-new="1"] .badge-new       { visibility: visible; }
/* Badge dans la nav (indicateur global) */
.nav-news .nav-badge {
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-left: 4px;
  vertical-align: middle;
}

/* ========================================================================== */
/*  RESPONSIVE                                                                  */
/* ========================================================================== */

@media (max-width: 900px) {
  /* Article */
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .article-rail {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--w-line);
  }
  .share {
    grid-column: 1 / -1;
  }
  .article-pager {
    grid-template-columns: 1fr;
  }
  .article-pager a.next { text-align: left; }

  /* Liste */
  .news-featured {
    grid-template-columns: 1fr;
  }
  .fmedia {
    min-height: 200px;
    max-height: 260px;
  }
  .fbody {
    padding: 1.25rem;
  }
  .news-grid2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .article-cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .news-grid2 {
    grid-template-columns: 1fr;
  }
  .article-title { font-size: clamp(1.75rem, 8vw, 2.4rem); }
}

/* ========================================================================== */
/*  NOUVELLES CARTES (news-card.php / news-card-featured.php)                  */
/* ========================================================================== */

/* Tags */
.news-tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  list-style: none; margin: 0; padding: 0;
}
.news-tags li {
  padding: .2rem .65rem;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: var(--card-2, #0e1d3c);
  font-size: .7rem; font-weight: 600; color: #cfd9ee;
}

/* Méta auteur/date/lecture */
.news-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .35rem .8rem; font-size: .8rem; color: var(--w-muted);
}
.news-meta .av {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2, #0e1d3c);
  border: 1px solid var(--w-line);
  color: var(--orange-2, #ff9e4d);
  font-weight: 800; font-size: .72rem; flex-shrink: 0;
}
.news-meta .news-author { color: #fff; font-weight: 600; }
.news-meta .sep::before { content: "·"; margin-right: .5rem; opacity: .5; }

/* Carte standard */
.news-card {
  border: 1px solid var(--w-line); border-radius: 16px;
  overflow: hidden; background: var(--card);
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s;
}
.news-card:hover { border-color: var(--orange); transform: translateY(-3px); }
.news-card__img-wrap { display: block; overflow: hidden; aspect-ratio: 16/9; }
.news-card__img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s;
}
.news-card:hover .news-card__img-wrap img { transform: scale(1.04); }
.news-img--placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--card-2, #0e1d3c), var(--card, #0b1730));
}
.news-body {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .9rem 1rem 1.1rem; flex: 1;
}
.news-body h3 { font-size: .95rem; color: #fff; line-height: 1.35; margin: 0; }
.news-body h3 a { color: inherit; text-decoration: none; }
.news-body h3 a:hover { color: var(--orange); }
.news-excerpt { font-size: .85rem; color: var(--w-muted); line-height: 1.6; margin: 0; }
.news-meta { margin-top: auto; padding-top: .5rem; }

/* NEWSLINK-1 : toute la carte est cliquable — l'overlay couvre la carte ;
   titre + bouton gardent le dessus (z-index 2) pour le clavier et le survol. */
.news-card, .news-featured { position: relative; }
.news-stretch { position: absolute; inset: 0; z-index: 1; }
.news-stretch:focus { outline: none; } /* decorative, jamais au clavier (tabindex="-1") */
.news-card h3 a, .news-featured h2 a, .news-featured .btn { position: relative; z-index: 2; }

/* Carte à la une */
.news-featured {
  display: grid; grid-template-columns: 5fr 4fr;
  gap: 0; border: 1px solid var(--w-line);
  border-radius: 18px; overflow: hidden; background: var(--card);
  transition: border-color .2s;
  margin-block: clamp(1.25rem, 3vw, 2rem);
}
.news-featured:hover { border-color: var(--orange); }
.news-featured__img-wrap { display: block; overflow: hidden; min-height: 260px; }
.news-featured__img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s;
}
.news-featured:hover .news-featured__img-wrap img { transform: scale(1.03); }
.news-featured__body {
  display: flex; flex-direction: column; gap: .8rem;
  padding: 2rem; justify-content: center;
}
.news-featured__body .btn-primary {
  box-shadow: 0 6px 16px -6px rgba(245,130,32,.35);
  align-self: flex-start;
}
.news-featured__body h2 { font-size: clamp(1.2rem, 2vw, 1.7rem); color: #fff; line-height: 1.2; margin: 0; }
.news-featured__body h2 a { color: inherit; text-decoration: none; }
.news-featured__body h2 a:hover { color: var(--orange); }
.news-featured__lead { font-size: .92rem; color: var(--w-muted); line-height: 1.65; margin: 0; }

/* Pagination */
.news-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 2rem 1rem; flex-wrap: wrap;
}
.news-pager__info { font-size: .85rem; color: var(--w-muted); }

/* Bouton "Voir plus" accueil */
.news-more { text-align: center; padding-top: 1.5rem; }

/* Label section */
.news-section-label { margin: 2rem 0 1rem; }

/* Responsive nouvelles cartes */
@media (max-width: 900px) {
  .news-featured { grid-template-columns: 1fr; }
  .news-featured__img-wrap { min-height: 200px; max-height: 240px; }
}
@media (max-width: 600px) {
  .news-pager { flex-direction: column; align-items: center; }
}
