/*
Theme Name: Blueprint HowTo
Theme URI: https://on-fait-comment.fr
Author: On fait comment
Author URI: https://on-fait-comment.fr
Description: Theme blueprint technique pour on-fait-comment.fr — rendu magnifique du format HowTo (mode d'emploi en etapes), optimise GEO/AEO. Palette papier/bleu blueprint/orange securite/ardoise. Anti-footprint reseau.
Version: 1.0.9
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blueprint-howto
*/

/* ============================================================
   TOKENS — palette UNIQUE (blueprint technique)
   ============================================================ */
:root{
  --ofc-paper:#F7F6F1;          /* papier blanc casse */
  --ofc-paper-2:#FFFFFF;
  --ofc-ink:#1B2733;            /* ardoise (texte) */
  --ofc-ink-soft:#3A4856;
  --ofc-blue:#1D5FA8;           /* bleu blueprint */
  --ofc-blue-deep:#13406F;
  --ofc-blue-wash:#E7EFF7;
  --ofc-orange:#F08A24;         /* orange securite (accent) */
  --ofc-orange-soft:#FBE6CF;
  --ofc-line:#C9D4DE;           /* traits techniques fins */
  --ofc-line-strong:#9DB1C2;
  --ofc-grid:rgba(29,95,168,.07);

  --ofc-shadow:0 1px 0 var(--ofc-line), 0 18px 40px -28px rgba(27,39,51,.35);
  --ofc-radius:4px;             /* coins quasi droits = technique */

  --font-title:"Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:"Spline Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:"IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap:74rem;
  --wrap-narrow:46rem;
  --step:clamp(1rem,.7rem + 1.4vw,1.6rem);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  margin:0;
  font-family:var(--font-body);
  font-size:clamp(1rem,.96rem + .2vw,1.075rem);
  line-height:1.7;
  color:var(--ofc-ink);
  background-color:var(--ofc-paper);
  /* trame blueprint discrete */
  background-image:
    linear-gradient(var(--ofc-grid) 1px,transparent 1px),
    linear-gradient(90deg,var(--ofc-grid) 1px,transparent 1px);
  background-size:32px 32px;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--ofc-blue);text-underline-offset:.18em;text-decoration-thickness:1px}
a:hover{color:var(--ofc-orange)}
h1,h2,h3,h4{font-family:var(--font-title);line-height:1.12;color:var(--ofc-ink);font-weight:600;letter-spacing:-.015em}
h1{font-size:clamp(2.1rem,1.5rem + 3vw,3.5rem);margin:.2em 0 .35em}
h2{font-size:clamp(1.5rem,1.2rem + 1.4vw,2.1rem);margin:2.2em 0 .6em}
h3{font-size:clamp(1.2rem,1.05rem + .7vw,1.5rem);margin:1.8em 0 .5em}
p{margin:0 0 1.1em}
:focus-visible{outline:3px solid var(--ofc-orange);outline-offset:2px}
::selection{background:var(--ofc-orange);color:#fff}

.wrap{width:min(100% - 2.4rem,var(--wrap));margin-inline:auto}
.wrap-narrow{width:min(100% - 2.4rem,var(--wrap-narrow));margin-inline:auto}
.mono{font-family:var(--font-mono)}
.skip-link{position:absolute;left:-999px;top:0;background:var(--ofc-ink);color:#fff;padding:.7rem 1rem;z-index:200}
.skip-link:focus{left:.5rem;top:.5rem}

/* ============================================================
   HEADER
   ============================================================ */
.site-header{
  position:sticky;top:0;z-index:100;
  background:color-mix(in srgb,var(--ofc-paper) 88%,transparent);
  backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--ofc-line);
}
.site-header__bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.75rem 0;min-height:60px}
.brand{display:inline-flex;align-items:center;gap:.6rem;text-decoration:none;color:var(--ofc-ink)}
.brand__mark{width:38px;height:38px;flex:0 0 auto}
.brand__name{font-family:var(--font-title);font-weight:700;font-size:1.18rem;letter-spacing:-.02em;line-height:1}
.brand__name b{color:var(--ofc-blue)}
.brand__tag{display:block;font-family:var(--font-mono);font-size:.62rem;letter-spacing:.14em;text-transform:uppercase;color:var(--ofc-ink-soft);margin-top:.2rem}
.nav-toggle{display:none}
.main-nav ul{list-style:none;display:flex;gap:.3rem;margin:0;padding:0}
.main-nav a{
  display:block;padding:.5rem .8rem;border-radius:var(--ofc-radius);
  font-family:var(--font-title);font-weight:500;font-size:.96rem;color:var(--ofc-ink);text-decoration:none;
  transition:background .15s,color .15s;
}
.main-nav a:hover,.main-nav .current-menu-item>a{background:var(--ofc-blue-wash);color:var(--ofc-blue-deep)}

@media (max-width:860px){
  .nav-toggle{display:inline-flex;align-items:center;gap:.45rem;background:var(--ofc-ink);color:#fff;border:0;border-radius:var(--ofc-radius);padding:.5rem .8rem;font-family:var(--font-mono);font-size:.8rem;cursor:pointer}
  .main-nav{position:absolute;inset:60px 0 auto 0;background:var(--ofc-paper-2);border-bottom:1px solid var(--ofc-line);
    transform:scaleY(0);transform-origin:top;transition:transform .2s ease;display:none}
  .main-nav.open{display:block;transform:scaleY(1)}
  .main-nav ul{flex-direction:column;gap:0;padding:.4rem 1.2rem 1rem}
  .main-nav a{padding:.7rem .4rem;border-bottom:1px solid var(--ofc-line)}
}

/* ============================================================
   HERO (home)
   ============================================================ */
.hero{position:relative;padding:clamp(3rem,2rem + 6vw,6rem) 0 clamp(2.5rem,2rem + 4vw,4rem);overflow:hidden}
.hero__eyebrow{display:inline-flex;align-items:center;gap:.55rem;font-family:var(--font-mono);font-size:.74rem;letter-spacing:.16em;text-transform:uppercase;color:var(--ofc-blue);border:1px solid var(--ofc-line-strong);border-radius:100px;padding:.32rem .8rem;background:var(--ofc-paper-2)}
.hero__eyebrow .dot{width:7px;height:7px;border-radius:50%;background:var(--ofc-orange)}
.hero h1{max-width:18ch;margin-top:1.1rem}
.hero h1 .accent{color:var(--ofc-blue);position:relative}
.hero h1 .accent::after{content:"";position:absolute;left:0;right:0;bottom:.06em;height:.16em;background:var(--ofc-orange-soft);z-index:-1}
.hero__lead{max-width:54ch;font-size:1.18rem;color:var(--ofc-ink-soft);margin-top:.4rem}
.hero__cta{display:flex;flex-wrap:wrap;gap:.8rem;margin-top:1.6rem}
.hero__search{margin-top:1.6rem;max-width:38rem}

.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--font-title);font-weight:600;font-size:1rem;text-decoration:none;border-radius:var(--ofc-radius);padding:.72rem 1.2rem;border:2px solid transparent;cursor:pointer;transition:transform .12s,box-shadow .12s,background .12s}
.btn--primary{background:var(--ofc-blue);color:#fff}
.btn--primary:hover{background:var(--ofc-blue-deep);color:#fff;transform:translateY(-2px);box-shadow:0 10px 22px -12px var(--ofc-blue)}
.btn--ghost{background:var(--ofc-paper-2);color:var(--ofc-ink);border-color:var(--ofc-line-strong)}
.btn--ghost:hover{border-color:var(--ofc-ink);color:var(--ofc-ink);transform:translateY(-2px)}

/* blueprint corner ticks */
.hero__plan{position:absolute;inset:auto -4% -30% auto;width:min(46%,420px);aspect-ratio:1;pointer-events:none;opacity:.5}

/* search */
.searchform{display:flex;border:2px solid var(--ofc-ink);border-radius:var(--ofc-radius);overflow:hidden;background:var(--ofc-paper-2)}
.searchform input[type=search]{flex:1;border:0;padding:.8rem 1rem;font-family:var(--font-body);font-size:1rem;background:transparent;color:var(--ofc-ink)}
.searchform input[type=search]:focus{outline:none}
.searchform button{border:0;background:var(--ofc-ink);color:#fff;padding:0 1.2rem;font-family:var(--font-mono);font-size:.85rem;cursor:pointer;letter-spacing:.05em}
.searchform button:hover{background:var(--ofc-orange)}

/* ============================================================
   CARDS / GRID  (listes de "comment")
   ============================================================ */
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:0 0 1.4rem}
.section-head h2{margin:0}
.section-head__kicker{font-family:var(--font-mono);font-size:.72rem;letter-spacing:.16em;text-transform:uppercase;color:var(--ofc-blue);display:block;margin-bottom:.4rem}

.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:1.1rem}
.howto-card{
  position:relative;display:flex;flex-direction:column;
  background:var(--ofc-paper-2);border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);
  overflow:hidden;text-decoration:none;color:inherit;
  transition:transform .15s,box-shadow .15s,border-color .15s;
}
.howto-card:hover{transform:translateY(-4px);box-shadow:var(--ofc-shadow);border-color:var(--ofc-line-strong)}
.howto-card__media{position:relative;aspect-ratio:16/9;background:var(--ofc-blue-wash);overflow:hidden}
.howto-card__media img{width:100%;height:100%;object-fit:cover}
.howto-card__cat{position:absolute;top:.6rem;left:.6rem;font-family:var(--font-mono);font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;background:var(--ofc-ink);color:#fff;padding:.25rem .55rem;border-radius:3px}
.howto-card__body{padding:1rem 1.1rem 1.2rem;display:flex;flex-direction:column;gap:.6rem;flex:1}
.howto-card__title{font-family:var(--font-title);font-weight:600;font-size:1.12rem;line-height:1.25;margin:0}
.howto-card:hover .howto-card__title{color:var(--ofc-blue-deep)}
.howto-card__meta{margin-top:auto;display:flex;flex-wrap:wrap;gap:.5rem;font-family:var(--font-mono);font-size:.7rem;color:var(--ofc-ink-soft)}
.howto-card__meta span{display:inline-flex;align-items:center;gap:.3rem;background:var(--ofc-paper);border:1px solid var(--ofc-line);padding:.2rem .45rem;border-radius:3px}

/* ============================================================
   ARTICLE — le coeur (rendu HowTo)
   ============================================================ */
.article{padding:clamp(1.6rem,1rem + 3vw,3rem) 0 4rem}
.article__head{max-width:var(--wrap-narrow)}
.breadcrumbs{font-family:var(--font-mono);font-size:.74rem;color:var(--ofc-ink-soft);margin-bottom:1rem;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.breadcrumbs a{color:var(--ofc-blue);text-decoration:none}
.breadcrumbs a:hover{color:var(--ofc-orange)}
.breadcrumbs .sep{color:var(--ofc-line-strong)}

.article__title{margin-top:.2rem}
.article__dek{font-size:1.2rem;color:var(--ofc-ink-soft);max-width:60ch}

/* fiche technique (matériel/temps/difficulté) */
.spec-board{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:0;
  border:1.5px solid var(--ofc-ink);border-radius:var(--ofc-radius);
  margin:1.6rem 0;background:var(--ofc-paper-2);overflow:hidden;
  max-width:var(--wrap-narrow);
}
.spec-board__item{padding:.85rem 1rem;border-right:1px solid var(--ofc-line)}
.spec-board__item:last-child{border-right:0}
.spec-board__label{font-family:var(--font-mono);font-size:.64rem;letter-spacing:.12em;text-transform:uppercase;color:var(--ofc-blue);display:flex;align-items:center;gap:.35rem}
.spec-board__value{font-family:var(--font-title);font-weight:600;font-size:1.15rem;margin-top:.25rem;color:var(--ofc-ink)}

.article__media{margin:1.8rem 0;border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);overflow:hidden}

.article__body{max-width:var(--wrap-narrow);font-size:1.075rem}
.article__body h2{scroll-margin-top:90px}
.article__body h3{scroll-margin-top:90px}
.article__body ul,.article__body ol{padding-left:1.3em}
.article__body li{margin:.4em 0}
.article__body img{border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);margin:1.4rem 0}
.article__body blockquote{margin:1.6rem 0;padding:1rem 1.3rem;border-left:4px solid var(--ofc-blue);background:var(--ofc-blue-wash);border-radius:0 var(--ofc-radius) var(--ofc-radius) 0;font-style:normal}
.article__body code{font-family:var(--font-mono);font-size:.9em;background:var(--ofc-ink);color:#fff;padding:.12em .4em;border-radius:3px}
.article__body a{font-weight:500}

/* ETAPES numerotees proeminentes */
.steps{counter-reset:step;list-style:none;padding:0;margin:2rem 0;max-width:var(--wrap-narrow)}
.steps>li{
  counter-increment:step;position:relative;
  padding:1.2rem 1.2rem 1.2rem 4.6rem;margin:0 0 1rem;
  background:var(--ofc-paper-2);border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);
}
.steps>li::before{
  content:counter(step,decimal-leading-zero);
  position:absolute;left:0;top:0;bottom:0;width:3.6rem;
  display:flex;align-items:flex-start;justify-content:center;padding-top:1.15rem;
  font-family:var(--font-mono);font-weight:600;font-size:1.05rem;color:#fff;
  background:var(--ofc-blue);
  border-right:3px solid var(--ofc-orange);
}
.steps>li h3,.steps>li .step__title{margin:.1rem 0 .35rem;font-family:var(--font-title);font-size:1.18rem;font-weight:600}
.steps>li p:last-child{margin-bottom:0}

/* encadrés (astuce / attention / note) */
.callout{
  margin:1.6rem 0;padding:1rem 1.2rem 1rem 3rem;position:relative;
  border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);background:var(--ofc-paper-2);
  max-width:var(--wrap-narrow);
}
.callout::before{position:absolute;left:1rem;top:1rem;font-family:var(--font-mono);font-weight:700;font-size:1.1rem}
.callout__title{font-family:var(--font-title);font-weight:600;margin:0 0 .2rem}
.callout p:last-child{margin-bottom:0}
.callout--tip{border-left:4px solid var(--ofc-blue)}
.callout--tip::before{content:"!";color:var(--ofc-blue)}
.callout--warn{border-left:4px solid var(--ofc-orange);background:var(--ofc-orange-soft)}
.callout--warn::before{content:"\26A0";color:#b4630a}
.callout--note{border-left:4px solid var(--ofc-line-strong)}
.callout--note::before{content:"i";color:var(--ofc-ink-soft)}

/* TL;DR / réponse courte citable (GEO) */
.answer-box{
  margin:1.6rem 0;padding:1.2rem 1.3rem;max-width:var(--wrap-narrow);
  border:1.5px solid var(--ofc-blue);border-radius:var(--ofc-radius);
  background:var(--ofc-blue-wash);position:relative;
}
.answer-box__label{font-family:var(--font-mono);font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:var(--ofc-blue-deep);font-weight:600;display:block;margin-bottom:.4rem}
.answer-box p{margin:0;font-size:1.08rem}

/* FAQ */
.faq{max-width:var(--wrap-narrow);margin:2.4rem 0}
.faq details{border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);background:var(--ofc-paper-2);margin:0 0 .7rem;overflow:hidden}
.faq summary{cursor:pointer;list-style:none;padding:1rem 1.2rem;font-family:var(--font-title);font-weight:600;display:flex;justify-content:space-between;gap:1rem;align-items:center}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";font-family:var(--font-mono);color:var(--ofc-blue);font-size:1.4rem;line-height:1;transition:transform .2s}
.faq details[open] summary::after{transform:rotate(45deg)}
.faq details>div{padding:0 1.2rem 1.1rem}
.faq details>div p:last-child{margin-bottom:0}

/* author / meta line */
.byline{display:flex;align-items:center;gap:.7rem;margin:1.4rem 0;padding:.9rem 0;border-top:1px solid var(--ofc-line);border-bottom:1px solid var(--ofc-line);max-width:var(--wrap-narrow);font-size:.92rem}
.byline img{width:42px;height:42px;border-radius:50%;border:1px solid var(--ofc-line)}
.byline__name{font-weight:600;font-family:var(--font-title)}
.byline__meta{font-family:var(--font-mono);font-size:.74rem;color:var(--ofc-ink-soft)}

/* related */
.related{background:var(--ofc-ink);color:var(--ofc-paper);padding:3rem 0;margin-top:3rem;background-image:linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:32px 32px}
.related h2{color:#fff}
.related .howto-card{background:#22323f;border-color:#33454f;color:var(--ofc-paper)}
.related .howto-card__title{color:#fff}
.related .howto-card:hover .howto-card__title{color:var(--ofc-orange)}
.related .howto-card__meta span{background:#1b2733;border-color:#33454f;color:#aab8c4}

/* ============================================================
   ARCHIVE / CATEGORY
   ============================================================ */
.page-hero{padding:clamp(2.2rem,1.6rem + 3vw,3.4rem) 0 1.6rem;border-bottom:1px solid var(--ofc-line)}
.page-hero h1{margin:.2rem 0}
.page-hero p{color:var(--ofc-ink-soft);max-width:60ch}
.cat-strip{display:flex;flex-wrap:wrap;gap:.5rem;margin:1.2rem 0 0}
.cat-strip a{font-family:var(--font-mono);font-size:.8rem;text-decoration:none;color:var(--ofc-ink);background:var(--ofc-paper-2);border:1px solid var(--ofc-line);padding:.4rem .8rem;border-radius:100px}
.cat-strip a:hover,.cat-strip a.is-active{background:var(--ofc-blue);color:#fff;border-color:var(--ofc-blue)}

.pagination{display:flex;gap:.5rem;justify-content:center;margin:3rem 0 0;flex-wrap:wrap}
.pagination a,.pagination span{font-family:var(--font-mono);font-size:.9rem;padding:.5rem .85rem;border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);text-decoration:none;color:var(--ofc-ink);background:var(--ofc-paper-2)}
.pagination .current{background:var(--ofc-ink);color:#fff;border-color:var(--ofc-ink)}
.pagination a:hover{border-color:var(--ofc-blue);color:var(--ofc-blue)}

/* ============================================================
   PAGE (légal / à propos)
   ============================================================ */
.page-body{max-width:var(--wrap-narrow);padding:clamp(1.6rem,1rem + 3vw,3rem) 0 4rem}
.page-body h2{border-bottom:1px solid var(--ofc-line);padding-bottom:.3rem}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{background:var(--ofc-ink);color:#c4d0da;margin-top:0;padding:3.2rem 0 1.6rem;
  background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:32px 32px}
.site-footer a{color:#c4d0da;text-decoration:none}
.site-footer a:hover{color:var(--ofc-orange)}
.footer-grid{display:grid;grid-template-columns:1.6fr repeat(3,1fr);gap:2rem}
.footer-brand .brand__name{color:#fff}
.footer-brand p{font-size:.92rem;color:#90a1ad;max-width:34ch;margin-top:.8rem}
.footer-col h3{color:#fff;font-size:.8rem;font-family:var(--font-mono);letter-spacing:.12em;text-transform:uppercase;margin:0 0 .9rem}
.footer-col ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem;font-size:.92rem}
.footer-bottom{margin-top:2.4rem;padding-top:1.4rem;border-top:1px solid #2c3c48;display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem;font-family:var(--font-mono);font-size:.74rem;color:#7e909c}
@media (max-width:760px){.footer-grid{grid-template-columns:1fr 1fr}.footer-brand{grid-column:1/-1}}

/* ============================================================
   MOTION (CSS-first, respecte reduced-motion)
   ============================================================ */
@media (prefers-reduced-motion:no-preference){
  /* Reveal sur-scroll : on n'anime que des proprietes NON bloquantes pour la
     lisibilite (transform + une legere baisse d'opacite plancher a .35).
     Le contenu reste donc toujours visible (crawler / capture pleine page safe),
     l'effet d'entree se joue uniquement sur le glissement vertical. */
  @supports (animation-timeline:view()){
    .reveal{animation:ofc-reveal linear both;animation-timeline:view();animation-range:entry 0% entry 60%}
  }
  @keyframes ofc-reveal{from{opacity:.35;transform:translateY(16px)}to{opacity:1;transform:none}}
  .hero h1{animation:ofc-rise .6s cubic-bezier(.2,.7,.2,1) both}
  .hero__lead{animation:ofc-rise .6s .12s cubic-bezier(.2,.7,.2,1) both}
  .hero__cta,.hero__search{animation:ofc-rise .6s .2s cubic-bezier(.2,.7,.2,1) both}
  @keyframes ofc-rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
}

/* utility */
.tac{text-align:center}
.muted{color:var(--ofc-ink-soft)}
.mt0{margin-top:0}
.lead-cta{background:var(--ofc-blue-wash);border:1px solid var(--ofc-line);border-radius:var(--ofc-radius);padding:1.4rem 1.5rem;margin:2.4rem 0;max-width:var(--wrap-narrow)}
.lead-cta h3{margin-top:0}
