/*
Theme Name: ERP-X Vitrine
Theme URI: https://www.ams-studio.lu/
Author: AMS Studio
Author URI: https://www.ams-studio.lu/
Description: Thème de présentation d'ERP-X — page unique, bilingue français / anglais, sans constructeur de pages.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: erpx-vitrine
*/

/* ---------------------------------------------------------------------------
   DIRECTION ÉDITORIALE.

   Le pari : un ERP se vend sur la confiance, et la confiance se joue à l'échelle
   de la typographie, pas au nombre de couleurs. Toute l'audace part donc dans le
   corps des titres — Instrument Serif, très contrastée, posée en très grand —
   et le reste se tait. Une seule couleur d'accent, un seul geste.

   Jetons : la palette entière vit sur :root. Le thème sombre ne redéfinit QUE
   ces jetons, jamais une couleur au fil des composants.
   --------------------------------------------------------------------------- */
:root {
  --papier:      #FAFAF9;
  --surface:     #FFFFFF;
  --surface-alt: #F2F2F0;
  --encre:       #0F1214;
  --encre-douce: #3A4046;
  --sourdine:    #6B7278;
  --filet:       #E2E2DE;
  --filet-fort:  #C8C9C3;
  --accent:      #16457A;
  --accent-vif:  #1F5FA8;
  --sur-accent:  #FFFFFF;

  --titre: "Instrument Serif", Georgia, "Times New Roman", serif;
  --texte: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --signe: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --page:   1240px;
  --marge:  clamp(20px, 5vw, 60px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:      #0C0E10;
    --surface:     #14171A;
    --surface-alt: #1A1E22;
    --encre:       #F2F1EE;
    --encre-douce: #C6C9CC;
    --sourdine:    #8E9599;
    --filet:       #22262A;
    --filet-fort:  #333940;
    --accent:      #8FBBE8;
    --accent-vif:  #B4D3F2;
    --sur-accent:  #0C0E10;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Les deux langues sont dans le document ; on n'en montre qu'une. Sans
   JavaScript, le français reste — jamais une page vide. */
html[data-lang="en"] .fr,
html:not([data-lang="en"]) .en { display: none; }

/* --- Échelle typographique ---------------------------------------------
   Instrument Serif n'a qu'une graisse. Toute la hiérarchie se fait donc au
   corps et à l'interlettrage — ce qui oblige à un vrai écart entre les
   niveaux, et c'est précisément ce qui donne son aplomb à la page. */
h1, h2 {
  font-family: var(--titre); font-weight: 400;
  text-wrap: balance; margin: 0;
  letter-spacing: -0.018em; line-height: 0.98;
}
/* ⚠️ LA THÈSE TIENT SUR UNE LIGNE, ET C'EST UNE CONTRAINTE DE COMPOSITION.
   Coupée en deux, la phrase perd son aplomb — on lit « Votre ERP est » puis on
   cherche la suite. Le corps se cale donc sur la LARGEUR disponible (vw) et non
   sur une taille fixe, et « white-space: nowrap » interdit le retour. La borne
   basse existe pour le téléphone, où une ligne unique deviendrait illisible :
   en dessous de 620 px la coupure est autorisée, faute de quoi le texte
   sortirait de l'écran. */
h1 {
  font-size: clamp(2.5rem, 7.2vw, 6.6rem);
  white-space: nowrap;
}
@media (max-width: 620px) {
  h1 { white-space: normal; font-size: clamp(2.3rem, 10vw, 3.4rem); }
}
h2 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h3 {
  font-family: var(--texte); font-weight: 600; margin: 0;
  font-size: 1.06rem; line-height: 1.4; letter-spacing: -0.004em;
}
p { margin: 0; }
em { font-family: var(--titre); font-style: italic; font-size: 1.08em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.saut-contenu {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--encre);
  padding: 10px 16px; border: 1px solid var(--filet-fort); border-radius: 4px; z-index: 100;
}
.saut-contenu:focus { left: 12px; top: 12px; }

.enveloppe { max-width: var(--page); margin-inline: auto; padding-inline: var(--marge); }

.etiquette {
  font-family: var(--signe); font-size: 0.7rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--sourdine);
}

/* --- Barre supérieure ---------------------------------------------------- */
.barre {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--papier) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--filet);
}
.admin-bar .barre { top: 32px; }
@media (max-width: 782px) { .admin-bar .barre { top: 46px; } }

.barre .enveloppe { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.marque { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: inherit; }
.marque svg { display: block; }
.marque b {
  font-family: var(--titre); font-weight: 400;
  font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1;
}

.langues { display: flex; gap: 2px; }
.langues button {
  font-family: var(--signe); font-size: 0.7rem; letter-spacing: 0.1em;
  padding: 5px 9px; border: 0; border-radius: 3px;
  background: transparent; color: var(--sourdine); cursor: pointer;
}
.langues button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }

.bouton {
  display: inline-block;
  font-family: var(--texte); font-size: 0.95rem; font-weight: 500;
  padding: 11px 22px; border-radius: 4px;
  background: var(--accent); color: var(--sur-accent);
  text-decoration: none; border: 1px solid var(--accent);
  transition: background 140ms ease, border-color 140ms ease;
}
.bouton:hover { background: var(--accent-vif); border-color: var(--accent-vif); }
.bouton.creux {
  /* ⚠️ SON ENCRE EST CELLE DE LA PAGE. Lui laisser « --sur-accent » — la couleur
     faite pour se poser SUR l'aplat — rendait le libellé invisible en thème
     sombre : presque noir sur presque noir. */
  background: transparent; color: var(--encre); border-color: var(--filet-fort);
}
.bouton.creux:hover { background: var(--surface-alt); border-color: var(--sourdine); }

@media (max-width: 660px) { .barre .bouton { display: none; } }

/* --- Ouverture ----------------------------------------------------------- */
.ouverture { padding: clamp(64px, 11vw, 132px) 0 0; }
.ouverture .these { margin-top: 22px; }
.ouverture .porte {
  /* « em » et non « ch » : la mesure se règle ici sur la police de CE
     paragraphe, qui est bien celle qu'on lit. */
  max-width: 34em; margin-top: 28px;
  font-size: clamp(1.1rem, 1.5vw, 1.34rem); color: var(--encre-douce);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; align-items: center; }
.note-cle { font-family: var(--signe); font-size: 0.74rem; color: var(--sourdine); }

/* Le cadre des captures : un filet, pas une carte. L'ombre portée date. */
.vitre {
  margin: clamp(48px, 7vw, 84px) 0 0;
  border: 1px solid var(--filet-fort);
  background: var(--surface); padding: 6px;
  overflow: hidden;
}
.vitre img { display: block; width: 100%; height: auto; }

/* --- Le mouvement -------------------------------------------------------
   Une seule idée, tenue partout : la capture se POSE quand on l'atteint, et
   l'image respire de quelques pixels dans son cadre pendant qu'on la dépasse.
   Rien d'autre ne bouge — un site qui s'agite à chaque bloc fatigue avant de
   convaincre.

   ⚠️ L'ÉTAT DE DÉPART N'EST POSÉ QUE SI LE JAVASCRIPT RÉPOND. La classe
   « anime » est ajoutée par le script sur <html> : sans elle, les captures
   restent visibles. Poser l'opacité à zéro en CSS pur ferait une page blanche
   pour qui bloque les scripts. */
.anime .vitre {
  opacity: 0;
  transform: translateY(26px) scale(0.988);
  transition: opacity 760ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 760ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.anime .vitre.posee { opacity: 1; transform: none; }

/* La respiration : l'image glisse dans un cadre qui, lui, ne bouge pas.
   Le décalage est piloté par le script, en une variable. */
.anime .vitre img {
  transform: translate3d(0, var(--glisse, 0px), 0) scale(1.035);
  transform-origin: center 40%;
}

@media (prefers-reduced-motion: reduce) {
  .anime .vitre { opacity: 1; transform: none; transition: none; }
  .anime .vitre img { transform: none; }
}

/* --- Sections ------------------------------------------------------------ */
.section { padding: clamp(72px, 10vw, 124px) 0; }
.section + .section { border-top: 1px solid var(--filet); }
/* ⚠️ « ch » SE CALCULE SUR LA POLICE DE L'ÉLÉMENT QUI PORTE LA RÈGLE.
   Ce bloc a porté « max-width: 26ch » — posé sur le conteneur, donc mesuré en
   Archivo 17 px : 26ch valait 220 px, pas 26 caractères de titre. Tous les
   en-têtes de section se retrouvaient enfermés dans un ruban étroit au milieu
   d'une page de 1240 px, avec le vide à droite. Une largeur de titre se borne
   sur le TITRE, jamais sur son parent. */
.titre-section { display: grid; gap: 18px 56px; }
@media (min-width: 900px) {
  .titre-section {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: end;
  }
  .titre-section .etiquette { grid-column: 1 / -1; }
  .titre-section h2 { grid-column: 1; }
  .titre-section p { grid-column: 2; align-self: end; padding-bottom: 0.4em; }
}
.titre-section h2 { max-width: 16em; }
.titre-section p { color: var(--encre-douce); font-size: 1.05rem; max-width: 46em; }

/* --- La chaîne documentaire : une vraie séquence ------------------------- */
.chaine {
  display: grid; gap: 0; margin: clamp(48px, 6vw, 76px) 0 0; padding: 0; list-style: none;
  border-top: 1px solid var(--filet);
}
@media (min-width: 880px) { .chaine { grid-template-columns: repeat(4, 1fr); } }
.maillon {
  padding: 26px 26px 34px 0; display: flex; flex-direction: column; gap: 12px;
  border-bottom: 1px solid var(--filet);
}
@media (min-width: 880px) {
  .maillon { border-bottom: 0; border-right: 1px solid var(--filet); padding-left: 26px; }
  .maillon:first-child { padding-left: 0; }
  .maillon:last-child { border-right: 0; }
}
/* Le rang est un vrai numéro d'ordre : ces quatre pièces se suivent. On le
   traite donc comme un chiffre de registre, pas comme une pastille décorative. */
.maillon .rang {
  font-family: var(--titre); font-size: 2.6rem; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.maillon p { font-size: 0.95rem; color: var(--sourdine); }

/* --- Alternance texte / capture ------------------------------------------ */
.volet { display: grid; gap: clamp(30px, 4vw, 60px); align-items: center; }
@media (min-width: 920px) {
  /* minmax(0, …) et pas « 0.95fr » seul : sans lui, une capture large impose sa
     taille intrinsèque à la colonne et écrase le texte d'à côté. */
  .volet { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
  .volet.inverse > .propos { order: 2; }
}
.volet + .volet { margin-top: clamp(64px, 9vw, 108px); }
.propos { display: flex; flex-direction: column; gap: 16px; }
.propos p { color: var(--encre-douce); }
.propos h3 { font-family: var(--titre); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.05; letter-spacing: -0.014em; }
.liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.liste li { position: relative; padding-left: 22px; font-size: 0.96rem; color: var(--encre-douce); }
.liste li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 9px; height: 1px; background: var(--accent);
}

/* --- Les garanties ------------------------------------------------------- */
.garanties { margin-top: clamp(44px, 5vw, 64px); overflow-x: auto; border-top: 1px solid var(--filet); }
.garanties table { width: 100%; border-collapse: collapse; font-size: 0.94rem; min-width: 660px; }
.garanties th, .garanties td { text-align: left; padding: 20px 26px 20px 0; border-bottom: 1px solid var(--filet); vertical-align: top; }
.garanties th {
  font-family: var(--titre); font-weight: 400; font-size: 1.34rem;
  letter-spacing: -0.01em; color: var(--encre); width: 22%; white-space: nowrap;
}
.garanties td { color: var(--encre-douce); }

/* --- Tarifs -------------------------------------------------------------- */
.formules { display: grid; gap: 0; margin-top: clamp(44px, 5vw, 64px); align-items: stretch; border-top: 1px solid var(--filet); }
@media (min-width: 820px) { .formules { grid-template-columns: 1fr 1fr; } }
.formule {
  padding: 34px 0 38px; display: flex; flex-direction: column; gap: 18px;
  border-bottom: 1px solid var(--filet);
}
@media (min-width: 820px) {
  .formule { border-bottom: 0; padding-right: 44px; }
  .formule + .formule { border-left: 1px solid var(--filet); padding-left: 44px; padding-right: 0; }
}
.prix {
  font-family: var(--titre); font-weight: 400; font-size: clamp(3rem, 5.6vw, 4.4rem);
  line-height: 1; letter-spacing: -0.024em; font-variant-numeric: tabular-nums;
}
.prix small {
  display: block; margin-top: 10px;
  font-family: var(--signe); font-size: 0.74rem; letter-spacing: 0.06em;
  color: var(--sourdine);
}
.formule.retenue .prix { color: var(--accent); }
.formule .chapeau { color: var(--sourdine); font-size: 0.96rem; max-width: 34em; }
/* Le mot qui remplace le bouton d'achat : il doit peser autant qu'un bouton,
   sinon la colonne payante a l'air de manquer de quelque chose. */
.formule .apres {
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--filet);
  color: var(--encre-douce); font-size: 0.95rem; max-width: 34em;
}
.formule .apres strong { color: var(--encre); font-weight: 600; }
.formule .liste li { font-size: 1rem; }

/* --- La marche à suivre, en fenêtre ------------------------------------- */
.marche {
  border: 1px solid var(--filet-fort); border-radius: 6px; padding: 0;
  background: var(--surface); color: var(--encre);
  max-width: min(680px, calc(100vw - 32px)); width: 100%;
  max-height: min(88vh, 900px);
}
.marche::backdrop { background: rgba(9, 12, 15, 0.58); backdrop-filter: blur(2px); }
.marche-corps { padding: clamp(26px, 4vw, 42px); display: flex; flex-direction: column; gap: 16px; }
.marche h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); }
.marche-intro { color: var(--encre-douce); font-size: 1rem; }
.marche-intro strong, .marche-note strong { color: var(--encre); font-weight: 600; }

.marche-etapes { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.marche-etapes li {
  display: grid; grid-template-columns: 3rem 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--filet);
}
.marche-etapes .rang {
  font-family: var(--titre); font-size: 1.7rem; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.marche-etapes h3 { margin-bottom: 4px; }
.marche-etapes p { color: var(--sourdine); font-size: 0.94rem; }

.marche-note {
  margin-top: 6px; padding: 14px 16px;
  background: var(--surface-alt); border-radius: 4px;
  color: var(--encre-douce); font-size: 0.94rem;
}
.marche-pied { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Un bouton reste un bouton, même quand ce n'est pas un lien. */
button.bouton { font: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer; }

/* --- Pied ---------------------------------------------------------------- */
.pied { border-top: 1px solid var(--filet); padding: 52px 0 64px; color: var(--sourdine); font-size: 0.9rem; }
.pied .enveloppe { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: baseline; }
.pied .droits { margin-right: auto; }
.pied nav { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.pied nav a { color: var(--sourdine); text-decoration: none; }
.pied nav a:hover { color: var(--encre); text-decoration: underline; }

/* --- Pages de contenu (mentions légales, confidentialité…) --------------- */
.page-texte { padding: clamp(56px, 8vw, 96px) 0 clamp(64px, 9vw, 104px); }
.page-texte .corps { max-width: 68ch; display: flex; flex-direction: column; gap: 20px; margin-top: 30px; }
.page-texte .corps h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 24px; }
.page-texte .corps h3 { font-size: 1.06rem; margin-top: 14px; }
.page-texte .corps p, .page-texte .corps li { color: var(--encre-douce); }
.page-texte .corps ul, .page-texte .corps ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.page-texte .corps table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.page-texte .corps th, .page-texte .corps td { text-align: left; padding: 12px 18px 12px 0; border-bottom: 1px solid var(--filet); vertical-align: top; }
.page-texte .corps th { font-weight: 600; width: 14rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
