/* CAPVISH – Ressources : cartes « Ressources en vedette » */

.cv-res-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.cv-res-item {
  margin: 0;
  padding: 0;
}

.cv-res-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e3ecee;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(14, 74, 90, 0.06);
}

/* Cadre 16:9 fixe : l'image est recadrée, quelle que soit sa taille d'origine. */
.cv-res-card .cv-res-media {
  position: relative;
  height: 0;
  padding-top: 56.25%;
  overflow: hidden;
  background: #eef6f4;
}

.cv-res-card .cv-res-media img.cv-res-img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.cv-res-badge {
  position: absolute;
  z-index: 1;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d7f3e3;
  color: #0e5a3a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.cv-res-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 14px 16px 16px;
}

.cv-res-card .cv-res-title {
  margin: 0;
  color: #1f2a30;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.cv-res-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #2b3a42;
  font-size: 13px;
  line-height: 1.35;
}

.cv-res-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cv-ico {
  flex: none;
  width: 16px;
  height: 16px;
  fill: #2f5da8;
}

.cv-res-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #2b3a42;
  font-size: 13px;
  line-height: 1.35;
}

.cv-res-rating .cv-ico--star {
  fill: #f5a623;
}

.cv-res-sep {
  color: #8a9aa3;
}

.cv-res-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.cv-res-card a.cv-res-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid #0e4a5a;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.cv-res-card a.cv-res-btn--ghost {
  background: #fff;
  color: #0e4a5a;
}

.cv-res-card a.cv-res-btn--ghost:hover {
  background: #eef6f4;
  color: #0e4a5a;
}

.cv-res-card a.cv-res-btn--solid {
  background: #0e4a5a;
  color: #fff;
}

.cv-res-card a.cv-res-btn--solid:hover {
  background: #0a3844;
  color: #fff;
}

.cv-res-card a.cv-res-btn:focus-visible {
  outline: 3px solid #f5c518;
  outline-offset: 2px;
}

.cv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cv-res-empty {
  padding: 16px;
  border: 1px dashed #d6e3e6;
  border-radius: 8px;
  color: #2b3a42;
}

@media (max-width: 1024px) {
  .cv-res-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cv-res-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cv-res-card a.cv-res-btn {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Actualités : [cv_actualites]                                        */
/* ------------------------------------------------------------------ */

.cv-news-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.cv-news-item {
  margin: 0;
  padding: 0;
}

.cv-news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e3ecee;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(14, 74, 90, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.cv-news-card:hover {
  box-shadow: 0 8px 22px rgba(14, 74, 90, 0.12);
  transform: translateY(-2px);
}

.cv-news-card:focus-within {
  outline: 3px solid #f5c518;
  outline-offset: 3px;
}

/* Cadre 16:9 fixe : l'image est recadrée, quelle que soit sa taille d'origine. */
.cv-news-card .cv-news-media {
  position: relative;
  height: 0;
  padding-top: 56.25%;
  overflow: hidden;
  background: #eef6f4;
}

.cv-news-card .cv-news-media img.cv-news-img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.cv-news-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 16px 18px 18px;
}

.cv-news-date {
  color: #4a5a63;
  font-size: 13px;
}

.cv-news-card .cv-news-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.cv-news-card a.cv-news-link {
  color: #0e4a5a;
  text-decoration: none;
}

.cv-news-card a.cv-news-link:focus {
  outline: none;
}

/* Rend toute la carte cliquable à partir du lien du titre. */
.cv-news-card a.cv-news-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.cv-news-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  color: #1b7a63;
  font-size: 15px;
  font-weight: 700;
}

.cv-news-card:hover .cv-news-more {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .cv-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cv-news-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cv-news-card,
  .cv-news-card:hover {
    transition: none;
    transform: none;
  }
}
