/*
Theme Name: Guide Figma → MCP
Theme URI: https://viruscomm.ca/
Author: Équipe dev — Virus Santé Communication
Author URI: https://viruscomm.ca/
Description: Thème mono-page présentant le guide « Préparer un fichier Figma pour le MCP » destiné aux infographistes. Design éditorial, animations de lecture (barre de progression, scroll-reveal, scrollspy). Français uniquement.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: guide-figma-mcp
*/

/* =========================================================================
   1. Tokens — palette éditoriale, typo, rythme
   ========================================================================= */
:root {
  /* Papier & encre */
  --paper:        #f6f1e7;   /* crème */
  --paper-2:      #efe8da;   /* crème légèrement plus profond (cartes) */
  --paper-3:      #e7decd;   /* bordures douces / séparations */
  --ink:          #2c2722;   /* encre chaude */
  --ink-soft:     #5b5349;   /* texte secondaire */
  --ink-faint:    #8a8073;   /* légendes, méta */

  /* Accent vert sauge */
  --sage:         #6d7f60;
  --sage-deep:    #4f5e44;
  --sage-soft:    #cdd6c2;
  --sage-tint:    #e4eadd;

  /* Signalétique */
  --warn:         #b06a3c;   /* terre cuite pour les « pièges » */
  --warn-tint:    #f0e0d2;
  --ok:           #5f7a4f;
  --ok-tint:      #e0ead7;

  /* Code */
  --code-bg:      #2c2722;
  --code-ink:     #ece4d6;
  --code-green:   #a9bf97;
  --code-faint:   #897f70;

  /* Typo */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Rythme */
  --maxw:         720px;
  --maxw-wide:    1080px;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 1px 2px rgba(44,39,34,.04), 0 8px 30px rgba(44,39,34,.07);
  --shadow-soft:  0 1px 2px rgba(44,39,34,.04), 0 4px 16px rgba(44,39,34,.05);
}

/* =========================================================================
   2. Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.72;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Léger grain de papier */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image: radial-gradient(rgba(44,39,34,.025) 1px, transparent 1px);
  background-size: 3px 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 540;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}

p { margin: 0 0 1.1em; }
a { color: var(--sage-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--sage); }

strong { font-weight: 650; }
em { font-style: italic; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
  border-radius: 5px;
  padding: .1em .38em;
}
kbd {
  background: #fff;
  box-shadow: 0 1px 0 var(--paper-3);
  font-size: .8em;
  padding: .12em .45em;
}

hr {
  border: 0;
  border-top: 1px solid var(--paper-3);
  margin: 3rem 0;
}

::selection { background: var(--sage-soft); color: var(--ink); }

/* =========================================================================
   3. Barre de progression de lecture
   ========================================================================= */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--sage), var(--sage-deep));
  z-index: 100;
  transition: width .08s linear;
}
@media (prefers-reduced-motion: reduce) { .reading-progress { transition: none; } }

/* =========================================================================
   4. Mise en page : sommaire latéral + contenu
   ========================================================================= */
.layout {
  position: relative;
  z-index: 1;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 1000px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
}

/* Sommaire */
.toc {
  display: none;
}
@media (min-width: 1000px) {
  .toc {
    display: block;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 40px 0;
    font-size: 14px;
    line-height: 1.45;
  }
}
.toc__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  gap: 9px;
  padding: 5px 10px 5px 12px;
  margin-left: -12px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 0 6px 6px 0;
  transition: color .15s, background .15s, border-color .15s;
}
.toc a:hover { color: var(--ink); background: var(--paper-2); }
.toc a .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  padding-top: 2px;
  min-width: 18px;
}
.toc a.is-active {
  color: var(--sage-deep);
  border-left-color: var(--sage);
  background: var(--sage-tint);
}
.toc a.is-active .num { color: var(--sage-deep); }

/* Contenu */
.content {
  max-width: var(--maxw);
  padding: 0 0 8rem;
}

/* =========================================================================
   5. En-tête éditorial
   ========================================================================= */
.masthead {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--paper-3);
  margin-bottom: 56px;
}
.masthead__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.masthead__kicker::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--sage);
}
.masthead h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  margin: 0 0 .4em;
  font-weight: 560;
}
.masthead__lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 36ch;
}
.masthead__meta {
  margin-top: 32px;
  font-size: 14px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.masthead__meta span { display: inline-flex; align-items: center; gap: 7px; }
.masthead__meta span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--sage);
}

/* =========================================================================
   6. Sections
   ========================================================================= */
.section { scroll-margin-top: 24px; padding: 18px 0 8px; }
.section + .section { border-top: 1px solid var(--paper-3); margin-top: 40px; }

.section__num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--sage-deep);
  letter-spacing: .05em;
  margin: 0 0 6px;
}
.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  margin: 0 0 .7em;
}
.section h3 {
  font-size: 1.18rem;
  margin: 2em 0 .6em;
  color: var(--ink);
}
.section ul, .section ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.section li { margin: .3em 0; }
.section li::marker { color: var(--sage); }

.lead { font-size: 1.12rem; color: var(--ink-soft); }

/* =========================================================================
   7. Encadrés
   ========================================================================= */
.callout {
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 1.8em 0;
  box-shadow: var(--shadow-soft);
  background: var(--paper-2);
  border: 1px solid var(--paper-3);
}
.callout__title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.callout p:last-child { margin-bottom: 0; }

/* « Concrètement dans Figma » */
.callout--figma {
  background: var(--sage-tint);
  border-color: var(--sage-soft);
}
.callout--figma .callout__title { color: var(--sage-deep); }

/* « Piège » */
.callout--warn {
  background: var(--warn-tint);
  border-color: #e6c9b2;
}
.callout--warn .callout__title { color: var(--warn); }

/* « À retenir » */
.callout--note {
  background: #fff;
  border-color: var(--paper-3);
}
.callout--note .callout__title { color: var(--ink-faint); }

/* Médical : placeholder à valider */
.callout--med {
  background: #fbf7ef;
  border: 1px dashed #d8c79f;
}
.callout--med .callout__title { color: #a07d2e; }

/* =========================================================================
   8. Code & avant/après
   ========================================================================= */
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 1.2em 0;
  box-shadow: var(--shadow-soft);
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
pre .c { color: var(--code-faint); }     /* commentaire */
pre .g { color: var(--code-green); }     /* mise en avant */

.beforeafter {
  display: grid;
  gap: 16px;
  margin: 1.6em 0;
}
@media (min-width: 720px) { .beforeafter { grid-template-columns: 1fr 1fr; } }
.beforeafter__col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.beforeafter__col--before h4 { color: var(--warn); }
.beforeafter__col--after h4 { color: var(--ok); }
.beforeafter pre { margin: 0; height: 100%; }

/* =========================================================================
   9. Check-list de remise
   ========================================================================= */
.checklist { list-style: none; padding: 0; margin: 1.4em 0; }
.checklist li {
  position: relative;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-sm);
  background: #fff;
  margin: 8px 0;
  box-shadow: var(--shadow-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid var(--sage);
  background:
    linear-gradient(45deg, transparent 38%, var(--sage) 38% 62%, transparent 62%) no-repeat center/0 0;
}
.checklist li strong { color: var(--ink); }

/* =========================================================================
   10. FAQ / objections
   ========================================================================= */
.faq { margin: 1.4em 0; }
.faq__item {
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-sm);
  background: #fff;
  margin: 10px 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.faq__q {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 540;
  padding: 16px 20px;
  margin: 0;
  display: flex;
  gap: 10px;
}
.faq__q::before { content: "—"; color: var(--sage); }
.faq__a { padding: 0 20px 18px; color: var(--ink-soft); }
.faq__a p:last-child { margin-bottom: 0; }

/* =========================================================================
   11. Pied de page
   ========================================================================= */
.colophon {
  border-top: 1px solid var(--paper-3);
  margin-top: 72px;
  padding: 40px 0 64px;
  font-size: 14px;
  color: var(--ink-faint);
}
.colophon strong { color: var(--ink-soft); }
.colophon a { color: var(--sage-deep); }

/* =========================================================================
   12. Animations (scroll-reveal)
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
