/* ===================================================================
   ONG VISION CITOYENNE — news.css
   Actualités du site : bloc compact de l'accueil, page Actualités
   et fenêtre de lecture.
   =================================================================== */

.news-home {
  background: var(--section-alt-bg);
  padding: 60px 0;
}
.news-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.news-head h2 {
  margin: 6px 0 0;
  font-family: var(--head);
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--ink);
}
.news-head .section-tag { margin-bottom: 0; }
.news-all {
  font-family: var(--head);
  font-size: .9rem;
  font-weight: 700;
  color: var(--blue-700);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color .2s var(--ease);
}
.news-all:hover,
.news-all:focus-visible { border-bottom-color: var(--gold); }

/* ===== CARTES ===== */
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(197, 211, 228, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.news-card:focus-within { box-shadow: 0 0 0 3px var(--blue-400), var(--shadow); }
.news-thumb {
  overflow: hidden;
  background: var(--blue-100);
}
.news-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.news-card:hover .news-thumb img { transform: scale(1.04); }
.news-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}
.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: .76rem;
  font-weight: 600;
  color: var(--muted);
}
.news-cat {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  background: var(--blue-100);
  color: var(--blue-800);
}
.news-cat--annonce { background: var(--yellow-soft); color: #8a5a00; }
.news-cat--evenement { background: var(--gold-soft); color: var(--gold-deep); }
.news-cat--don { background: #dcfce7; color: #15803d; }
.news-cat--sensibilisation { background: #ede9fe; color: #6d28d9; }
.news-cat--projet { background: #ccfbf1; color: #0f766e; }
.news-title {
  margin: 0;
  font-family: var(--head);
  font-size: 1.02rem;
  line-height: 1.3;
}
.news-open {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color .2s var(--ease);
}
/* Toute la carte est cliquable */
.news-open::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.news-open:focus-visible { outline: none; }
.news-card:hover .news-open { color: var(--blue-700); }
.news-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.news-read {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--head);
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue-700);
}

/* ===== ACCUEIL : une à la une + liste compacte ===== */
.news-layout[data-news="home"] {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
}
.news-card--featured .news-thumb { aspect-ratio: 3 / 2; }
.news-card--featured .news-title { font-size: 1.3rem; letter-spacing: -.2px; }
.news-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-card--compact {
  flex: 1;
  flex-direction: row;
}
.news-card--compact .news-thumb { flex: 0 0 124px; }
.news-card--compact .news-body {
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
}
.news-card--compact .news-title { font-size: .95rem; }

/* ===== PAGE ACTUALITÉS : une à la une + grille ===== */
.news-layout[data-news="page"] {
  display: grid;
  gap: 22px;
}
.news-layout[data-news="page"] .news-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.news-layout[data-news="page"] .news-card--featured .news-thumb {
  aspect-ratio: auto;
  min-height: 320px;
}
.news-layout[data-news="page"] .news-card--featured .news-body {
  justify-content: center;
  gap: 12px;
  padding: 28px 30px;
}
.news-layout[data-news="page"] .news-card--featured .news-title { font-size: 1.55rem; }
.news-layout[data-news="page"] .news-card--featured .news-read { margin-top: 4px; }
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.news-card--card .news-thumb { aspect-ratio: 16 / 10; }
.fb-section-head { margin-top: 8px; }

/* ===== FENÊTRE DE LECTURE ===== */
.news-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(5, 29, 61, .4);
}
.news-dialog::backdrop {
  background: rgba(5, 29, 61, .65);
  backdrop-filter: blur(3px);
}
.nd-inner { position: relative; }
.nd-img {
  display: block;
  width: 100%;
  max-width: none;
  max-height: 380px;
  object-fit: cover;
}
.nd-body { padding: 22px 26px 26px; }
.nd-body h3 {
  margin: 10px 0 12px;
  font-family: var(--head);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -.3px;
}
.nd-text p {
  margin: 0 0 12px;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--muted);
}
.nd-text .nd-lead { font-weight: 600; color: var(--ink); }
.nd-link { margin-top: 6px; }
.nd-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.nd-close svg { width: 18px; height: 18px; }
.nd-close:hover { background: #fff; }
.nd-close:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .news-dialog[open] { animation: nd-in .28s var(--ease); }
  @keyframes nd-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .news-layout[data-news="home"] { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-layout[data-news="page"] .news-card--featured { grid-template-columns: 1fr; }
  .news-layout[data-news="page"] .news-card--featured .news-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .news-layout[data-news="page"] .news-card--featured .news-body { padding: 20px; }
  .news-layout[data-news="page"] .news-card--featured .news-title { font-size: 1.3rem; }
}
@media (max-width: 560px) {
  .news-home { padding: 44px 0; }
  .news-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card--compact .news-thumb { flex-basis: 100px; }
  .nd-body { padding: 18px; }
  .nd-body h3 { font-size: 1.2rem; }
}
