/* VideoGenAPI blog : mise en page éditoriale (articles + index). */
:root {
  --b-ink: #0B0B14;
  --b-text: #262633;
  --b-muted: #6B6B7B;
  --b-faint: #9A9AA8;
  --b-line: #ECECF1;
  --b-soft: #F7F7FA;
  --b-accent: #6D4AFF;
  --b-accent-soft: #F1EDFF;
  --b-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --b-display: 'Bricolage Grotesque', Inter, system-ui, sans-serif;
  --b-sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --b-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
body.blog { background: #fff; color: var(--b-text); font-family: var(--b-sans); }

/* Barre de progression de lecture */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, #8B5CF6, #3B82F6, #EC4899, #F97316); transition: width .1s linear; }

/* ---------- En-tête d'article ---------- */
.post-hero { padding: 120px 24px 0; }
.post-hero-inner { max-width: 820px; margin: 0 auto; }
.post-crumbs { font-size: 13px; color: var(--b-faint); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.post-crumbs a:hover { color: var(--b-ink); }
.post-kicker { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--b-accent); }
.post-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.post-title { font-family: var(--b-display); font-size: clamp(32px, 5vw, 54px); line-height: 1.06; letter-spacing: -.025em; font-weight: 700; color: var(--b-ink); margin: 14px 0 0; }
.post-dek { font-family: var(--b-serif); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.5; color: var(--b-muted); margin: 18px 0 0; max-width: 720px; }
.post-meta { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--b-line); border-bottom: 1px solid var(--b-line); flex-wrap: wrap; }
.author-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; background: linear-gradient(135deg, #8B5CF6, #3B82F6 45%, #EC4899); }
.post-meta .who { line-height: 1.35; flex: 1; min-width: 0; }
.post-meta .who a { font-weight: 600; color: var(--b-ink); }
.post-meta .who span { display: block; font-size: 13px; color: var(--b-muted); }
.post-meta .share { margin-left: auto; display: flex; gap: 6px; }
.share-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--b-line); display: grid; place-items: center; color: var(--b-muted); background: #fff; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.share-btn:hover { color: var(--b-ink); border-color: #D6D6DE; background: var(--b-soft); }
.share-btn svg { width: 16px; height: 16px; }
.share-btn.copied { color: #15803D; border-color: #BBE5C8; }

.post-cover { max-width: 1120px; margin: 40px auto 0; padding: 0 24px; }
.post-cover .cover { border-radius: 20px; overflow: hidden; aspect-ratio: 21 / 9; }

/* Couverture générée (SVG) */
.cover { position: relative; display: block; background: #111; }
.cover svg { display: block; width: 100%; height: 100%; }

/* ---------- Corps : colonne de lecture + sommaire ---------- */
.post-layout { max-width: 1120px; margin: 0 auto; padding: 56px 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 72px; }
.post-main { max-width: 700px; min-width: 0; }
.toc { position: sticky; top: 104px; align-self: start; font-size: 14px; }
.toc-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--b-faint); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--b-line); }
.toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--b-muted); line-height: 1.4; }
.toc li a:hover { color: var(--b-ink); }
.toc li a.active { color: var(--b-accent); border-left-color: var(--b-accent); font-weight: 500; }
.toc-cta { margin-top: 28px; padding: 18px; border-radius: 14px; background: var(--b-soft); border: 1px solid var(--b-line); }
.toc-cta p { font-size: 13px; color: var(--b-muted); margin: 6px 0 12px; line-height: 1.5; }
.toc-cta strong { color: var(--b-ink); font-size: 14px; }
.toc-cta a { display: inline-block; font-size: 13px; font-weight: 600; color: #fff; background: var(--b-ink); padding: 8px 14px; border-radius: 999px; }

/* Typographie de l'article */
.article-body { font-family: var(--b-serif); font-size: 19px; line-height: 1.75; color: var(--b-text); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.35em; }
.article-body h2 { font-family: var(--b-display); font-size: 30px; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; color: var(--b-ink); margin: 2.2em 0 .7em; scroll-margin-top: 100px; }
.article-body h3 { font-family: var(--b-sans); font-size: 20px; line-height: 1.35; font-weight: 650; color: var(--b-ink); margin: 1.8em 0 .6em; scroll-margin-top: 100px; }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding-left: 1.3em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: .55em; padding-left: .2em; }
.article-body li::marker { color: var(--b-accent); }
.article-body strong { color: var(--b-ink); font-weight: 650; }
.article-body a { color: var(--b-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(109, 74, 255, .35); transition: text-decoration-color .15s; }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body blockquote { margin: 2em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--b-accent); font-style: italic; color: var(--b-ink); font-size: 21px; }
.article-body hr { border: 0; border-top: 1px solid var(--b-line); margin: 3em 0; }
.article-body img { border-radius: 12px; margin: 2em 0; }

/* Résumé (TL;DR) */
.tldr { font-family: var(--b-sans); font-size: 16.5px; line-height: 1.65; background: var(--b-accent-soft); border: 1px solid #E2DAFF; border-radius: 16px; padding: 22px 24px; margin: 0 0 2.4em; color: #2B2350; }
.tldr-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--b-accent); margin-bottom: 8px; }
.tldr p { margin: 0; }
.tldr strong { color: #1B1440; }

/* Tableaux */
.table-scroll { margin: 2em 0; overflow-x: auto; border: 1px solid var(--b-line); border-radius: 14px; }
.article-body table { width: 100%; border-collapse: collapse; font-family: var(--b-sans); font-size: 14.5px; line-height: 1.5; }
.article-body th { background: var(--b-soft); text-align: left; padding: 12px 16px; font-weight: 600; color: var(--b-ink); border-bottom: 1px solid var(--b-line); white-space: nowrap; }
.article-body td { padding: 12px 16px; border-bottom: 1px solid var(--b-line); vertical-align: top; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body td:first-child { font-weight: 500; color: var(--b-ink); }

/* Code */
.code-block { position: relative; margin: 1.8em 0; }
.article-body pre { background: #0F0F1A; color: #E6E6F0; padding: 20px 22px; border-radius: 14px; overflow-x: auto; font-size: 14px; line-height: 1.65; font-family: var(--b-mono); margin: 0; }
.article-body pre code { font-family: inherit; background: none; color: inherit; padding: 0; font-size: inherit; }
.article-body :not(pre) > code { font-family: var(--b-mono); font-size: .82em; background: var(--b-soft); border: 1px solid var(--b-line); color: #4C2FD9; padding: .12em .4em; border-radius: 6px; }
.copy-code { position: absolute; top: 10px; right: 10px; font-family: var(--b-sans); font-size: 12px; font-weight: 500; color: #B9B9CC; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.copy-code:hover { color: #fff; background: rgba(255, 255, 255, .16); }

/* CTA dans l'article */
.post-cta { font-family: var(--b-sans); margin: 2.6em 0; border-radius: 18px; padding: 28px; background: var(--b-ink); color: #fff; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.post-cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 200px at 100% 0%, rgba(139, 92, 246, .45), transparent 60%), radial-gradient(400px 200px at 0% 100%, rgba(236, 72, 153, .3), transparent 60%); pointer-events: none; }
.post-cta > * { position: relative; }
.post-cta h3 { font-family: var(--b-display); font-size: 22px; margin: 0 0 4px; color: #fff; }
.post-cta p { margin: 0; color: #C9C9D6; font-size: 15px; line-height: 1.5; }
.post-cta a.btn { flex: none; background: #fff; color: var(--b-ink) !important; text-decoration: none !important; font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 999px; }
.post-cta a.btn:hover { background: #EDE9FF; }

/* FAQ */
.faq { margin-top: .5em; border-top: 1px solid var(--b-line); font-family: var(--b-sans); }
.faq details { border-bottom: 1px solid var(--b-line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-weight: 600; font-size: 17px; color: var(--b-ink); line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 14px; font-size: 24px; font-weight: 300; color: var(--b-muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 20px; font-size: 16px; line-height: 1.7; color: var(--b-text); }

/* Sources */
.sources { font-family: var(--b-sans); font-size: 14px; color: var(--b-muted); }
.sources ol { padding-left: 1.4em; list-style: decimal; }
.sources li { margin-bottom: .45em; }
.sources a { color: var(--b-text); text-decoration-color: var(--b-line); }

/* Fin d'article : partage + auteur */
.post-end { margin-top: 3.5em; padding-top: 28px; border-top: 1px solid var(--b-line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--b-sans); }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-chip { font-size: 13px; font-weight: 500; color: var(--b-text); background: var(--b-soft); border: 1px solid var(--b-line); padding: 5px 12px; border-radius: 999px; }
.tag-chip:hover { border-color: #D6D6DE; color: var(--b-ink); }
.author-card { margin-top: 32px; display: flex; gap: 18px; padding: 24px; border-radius: 18px; background: var(--b-soft); border: 1px solid var(--b-line); font-family: var(--b-sans); }
.author-card .author-avatar { width: 56px; height: 56px; font-size: 18px; }
.author-card .name { font-weight: 650; color: var(--b-ink); font-size: 16px; }
.author-card .role { font-size: 13px; color: var(--b-muted); margin-bottom: 8px; }
.author-card p { font-size: 15px; line-height: 1.6; color: var(--b-text); margin: 0; }
.author-card a.more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--b-accent); }

/* À lire ensuite + index : cartes */
.more-posts { max-width: 1120px; margin: 96px auto 0; padding: 56px 24px 0; border-top: 1px solid var(--b-line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-family: var(--b-display); font-size: 28px; letter-spacing: -.015em; color: var(--b-ink); font-weight: 700; }
.section-head a { font-size: 14px; font-weight: 600; color: var(--b-accent); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
.post-card { display: flex; flex-direction: column; color: inherit; }
.post-card .cover { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.post-card:hover .cover { transform: translateY(-3px); box-shadow: 0 16px 32px -16px rgba(20, 10, 60, .35); }
.post-card .meta { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--b-faint); }
.post-card .meta .cat { color: var(--b-accent); font-weight: 600; }
.post-card h3 { font-family: var(--b-display); font-size: 20px; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; color: var(--b-ink); margin: 8px 0 0; }
.post-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-card p { font-size: 15px; line-height: 1.55; color: var(--b-muted); margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Index du blog ---------- */
.blog-top { padding: 128px 24px 0; max-width: 1120px; margin: 0 auto; }
.blog-top h1 { font-family: var(--b-display); font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.03em; font-weight: 700; color: var(--b-ink); }
.blog-top h1 em { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.blog-top .intro { font-family: var(--b-serif); font-size: 20px; line-height: 1.55; color: var(--b-muted); max-width: 640px; margin-top: 18px; }
.featured { max-width: 1120px; margin: 48px auto 0; padding: 0 24px; }
.featured a { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; color: inherit; }
.featured .cover { aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; transition: box-shadow .25s; }
.featured a:hover .cover { box-shadow: 0 24px 48px -20px rgba(20, 10, 60, .4); }
.featured .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--b-accent); }
.featured h2 { font-family: var(--b-display); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; color: var(--b-ink); margin: 12px 0 0; }
.featured a:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.featured p { font-family: var(--b-serif); font-size: 18px; line-height: 1.6; color: var(--b-muted); margin: 14px 0 0; }
.featured .meta { margin-top: 20px; display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--b-muted); }
.featured .meta .author-avatar { width: 32px; height: 32px; font-size: 12px; }
.blog-filters { max-width: 1120px; margin: 72px auto 0; padding: 0 24px 20px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--b-line); }
.filter-chip { font: inherit; font-size: 14px; font-weight: 500; color: var(--b-muted); background: #fff; border: 1px solid var(--b-line); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.filter-chip:hover { color: var(--b-ink); border-color: #D6D6DE; }
.filter-chip.is-active { background: var(--b-ink); border-color: var(--b-ink); color: #fff; }
.filter-chip span { opacity: .55; margin-left: 4px; }
.blog-list { max-width: 1120px; margin: 40px auto 0; padding: 0 24px; }

@media (max-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-main { margin: 0 auto; width: 100%; }
  .toc { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured a { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .post-hero { padding-top: 100px; }
  .post-hero, .post-cover, .post-layout, .more-posts, .blog-top, .featured, .blog-filters, .blog-list { padding-left: 16px; padding-right: 16px; }
  .post-cover .cover { aspect-ratio: 16 / 10; border-radius: 14px; }
  .article-body { font-size: 18px; }
  .article-body h2 { font-size: 25px; }
  .post-meta .share { margin-left: 0; width: 100%; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-cta { padding: 22px; }
  .author-card { flex-direction: column; }
}
