/* ══════════════════════════════════════════════════════════════
   PICBOIS47 — PAGES SECONDAIRES : la structure commune.
   Chargé sur toutes les pages, accueil compris ; rien ici ne s'applique
   à l'accueil sauf par des classes qu'il n'utilise pas (.page, .concepts).
   precision47.css fournit la base (rail, étiquettes, liens mono, grille) ;
   ce fichier ajoute : le rail en flux, les quatre gabarits d'en-tête, la
   bande d'appel compacte, la galerie des concepts, les champs de
   formulaire, le sommaire. Les composants propres à une page vivent avec
   la page (feuille dédiée, chargée par son bloc meta).
   ══════════════════════════════════════════════════════════════ */

:root {
  --pg-ivoire: #f2efe9;
  --pg-encre: #131110;
  --pg-texte: #3d3935;
  --pg-sourdine: #625b53;
  --pg-filet: rgba(19, 17, 16, 0.14);
  --pg-filet-fort: rgba(19, 17, 16, 0.34);
}

/* ── Le rail : en flux sur les pages (absolu sur l'accueil, au-dessus du héros) ── */
body.page { background: var(--pg-ivoire); color: var(--pg-texte); }
body.page .rail-haut { position: sticky; inset: auto; top: 0; }   /* inset avant top : sinon inset remet top à auto et rien ne colle */
body.page main { min-height: 60vh; }
body.page h1, body.page h2, body.page h3 { color: var(--pg-encre); }
body.page .label { color: var(--pg-sourdine); }
/* …mais PAS dans le pied, qui est sombre. La règle ivoire ci-dessus y
   descendait et ramenait les étiquettes à 2,82:1 sur toutes les pages du
   prototype. Corrigé le 25 sept. 2026, avant la mise en ligne. */
body.page .pied .label { color: var(--muted); }
body.page .pied-base .label { color: var(--text); }
body.page .pied-base .pied-coord { color: var(--muted); }
body.page .lien-mono { color: var(--pg-encre); border-bottom-color: var(--pg-filet-fort); }
body.page .lien-mono:hover { border-bottom-color: var(--pg-encre); }
body.page :focus-visible { outline-color: var(--pg-encre); }
/* une section sombre dans une page ivoire (préfixe body.page : plus fort que les règles ivoire ci-dessus) */
.bande-noire { background: var(--canvas); color: var(--text); }
body.page .bande-noire h2, body.page .bande-noire h3, body.page .bande-noire .fort { color: var(--ink); }
body.page .bande-noire .label { color: var(--muted); }
body.page .bande-noire .lien-mono { color: var(--ink); border-bottom-color: var(--ligne-ivoire-forte); }
body.page .bande-noire .lien-mono:hover { border-bottom-color: var(--ink); }
body.page .bande-noire :focus-visible { outline-color: var(--ink); }
body.page-noire { background: var(--canvas); color: var(--text); }
body.page-noire h1, body.page-noire h2, body.page-noire h3 { color: var(--ink); }
body.page-noire .label { color: var(--muted); }

/* ── Les en-têtes de page : quatre gabarits, une seule famille ────
   tete-sommaire  : à gauche, avec un sommaire de relevé à droite (Services)
   tete-geante    : pleine largeur, titre à l'échelle du héros (Sites Web)
   tete-courte    : compacte, à gauche (Automatisations, Applications, À propos, Contact)
   tete-document  : numérotée, marges de document (Municipalités, Confidentialité) */
.page-tete { position: relative; padding: var(--sp-7) 0 var(--sp-6); }
.page-tete .cadre-section { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); row-gap: var(--sp-3); align-items: end; }
.page-tete .label { grid-column: 1 / -1; }
.page-tete h1 { grid-column: 1 / span 8; margin: 0; font-size: clamp(2.2rem, 4.2vw, 3.8rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.page-tete .page-chapo { grid-column: 1 / span 6; margin: var(--sp-2) 0 0; font-size: clamp(1.0625rem, 1.3vw, 1.2rem); line-height: 1.5; max-width: 46ch; }
.tete-geante { padding-top: var(--sp-8); }
.tete-geante h1 { grid-column: 1 / -1; font-size: clamp(2.6rem, 6.1vw, 6.2rem); line-height: 1; letter-spacing: -0.035em; text-transform: uppercase; max-width: none; }
.tete-geante .page-chapo { grid-column: 1 / span 5; }
.tete-courte { padding: var(--sp-6) 0 var(--sp-5); }
.tete-courte h1 { grid-column: 1 / span 7; font-size: clamp(2rem, 3.4vw, 3rem); }
.tete-document { padding-top: var(--sp-6); }
.tete-document h1 { grid-column: 2 / span 8; font-size: clamp(2rem, 3.2vw, 2.8rem); }
.tete-document .page-chapo { grid-column: 2 / span 6; }
.tete-document .numero { grid-column: 1; grid-row: 2; font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.12em; color: var(--pg-sourdine); padding-top: 12px; align-self: start; }
.tete-sommaire .page-chapo { grid-column: 1 / span 6; }
/* le fil d'entrée : un trait court sous l'étiquette, tracé à l'arrivée */
.page-tete .fil-entree { grid-column: 1 / -1; width: 48px; height: 1px; background: var(--pg-encre); transform-origin: left center; }
html[data-motion="on"] .page-tete .fil-entree { transform: scaleX(0); transition: transform 500ms var(--ease-out) 120ms; }
html[data-motion="on"] .page-tete h1, html[data-motion="on"] .page-tete .page-chapo { opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
html[data-motion="on"] .page-tete .page-chapo { transition-delay: 140ms; }
html[data-motion="on"].pret .page-tete h1, html[data-motion="on"].pret .page-tete .page-chapo { opacity: 1; transform: none; }
html[data-motion="on"].pret .page-tete .fil-entree { transform: none; }

/* ── Les sections de page ───────────────────────────────────── */
.page-section { padding: var(--sp-7) 0; }
.page-section + .page-section { border-top: 1px solid var(--pg-filet); }
.bande-noire.page-section { border-top: 0; }

/* ── La bande d'appel compacte (une par page, texte propre à la page) ── */
.appel-compact { padding: var(--sp-7) 0 var(--sp-8); border-top: 1px solid var(--pg-encre); }
.appel-compact .cadre-section { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); row-gap: var(--sp-3); align-items: start; }
.appel-compact h2 { grid-column: 1 / span 7; margin: 0; font-size: clamp(1.9rem, 3.4vw, 3rem); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.appel-compact p { grid-column: 1 / span 6; margin: 0; font-size: 1.125rem; line-height: 1.55; max-width: 44ch; }
.appel-compact .appel-action { grid-column: 1 / span 7; }
.appel-compact .appel-action {
  position: relative; justify-self: start; margin-top: var(--sp-2);
  display: inline-flex; align-items: center; gap: 0.6em; min-height: 56px; padding: 0 26px 0 22px;
  font-family: var(--f-mono); font-size: 1.0625rem; font-weight: 500; color: var(--pg-ivoire); background: var(--pg-encre);
  transition: gap var(--dur) var(--ease);
}
.appel-compact .appel-action i { width: 8px; height: 8px; background: var(--red); }
.appel-compact .appel-action::before, .appel-compact .appel-action::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; transition: transform var(--dur) var(--ease); }
.appel-compact .appel-action::before { left: -7px; top: -7px; border-left: 1px solid var(--pg-encre); border-top: 1px solid var(--pg-encre); }
.appel-compact .appel-action::after { right: -7px; bottom: -7px; border-right: 1px solid var(--pg-encre); border-bottom: 1px solid var(--pg-encre); }
.appel-compact .appel-action:hover { gap: 1em; }
.appel-compact .appel-action:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
.bande-noire.appel-compact { border-top-color: var(--ligne-ivoire); }
.bande-noire .appel-action { color: var(--canvas); background: var(--ink); }
.bande-noire .appel-action::before, .bande-noire .appel-action::after { border-color: var(--ink); }

/* ── La galerie des concepts (accueil, Réalisations, Sites Web) ──
   Deux colonnes d'alignement, comme les projets livrés : image 3:2 à
   gauche / 4:5 à droite en alternance. N'existe pas quand rien n'est publié. */
.concepts { padding: var(--sp-7) 0; background: var(--pg-ivoire); color: var(--pg-texte); }
.concepts-tete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--pg-encre); }
.concepts-tete h2 { margin: 0; color: var(--pg-encre); font-size: clamp(1.6rem, 2.6vw, 2.25rem); letter-spacing: -0.025em; }
.concepts-tete h2.label { font-size: var(--t-label); letter-spacing: var(--t-label-ls); font-weight: 500; }
.concepts-note { margin: 0; font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.06em; color: var(--pg-sourdine); }
.concepts-grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); }
.concept { position: relative; grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; column-gap: var(--sp-3); align-items: start; padding: var(--sp-5) 0 0; margin: 0; }
.concept-index { grid-column: 1; font-family: var(--f-mono); font-size: var(--t-label); letter-spacing: 0.12em; color: var(--pg-encre); padding-top: 2px; }
.concept-image { display: block; overflow: hidden; background: var(--band); }
.concept-image img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.concept-image-vide { display: grid; place-items: center; background: var(--pg-ivoire); border: 1px dashed var(--pg-filet-fort); }
.concept-image-vide span { font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pg-sourdine); }
.concept figcaption { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--pg-encre); }
.concept-etiquette { color: var(--red); }
.concept-nom { font-size: 1.25rem; font-weight: 600; color: var(--pg-encre); letter-spacing: -0.01em; }
.concept-desc { max-width: 30ch; }
.concept:nth-child(odd) .concept-image { grid-column: 2 / span 6; aspect-ratio: 3 / 2; }
.concept:nth-child(odd) figcaption { grid-column: 9 / span 3; }
.concept:nth-child(even) figcaption { grid-column: 2 / span 3; grid-row: 1; }
.concept:nth-child(even) .concept-image { grid-column: 9 / span 3; grid-row: 1; aspect-ratio: 4 / 5; }
.concept:nth-child(even) .concept-index { grid-row: 1; }
/* brouillon (aperçu interne seulement) */
.concept figcaption > span { display: block; }
.brouillon-bandeau { justify-self: start; padding: 6px 10px; font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-ivoire); background: var(--red); }
.concept-brouillon .concept-image { outline: 2px dashed var(--red); outline-offset: -2px; }
html[data-motion="on"] .concept[data-rv="masque"] .concept-image { clip-path: inset(100% 0 0 0); transition: clip-path 900ms var(--ease-out); }
html[data-motion="on"] .concept[data-rv="masque"].vu .concept-image { clip-path: inset(0 0 0 0); }

/* ── Le pied de page (partagé) ───────────────────────────────
   Partagé par toutes les pages. Même grille que l'appel de l'accueil : la
   marque sur 1–4, trois colonnes sur 6–7, 8–9, 10–12. Cibles de 44 px. */
.pied { background: var(--canvas); color: var(--text); padding: var(--sp-7) 0 var(--sp-4); }
.pied-grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--sp-3); row-gap: var(--sp-5); }
.pied-marque { grid-column: 1 / span 4; }
.pied-col:nth-of-type(1) { grid-column: 6 / span 2; }
.pied-col:nth-of-type(2) { grid-column: 8 / span 2; }
.pied-grille > .pied-col:last-child { grid-column: 10 / span 3; }
.pied .brand { display: inline-flex; align-items: center; min-height: 44px; }
.pied .brand svg { height: 54px; }   /* la signature de fin : plus imposante que dans le rail */
.pied-marque p { margin-top: var(--sp-3); max-width: 36ch; }
.pied-lieu { margin-top: var(--sp-2) !important; max-width: none !important; font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.06em; color: var(--muted); }
.pied-col .label { display: block; padding-top: 12px; }
.pied-col ul { list-style: none; margin: var(--sp-1) 0 0; padding: 0; display: grid; gap: 0; }
.pied-col a { display: inline-block; padding: 12px 0; color: var(--text); border-bottom: 1px solid transparent; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.pied-col a:hover { color: var(--ink); border-bottom-color: var(--ligne-ivoire-forte); }
.pied-base { margin-top: var(--sp-6); padding-top: var(--sp-2); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.pied-base .label { text-transform: none; letter-spacing: 0.05em; padding: 13px 0; color: var(--text); }
.pied-base a.label { border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease); }
.pied-base a.label:hover { border-bottom-color: var(--ligne-ivoire-forte); }
.pied-coord { color: var(--muted); }

/* ── Champs de formulaire (Contact ; la démonstration de l'accueil garde les siens) ── */
.champ { display: grid; gap: 8px; }
.champ label { font-family: var(--f-mono); font-size: var(--t-annot); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pg-sourdine); }
.champ input, .champ select, .champ textarea {
  width: 100%; min-height: 48px; padding: 10px 0; font: inherit; font-size: 1rem; color: var(--pg-encre);
  background: none; border: 0; border-bottom: 1px solid var(--pg-filet-fort); border-radius: 0;
  transition: border-color var(--dur) var(--ease);
}
.champ textarea { min-height: 140px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-bottom-color: var(--pg-encre); box-shadow: 0 1px 0 var(--pg-encre); }
.champ [aria-invalid="true"] { border-bottom-color: var(--red); }
.champ-erreur { font-family: var(--f-mono); font-size: var(--t-annot); color: var(--red); }
.champ-case { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; line-height: 1.5; }
.champ-case input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; accent-color: var(--red); }

/* ── Le sommaire (Services, Confidentialité) : entrée active suivie par pages.js ── */
.sommaire { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--pg-encre); }
.sommaire a { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; min-height: 44px; font-family: var(--f-mono); font-size: var(--t-small); color: var(--pg-texte); border-bottom: 1px solid var(--pg-filet); }
.sommaire .no { font-size: var(--t-annot); letter-spacing: 0.12em; color: var(--pg-sourdine); }
.sommaire a:hover, .sommaire a.actif { color: var(--pg-encre); }
.sommaire a.actif .no { color: var(--red); }

/* ═══ TÉLÉPHONE ═══ */
@media (max-width: 860px) {
  .page-tete { padding: var(--sp-5) 0 var(--sp-4); }
  .page-tete .cadre-section { display: grid; grid-template-columns: 1fr; }
  .page-tete h1, .page-tete .page-chapo, .tete-geante h1, .tete-document h1, .tete-document .page-chapo { grid-column: auto; max-width: none; }
  .tete-geante h1 { font-size: clamp(2.2rem, 9.8vw, 3.2rem); }
  .tete-document .numero { grid-column: auto; grid-row: auto; padding-top: 0; }
  .page-section { padding: var(--sp-6) 0; }
  .appel-compact { padding: var(--sp-6) 0 var(--sp-7); }
  .appel-compact .cadre-section { grid-template-columns: 1fr; }
  .appel-compact h2, .appel-compact p, .appel-compact .appel-action { grid-column: auto; }
  .appel-compact .appel-action { width: 100%; justify-content: center; white-space: nowrap; font-size: 1rem; }
  .concepts { padding: var(--sp-6) 0; }
  .concepts-grille { grid-template-columns: auto 1fr; column-gap: var(--sp-2); }
  .concept { grid-template-columns: subgrid; padding: var(--sp-4) 0 0; }
  .concept-index { grid-column: 1; grid-row: 1; padding-right: var(--sp-2); }
  .concept:nth-child(n) .concept-image { grid-column: 2; grid-row: 1; aspect-ratio: 4 / 5; }
  .concept:nth-child(n) figcaption { grid-column: 2; grid-row: 2; margin-top: var(--sp-3); }
  .pied-grille { grid-template-columns: 1fr 1fr; }
  .pied-marque { grid-column: 1 / -1; }
  .pied-col:nth-of-type(1), .pied-col:nth-of-type(2), .pied-grille > .pied-col:last-child { grid-column: auto; }
}
@media (max-width: 480px) { .appel-compact .appel-action { font-size: 0.9375rem; padding: 0 18px 0 16px; } .pied-grille { grid-template-columns: 1fr; } .pied-base { justify-content: flex-start; } .pied-coord { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .page-tete h1, .page-tete .page-chapo { opacity: 1 !important; transform: none !important; }
  .page-tete .fil-entree { transform: none !important; }
  .concept-image { clip-path: none !important; }
}
