/* ==========================================================================
   Actualités — revue mensuelle des assistantes maternelles (pages/assistant/news.php, includes/news.php)
   Mise en page « revue administrative » : bandeau titre avec vagues dessinées (illusArt('revue')), planche blanche
   à trois colonnes (sommaire, essentiel du mois, à retenir et échéances), cartes d'articles, montants et check-list.
   Couleurs : uniquement les variables de la palette (assets/css/palettes.css) et le blanc ; aucun dégradé, aucune animation.
   ========================================================================== */

/* ---------- Bandeau de la revue ---------- */
.news-masthead {
  position: relative; overflow: hidden; margin: 4px 0 20px; padding: 22px 26px 24px;
  background: #FFFFFF; border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.news-masthead > .ill-revue { position: absolute; top: 0; right: 0; width: min(62%, 640px); height: auto; pointer-events: none; }
.news-top.ui-page-head {
  position: relative; z-index: 1; margin: 0;
  display: grid; align-items: center; gap: 6px 16px;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "ico kick tag act" "title title title title" "lead lead lead lead";
}
.news-top > .ill-sticker { grid-area: ico; --s: 52px; }
.news-top .ui-page-head-text { display: contents; }
.news-top .ui-page-head-kicker { grid-area: kick; display: grid; gap: 2px; margin: 0; padding-right: 20px; border-right: 1px solid var(--line-strong); }
.news-brand-name { font-size: 1.375rem; font-weight: 900; color: var(--ink-800); line-height: 1.1; letter-spacing: -.01em; }
.news-brand-sub { font-size: .75rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--ok-700); }
.news-tagline { grid-area: tag; margin: 0; max-width: 38ch; font-size: .875rem; font-style: italic; color: var(--ink-500); line-height: 1.4; }
.news-top h1 { grid-area: title; margin: 18px 0 2px; font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.625rem); font-weight: 900; letter-spacing: -.02em; color: var(--ink-800); }
.news-month { text-decoration: underline; text-decoration-color: var(--warm-400); text-decoration-thickness: .1em; text-underline-offset: .22em; text-decoration-skip-ink: none; }
.news-top .page-description { grid-area: lead; margin: 0; max-width: none; font-size: 1rem; color: var(--ink-600); }
.news-top .ui-page-head-actions { grid-area: act; margin: 0; align-self: start; }

/* Menu « Archives mensuelles » */
.news-archives-menu { position: relative; }
.news-archives-menu > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; cursor: pointer; list-style: none;
  background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--ui-shadow-xs);
  font-size: .875rem; font-weight: 800; line-height: 1.15; color: var(--ink-700);
}
.news-archives-menu > summary::-webkit-details-marker { display: none; }
.news-archives-menu > summary > .fa-calendar { font-size: 1.375rem; color: var(--ok-600); }
.news-archives-menu > summary:hover { border-color: var(--ok-300); }
.news-archives-caret { font-size: .75rem; color: var(--muted); }
.news-archives-menu[open] .news-archives-caret { transform: rotate(180deg); }
.news-archives-menu ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; margin: 0; padding: 6px; list-style: none;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-2);
}
.news-archives-menu li a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-700); font-weight: 700; text-decoration: none; }
.news-archives-menu li a:hover { background: var(--ok-50); }
.news-archives-menu li a[aria-current] { color: var(--ok-700); font-weight: 900; background: var(--ok-50); }
.news-archives-menu li:last-child { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }

.news-older { margin: -6px 0 16px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--warm-50); color: var(--ink-700); font-size: .9rem; }

/* ---------- Planche du numéro ---------- */
.news-board { background: #FFFFFF; border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 24px; margin-bottom: 24px; }
.news-grid {
  display: grid; gap: 24px; align-items: start;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(240px, 280px);
  grid-template-areas:
    "sum center side"
    "actus actus all"
    "amounts amounts todo"
    "rappels rappels todo";
}
.news-summary { grid-area: sum; }
/* Une seule colonne qui ne s'élargit jamais au-delà de sa place : un tableau large (détail des contrats à corriger, ouvert d'office)
   défile dans son cadre au lieu de pousser tout le numéro hors de l'écran sur téléphone. */
.news-center { grid-area: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.news-side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.news-month-list { grid-area: actus; min-width: 0; }
.news-all-side { grid-area: all; margin-top: 44px; }
.news-amounts { grid-area: amounts; }
.news-todo-panel { grid-area: todo; }
.news-rappels { grid-area: rappels; min-width: 0; }

.news-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.3125rem; font-weight: 900; color: var(--ink-800); }
.news-h2 .ill-rays { flex: none; margin-top: -14px; }
.news-h2-ico { color: var(--ok-600); font-size: 1.125rem; }
.news-h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.0625rem; font-weight: 900; color: var(--ink-800); }
.news-h3 .ill-rays { margin-top: -12px; margin-left: auto; }
.news-h3-ico { color: var(--ok-600); }

/* Sommaire */
.news-summary { padding-right: 22px; border-right: 1px solid var(--line); align-self: stretch; }
.news-summary-list { margin: 0; padding: 0; list-style: none; }
.news-summary-list li + li { border-top: 1px solid var(--line); }
.news-summary-list a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; color: var(--ink-700); font-weight: 700; font-size: .9375rem; line-height: 1.25; text-decoration: none; }
.news-summary-list a:hover { color: var(--ok-700); }
.news-summary-list .fa-chevron-right { margin-left: auto; font-size: .75rem; color: var(--muted); }
.news-num { flex: none; display: inline-grid; place-items: center; width: 34px; height: 28px; border-radius: var(--r-xs); background: var(--warm-50); color: var(--warm-700); font-size: .8125rem; font-weight: 900; }

/* L'essentiel en un coup d'œil */
.news-essential .news-h2 { margin-bottom: 12px; }
.news-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 6px; border-radius: var(--r-md); background: var(--ok-50); border: 1px solid var(--ok-100); }
.news-kpi { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 2px 8px; text-align: center; min-width: 0; }
.news-kpi + .news-kpi { border-left: 1px solid var(--ok-100); }
.news-kpi-ico { font-size: 1.375rem; line-height: 1; }
.news-kpi-ico.is-warm { color: var(--warm-500); }
.news-kpi-ico.is-ok { color: var(--ok-600); }
.news-kpi-value { font-size: 1.4375rem; font-weight: 900; color: var(--ink-800); line-height: 1.15; white-space: nowrap; }
.news-kpi-label { font-size: .78125rem; font-weight: 600; color: var(--ink-500); line-height: 1.3; }

/* Conformité des contrats */
.news-check { padding: 12px 16px; border-radius: var(--r-md); background: var(--ok-50); border: 1px solid var(--ok-100); }
.news-check.is-warn { background: var(--warm-50); border-color: var(--warm-100); }
.news-check-row { display: flex; align-items: center; gap: 14px; }
.news-check-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: #FFFFFF; color: var(--ok-600); font-size: 1.25rem; }
.news-check.is-warn .news-check-ico { color: var(--warm-600); }
.news-check-text { display: grid; gap: 2px; margin: 0; font-size: .875rem; color: var(--ink-600); line-height: 1.4; }
.news-check-text > strong { font-size: 1rem; font-weight: 900; color: var(--ink-800); }
.news-check details { margin-top: 8px; }
.news-check summary { display: inline-flex; align-items: center; min-height: 32px; margin-left: 54px; cursor: pointer; list-style: none; font-size: .875rem; font-weight: 800; color: var(--brand-600); }
.news-check summary::-webkit-details-marker { display: none; }
.news-check details[open] summary .fa-chevron-down { transform: rotate(180deg); }
.news-check .table-responsive { margin-top: 8px; padding: 4px 10px; border-radius: var(--r-sm); background: #FFFFFF; }

/* Focus du mois */
.news-focus { position: relative; padding: 0 16px 14px; border-radius: var(--r-md); background: var(--warm-50); border: 1px solid var(--warm-100); }
.news-focus-tag { display: inline-flex; align-items: center; gap: 8px; margin: -1px 0 8px -17px; padding: 6px 16px 6px 14px; border-radius: var(--r-md) 0 var(--r-md) 0; background: var(--warm-100); color: var(--warm-700); font-size: .9375rem; font-weight: 900; }
.news-focus-tag .fa-bookmark { color: var(--warm-500); }
.news-focus-body { display: flex; align-items: center; gap: 14px; }
.news-focus-body > div { flex: 1; min-width: 0; padding-left: 4px; }
.news-focus-title { margin: 0 0 2px; font-size: 1.0625rem; font-weight: 900; color: var(--ink-800); }
.news-focus-text { margin: 0; font-size: .875rem; color: var(--ink-600); line-height: 1.45; }
.news-focus .news-go { background: #FFFFFF; color: var(--warm-700); }

/* À retenir, échéances */
.news-retain { padding: 16px; border-radius: var(--r-md); background: var(--ok-50); border: 1px solid var(--ok-100); }
.news-retain-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.news-retain-list li { display: flex; gap: 10px; font-size: .875rem; line-height: 1.4; color: var(--ink-600); }
.news-retain-list .fa-check { flex: none; margin-top: 3px; color: var(--ok-600); }
.news-retain-list strong { color: var(--ink-800); }
.news-dates { padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); }
.news-dates-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.news-dates-list li { display: flex; align-items: center; gap: 10px; font-size: .84375rem; line-height: 1.35; color: var(--ink-700); }
.news-date { flex: none; min-width: 62px; padding: 4px 8px; border-radius: var(--r-xs); background: var(--warm-50); color: var(--warm-700); font-size: .8125rem; font-weight: 900; text-align: center; }

/* Cartes d'articles */
.news-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.news-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #FFFFFF; box-shadow: var(--ui-shadow-xs); min-width: 0; }
.news-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.news-aud { padding: 3px 10px; border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-700); font-size: .75rem; font-weight: 800; }
.news-pill { align-self: flex-start; padding: 3px 10px; border-radius: var(--r-pill); background: var(--ok-50); color: var(--ok-700); font-size: .75rem; font-weight: 800; }
.news-card-body { flex: 1; }
.news-card-title { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 900; line-height: 1.25; color: var(--ink-800); }
.news-card-excerpt { margin: 0; font-size: .84375rem; line-height: 1.45; color: var(--ink-600); }
.news-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.news-card-date { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--ink-500); }
.news-go {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ok-100); color: var(--ok-700); text-decoration: none; transition: background var(--t-fast) var(--ease);
}
.news-go::before { content: ""; position: absolute; inset: -5px; }
.news-go:hover, .news-go:focus-visible { background: var(--ok-200); color: var(--ok-700); }
.news-cards.is-compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.news-card.is-compact { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.news-card.is-compact .news-card-title { margin: 0; font-size: .9375rem; }
.news-card.is-compact .news-card-foot { padding: 0; }
.news-card-meta { margin: 2px 0 0; font-size: .78125rem; font-weight: 700; color: var(--muted); }
.news-ico { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--brand-50); color: var(--brand-600); font-size: 1rem; }
.news-ico.is-ok { background: var(--ok-50); color: var(--ok-600); }
.news-ico.is-warm { background: var(--warm-50); color: var(--warm-600); }
.news-ico.is-rose { background: var(--bad-50); color: var(--bad-600); }
.news-ico.is-lg { width: 48px; height: 48px; font-size: 1.25rem; }

/* Toutes les actualités */
.news-all { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: var(--r-md); background: var(--ok-50); border: 1px solid var(--ok-100); color: var(--ink-700); text-decoration: none; }
.news-all:hover { border-color: var(--ok-300); color: var(--ink-700); }
.news-all-text { display: grid; gap: 4px; flex: 1; font-size: .84375rem; line-height: 1.4; }
.news-all strong { font-size: 1.0625rem; font-weight: 900; color: var(--ink-800); }
.news-go-static { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF; color: var(--ok-700); }

/* Montants en vigueur, check-list */
.news-amounts { padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--line); }
.news-amounts .news-h2 { margin-bottom: 4px; }
.news-amounts-lead { margin: 0 0 12px; font-size: .84375rem; color: var(--ink-500); }
.news-amounts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; margin: 0; }
.news-amounts-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.news-amounts-list dt { font-size: .875rem; font-weight: 600; color: var(--ink-600); }
.news-amounts-list dd { margin: 0; font-weight: 900; color: var(--ink-800); white-space: nowrap; }
.news-todo-panel { padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); }
.news-todo { display: grid; gap: 8px; margin: 0; padding-left: 1.2rem; font-size: .875rem; line-height: 1.45; color: var(--ink-600); }
.news-todo li::marker { color: var(--warm-600); font-weight: 900; }

/* Pied : références et sources */
.news-foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.news-foot summary { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; list-style: none; font-size: .875rem; color: var(--ink-600); }
.news-foot summary::-webkit-details-marker { display: none; }
.news-foot summary > .fa-circle-info { color: var(--ink-500); }
.news-foot-caret { margin-left: auto; font-size: .75rem; color: var(--muted); }
.news-foot details[open] .news-foot-caret { transform: rotate(180deg); }
.news-sources { display: grid; gap: 4px; margin: 0; padding-left: 1.1rem; font-size: .875rem; }

/* ---------- Article ---------- */
.news-crumb { margin: 0 0 16px; font-size: .9375rem; font-weight: 800; }
.news-crumb a { text-decoration: none; }
.news-article-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); align-items: start; }
.news-article-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.news-article-title { margin: 0 0 6px; font-size: clamp(1.375rem, 1.2rem + .8vw, 1.875rem); font-weight: 900; line-height: 1.2; color: var(--ink-800); }
.news-article-kicker { margin: 0 0 16px; font-size: .9375rem; font-weight: 700; color: var(--ink-500); }
.news-points { display: grid; gap: 10px; margin: 0; padding-left: 1.2rem; font-size: 1rem; line-height: 1.6; color: var(--ink-700); max-width: 75ch; }
.news-points li::marker { color: var(--ok-600); }
.news-points a { text-decoration: underline; text-underline-offset: .15em; }
.news-article-side { display: grid; gap: 16px; }
.news-article-side .news-panel { padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); }
.news-also { display: grid; margin: 0; padding: 0; list-style: none; }
.news-also li + li { border-top: 1px solid var(--line); }
.news-also a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 0; font-size: .875rem; font-weight: 700; line-height: 1.3; color: var(--ink-700); text-decoration: none; }
.news-also a:hover { color: var(--ok-700); }
.news-also .news-ico { width: 32px; height: 32px; font-size: .8125rem; }
.news-also .fa-chevron-right { margin-left: auto; font-size: .75rem; color: var(--muted); }

/* ---------- Toutes les actualités ---------- */
.news-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.news-section-head .news-h2 { margin: 0; }
.news-archive-meta { margin: 4px 0 14px; font-size: .875rem; color: var(--ink-500); }

/* ---------- Écrans moyens : deux colonnes ---------- */
@media (max-width: 1279.98px) {
  .news-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "center center"
      "sum side"
      "actus actus"
      "all all"
      "amounts amounts"
      "todo todo"
      "rappels rappels";
  }
  .news-all-side { margin-top: 0; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 767.98px) {
  .news-masthead { padding: 16px 16px 18px; margin-bottom: 16px; }
  .news-masthead > .ill-revue { width: 90%; }
  .news-top.ui-page-head { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico kick" "act act" "title title" "lead lead"; }
  .news-top > .ill-sticker { --s: 44px; }
  .news-top .ui-page-head-kicker { border-right: 0; padding-right: 0; }
  .news-brand-name { font-size: 1.125rem; }
  .news-tagline { display: none; }
  .news-top h1 { margin-top: 8px; }
  .news-top .ui-page-head-actions { width: auto; justify-self: start; }
  .news-archives-menu ul { left: 0; right: auto; }
  .news-board { padding: 16px; border-radius: var(--r-md); }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; grid-template-areas: "center" "side" "actus" "all" "sum" "amounts" "todo" "rappels"; }
  .news-summary { padding-right: 0; border-right: 0; }
  .news-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .news-kpi:nth-child(3) { border-left: 0; }
  .news-check summary { margin-left: 0; }
  /* Détail par contrat : une fiche par contrat au lieu d'un tableau à faire défiler, le montant à relever reste sous les yeux */
  .news-check-table thead { display: none; }
  .news-check-table > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .news-check-table > tbody > tr:last-child { border-bottom: 0; }
  .news-check-table > tbody > tr > td { display: block; padding: 0; border: 0; }
  .news-check-table > tbody > tr > td.text-end { text-align: left !important; }
  .news-check-table > tbody > tr > td:first-child, .news-check-table > tbody > tr > td:last-child { grid-column: 1 / -1; }
  .news-check-table > tbody > tr > td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 800; color: var(--ink-500); }
  .news-article-layout { grid-template-columns: minmax(0, 1fr); }
  .news-cards.is-compact { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .news-go { transition: none; } }
