/* =====================================================================
   Décolle — Blog / Ressources : index, articles (prose), glossaire
   Chargé uniquement sur les pages de contenu (blog.html + articles).
   Réutilise le design system (style.css) ; ajoute la typographie d'article,
   les cartes d'articles, le sommaire (TOC) et le glossaire filtrable.
   ===================================================================== */

/* ---- En-tête d'article : méta (auteur · date · lecture) ---------- */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; color: var(--on-space-muted); font-size: .92rem; }
.post-meta .dotsep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.post-meta b { color: #fff; font-weight: 600; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.post-cat { font-family: var(--font-head); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #b9acff; background: rgba(124,92,255,.16); border: 1px solid rgba(124,92,255,.3); padding: 5px 12px; border-radius: 100px; }

/* ---- Liste d'articles (index) ------------------------------------ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 50px; }
.post { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.post:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post__cover { aspect-ratio: 16 / 9; position: relative; overflow: hidden; display: grid; place-items: center; }
.post__cover svg { width: 64px; height: 64px; color: #fff; opacity: .92; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.post__cover::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000, transparent 75%); mask-image: radial-gradient(120% 90% at 50% 30%, #000, transparent 75%); }
.post__body { display: flex; flex-direction: column; gap: 10px; padding: 22px; flex: 1; }
.post__cat { font-family: var(--font-head); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--violet-d); }
.post__title { font-size: 1.22rem; line-height: 1.25; }
.post__excerpt { color: var(--muted); font-size: .96rem; flex: 1; }
.post__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.post__more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 600; color: var(--violet-d); }
.post__more svg { width: 16px; height: 16px; transition: transform .25s; }
.post:hover .post__more svg { transform: translateX(4px); }

/* ---- Mise en page article : sommaire + corps -------------------- */
.article { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; max-width: 1040px; margin-inline: auto; }
.toc { position: sticky; top: calc(var(--nav-h) + 22px); }
.toc__title { font-family: var(--font-head); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc__list { display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc__list a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: .94rem; line-height: 1.3; transition: color .2s, border-color .2s; }
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--violet-d); border-left-color: var(--violet); font-weight: 600; }

/* ---- Typographie de contenu (prose) ----------------------------- */
.prose { max-width: 740px; }
.prose > * + * { margin-top: 1.15em; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.8; font-size: 1.07rem; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin-top: 1.9em; scroll-margin-top: calc(var(--nav-h) + 22px); }
.prose h2 .num { color: var(--violet); -webkit-text-fill-color: var(--violet); margin-right: .35em; }
.prose h3 { font-size: 1.28rem; margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: .5em; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li::marker { color: var(--violet); }
.prose a { color: var(--violet-d); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: rgba(124,92,255,.4); transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--violet); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose blockquote { border-left: 3px solid var(--violet); background: var(--paper-2); border-radius: 0 10px 10px 0; padding: 14px 20px; color: var(--ink-2); font-style: italic; }
.prose figure { margin: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--paper-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--violet-d); }

/* bloc copiable (templates, emails, prompts) */
.copyblock { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 16px 0; }
.copyblock__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.copyblock__obj { font-family: var(--font-head); font-weight: 600; font-size: .96rem; color: var(--ink); }
.copyblock__btn { flex: none; font-family: var(--font-head); font-weight: 600; font-size: .8rem; color: var(--violet-d);
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px; background: var(--paper); cursor: pointer; transition: border-color .2s, color .2s; }
.copyblock__btn:hover { border-color: var(--violet); }
.copyblock__btn.copied { color: #0a9d63; border-color: #0a9d63; }
.copyblock__body { white-space: pre-wrap; color: var(--ink-2); font-size: .97rem; line-height: 1.6; }

/* encadré "points clés" en tête d'article */
.keypoints { background: linear-gradient(160deg, var(--space-2), var(--space)); color: var(--on-space); border: 1px solid var(--space-line);
  border-radius: var(--radius); padding: 24px 26px; }
.keypoints h2 { font-size: 1.05rem !important; margin: 0 0 12px !important; color: #fff; display: flex; align-items: center; gap: 9px; }
.keypoints h2 svg { width: 20px; height: 20px; color: var(--cyan); }
.keypoints ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; list-style: none; }
.keypoints li { color: var(--on-space-muted); font-size: .98rem; position: relative; padding-left: 4px; }
.keypoints li::before { content: "→"; position: absolute; left: -18px; color: var(--cyan); }

/* astuce / note (réutilise l'esprit .callout, version article) */
.note { display: flex; gap: 14px; background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.22); border-radius: 14px; padding: 16px 18px; }
.note__ico { flex: none; width: 30px; height: 30px; }
.note p { margin: 0; font-size: 1rem; }

/* ---- Articles liés ---------------------------------------------- */
.related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 30px; }

/* ---- Glossaire filtrable ----------------------------------------- */
.glossary__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin: 30px 0 8px; }
.glossary__search { position: relative; flex: 1; max-width: 420px; min-width: 240px; }
.glossary__search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.glossary__search input { width: 100%; padding: 13px 16px 13px 42px; border-radius: 100px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
.glossary__search input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.glossary__count { color: var(--muted); font-size: .9rem; }
.glossary__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
.term { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.term[hidden] { display: none; }
.term dt { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--ink); margin-bottom: 6px; }
.term dd { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.6; }
.term mark { background: rgba(124,92,255,.22); color: inherit; border-radius: 3px; padding: 0 2px; }
.glossary__empty { text-align: center; color: var(--muted); padding: 30px; }

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .article { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
  .toc__list { display: flex; flex-wrap: wrap; gap: 4px 10px; border-left: 0; }
  .toc__list a { border-left: 0; padding: 4px 0; }
  .toc__list a.is-active { border-left: 0; }
}
@media (max-width: 620px) {
  .post-grid { grid-template-columns: 1fr; }
  .glossary__grid { grid-template-columns: 1fr; }
  .related { grid-template-columns: 1fr; }
}
