/* Blog : liste (/blog/), carte d'article et lecture d'un article (/blog/{slug}/). */
:root { --blog-ink: #1f2328; --blog-muted: #5f6670; --blog-line: #eceef1; --blog-red: #bc1728; --blog-green: #23863b; --blog-paper: #fff; }

/* ---------- Liste ---------- */
.blog-index { padding-top: 48px; padding-bottom: 96px; }

.blog-index__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; }
.blog-index__empty { grid-column: 1 / -1; padding: 64px 0; color: var(--blog-muted); text-align: center; }
.blog-index__pagination { margin-top: 64px; }
.blog-index__pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; list-style: none; }
.blog-index__pagination .page-numbers:not(ul) { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; font: 500 14px/1 Poppins, sans-serif; transition: border-color .2s, color .2s; }
.blog-index__pagination .page-numbers.current { border-color: var(--blog-red); background: var(--blog-red); color: #fff; font-weight: 600; }
.blog-index__pagination a.page-numbers:hover { border-color: var(--blog-red); color: var(--blog-red); }
.blog-index__pagination .dots { border-color: transparent !important; }

/* ---------- Carte ---------- */
.article-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--blog-line); border-radius: 14px; background: var(--blog-paper); transition: box-shadow .25s ease, transform .25s ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgb(17 24 39 / 40%); }
.article-card__image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #f1f2f4; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.article-card:hover .article-card__image img { transform: scale(1.04); }
.article-card__body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 18px; }
.article-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; color: var(--blog-muted); font-size: 13px; }
.article-card__category { color: var(--blog-green); font-weight: 600; }
.article-card__category:hover { text-decoration: underline; text-underline-offset: 3px; }
.article-card__meta > span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 12px; border-radius: 50%; background: #c4c8ce; vertical-align: middle; }
.article-card__meta > span:first-child::before { display: none; }
.article-card__title { margin: 0 0 10px; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--blog-ink); text-wrap: balance; }
.article-card__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s ease; }
.article-card__title a:hover { background-size: 100% 1.5px; }
.article-card__excerpt { display: -webkit-box; margin: 0 0 18px; overflow: hidden; color: var(--blog-muted); font-size: 15px; line-height: 1.6; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.article-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--blog-line); color: var(--blog-muted); font-size: 13px; }

/* ---------- Article ---------- */
.article-progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; pointer-events: none; }
.article-progress span { display: block; height: 100%; background: var(--blog-red); transform: scaleX(0); transform-origin: 0 50%; }
.article-page { background: var(--blog-paper); color: var(--blog-ink); padding-bottom: 96px; }
.article-wide { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.article-breadcrumb { padding: 28px 0 0; }
.article-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--blog-muted); font-size: 14px; }
.article-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #c4c8ce; }
.article-breadcrumb a:hover { color: var(--blog-red); }
.article-breadcrumb [aria-current] { max-width: 48ch; overflow: hidden; color: var(--blog-ink); text-overflow: ellipsis; white-space: nowrap; }

.article-header { width: min(780px, calc(100% - 40px)); margin: 48px auto 36px; text-align: center; }
.article-header__category { display: inline-block; margin-bottom: 18px; padding: 5px 14px; border-radius: 999px; background: #e8f5ec; color: var(--blog-green); font-size: 13px; font-weight: 600; }
.article-header h1 { margin: 0 0 24px; font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.article-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 24px; color: var(--blog-muted); font-size: 14px; }
.article-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.article-meta svg { width: 17px; height: 17px; }
.article-meta__author { color: var(--blog-ink); font-weight: 600; }
.article-meta__author img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.article-cover { margin: 0 auto 56px; overflow: hidden; border-radius: 18px; aspect-ratio: 2 / 1; background: #f1f2f4; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: 250px minmax(0, 700px); justify-content: center; gap: 64px; }
.article-aside { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 28px; align-self: start; }

.article-toc summary { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--blog-ink); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; list-style: none; }
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary svg { width: 16px; height: 16px; }
.article-toc ol { margin: 0; padding: 0 0 0 2px; list-style: none; border-left: 2px solid var(--blog-line); }
.article-toc a { display: block; margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--blog-muted); font-size: 14px; line-height: 1.45; transition: color .2s, border-color .2s; }
.article-toc__item--h3 a { padding-left: 28px; font-size: 13px; }
.article-toc a:hover { color: var(--blog-ink); }
.article-toc a.is-active { border-left-color: var(--blog-red); color: var(--blog-red); font-weight: 600; }

/* Contenu : lecture confortable. */
.article-content { font-size: 18px; line-height: 1.8; color: #2b3036; overflow-wrap: break-word; }
.article-content > * + * { margin-top: 1.25em; }
.article-content h2, .article-content h3 { scroll-margin-top: 110px; color: var(--blog-ink); line-height: 1.3; letter-spacing: -0.01em; }
.article-content h2 { margin-top: 2.2em; font-size: 28px; font-weight: 700; }
.article-content h3 { margin-top: 1.8em; font-size: 22px; font-weight: 700; }
.article-content h2 + *, .article-content h3 + * { margin-top: .7em; }
.article-content a { color: var(--blog-red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-content a:hover { text-decoration-thickness: 2px; }
.article-content strong { color: var(--blog-ink); }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li + li { margin-top: .4em; }
.article-content li::marker { color: var(--blog-red); }
.article-content blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--blog-green); color: var(--blog-ink); font-size: 20px; font-style: italic; }
.article-content img { height: auto; max-width: 100%; border-radius: 12px; }
.article-content figure { margin-inline: 0; }
.article-content figcaption { margin-top: 8px; color: var(--blog-muted); font-size: 14px; text-align: center; }
.article-content .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.article-content iframe, .article-content video { width: 100%; max-width: 100%; border-radius: 12px; }
.article-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.article-content th, .article-content td { padding: 10px 12px; border-bottom: 1px solid var(--blog-line); text-align: left; }
.article-content .japsso-social { display: none; } /* boutons ajoutés au contenu : la page les place elle-même */

.article-share .japsso-social { display: flex; flex-direction: column; gap: 12px; }
.article-share .japsso-social > span { color: var(--blog-ink); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.article-share .japsso-social ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.article-share--end { display: none; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--blog-line); }

.article-related { margin-top: 96px; padding-top: 56px; border-top: 1px solid var(--blog-line); }
.article-related .related-content__track { align-items: stretch; }

@media (max-width: 1023px) {
  .blog-index__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { display: block; max-width: 700px; }
  .article-aside { position: static; margin-bottom: 32px; }
  .article-share--aside { display: none; }
  .article-share--end { display: block; }
  .article-toc { padding: 16px 18px; border: 1px solid var(--blog-line); border-radius: 12px; background: #fafbfc; }
  .article-toc summary { margin: 0; }
  .article-toc[open] summary { margin-bottom: 12px; }
  .article-toc summary::after { content: "+"; margin-left: auto; font-size: 18px; font-weight: 400; }
  .article-toc[open] summary::after { content: "−"; }
}
@media (max-width: 639px) {
  .blog-index { padding-top: 32px; }
  .blog-index__grid { grid-template-columns: 1fr; }
  .article-header { margin-top: 32px; text-align: left; }
  .article-meta { justify-content: flex-start; }
  .article-cover { border-radius: 12px; margin-bottom: 36px; aspect-ratio: 16 / 10; }
  .article-content { font-size: 17px; }
  .article-content h2 { font-size: 24px; }
  .article-breadcrumb [aria-current] { max-width: 24ch; }
}
@media (prefers-reduced-motion: reduce) {
  .article-card, .article-card__image img, .article-card__title a { transition: none; }
  .article-card:hover, .article-card:hover .article-card__image img { transform: none; }
}
.archive-count, .blog-index__count { margin: 0 0 20px; color: #5f6670; font-size: 14px; }
