/* ──────────────────────────────────────────────────────────────
   Page Actualités CRPE (/blog) — contenu entre la nav et le footer.
   Charte verte Ludilon. Classes préfixées .news-* : la page n'utilise
   plus .blog-card / .blog-grid, qui restent réservées à la home.
   ────────────────────────────────────────────────────────────── */

.news-hero,
.news-section {
  --nc-green: #006149;
  --nc-green-dark: #004b38;
  --nc-mint: #CAF0C7;
  --nc-mint-strong: #A4E9B9;
  --nc-mint-soft: #EAF8E7;
  --nc-yellow: #FAEDC7;
  --nc-ink: #16352B;
  --nc-body: #5A6B64;
  --nc-line: #DCE3E0;
  font-family: 'Quicksand', sans-serif;
}

/* ── HERO ── */
.news-hero {
  padding: 56px 24px 40px;
  text-align: center;
  background: var(--white);
}
.news-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.12; letter-spacing: -0.015em;
  color: var(--nc-ink);
  margin: 0 0 16px;
}
/* z-index: 0 crée un contexte d'empilement : sans lui, le ::after en
   z-index -1 passerait derrière le fond blanc du body et disparaîtrait. */
.news-title-hl { position: relative; display: inline-block; z-index: 0; }
.news-title-hl::after {
  content: ''; position: absolute; left: -4px; right: -4px; bottom: 6px; height: 12px;
  background: var(--nc-mint-strong); border-radius: 4px; transform: skewX(-2deg); z-index: -1;
}
.news-subtitle {
  font-size: 1.02rem; font-weight: 500; line-height: 1.7;
  color: var(--nc-body); max-width: 560px; margin: 0 auto;
}

/* ── SECTION ── */
.news-section { padding: 8px 24px 100px; max-width: 1100px; margin: 0 auto; }

/* ── FILTRES ── */
.news-filters { margin-bottom: 36px; }

.news-search { position: relative; max-width: 520px; margin: 0 auto 20px; }
.news-search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--nc-green); opacity: 0.6; pointer-events: none;
}
.news-search-input {
  width: 100%;
  font-family: 'Quicksand', sans-serif; font-size: 0.95rem; font-weight: 500;
  color: var(--nc-ink);
  padding: 14px 18px 14px 48px;
  border: 1.5px solid var(--nc-line); border-radius: 999px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
.news-search-input::placeholder { color: #9AA8A2; font-weight: 500; }
.news-search-input:hover { border-color: #C2CDC8; }
.news-search-input:focus {
  outline: none;
  border-color: var(--nc-green);
  box-shadow: 0 0 0 3px rgba(0, 97, 73, 0.14);
}
/* Croix native de <input type="search"> */
.news-search-input::-webkit-search-cancel-button { cursor: pointer; }

.news-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.news-chip {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.82rem; font-weight: 600; color: var(--nc-ink);
  padding: 8px 16px;
  border: 1.5px solid var(--nc-line); border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}
.news-chip:hover { border-color: var(--nc-green); color: var(--nc-green); }
.news-chip[aria-pressed="true"] {
  background: var(--nc-green);
  border-color: var(--nc-green);
  color: var(--white);
}
.news-chip[aria-pressed="true"]:hover { background: var(--nc-green-dark); border-color: var(--nc-green-dark); color: var(--white); }
.news-chip:active { transform: scale(0.97); }

.news-summary {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px;
  margin-top: 20px;
}
.news-count {
  font-size: 0.85rem; font-weight: 600; color: var(--nc-body); margin: 0;
}
.news-reset {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.83rem; font-weight: 700; color: var(--nc-green);
  background: none; border: none; padding: 4px 8px; border-radius: 8px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  transition: background-color 0.18s;
}
.news-reset:hover { background: var(--nc-mint-soft); }
.news-reset[hidden] { display: none; }

/* ── GRILLE ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--white);
  border: 1.5px solid var(--nc-line); border-radius: 18px; overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.news-card:hover {
  border-color: var(--nc-mint-strong);
  box-shadow: 0 12px 34px rgba(0, 97, 73, 0.12);
  transform: translateY(-4px);
}
.news-card:focus-visible {
  outline: 2.5px solid var(--nc-green);
  outline-offset: 3px;
}
.news-card[hidden] { display: none; }

.news-thumb {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}
.nt-1 { background: var(--nc-yellow); }
.nt-2 { background: var(--nc-mint); }
.nt-3 { background: var(--nc-mint-strong); }
.nt-4 { background: var(--nc-mint-soft); }

.news-body { padding: 20px 22px 24px; }
.news-cat {
  display: block; margin-bottom: 9px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--nc-green);
}
.news-card h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.05rem; font-weight: 600; line-height: 1.3;
  color: var(--nc-ink); margin: 0 0 10px;
}
.news-card p {
  font-size: 0.85rem; font-weight: 500; line-height: 1.65;
  color: var(--nc-body); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-read {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 14px;
  font-size: 0.82rem; font-weight: 700; color: var(--nc-green);
}
.news-read::after { content: '→'; transition: transform 0.2s; }
.news-card:hover .news-read::after { transform: translateX(4px); }

/* ── ÉTAT VIDE ── */
.news-empty {
  background: var(--nc-yellow);
  border-radius: 20px;
  padding: 48px 28px;
  text-align: center;
  margin-bottom: 8px;
}
.news-empty[hidden] { display: none; }
.news-empty-emoji { font-size: 2.2rem; margin-bottom: 12px; }
.news-empty-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: var(--nc-ink); margin: 0 0 8px;
}
.news-empty-text {
  font-size: 0.92rem; font-weight: 500; color: var(--nc-body);
  max-width: 420px; margin: 0 auto 22px; line-height: 1.6;
}
.news-empty-btn {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.88rem; font-weight: 700; color: var(--white);
  background: var(--nc-green); border: none;
  padding: 12px 24px; border-radius: 999px; cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}
.news-empty-btn:hover { background: var(--nc-green-dark); transform: translateY(-1px); }
.news-empty-btn:active { transform: scale(0.98); }

/* ── FOCUS CLAVIER ── */
.news-chip:focus-visible,
.news-reset:focus-visible,
.news-empty-btn:focus-visible {
  outline: 2.5px solid var(--nc-green);
  outline-offset: 2px;
}
.news-search-input:focus-visible { outline: none; }

/* ── LABEL ACCESSIBLE MASQUÉ ── */
.news-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .news-hero { padding: 40px 18px 32px; }
  .news-section { padding: 8px 18px 72px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-chips { justify-content: flex-start; }
  .news-empty { padding: 36px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .news-card, .news-chip, .news-read::after, .news-empty-btn { transition: none; }
  .news-card:hover { transform: none; }
}
