/* ============================================================
   Modèle Facile — feuille de style principale
   ============================================================ */
:root {
  /* Marque — Indigo & Amber */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-050: #eef2ff;
  --violet: #7c3aed;
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-050: #fffbeb;

  /* Neutres (slate) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;

  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 10px 30px rgba(15,23,42,.10);
  --shadow-brand: 0 8px 22px rgba(79,70,229,.30);
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background: var(--bg); line-height: 1.6; font-size: 17px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -.015em; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* --- Header --- */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; display: block; flex: 0 0 auto; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-pro { color: var(--primary); }
.site-nav { margin-left: auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: .94rem; font-weight: 600; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav .nav-tool {
  background: var(--brand-grad); color: #fff; padding: .5rem .9rem; border-radius: 10px;
  box-shadow: var(--shadow-brand);
}
.site-nav .nav-tool:hover { filter: brightness(1.05); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; margin-left: auto; }

/* --- Hero --- */
.hero { padding: 3rem 0 1.5rem; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.2rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.2rem; border-radius: 11px; font-weight: 700; font-size: .96rem;
  cursor: pointer; border: 1px solid transparent; text-align: center; transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-accent { background: var(--accent); color: #40260a; box-shadow: 0 6px 16px rgba(245,158,11,.35); }
.btn-accent:hover { background: var(--accent-dark); color: #40260a; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* --- Sections & titles --- */
main.container { padding-top: 1rem; padding-bottom: 3rem; }
.section-title { font-size: 1.35rem; margin: 2.2rem 0 1rem; }
.page-head { padding: 1.5rem 0 1rem; }
.page-head h1 { font-size: 1.9rem; margin: 0 0 .4rem; letter-spacing: -.02em; }

/* --- Cards grid --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s; color: var(--text);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.card-icon { font-size: 1.7rem; }
.card-title { font-weight: 700; font-size: 1.05rem; }
.card-desc { color: var(--muted); font-size: .92rem; }

/* --- Lists --- */
.list-links { list-style: none; padding: 0; margin: 0; }
.list-links li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-bottom: 1px solid var(--border);
}
.list-links a { font-weight: 500; }
.badge { color: var(--muted); font-size: .8rem; white-space: nowrap; }

.list-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.list-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.list-card h3 { margin: 0 0 .3rem; font-size: 1.12rem; }
.list-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.list-card a { color: var(--text); }
.list-card a:hover { text-decoration: none; color: var(--primary); }
.list-card-meta { display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.tag { font-size: .78rem; background: var(--primary-050); color: var(--primary-dark); padding: .2rem .55rem; border-radius: 6px; }
.tag-muted { background: #f0f2f5; color: var(--muted); }

/* --- Breadcrumb --- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding: 1rem 0 .2rem; }
.breadcrumb span { color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* --- Article --- */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow); max-width: 760px; }
.article-head h1 { font-size: 1.85rem; margin: 0 0 .5rem; letter-spacing: -.02em; }
.prose { font-size: 1.05rem; }
.prose h2 { font-size: 1.4rem; margin: 1.8rem 0 .7rem; }
.prose h3 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; }
.prose th { background: #f4f6f9; }

.download-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-050), #fef3c7); border: 1px solid #fcd34d;
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 1.5rem;
}
.download-box strong { display: block; font-size: 1.05rem; }
.download-formats { color: var(--muted); font-size: .85rem; }

/* --- Article wide + table of contents --- */
.article-wide { max-width: 820px; }
.toc {
  background: var(--primary-050); border: 1px solid #c7d2fe; border-radius: var(--radius);
  padding: 1rem 1.3rem; margin: 0 0 1.5rem;
}
.toc strong { display: block; margin-bottom: .4rem; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .25rem 0; }

/* --- Template cards --- */
.templates { margin-top: 2.4rem; }
.templates > h2 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.template-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 1.3rem 1.4rem; margin-bottom: 1.3rem; box-shadow: var(--shadow); scroll-margin-top: 80px;
}
.template-head h3 { margin: 0 0 .35rem; font-size: 1.25rem; }
.template-tag { margin: 0 0 .8rem; color: var(--accent); font-size: .9rem; font-weight: 600; }
.template-desc { font-size: 1rem; }
.template-desc p { margin: 0 0 .8rem; }
.template-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.template-formats { display: flex; gap: .4rem; flex-wrap: wrap; }
.fmt { font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .2rem .5rem; border-radius: 5px; background: #eef2f7; color: var(--muted); text-transform: uppercase; }
.fmt-word { background: #e7effb; color: #1d4ed8; }
.fmt-excel { background: #e6f5ec; color: #12794a; }
.fmt-pdf { background: #fdeaea; color: #c0392b; }
.template-soon { color: var(--muted); font-size: .85rem; font-style: italic; }

/* --- FAQ --- */
.faq { margin-top: 2rem; }
.faq details { border: 1px solid var(--border); border-radius: 9px; padding: .3rem .9rem; margin-bottom: .6rem; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: .6rem 0; }
.faq p { margin: 0 0 .7rem; color: var(--muted); }

.related { margin-top: 2rem; }

/* --- Ads --- */
.ad-wrap { margin: 1.6rem 0; text-align: center; }
.ad-placeholder {
  border: 1px dashed #c7cfdb; border-radius: 8px; color: #9aa4b3; font-size: .8rem;
  padding: 1.4rem; background: repeating-linear-gradient(45deg,#fafbfc,#fafbfc 10px,#f3f5f8 10px,#f3f5f8 20px);
}

/* --- Generator --- */
.gen-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); gap: 1.5rem; align-items: start; }
.gen-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.gen-form fieldset { border: 1px solid var(--border); border-radius: 9px; margin: 0 0 1rem; padding: .8rem 1rem 1rem; }
.gen-form legend { font-weight: 700; font-size: .9rem; padding: 0 .4rem; }
.gen-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.gen-form label.full { margin-top: .5rem; }
.gen-form input, .gen-form select, .gen-form textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit;
  border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text);
}
.gen-form input:focus, .gen-form select:focus, .gen-form textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.line-row { display: grid; grid-template-columns: 1fr 68px 90px 32px; gap: .4rem; margin-bottom: .5rem; align-items: center; }
.line-row input { margin-top: 0; }
.l-del { background: #fff0f0; border: 1px solid #f3c9c9; color: #c0392b; border-radius: 7px; cursor: pointer; height: 100%; }
.gen-actions { margin-top: .5rem; }
.gen-preview { position: sticky; top: 78px; }

/* Document sheet (facture/devis) */
.doc-sheet {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-md);
  padding: 2rem; font-size: .92rem; color: #1f2733; min-height: 400px;
}
.doc-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.doc-title h2 { margin: 0 0 .3rem; color: var(--primary-dark); letter-spacing: .05em; text-align: right; }
.doc-title div { text-align: right; font-size: .85rem; color: var(--muted); }
.doc-to { margin-bottom: 1.2rem; }
.doc-to .muted, .muted { color: var(--muted); }
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.doc-table th { background: #f4f6f9; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--border); padding: .5rem .6rem; text-align: left; }
.doc-table .num { text-align: right; }
.doc-totals { margin-left: auto; width: 260px; }
.doc-totals div { display: flex; justify-content: space-between; padding: .3rem 0; }
.doc-totals .ttc { border-top: 2px solid var(--text); font-weight: 700; font-size: 1.05rem; margin-top: .3rem; padding-top: .5rem; }
.doc-notes { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* --- Footer --- */
.site-footer { background: var(--ink); color: #cbd5e1; margin-top: 3.5rem; padding: 2.4rem 0;
  border-top: 3px solid transparent; border-image: var(--brand-grad) 1; }
.footer-inner { display: grid; gap: 1rem; }
.site-footer strong { color: #fff; font-family: var(--font-display); }
.site-footer p { margin: .3rem 0; font-size: .9rem; }
.footer-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-nav a { color: #94a3b8; font-size: .9rem; }
.footer-nav a:hover { color: #fff; }
.copyright { color: #64748b; font-size: .82rem; }

/* --- Consent banner --- */
.consent-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 1rem 1.2rem; z-index: 50;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.consent-banner p { margin: 0; font-size: .9rem; flex: 1 1 260px; }
.consent-actions { display: flex; gap: .6rem; }

/* --- Responsive --- */
@media (max-width: 820px) {
  .gen-layout { grid-template-columns: 1fr; }
  .gen-preview { position: static; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface);
    flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .6rem 0; width: 100%; }
  .site-nav .nav-tool { width: 100%; }
  .hero h1 { font-size: 1.7rem; }
  .article { padding: 1.2rem; }
}

/* --- Print (facture/devis) --- */
@media print {
  .site-header, .site-footer, .consent-banner, .gen-form, .breadcrumb, .page-head, .ad-wrap, .gen-explainer { display: none !important; }
  body { background: #fff; }
  .doc-sheet { box-shadow: none; border: 0; padding: 0; }
}

/* =====================================================================
   UI v2 — hero, category cards, post grid with thumbnails, hero banner
   ===================================================================== */
.hero { position: relative; padding: 3.4rem 0 1.6rem; overflow: hidden; }
.hero::before { content: ""; position: absolute; top: -180px; right: -140px; width: 520px; height: 520px;
  background: radial-gradient(closest-side, rgba(139,92,246,.20), rgba(99,102,241,.10) 55%, transparent 72%); z-index: -1; }
.hero-inner { max-width: 740px; }
.hero-eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 800;
  color: var(--primary); background: var(--primary-050); padding: .35rem .7rem; border-radius: 20px; margin: 0 0 1rem; }
.hero h1 { font-size: 2.5rem; line-height: 1.1; margin: 0 0 .8rem; letter-spacing: -.025em; }
.hero .lead { font-size: 1.12rem; max-width: 620px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2.4rem 0 1.1rem; }
.section-head .section-title { margin: 0; }
.section-sub { color: var(--muted); font-size: .9rem; }

/* Category cards (home) */
.cat-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; display: flex; flex-direction: column; gap: .45rem; box-shadow: var(--shadow);
  color: var(--text); overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.cat-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--cat); }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none;
  border-color: color-mix(in srgb, var(--cat) 45%, var(--border)); }
.cat-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 1.55rem;
  background: color-mix(in srgb, var(--cat) 14%, transparent); margin-bottom: .2rem; }
.cat-title { font-weight: 700; font-size: 1.08rem; }
.cat-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.cat-more { color: var(--cat); font-weight: 700; font-size: .85rem; margin-top: .3rem; }

/* Post grid with feature-image thumbnails */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1.3rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #eef2f7; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.post-card:hover .post-thumb img { transform: scale(1.045); }
.post-count { position: absolute; right: .6rem; bottom: .6rem; background: rgba(16,21,31,.74); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 20px; }
.post-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.post-cat { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.post-title { font-size: 1.1rem; margin: 0; line-height: 1.3; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); text-decoration: none; }
.post-desc { color: var(--muted); font-size: .9rem; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-more { color: var(--primary); font-weight: 700; font-size: .85rem; margin-top: .5rem; }

/* Category page header */
.cat-head { display: flex; align-items: center; gap: 1.1rem; }
.cat-head-icon { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; font-size: 2rem;
  flex: 0 0 auto; background: color-mix(in srgb, var(--cat) 15%, transparent); }
.cat-head h1 { margin: 0 0 .25rem; }

/* Article hero banner */
.article-hero { margin: 0 0 1.5rem; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 6.6; box-shadow: var(--shadow); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

@media (max-width: 680px) {
  .hero h1 { font-size: 1.75rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .cat-head { gap: .8rem; }
  .cat-head-icon { width: 50px; height: 50px; font-size: 1.6rem; }
  .article-hero { aspect-ratio: 16 / 8; }
}

/* =====================================================================
   Homepage v3 — content-rich, article-first
   ===================================================================== */
.home-hero { display: grid; grid-template-columns: 1.02fr .98fr; gap: 2.2rem; align-items: center; padding: 2.4rem 0 1.6rem; }
.hh-text { max-width: 560px; }
.home-hero h1 { font-size: 2.4rem; line-height: 1.08; margin: 0 0 .7rem; letter-spacing: -.025em; }
.home-hero .lead { font-size: 1.08rem; margin-bottom: 1.2rem; }
.cat-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip { font-size: .82rem; font-weight: 600; padding: .42rem .8rem; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-flex; gap: .35rem; align-items: center; }
.chip:hover { border-color: var(--cat); color: var(--cat); text-decoration: none; box-shadow: var(--shadow); }

.hh-featured { display: block; position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-md); color: var(--text); transition: transform .15s; }
.hh-featured:hover { text-decoration: none; transform: translateY(-3px); }
.hh-featured img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.hh-featured-badge { position: absolute; top: .8rem; left: .8rem; z-index: 2; background: var(--accent); color: #40260a;
  font-weight: 800; font-size: .72rem; padding: .3rem .65rem; border-radius: 20px; letter-spacing: .03em; box-shadow: 0 4px 12px rgba(245,158,11,.4); }
.hh-featured-body { padding: 1.1rem 1.35rem 1.35rem; }
.hh-featured-body h2 { font-size: 1.32rem; margin: .25rem 0 .45rem; line-height: 1.25; }
.hh-featured-body p { color: var(--muted); font-size: .95rem; margin: 0 0 .6rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.cat-section { margin-top: 2.6rem; }
.cat-section .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.cat-section-title { display: flex; align-items: center; gap: .65rem; font-size: 1.45rem; margin: 0; }
.cat-section-ico { width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 1.2rem;
  background: color-mix(in srgb, var(--cat) 15%, transparent); }
.cat-section-all { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.cat-section-all:hover { text-decoration: none; opacity: .8; }

.home-about { margin-top: 3rem; padding: 2rem 2.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.home-about .prose { max-width: 820px; }
.home-about h2 { margin-top: 0; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 1.6rem; }
  .home-hero .hh-featured { order: 2; }
}
@media (max-width: 680px) {
  .home-hero h1 { font-size: 1.9rem; }
  .cat-section-title { font-size: 1.25rem; }
}

/* --- Template downloads (format variants) --- */
.template-dl-label { font-weight: 700; font-size: .85rem; color: var(--muted); }
.template-downloads { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-dl { padding: .42rem .85rem; font-size: .85rem; }

/* --- Gallery de styles (aperçus) --- */
.templates-sub { color: var(--muted); margin: -.4rem 0 1.3rem; }
.template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.3rem; }
.tpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; scroll-margin-top: 80px; }
.tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tpl-preview { display: block; background: #eef2f7; aspect-ratio: 1 / 1.32; overflow: hidden; border-bottom: 1px solid var(--border); }
.tpl-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform .3s ease; }
.tpl-card:hover .tpl-preview img { transform: scale(1.03); }
.tpl-body { padding: .9rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tpl-body h3 { font-size: 1rem; margin: 0; line-height: 1.25; }
.tpl-desc { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-desc p { margin: 0 0 .3rem; }
.tpl-desc strong { color: var(--text); }
.tpl-downloads { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }

/* --- Topic clusters (pilier / clusters) --- */
.pillar-callout { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--cat) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cat) 28%, var(--border));
  border-left: 4px solid var(--cat); border-radius: 10px; padding: .75rem 1rem; margin: 0 0 1.3rem; font-size: .92rem; }
.pillar-callout:hover { text-decoration: none; background: color-mix(in srgb, var(--cat) 15%, var(--surface)); }
.pillar-callout-ico { font-size: 1.1rem; }
.pillar-callout strong { color: var(--cat); }

.cluster-block { margin: 2.2rem 0; padding: 1.5rem 1.6rem; background: var(--primary-050); border: 1px solid #c7d2fe; border-radius: var(--radius); }
.cluster-block > h2 { margin-top: 0; }
.cluster-intro { color: var(--muted); margin: -.3rem 0 1.1rem; }
.cluster-block .posts-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #151c2c; --ink: #f1f5f9; --text: #cbd5e1; --muted: #94a3b8;
    --border: #263248; --primary-050: #1e1b4b; --accent-050: #2a1f0a;
    --shadow: none; --shadow-md: 0 10px 30px rgba(0,0,0,.45);
  }
  .toc { border-color: #3730a3; }
  .tag { background: #1e2a44; }
  .tag-muted { background: #222b37; }
  .download-box { background: #16233b; border-color: #23375f; }
  .prose th, .doc-table th { background: #1c2530; }
  .ad-placeholder { background: #141a22; border-color: #2c3846; color: #5b6675; }
  .doc-sheet { color: #e6eaf0; }
  .gen-form input, .gen-form select, .gen-form textarea { background: #10161e; color: var(--text); }
}
