/* Chablia — pages de services, ressources, guides, 404.
   Même thème que la home, en version sobre : pas d’épinglage ni de scrub,
   seulement une apparition discrète (js/page.js) et des illustrations en lignes. */

:root { --gut: max(var(--pad), calc(50% - 640px)); }

.breadcrumb, .page-hero, .content, .related, .article-layout, .cta-block, .faq, .sep, .error-page {
  max-width: none; padding-inline: var(--gut);
}

/* ---------- En-tête de page : texte à gauche, illustration à droite ---------- */
.page-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center; gap: 32px clamp(32px, 5vw, 88px);
  padding-top: clamp(104px, 14vh, 140px); padding-bottom: clamp(36px, 7vh, 72px);
}
.page-hero .breadcrumb { padding: 0; margin-bottom: clamp(26px, 4vh, 40px); }
.page-hero .label { margin-bottom: 0; }
.page-hero h1 { font-size: clamp(36px, 4.3vw, 64px); line-height: 1.05; max-width: 17ch; }
.page-lead { max-width: 50ch; }
.article .article-date { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); font: 600 11px/1.4 var(--fm); letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.page-art { position: relative; justify-self: end; width: 100%; max-width: 540px; }
.page-art::before {
  content: ""; position: absolute; inset: 8% 4% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(139, 123, 255, .13), rgba(139, 123, 255, 0) 70%),
              radial-gradient(40% 35% at 62% 70%, rgba(255, 77, 141, .08), rgba(255, 77, 141, 0) 70%);
}

/* Effet d’en-tête (js/hero-fx.js) : l’illustration attend le script, puis se trace.
   Sans script, elle apparaît d’elle-même après un court délai. */
.page-art [data-fx]:not(.fx-ready) { opacity: 0; animation: fx-show .6s 1.4s forwards; }
@keyframes fx-show { to { opacity: 1; } }
.fx-off .page-art [data-fx] { opacity: 1; animation: none; }
.page-art, .page-hero-copy { will-change: transform; }
.fx-ready .art-wave { animation: none; }
.art-pkt, .art-walker { fill: var(--neve); filter: drop-shadow(0 0 5px var(--glacier)); }
@media (prefers-reduced-motion: reduce) {
  .page-art [data-fx]:not(.fx-ready) { opacity: 1; animation: none; }
  .page-art, .page-hero-copy { will-change: auto; }
}

/* ---------- Sections ---------- */
.content, .content + .content { padding-top: clamp(64px, 10vh, 112px); }
.content h2, .faq .h2 { font: 700 clamp(28px, 3.1vw, 46px)/1.1 var(--fd); letter-spacing: -.025em; max-width: 20ch; margin: 0; }
.sec-head .label { margin-bottom: 18px; }
.content .sec-body > p { font-size: 17px; line-height: 1.65; }
.content p.label { color: var(--glacier); font-size: 12px; line-height: 1; }

.content--split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(32px, 5vw, 80px); align-items: start; }
.content--split .sec-body { padding-top: 34px; }
.content--split .sec-body p { max-width: 62ch; }
.content--wide .sec-body { margin-top: clamp(30px, 5vh, 52px); }

.audience-list { margin-top: 24px; }

/* Cartes « ce que je mets en place » : même langage que les domaines de la home */
.offer-list { max-width: none; margin: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px clamp(20px, 2.4vw, 36px); counter-reset: offer; }
.offer-list li {
  grid-column: span 4; counter-increment: offer; position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 12px 30px 0; border-top: 1px solid var(--line);
  font: 600 clamp(18px, 1.45vw, 21px)/1.25 var(--fd); letter-spacing: -.015em; color: var(--neve);
}
.offer-list li::before {
  content: counter(offer, decimal-leading-zero); position: static; margin-bottom: 6px;
  font: 600 clamp(30px, 2.6vw, 40px)/1 var(--fd); letter-spacing: -.02em; color: var(--glacier); font-variant-numeric: tabular-nums lining-nums;
}
.offer-list li::after { content: ""; position: absolute; left: 0; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--glacier); box-shadow: 0 0 10px var(--glacier); }
.offer-list li span { margin: 0; font: 400 15px/1.55 var(--ft); letter-spacing: 0; color: var(--mist); max-width: 40ch; }
.offer-list:has(> li:nth-child(4):last-child) > li { grid-column: span 3; }
.offer-list:has(> li:nth-child(5):last-child) > li:nth-child(n+4),
.offer-list:has(> li:nth-child(2):last-child) > li { grid-column: span 6; }

/* Méthode : trois cartes */
.howto-grid { margin: 0; gap: clamp(16px, 2vw, 28px); }
.howto-step {
  gap: 12px; padding: 28px 28px 32px; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(143, 227, 240, .045), rgba(143, 227, 240, 0) 75%);
}
.howto-n { font: 600 clamp(34px, 3vw, 46px)/1 var(--fd); letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.howto-step h3 { margin: 6px 0 0; font-size: clamp(21px, 1.9vw, 27px); }
.howto-step p { max-width: 32ch; font-size: 15px; }

/* FAQ : même accordéon que la home */
.faq { padding-top: clamp(72px, 11vh, 120px); padding-bottom: 0; }
.faq summary { font-size: clamp(16px, 1.3vw, 19px); }
.article .faq-list { margin-top: 18px; border-bottom: 1px solid var(--line); }
.article .faq-list details { border-top: 1px solid var(--line); }
.article .faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 0; font: 600 18px/1.3 var(--fd); letter-spacing: -.01em; color: var(--neve); }
.article .faq-list summary::-webkit-details-marker { display: none; }
.article .faq-list summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--glacier), var(--glacier)) center / 100% 1.5px no-repeat, linear-gradient(var(--glacier), var(--glacier)) center / 1.5px 100% no-repeat; transition: transform .4s var(--ease); }
.article .faq-list details[open] summary::after { transform: rotate(45deg); }
.article .faq-list details p { padding: 0 36px 22px 0; margin: 0; }

/* Liens liés */
.related { padding-top: clamp(72px, 11vh, 120px); }
.related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.related-card { position: relative; padding: 24px 24px 52px; background: rgba(11, 17, 28, .45); }
.related-card::after { content: "→"; position: absolute; left: 24px; bottom: 20px; color: var(--glacier); font-weight: 600; transition: transform .35s var(--ease); }
.related-card:hover::after { transform: translateX(4px); }

/* CTA final */
/* Le halo s’éteint avant les bords du bloc : aucune couture avec la crête du pied de page */
.cta-block { margin-top: clamp(56px, 9vh, 100px); padding-block: clamp(64px, 10vh, 110px) clamp(24px, 4vh, 48px); border-top: 1px solid var(--line); background: radial-gradient(closest-side, rgba(139, 123, 255, .1), rgba(139, 123, 255, 0)); }

/* ---------- Guides : colonne de lecture centrée, sommaire collant ---------- */
.article-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 72ch) minmax(0, 1fr); gap: 0 clamp(32px, 4vw, 64px);
  padding-top: clamp(40px, 7vh, 72px);
}
.article { grid-column: 2; grid-row: 1; }
.article > h2:first-child { margin-top: 0; }
.article p, .article ul, .article ol, .article blockquote, .article table { max-width: none; }
.article ul, .article ol { font-size: 17px; }
.toc { grid-column: 1; grid-row: 1; justify-self: end; width: min(230px, 100%); }
.toc a { padding: 4px 0; transition: color .25s; }
.toc a[aria-current] { color: var(--neve); }
.toc a[aria-current]::before { color: var(--glow); }

/* ---------- Ressources : cartes avec vignette ---------- */
.guides-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.content .guide-card { color: var(--neve); }
.guide-card { display: flex; flex-direction: column; padding: 0 0 30px; overflow: hidden; background: rgba(11, 17, 28, .45); }
.guide-card > :not(.guide-thumb) { margin-inline: 26px; }
.guide-thumb { aspect-ratio: 16 / 10; margin-bottom: 22px; display: grid; place-items: center; padding: 14px 18px 4px; border-bottom: 1px solid var(--line); background: radial-gradient(70% 90% at 50% 100%, rgba(139, 123, 255, .1), rgba(139, 123, 255, 0) 70%); }
.guide-thumb .art { height: 100%; width: auto; max-width: 100%; }
.guide-thumb .art-topo { animation: none; }
.guides.ht-on { padding: 0; }
.guides.ht-on .guides-grid { display: flex; width: max-content; gap: clamp(28px, 4vw, 64px); padding: 0 30vw 0 var(--gut); }
.guides.ht-on .guide-card { flex: none; width: clamp(300px, 32vw, 460px); }
.guides.ht-on .ht-progress { margin-inline: var(--gut); }
@media (max-width: 600px) { .guides.ht-on .guide-card { width: 76vw; } }

/* ---------- 404 ---------- */
/* Tout tient dans le premier écran : texte et liens à gauche, jeu à droite ;
   sur téléphone, le jeu passe juste sous le titre, avant les liens. */
.error-page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "head art" "more art" "links art";
  align-content: center; align-items: center; column-gap: clamp(32px, 5vw, 80px);
  padding-top: clamp(84px, 13vh, 120px); padding-bottom: clamp(24px, 5vh, 56px);
}
.error-head { grid-area: head; align-self: end; }
.error-page .label { margin-bottom: 16px; }
.error-page h1 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.02; }
.error-page h1 .grad { display: block; }
.error-page .error-more { grid-area: more; align-self: start; margin-top: 18px; font-size: 17px; }
.error-page .error-links { grid-area: links; align-self: start; margin-top: 28px; align-items: center; gap: 14px 26px; }
.error-page .page-art { grid-area: art; justify-self: center; max-width: min(520px, calc((100svh - 240px) * 1.2)); }

/* Jeu de la 404 (js/404.js) */
.nf-host::before { inset: 0; }
.nf-game { position: relative; }
.nf-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.nf-ghost { stroke: rgba(163, 179, 196, .38); stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: opacity .3s; }
.nf-ghost.is-done { opacity: 0; }
.nf-link { stroke: url(#nf-g); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(139, 123, 255, .55)); transition: stroke-width .3s, filter .3s; }
.nf-link.is-new { stroke-dasharray: 1; animation: nf-draw .35s cubic-bezier(.5, 0, .3, 1) both, nf-glow .9s ease-out; }
.nf-drag { stroke: url(#nf-g); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .9; pointer-events: none; }
.nf-drag.is-bad { stroke: rgba(163, 179, 196, .7); }
.nf-node { cursor: pointer; outline: none; }
.nf-hit { fill: transparent; }
.nf-dot { fill: #8fe3f0; transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 4px rgba(143, 227, 240, .7)); transition: fill .3s; }
.nf-node.is-hub .nf-dot { fill: #ff4d8d; filter: drop-shadow(0 0 6px #ff4d8d); }
.nf-node.is-off .nf-dot { fill: #b4c7dc; filter: none; animation: nf-blink 2.6s ease-in-out infinite; }
.nf-node.is-off:nth-child(2n) .nf-dot, .nf-node.is-off:nth-child(2n) .nf-halo { animation-delay: -1s; }
.nf-node.is-off:nth-child(3n) .nf-dot, .nf-node.is-off:nth-child(3n) .nf-halo { animation-delay: -1.9s; }
.nf-halo { fill: url(#nf-halo); pointer-events: none; transform-box: fill-box; transform-origin: center; display: none; }
.nf-node.is-off .nf-halo { display: block; animation: nf-breathe 2.6s ease-in-out infinite; }
.nf-fx, .nf-demo { pointer-events: none; }
.nf-demo-line { stroke: url(#nf-g); stroke-width: 2.2; stroke-linecap: round; opacity: .7; filter: drop-shadow(0 0 4px rgba(143, 227, 240, .6)); }
.nf-demo-trail { fill: none; stroke: url(#nf-g); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .38; filter: blur(2px); }
.nf-demo-halo { fill: url(#nf-halo); }
.nf-demo-dot { fill: url(#nf-dotg); transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 5px rgba(143, 227, 240, .95)) drop-shadow(0 0 10px rgba(255, 77, 141, .6)); }
.nf-demo-wave { fill: none; stroke: url(#nf-g); stroke-width: 1.8; transform-box: fill-box; transform-origin: center; animation: nf-wave .8s cubic-bezier(.2, .7, .3, 1) both; }
.nf-demo-wave--s { animation-duration: .6s; opacity: .8; }
.nf-node.is-demo .nf-ring { opacity: .8; }
.nf-ghost.is-hint { stroke: rgba(143, 227, 240, .7); stroke-width: 1.8; }
.nf-node.is-ok .nf-dot { animation: nf-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.nf-ring { fill: none; stroke: #8fe3f0; stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .2s; }
@media (hover: hover) { .nf-node:hover .nf-ring { opacity: .45; } }
.nf-node:focus-visible .nf-ring, .nf-node.is-sel .nf-ring, .nf-node.is-over .nf-ring { opacity: 1; }
.nf-node.is-sel .nf-ring { stroke: #ff4d8d; }
.nf-spark { fill: #fff; filter: drop-shadow(0 0 4px #8fe3f0) drop-shadow(0 0 9px rgba(255, 77, 141, .8)); pointer-events: none; }
.nf-svg.is-won .nf-link { stroke-width: 3.2; filter: drop-shadow(0 0 6px rgba(139, 123, 255, .9)); }
.nf-node.is-flash .nf-dot { animation: nf-flash .9s ease-out; }
.nf-game .nf-status { margin: 6px auto 0; max-width: none; text-align: center; font: 600 12px/1.4 var(--fm); letter-spacing: .14em; text-transform: uppercase; color: var(--glacier); }
.nf-game .nf-help { margin: 4px auto 0; max-width: 46ch; text-align: center; font-size: 14px; color: var(--mist); }
.nf-win { display: flex; justify-content: center; margin-top: 12px; }
.nf-kbd { color: var(--mist); }
@media (hover: none) { .nf-kbd { display: none; } }
.nf-win[hidden] { display: none; }
.nf-win .btn { animation: nf-in .55s cubic-bezier(.3, 1.4, .5, 1) both; box-shadow: 0 0 0 1px rgba(143, 227, 240, .35), 0 0 36px -6px rgba(255, 77, 141, .6); }
@keyframes nf-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes nf-glow { 0% { filter: drop-shadow(0 0 9px rgba(143, 227, 240, 1)); } }
@keyframes nf-blink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes nf-breathe { 0%, 100% { transform: scale(.55); opacity: .2; } 50% { transform: scale(1.35); opacity: .85; } }
@keyframes nf-wave { from { transform: scale(.2); opacity: .95; } to { transform: scale(1.5); opacity: 0; } }
@keyframes nf-pop { 0% { transform: scale(1); } 40% { transform: scale(1.8); } 100% { transform: scale(1); } }
@keyframes nf-flash { 0% { transform: scale(1); } 30% { transform: scale(2.2); filter: drop-shadow(0 0 14px #ff4d8d); } 100% { transform: scale(1); } }
@keyframes nf-in { from { opacity: 0; transform: translateY(12px) scale(.94); } }
@media (prefers-reduced-motion: reduce) {
  .nf-node.is-off .nf-dot { animation: none; opacity: .55; }
  .nf-node.is-off .nf-halo, .nf-demo { display: none; }
  .nf-link.is-new, .nf-node.is-ok .nf-dot, .nf-node.is-flash .nf-dot, .nf-win .btn { animation: none; }
}

/* ---------- Apparition discrète ---------- */
.rv .rv-item { opacity: 0; translate: 0 14px; transition: opacity .7s var(--ease) var(--d, 0ms), translate .7s var(--ease) var(--d, 0ms), border-color .3s, transform .3s var(--ease); }
.rv .rv-item.is-in { opacity: 1; translate: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 72ch); justify-content: center; }
  .article { grid-column: 1; grid-row: 2; }
  .toc { grid-column: 1; grid-row: 1; position: static; justify-self: stretch; width: auto; margin-bottom: 36px; }
  .offer-list li { grid-column: span 6; }
  .offer-list:has(> li:nth-child(5):last-child) > li:nth-child(5),
  .offer-list:has(> li:nth-child(3):last-child) > li:nth-child(3) { grid-column: span 12; }
  .offer-list:has(> li:nth-child(4):last-child) > li { grid-column: span 6; }
}
@media (max-width: 900px) {
  .page-hero, .content--split, .error-page { grid-template-columns: minmax(0, 1fr); }
  .error-page { grid-template-areas: "head" "art" "links" "more"; align-content: start; padding-top: 88px; }
  .error-head { align-self: auto; }
  .page-hero { padding-top: 96px; }
  .page-art { justify-self: center; max-width: 420px; }
  .content--split .sec-body { padding-top: 0; }
  .related-grid, .guides-grid { grid-template-columns: minmax(0, 1fr); }
  .howto-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .howto-step { padding: 22px 22px 26px; }
}
@media (max-width: 600px) {
  .page-hero h1 { font-size: clamp(32px, 9vw, 42px); }
  .error-page .label { margin-bottom: 10px; font-size: 11px; }
  .error-page h1 { font-size: clamp(22px, 6.3vw, 30px); line-height: 1.12; letter-spacing: -.02em; }
  .error-page .page-art { margin-top: 10px; max-width: min(340px, calc((100svh - 330px) * 1.2)); }
  .error-page .error-links { margin-top: 14px; justify-content: center; gap: 10px 20px; }
  .error-page .error-links .btn { padding: 11px 18px; font-size: 14px; }
  .error-page .error-more { margin-top: 18px; font-size: 14px; text-align: center; }
  .page-art { max-width: 340px; margin-top: 4px; }
  .offer-list { grid-template-columns: minmax(0, 1fr); }
  .offer-list li, .offer-list:has(> li) > li { grid-column: 1 / -1 !important; display: grid; grid-template-columns: 50px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding: 18px 0 20px; }
  .offer-list li::before { grid-row: span 2; font-size: 26px; margin: 2px 0 0; }
  .content .sec-body > p { font-size: 16px; }
  .guide-card > :not(.guide-thumb) { margin-inline: 20px; }
}
