/* KommIA : blog (index et articles, FR et EN), chargé après site.css. Les pages sont produites par les workflows n8n
   puis habillées par reskin.js (build/blog/) : leurs classes d'origine sont gardées et restylées ici, dans la charte
   du site (fond clair, halos, filets qui s'effacent, arrondi réservé à l'élément sélectionné). */

.kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--violet-ink); }
.kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #876AFF, #168EFF); box-shadow: 0 0 0 4px rgba(135, 106, 255, 0.14); }
@keyframes bl-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Le lien Blog de la navigation reste souligné sur tout le blog */
.nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

/* Halos de la marque derrière le haut de page */
.blog-main { isolation: isolate; }
.blog-main::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: -120px; width: min(1600px, 140vw); height: 860px; transform: translateX(-50%);
  background:
    radial-gradient(30% 42% at 24% 34%, rgba(184, 165, 255, 0.42), rgba(184, 165, 255, 0) 70%),
    radial-gradient(26% 36% at 76% 22%, rgba(90, 211, 255, 0.26), rgba(90, 211, 255, 0) 70%),
    radial-gradient(22% 30% at 58% 62%, rgba(22, 142, 255, 0.10), rgba(22, 142, 255, 0) 70%);
  pointer-events: none;
}

/* Catégorie : un point dégradé et le libellé, sans pastille */
.blog-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--violet-ink); }
.blog-chip::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, #876AFF, #168EFF); }

/* ═══════════════ Article ═══════════════ */

/* Barre de progression de lecture */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.reading-progress__fill { width: 0; height: 100%; border-radius: 0 2px 2px 0; background: linear-gradient(90deg, #168EFF, #876AFF); transition: width 100ms linear; }

.article-layout {
  max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 220px minmax(0, 700px); column-gap: 64px; justify-content: center;
}
.article-layout:not(:has(.article-toc)) { grid-template-columns: minmax(0, 700px); }

/* Haut de l'article : centré, la catégorie, le titre, la signature, l'image */
.article-hero { grid-column: 1 / -1; padding: clamp(40px, 6vw, 88px) 0 clamp(40px, 5vw, 64px); text-align: center; }
.article-hero .blog-chip { margin-bottom: 18px; animation: bl-up 800ms var(--ease-out) both 40ms; }
.article-hero__title { margin: 0 auto; max-width: 20ch; font-size: clamp(2.3rem, 1.2rem + 3.6vw, 4.3rem); font-weight: 620; letter-spacing: -0.045em; line-height: 1.04; text-wrap: balance; animation: bl-up 900ms var(--ease-out) both 120ms; }
.article-byline { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; font-size: 14.5px; color: var(--ink-60); animation: bl-up 900ms var(--ease-out) both 240ms; }
.article-byline__author { font-weight: 600; color: var(--ink); }
.article-byline__sep { font-size: 0; }
.article-byline__sep::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); opacity: 0.6; }
.article-hero__media { max-width: 940px; margin: clamp(36px, 5vw, 56px) auto 0; animation: bl-up 1000ms var(--ease-out) both 320ms; }
.article-hero__media img { width: 100%; aspect-ratio: 1376 / 768; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow-panel); }

/* Sommaire collant, comme celui du guide : numéros, filet vertical, entrée courante en dégradé */
.article-toc { grid-column: 1; grid-row: 2; align-self: start; position: sticky; top: calc(var(--nav-h) + 32px); }
.article-toc__title { margin-bottom: 14px; padding-left: 18px; font-size: 13px; font-weight: 600; color: var(--ink-60); }
.article-toc nav { position: relative; counter-reset: toc; }
.article-toc nav::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, rgba(14, 14, 20, 0.12), rgba(14, 14, 20, 0.12) 80%, transparent); }
.article-toc__link { position: relative; display: flex; gap: 10px; padding: 9px 0 9px 18px; font-size: 14px; line-height: 1.4; color: var(--ink-60); text-decoration: none; transition: color 200ms var(--ease-out); }
.article-toc__link::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); flex: none; font-size: 12px; font-weight: 650; color: rgba(14, 14, 20, 0.35); font-variant-numeric: tabular-nums; line-height: 1.6; }
.article-toc__link::after { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, #168EFF, #876AFF); opacity: 0; transition: opacity 250ms var(--ease-out); }
.article-toc__link:hover { color: var(--ink); }
.article-toc__link.is-active { color: var(--ink); font-weight: 600; }
.article-toc__link.is-active::before { color: var(--violet); }
.article-toc__link.is-active::after { opacity: 1; }

.article-main { grid-column: 2; grid-row: 2; min-width: 0; padding-bottom: 16px; }
.article-layout:not(:has(.article-toc)) .article-main { grid-column: 1; }

/* « À retenir » : un fond violet qui s'efface vers la droite, un filet à gauche */
.article-callout { display: flex; gap: 16px; margin-bottom: 44px; padding: 22px 24px; border-left: 2px solid var(--violet); background: linear-gradient(90deg, rgba(135, 106, 255, 0.10), rgba(135, 106, 255, 0) 92%); }
.article-callout__icon { flex: none; margin-top: 2px; color: var(--violet-ink); }
.article-callout__label { margin-bottom: 6px; font-size: 14px; font-weight: 650; color: var(--violet-ink); }
.article-callout__text { font-size: 16.5px; line-height: 1.7; color: var(--ink); text-wrap: pretty; }

/* Le texte, en colonne de lecture : intertitres numérotés, filet qui s'efface au-dessus */
.article-body { counter-reset: sec; }
.article-body h2 { position: relative; margin: 56px 0 16px; padding-top: 28px; font-size: clamp(1.55rem, 1.15rem + 1.2vw, 2.1rem); font-weight: 620; letter-spacing: -0.035em; line-height: 1.15; text-wrap: balance; scroll-margin-top: calc(var(--nav-h) + 24px); }
.article-body h2::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgba(14, 14, 20, 0.12), rgba(14, 14, 20, 0.12) 60%, transparent); }
.article-body h2::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); display: block; width: fit-content; margin-bottom: 10px; font-size: 14px; font-weight: 650; letter-spacing: 0.02em; color: var(--violet); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .article-body h2::before { background: linear-gradient(135deg, #168EFF, #876AFF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.article-body h3 { margin: 32px 0 10px; font-size: 1.2rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3; color: var(--violet-ink); }
.article-body p { margin: 0 0 18px; font-size: 17px; line-height: 1.75; color: var(--ink-70); text-wrap: pretty; }
.article-body > p:first-child { font-size: 18.5px; line-height: 1.7; color: var(--ink); }
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body a { color: var(--violet-ink); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(91, 63, 224, 0.35); text-underline-offset: 3px; transition: text-decoration-color 200ms var(--ease-out); }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body ol, .article-body ul { list-style: none; margin: 14px 0 22px; padding: 0; }
.article-body ol { counter-reset: li; }
.article-body li { position: relative; margin-bottom: 12px; padding-left: 36px; font-size: 17px; line-height: 1.65; color: var(--ink-70); }
.article-body ol > li::before { counter-increment: li; content: counter(li); position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #168EFF, #876AFF); color: #fff; font-size: 12.5px; font-weight: 650; }
.article-body ul > li::before { content: ''; position: absolute; left: 9px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.article-body blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 2px solid rgba(135, 106, 255, 0.45); font-size: 17.5px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.article-body blockquote p { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.6; color: var(--ink); }
.article-body table { width: 100%; margin: 22px 0 26px; border-collapse: collapse; font-size: 15.5px; }
.article-body th { padding: 0 14px 12px 0; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--violet-ink); border-bottom: 1px solid rgba(135, 106, 255, 0.35); }
.article-body td { padding: 14px 14px 14px 0; vertical-align: top; line-height: 1.5; color: var(--ink-70); border-bottom: 1px solid var(--line); }
.article-body img { margin: 28px 0; border-radius: 20px; }

/* Questions fréquentes : ouvertes, séparées par des filets */
.article-faq { margin-top: 64px; }
.article-faq__title { margin-bottom: 18px; font-size: clamp(1.55rem, 1.15rem + 1.2vw, 2.1rem); font-weight: 620; letter-spacing: -0.035em; line-height: 1.15; }
.faq-item { padding: 20px 0 22px; border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item__q { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.4; }
.faq-item__a { margin-top: 8px; font-size: 16px; line-height: 1.65; color: var(--ink-70); text-wrap: pretty; }
.faq-item__a a { color: var(--violet-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Partage */
.article-share { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: 14.5px; }
.article-share__label { color: var(--ink-60); }
.article-share a, .article-share__copy { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; transition: color 200ms var(--ease-out); }
.article-share a:hover, .article-share__copy:hover { color: var(--violet-ink); }
.article-share__copy .copied-label, .article-share__copy.is-copied .copy-label { display: none; }
.article-share__copy.is-copied .copied-label { display: inline; color: var(--violet-ink); }

/* À lire aussi */
.article-related { max-width: 1120px; margin: 0 auto; padding: clamp(64px, 7vw, 104px) var(--gutter) 0; }
.article-related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(28px, 3vw, 40px); padding-top: 28px; background: linear-gradient(90deg, rgba(14, 14, 20, 0.12), rgba(14, 14, 20, 0.12) 60%, transparent) left top / 100% 1px no-repeat; }
.article-related__title { font-size: clamp(1.8rem, 1.1rem + 1.8vw, 2.6rem); font-weight: 620; letter-spacing: -0.04em; line-height: 1.08; }

/* ═══════════════ Cartes d'articles (index et « À lire aussi ») ═══════════════ */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 40px; }
.blog-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.blog-card__media { overflow: hidden; border-radius: 20px; background: #F3F0FF; box-shadow: 0 0 0 1px rgba(14, 14, 20, 0.05); }
.blog-card__media img { width: 100%; aspect-ratio: 1376 / 768; object-fit: cover; transition: transform 700ms var(--ease-out); }
.blog-card:hover .blog-card__media img { transform: scale(1.035); }
.blog-card__body { display: flex; flex-direction: column; flex: 1; padding-top: 20px; }
.blog-card__body .blog-chip { margin-bottom: 10px; }
.blog-card__title { font-size: 1.2rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.3; text-wrap: balance; transition: color 200ms var(--ease-out); }
.blog-card:hover .blog-card__title { color: var(--violet-ink); }
.blog-card__excerpt { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-60); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card__excerpt:empty { display: none; }
.blog-card__meta, .blog-featured__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--ink-60); }
.blog-card__meta { margin-top: 14px; }
.blog-card__meta span[aria-hidden], .blog-featured__meta span[aria-hidden] { font-size: 0; }
.blog-card__meta span[aria-hidden]::before, .blog-featured__meta span[aria-hidden]::before { content: ''; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--violet); opacity: 0.6; }
.blog-card__more { margin-top: auto; padding-top: 14px; font-size: 14.5px; font-weight: 600; color: var(--violet-ink); }

/* ═══════════════ Index ═══════════════ */
.blog-wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) clamp(24px, 3vw, 40px); }
.blog-header { max-width: 900px; margin: 0 auto; padding: clamp(48px, 7vw, 104px) 0 clamp(36px, 4vw, 56px); text-align: center; }
.blog-header .kicker { animation: bl-up 800ms var(--ease-out) both 40ms; }
.blog-header__title { font-size: clamp(2.6rem, 1.3rem + 4.6vw, 5.2rem); font-weight: 620; letter-spacing: -0.05em; line-height: 1; text-wrap: balance; animation: bl-up 900ms var(--ease-out) both 120ms; }
.blog-header__intro { margin: 24px auto 0; max-width: 38rem; font-size: 1.15rem; line-height: 1.65; color: var(--ink-70); text-wrap: pretty; animation: bl-up 900ms var(--ease-out) both 240ms; }
.blog-header__intro strong { font-weight: 600; color: var(--ink); }

/* Outils : filtres à gauche (seul le filtre choisi porte un fond arrondi), recherche à droite sur un filet */
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-bottom: 18px; margin-bottom: clamp(32px, 4vw, 48px); background: linear-gradient(90deg, rgba(14, 14, 20, 0.12), rgba(14, 14, 20, 0.12) 70%, transparent) left bottom / 100% 1px no-repeat; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.blog-filter { height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-60); cursor: pointer; transition: color 200ms var(--ease-out), background-color 250ms var(--ease-out); }
.blog-filter:hover { color: var(--ink); }
.blog-filter.is-active { background: var(--ink); color: #fff; }
.blog-search { position: relative; flex: 0 1 300px; }
.blog-search input { width: 100%; height: 44px; padding: 0 4px 0 30px; border: 0; border-bottom: 1px solid rgba(14, 14, 20, 0.18); border-radius: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: border-color 200ms var(--ease-out); }
.blog-search input::placeholder { color: var(--ink-60); }
.blog-search input:focus { border-bottom-color: var(--violet); }
.blog-search input::-webkit-search-cancel-button { cursor: pointer; }
.blog-search__icon { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); color: var(--ink-60); pointer-events: none; }
.blog-results { margin: 0 0 22px; font-size: 13.5px; color: var(--ink-60); }

/* À la une : l'image à gauche, le texte à droite */
.blog-featured { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4vw, 64px); margin-bottom: clamp(56px, 6vw, 88px); color: inherit; text-decoration: none; }
.blog-featured__media { overflow: hidden; border-radius: 28px; box-shadow: var(--shadow-panel); }
.blog-featured__media img { width: 100%; aspect-ratio: 1376 / 768; object-fit: cover; transition: transform 800ms var(--ease-out); }
.blog-featured:hover .blog-featured__media img { transform: scale(1.03); }
.blog-featured__eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14.5px; font-weight: 600; color: var(--violet-ink); }
.blog-featured__eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #876AFF, #168EFF); box-shadow: 0 0 0 4px rgba(135, 106, 255, 0.14); }
.blog-featured__title { font-size: clamp(1.8rem, 1rem + 2vw, 2.8rem); font-weight: 620; letter-spacing: -0.04em; line-height: 1.08; text-wrap: balance; transition: color 200ms var(--ease-out); }
.blog-featured:hover .blog-featured__title { color: var(--violet-ink); }
.blog-featured__excerpt { margin-top: 16px; font-size: 17px; line-height: 1.65; color: var(--ink-70); text-wrap: pretty; }
.blog-featured__excerpt:empty { display: none; }
.blog-featured__meta { margin-top: 20px; }

.blog-empty { padding: 40px 0; text-align: center; color: var(--ink-60); }
.blog-loadmore { display: flex; justify-content: center; margin-top: clamp(48px, 5vw, 64px); }
.blog-loadmore button { height: 48px; padding: 0 26px; border: 1px solid rgba(14, 14, 20, 0.18); border-radius: 999px; background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color 200ms var(--ease-out), background-color 200ms var(--ease-out); }
.blog-loadmore button:hover { border-color: var(--ink); background: rgba(14, 14, 20, 0.03); }

/* L'appel final commun arrive après la dernière section */
.blog-main > .final { position: relative; z-index: 1; padding-top: clamp(72px, 8vw, 120px); }

/* ═══════════════ Tablette et téléphone ═══════════════ */
@media (max-width: 1023px) {
  .article-layout { grid-template-columns: minmax(0, 700px); }
  .article-toc { display: none; }
  .article-main { grid-column: 1; }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .article-hero { padding-top: 28px; }
  .blog-header { padding-top: 32px; }
  .blog-featured { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .article-hero__media img, .blog-featured__media { border-radius: 20px; }
  .article-callout { padding: 18px 18px; }
  .article-body p, .article-body li { font-size: 16.5px; }
  .article-body > p:first-child { font-size: 17.5px; }
  .blog-tools { flex-direction: column-reverse; align-items: stretch; }
  .blog-search { flex-basis: auto; }
  .blog-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }
  .blog-filters::-webkit-scrollbar { display: none; }
  .blog-filter { flex: none; }
  .article-rate__btns { margin-left: -16px; }
}

@media (prefers-reduced-motion: reduce) {
  .article-hero .blog-chip, .article-hero__title, .article-byline, .article-hero__media,
  .blog-header .kicker, .blog-header__title, .blog-header__intro { animation: none; }
  .reading-progress__fill { transition: none; }
  .blog-card__media img, .blog-featured__media img { transition: none; }
}

/* Retour au blog, gardé sur les articles sans « À lire aussi » (articles EN) */
.article-back { display: inline-block; margin-top: clamp(40px, 5vw, 64px); font-size: 15.5px; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(14, 14, 20, 0.28); text-underline-offset: 5px; transition: color 200ms var(--ease-out), text-decoration-color 200ms var(--ease-out); }
.article-back:hover { color: var(--violet-ink); text-decoration-color: currentColor; }

/* Avis sur l'article, au-dessus du partage : question, Oui ou Non ; seul le choix fait porte un fond arrondi */
.article-rate { margin-top: 48px; padding-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; background: linear-gradient(90deg, rgba(14, 14, 20, 0.12), rgba(14, 14, 20, 0.12) 60%, transparent) left top / 100% 1px no-repeat; }
.article-rate__q { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.article-rate__btns { display: flex; gap: 4px; }
.article-rate__btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-70); cursor: pointer; transition: color 200ms var(--ease-out), background-color 250ms var(--ease-out), transform 200ms var(--ease-out); }
.article-rate__btn:hover:not(:disabled) { color: var(--violet-ink); }
.article-rate__btn:active:not(:disabled) { transform: scale(0.96); }
.article-rate__btn--no svg { transform: rotate(180deg); }
.article-rate__btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.article-rate__btn:disabled { cursor: default; }
.article-rate__btn:disabled:not([aria-pressed="true"]) { opacity: 0.4; }
.article-rate__thanks { flex-basis: 100%; font-size: 14.5px; color: var(--ink-60); animation: bl-up 500ms var(--ease-out) both; }
.article-rate__thanks a { color: var(--violet-ink); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(91, 63, 224, 0.4); text-underline-offset: 3px; }
.article-rate__thanks a:hover { text-decoration-color: currentColor; }
.article-rate + .article-share { margin-top: 14px; }
.article-faq + .article-rate { margin-top: 36px; padding-top: 0; background: none; }
