/* =====================================================================
   FICHIER : assets/css/blog.css
   ROLE   : Blog public Jobwav — liste (vue carte / vue liste), barre
            d'outils de filtrage et colonne laterale partagee.
   Charge uniquement par blog.php et blog-single.php (voir inc/header.php).
   S'appuie sur les variables --jw-* de design-system.css.
   ===================================================================== */

/* ---------- Gabarit general : contenu + colonne laterale ---------- */
.jw-blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 991.98px) {
  .jw-blog-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ---------- Barre d'outils : nombre de resultats et bascule de vue ---------- */
.jw-blog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 26px;
  background: #fff;
  border: 1px solid var(--jw-border, #e2e8f0);
  border-radius: 12px;
}
@media (max-width: 575.98px) {
  .jw-blog-toolbar { grid-template-columns: minmax(0, 1fr); }
}
.jw-blog-count { margin: 0; font-size: 14px; color: var(--jw-text-muted, #64748b); }
.jw-blog-count strong { color: var(--jw-text-primary, #0f172a); }

.jw-view-switch { display: inline-flex; gap: 4px; padding: 4px; background: #f1f5f9; border-radius: 10px; justify-self: end; }
.jw-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--jw-text-muted, #64748b);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.jw-view-btn:hover { color: var(--jw-primary, #09232b); }
.jw-view-btn.is-active { background: var(--jw-primary, #09232b); color: #fff; }

/* ---------- Filtres actifs (puces retirables) ---------- */
.jw-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.jw-filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(9, 35, 43, .07); color: var(--jw-primary, #09232b);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.jw-filter-chip:hover { background: rgba(9, 35, 43, .14); color: var(--jw-primary, #09232b); }
.jw-filter-chip i { font-size: 11px; opacity: .7; }

/* ---------- Liste des articles ---------- */
.jw-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
@media (max-width: 575.98px) { .jw-posts { grid-template-columns: minmax(0, 1fr); } }

.jw-post {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid var(--jw-border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.jw-post:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(9, 35, 43, .10); }
.jw-post-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #f7f5f0; overflow: hidden; }
.jw-post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jw-post-cat {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--jw-secondary, #fec11a); color: var(--jw-primary, #09232b);
  font-size: 12px; font-weight: 700; text-decoration: none;
}
/* ---------- Articles de type video ---------- */
/* Pastille de lecture au centre de la vignette, et etiquette « Video » en bas a droite */
.jw-post-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9, 35, 43, .82); color: #fff; font-size: 18px;
  transition: transform .25s ease, background-color .25s ease;
}
.jw-post:hover .jw-post-play { transform: translate(-50%, -50%) scale(1.08); background: var(--jw-primary, #09232b); }
.jw-post-video-tag {
  position: absolute; right: 12px; bottom: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(9, 35, 43, .85); color: #fff;
  font-size: 11px; font-weight: 700;
}
.jw-badge-video {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  background: var(--jw-primary, #09232b); color: #fff;
  font-size: 12px; font-weight: 700;
}
/* Lecteur 16:9 fluide, sans calcul de padding */
.jw-video-wrap {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: 16px; overflow: hidden; background: #000;
}
.jw-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.jw-post-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.jw-post-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--jw-text-muted, #64748b); }
.jw-post-title { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.jw-post-title a { color: var(--jw-text-primary, #0f172a); text-decoration: none; }
.jw-post-title a:hover { color: var(--jw-primary, #09232b); text-decoration: underline; }
.jw-post-excerpt { margin: 0; font-size: 14px; line-height: 1.65; color: var(--jw-text-muted, #64748b); }
.jw-post-more { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--jw-primary, #09232b); text-decoration: none; }
.jw-post-more:hover { text-decoration: underline; color: var(--jw-primary, #09232b); }

/* ---------- Vue liste : vignette a gauche, texte a droite ---------- */
.jw-posts.is-list { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.jw-posts.is-list .jw-post { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto; }
.jw-posts.is-list .jw-post-thumb { aspect-ratio: auto; height: 100%; min-height: 170px; }
@media (max-width: 767.98px) {
  .jw-posts.is-list .jw-post { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .jw-posts.is-list .jw-post-thumb { aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- Aucun resultat ---------- */
.jw-empty { padding: 60px 24px; text-align: center; background: #fff; border: 1px dashed var(--jw-border, #cbd5e1); border-radius: 14px; }
.jw-empty i { font-size: 36px; color: var(--jw-secondary, #fec11a); margin-bottom: 12px; }

/* ---------- Pagination ---------- */
.jw-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 36px; }
.jw-page-link {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--jw-border, #e2e8f0); border-radius: 10px;
  background: #fff; color: var(--jw-text-primary, #0f172a);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.jw-page-link:hover { border-color: var(--jw-primary, #09232b); color: var(--jw-primary, #09232b); }
.jw-page-link.is-active { background: var(--jw-primary, #09232b); border-color: var(--jw-primary, #09232b); color: #fff; }
.jw-page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Colonne laterale ---------- */
.jw-blog-sidebar { display: grid; gap: 22px; position: sticky; top: 100px; }
@media (max-width: 991.98px) { .jw-blog-sidebar { position: static; } }

.jw-widget { padding: 22px; background: #fff; border: 1px solid var(--jw-border, #e2e8f0); border-radius: 14px; }
.jw-widget-title { margin: 0 0 16px; font-size: 16px; font-weight: 700; color: var(--jw-text-primary, #0f172a); }

.jw-search { position: relative; }
.jw-search .form-control { height: 46px; padding-right: 48px; border-radius: 10px; font-size: 14px; }
.jw-search-btn {
  position: absolute; top: 5px; right: 5px; width: 36px; height: 36px;
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--jw-primary, #09232b); color: var(--jw-secondary, #fec11a);
}

.jw-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.jw-recent-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; text-decoration: none; }
.jw-recent-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  background: #f7f5f0; display: flex; align-items: center; justify-content: center;
  color: var(--jw-text-muted, #94a3b8);
}
.jw-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.jw-recent-body { display: grid; gap: 4px; }
.jw-recent-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--jw-text-primary, #0f172a); }
.jw-recent-item:hover .jw-recent-title { color: var(--jw-primary, #09232b); text-decoration: underline; }
.jw-recent-date { font-size: 12px; color: var(--jw-text-muted, #64748b); }

.jw-cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jw-cat-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--jw-text-primary, #0f172a); text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.jw-cat-item:hover { background: #f1f5f9; color: var(--jw-primary, #09232b); }
.jw-cat-item.is-active { background: var(--jw-primary, #09232b); color: #fff; }
.jw-cat-count { font-size: 12px; font-weight: 700; opacity: .75; }

.jw-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.jw-tag {
  padding: 6px 12px; border-radius: 999px;
  background: #f1f5f9; color: var(--jw-text-primary, #0f172a);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.jw-tag:hover { background: var(--jw-secondary, #fec11a); color: var(--jw-primary, #09232b); }
.jw-tag.is-active { background: var(--jw-primary, #09232b); color: #fff; }

.jw-cta { background: var(--jw-primary, #09232b); border-color: var(--jw-primary, #09232b); text-align: center; }
/* design-system.css impose `h1..h6 { color: var(--jw-text-primary) !important }` :
   sans !important ici, ce titre restait bleu fonce sur fond bleu fonce, illisible. */
.jw-cta-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: #fff !important; }
.jw-cta-text { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .82) !important; }
.jw-cta-btn {
  display: block; padding: 12px 18px; border-radius: 10px;
  background: var(--jw-secondary, #fec11a); color: var(--jw-primary, #09232b);
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.jw-cta-btn:hover { background: var(--jw-secondary-light, #ffd24d); color: var(--jw-primary, #09232b); }
.jw-cta-link { display: block; margin-top: 12px; font-size: 13px; color: rgba(255, 255, 255, .8); text-decoration: underline; }
.jw-cta-link:hover { color: #fff; }

/* ---------- Page article : mots-cles, partage, articles lies ---------- */
.jw-single-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; }
.jw-single-tags .jw-label { font-size: 14px; font-weight: 600; color: var(--jw-text-muted, #64748b); margin-right: 4px; }

/* Les boutons de partage sont poses sur une grille : chaque bouton occupe au moins
   150 px et la ligne se replie toute seule. En flex simple ils se chevauchaient
   des que la colonne de contenu se resserrait. */
.jw-share { display: grid; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--jw-border, #e2e8f0); }
.jw-share-label { font-size: 14px; font-weight: 600; color: var(--jw-text-muted, #64748b); }
.jw-share-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.jw-share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 14px;
  border: 1px solid var(--jw-border, #e2e8f0); border-radius: 10px;
  background: #fff; color: var(--jw-text-primary, #0f172a);
  font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.jw-share-btn i { width: 16px; text-align: center; font-size: 15px; }
.jw-share-btn:hover { border-color: var(--jw-primary, #09232b); color: var(--jw-primary, #09232b); }
.jw-share-btn.is-whatsapp:hover { border-color: #25d366; color: #128c7e; }

/* « A lire aussi » sort de la grille a deux colonnes : pleine largeur, 3 colonnes,
   juste avant le pied de page, puisque la colonne laterale s'arrete au bloc d'appel. */
.jw-related { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--jw-border, #e2e8f0); }
.jw-related-title { margin-bottom: 22px; font-size: 22px; font-weight: 700; }
.jw-related .jw-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .jw-related .jw-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .jw-related .jw-posts { grid-template-columns: minmax(0, 1fr); } }
