/* ==========================================================================
   news.css — Actualités : grille, pagination, détail, responsive
   Réutilise .news-card, .card-shell, .card-content, .card-hitarea
   de home-sections.css (chargé via inc_header.cfm).
   Réutilise .book-header, .book-cover, .book-info de catalog.css.
   Dépend de : tokens.css (HSL components, shadow tokens)
   ========================================================================== */

/* ===== TITRE H2 (catégorie ou article) ===== */
.news-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ===== SOUS-TITRE MODE "TOUTES LES ACTUS" ===== */
.news-all-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-style: italic;
}

.news-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ===== GRILLE DE CARTES (responsive auto-fill) ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ===== DATE SUR CARTE ===== */
.news-card .card-date {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

/* ===== BADGE CATÉGORIE SUR CARTE ===== */
.news-card .badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.25rem 0.75rem;
  background: hsla(var(--ph), var(--ps), var(--pl), 0.9);
  color: var(--primary-fg);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
}

/* ===== PLACEHOLDER (pas d'image) ===== */
.news-card .thumb {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%);
}

.news-card .thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-card .thumb--placeholder::after {
  content: '';
  width: 48px;
  height: 48px;
  opacity: 0.15;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3Cpath d='M8 7h6'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3Cpath d='M8 7h6'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E") center/contain no-repeat;
  color: var(--primary);
}

.news-card .thumb img[data-broken] {
  display: none;
}

/* ===== VIDE ===== */
.news-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  border-radius: 2px;
  transition: background 0.3s, color 0.3s;
  text-decoration: none;
}

.pagination a {
  color: var(--muted);
}

.pagination a:hover,
.pagination a:focus {
  background: var(--card);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 500;
}

.pagination .gap {
  color: var(--muted);
  pointer-events: none;
}

/* ===== DÉTAIL ARTICLE ===== */

/* Résumé en italique (comme un chapeau) */
.news-detail-summary {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--primary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Date dans le détail */
.news-detail-date {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* Texte de l'article */
.news-detail-text {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--muted);
}

.news-detail-text p + p {
  margin-top: 1rem;
}

.news-detail-text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-detail-text img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 2px;
}

/* Image dans la vue détail */
.news-detail-cover {
  flex-shrink: 0;
  width: 260px;
}

.news-detail-cover img {
  width: 100%;
  box-shadow: 0 20px 60px -15px var(--shadow-lg);
  border-radius: 2px;
  transition: transform 0.5s;
}

.news-detail-cover img:hover {
  transform: scale(1.02);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-detail-cover {
    width: 180px;
  }

  .pagination a,
  .pagination span {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }
}
