/* ============================================================
   HCM ADVISORY SERVICE — CSS ARTICLES BLOG (WordPress)
   Adapté du modèle Demain Beauty, aux couleurs HCM.
   Palette : #575756 (texte) · #8CC83C (vert de marque) · Poppins
   Tout est scopé sous .hcm-article : le thème n'est jamais affecté.
   ============================================================ */


.hcm-article {
  /* ----- palette ----- */
  --hcm-text: #575756;          /* texte courant */
  --hcm-heading: #3a3a39;       /* H3 / H4 */
  --hcm-green: #8CC83C;         /* vert de marque, vif (accents, en-têtes) */
  --hcm-green-dark: #4E7D1A;    /* vert foncé lisible (titres H2, liens, boutons) */
  --hcm-on-green: #232322;      /* texte foncé posé sur le vert vif */
  --hcm-soft: #F4F8EC;          /* fond doux dérivé du vert */
  --hcm-border: #DBE7C5;        /* bordures claires */
  --hcm-cell-border: #E6EDD9;   /* lignes de tableau */
  --hcm-quote: #6a6a68;         /* citations */

  font-family: 'Poppins', sans-serif;
  color: var(--hcm-text);
}


/* ----- BASE TEXTE ----- */

.hcm-article p,
.hcm-article li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--hcm-text);
}

.hcm-article p { margin: 0 0 16px; }

.hcm-article a {
  color: var(--hcm-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hcm-article a:hover { text-decoration: none; }

.hcm-article img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px 0;
}


/* ----- TITRES ----- */

.hcm-article h2 {
  color: var(--hcm-green-dark);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.3;
  margin: 56px 0 18px;
  scroll-margin-top: 120px;
}

.hcm-article h3 {
  color: var(--hcm-heading);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  margin: 40px 0 14px;
}

.hcm-article h4 {
  color: var(--hcm-heading);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
  margin: 24px 0 10px;
}


/* ----- LISTES ----- */

.hcm-article ul,
.hcm-article ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.hcm-article li { margin: 0 0 2px; line-height: 1.6; }

.hcm-article li p { margin: 0; display: inline; }


/* ----- SOMMAIRE ----- */

.hcm-article .hcm-sommaire {
  border: 1px solid var(--hcm-border);
  background: var(--hcm-soft);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0 28px;
}

.hcm-article .hcm-sommaire-title {
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--hcm-green-dark);
}

.hcm-article .hcm-sommaire ul,
.hcm-article .hcm-sommaire ol {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hcm-article .hcm-sommaire li {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  list-style: none !important;
}

.hcm-article .hcm-sommaire li::before,
.hcm-article .hcm-sommaire li::marker {
  content: none !important;
  display: none !important;
}

.hcm-article .hcm-sommaire li a {
  display: block;
  padding: 8px 0;
  color: var(--hcm-green-dark) !important;
  text-decoration: none !important;
  font-size: 15px;
  line-height: 1.5;
  border-bottom: 1px solid var(--hcm-border);
}

.hcm-article .hcm-sommaire li:last-child a { border-bottom: none; }
.hcm-article .hcm-sommaire li a:hover { color: var(--hcm-text) !important; }


/* ----- ENCADRE (essentiel à retenir) ----- */

.hcm-article .hcm-encadre {
  border-left: 3px solid var(--hcm-green);
  background: var(--hcm-soft);
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--hcm-text);
}

.hcm-article .hcm-encadre p:last-child { margin-bottom: 0; }


/* ----- CTA ----- */

.hcm-article .hcm-cta { text-align: center; margin: 28px 0 36px; }

.hcm-article .hcm-btn {
  display: inline-block;
  background: var(--hcm-green-dark);
  color: #fff !important;
  text-decoration: none !important;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.hcm-article .hcm-btn:hover { opacity: 0.88; }


/* ----- TABLEAU RESPONSIVE ----- */

.hcm-article .hcm-table-wrap {
  overflow-x: auto;
  width: 100%;
  margin: 20px 0 28px;
}

.hcm-article .hcm-table-wrap,
.hcm-article .hcm-table-wrap table,
.hcm-article .hcm-table-wrap th,
.hcm-article .hcm-table-wrap td,
.hcm-article .hcm-table-wrap tr,
.hcm-article .hcm-table-wrap thead,
.hcm-article .hcm-table-wrap tbody {
  border: none !important;
  box-shadow: none !important;
}

.hcm-article .hcm-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 100%;
  font-size: 15px;
  border-radius: 10px;
  overflow: hidden;
}

.hcm-article .hcm-table th {
  background: var(--hcm-green);
  color: var(--hcm-on-green);
  padding: 12px 20px;
  text-align: center;
  font-weight: 700;
}

.hcm-article .hcm-table td {
  padding: 12px 20px;
  text-align: center;
  vertical-align: top;
  color: var(--hcm-text);
  border-bottom: 1px solid var(--hcm-cell-border) !important;
}

.hcm-article .hcm-table tbody tr:nth-child(odd) { background: #fff; }
.hcm-article .hcm-table tbody tr:nth-child(even) { background: var(--hcm-soft); }
.hcm-article .hcm-table tbody tr:last-child td { border-bottom: none !important; }


/* ----- FAQ DEROULANTE ----- */

.hcm-article .hcm-faq { margin: 36px 0 0; }

.hcm-article .hcm-faq details {
  border: 1px solid var(--hcm-border);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  margin: 0 0 10px;
  transition: background 0.2s ease;
}

.hcm-article .hcm-faq details[open] { background: var(--hcm-soft); }

.hcm-article .hcm-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: var(--hcm-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hcm-article .hcm-faq summary::-webkit-details-marker { display: none; }

.hcm-article .hcm-faq summary::after {
  content: "+";
  font-weight: 800;
  font-size: 18px;
  color: var(--hcm-green);
  flex-shrink: 0;
  margin-left: 12px;
}

.hcm-article .hcm-faq details[open] summary::after { content: "\2013"; }

.hcm-article .hcm-faq details p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--hcm-text);
}


/* ----- CITATION ----- */

.hcm-article blockquote {
  border-left: 3px solid var(--hcm-green);
  margin: 22px 0;
  padding: 4px 0 4px 20px;
  font-style: italic;
  color: var(--hcm-quote);
}


/* ----- SEPARATEUR ----- */

.hcm-article hr {
  border: none;
  border-top: 1px solid var(--hcm-border);
  margin: 32px 0;
}


/* ----- RESPONSIVE ----- */

@media (max-width: 640px) {
  .hcm-article h2 { font-size: 20px; margin: 44px 0 14px; }
  .hcm-article h3 { font-size: 18px; margin: 32px 0 10px; }
  .hcm-article .hcm-sommaire,
  .hcm-article .hcm-encadre,
  .hcm-article .hcm-faq details { padding: 14px 16px; }
  .hcm-article .hcm-btn { padding: 12px 22px; font-size: 15px; }
  .hcm-article .hcm-table { font-size: 14px; }
  .hcm-article .hcm-table th,
  .hcm-article .hcm-table td { padding: 10px 14px; }
}


/* ============================================================
   PAGE LISTE D'ARTICLES (bloc Boucle de requête WordPress)
   À appliquer en ajoutant la classe "hcm-blog-grid" au bloc.
   ============================================================ */

.hcm-blog-grid {
  --hcm-text: #575756;
  --hcm-green: #8CC83C;
  --hcm-green-dark: #4E7D1A;
  --hcm-soft: #F4F8EC;
  --hcm-border: #DBE7C5;
  --hcm-muted: #9a9a98;
  font-family: 'Poppins', sans-serif;
}

/* en-tête de page optionnel (groupe avec la classe hcm-blog-head) */
.hcm-blog-head { text-align: center; margin: 0 0 36px; }
.hcm-blog-head h1,
.hcm-blog-head h2 { color: var(--hcm-green-dark); font-family: 'Poppins', sans-serif; font-weight: 800; }
.hcm-blog-head p { color: var(--hcm-text); font-family: 'Poppins', sans-serif; font-size: 17px; line-height: 1.6; max-width: 640px; margin: 8px auto 0; }

/* la grille */
.hcm-blog-grid .wp-block-post-template {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* la carte */
.hcm-blog-grid .wp-block-post {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--hcm-border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hcm-blog-grid .wp-block-post:hover {
  border-color: var(--hcm-green);
  box-shadow: 0 6px 22px rgba(140, 200, 60, 0.18);
  transform: translateY(-2px);
}

.hcm-blog-grid .wp-block-post-featured-image { margin: 0; }

.hcm-blog-grid .wp-block-post-featured-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
}

.hcm-blog-grid .wp-block-post-title {
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  margin: 18px 18px 8px;
}

.hcm-blog-grid .wp-block-post-title a {
  color: var(--hcm-green-dark);
  text-decoration: none;
}

.hcm-blog-grid .wp-block-post-title a:hover { text-decoration: underline; }

.hcm-blog-grid .wp-block-post-excerpt {
  margin: 0 18px 14px;
  color: var(--hcm-text);
  font-size: 15px;
  line-height: 1.6;
}

.hcm-blog-grid .wp-block-post-excerpt p,
.hcm-blog-grid .wp-block-post-excerpt__excerpt {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hcm-blog-grid .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--hcm-green-dark);
  font-weight: 700;
  text-decoration: none;
}

.hcm-blog-grid .wp-block-post-excerpt__more-link:hover { text-decoration: underline; }

.hcm-blog-grid .wp-block-post-date {
  margin: auto 18px 16px;
  padding-top: 12px;
  color: var(--hcm-muted);
  font-size: 13px;
}

/* pagination */
.hcm-blog-grid .wp-block-query-pagination {
  margin-top: 36px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hcm-blog-grid .wp-block-query-pagination a,
.hcm-blog-grid .wp-block-query-pagination span {
  color: var(--hcm-green-dark);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--hcm-border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
}

.hcm-blog-grid .wp-block-query-pagination a:hover { background: var(--hcm-soft); }

.hcm-blog-grid .wp-block-query-pagination .current {
  background: var(--hcm-green-dark);
  color: #fff;
  border-color: var(--hcm-green-dark);
}

/* responsive */
@media (max-width: 980px) {
  .hcm-blog-grid .wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hcm-blog-grid .wp-block-post-template { grid-template-columns: 1fr; gap: 18px; }
}
