/**
 * News Block - Styles
 *
 * Styles spécifiques pour le bloc News
 *
 * @package CM98
 * @version 1.0.0
 */

/* ============================================
   SECTION NEWS - BASE
   ============================================ */

.news-section {
  position: relative;
}

/* ============================================
   CARTES D'ARTICLES
   ============================================ */

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Effet hover sur la carte */
.news-card:hover {
  transform: translateY(-4px);
}

/* ============================================
   IMAGE
   ============================================ */

.news-card__image-wrapper {
  position: relative;
  overflow: hidden;
}

.news-card__image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-card:hover .news-card__image-wrapper::after {
  opacity: 1;
}

/* ============================================
   LINE CLAMP (TRONCATURE)
   ============================================ */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   LIEN "EN SAVOIR PLUS"
   ============================================ */

.news-card__link {
  position: relative;
}

.news-card__link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.news-card__link:hover::after {
  width: calc(100% - 1.5rem);
}

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

@media (max-width: 767px) {
  .news-card {
    max-width: 100%;
  }
}

/* ============================================
   REDUCED MOTION - ACCESSIBILITÉ
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .news-card,
  .news-card__image-wrapper img,
  .news-card__link {
    transition: none;
  }

  .news-card:hover {
    transform: none;
  }

  .news-card:hover .news-card__image-wrapper img {
    transform: none;
  }
}

/* ============================================
   PLACEHOLDER ÉDITEUR GUTENBERG
   ============================================ */

.news-section .acf-placeholder {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
}
