/* Base : marque BO3P Suisse à l'échelle du site.
   Jetons, polices, typographie, grille, en-tête, pied de page. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blanc: #fff;
  --noir: #111;
  --texte: #262626;
  --gris: #6a6a6a;
  --gris-f: #3a3a3a;
  --filet: #d8d8d8;
  --rayure: #bdbdb9;
  --encadre: #f5f5f3;
  --rouge: #e3000f;
  --marine: #2f5b9e;
  --turq: #0097a7;

  --police: "Archivo", Arial, Helvetica, sans-serif;
  --gut: clamp(20px, 4.5vw, 64px);
  --max: 1360px;
  --rail: 260px;
  --lecture: 680px;

  --trait-l: 9px;
  --trait-m: 6px;
  --trait: 2.5px;

  --sortie: cubic-bezier(0.23, 1, 0.32, 1);
  --bouge: cubic-bezier(0.77, 0, 0.175, 1);
  --haut: 72px;

  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; }

html {
  font-size: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--haut) + 24px);
  scrollbar-color: var(--noir) var(--blanc);
}

body {
  font-family: var(--police);
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  min-height: 100vh;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

::selection { background: var(--noir); color: var(--blanc); }
.foyer ::selection { background: var(--blanc); color: var(--noir); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
button, .btn, .cta-s { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--marine); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }

/* Titres : graisse 900, interlettrage serré, espace entre mots. */
h1, h2, h3, h4 {
  font-weight: 900;
  letter-spacing: -0.02em;
  word-spacing: 0.05em;
  color: var(--noir);
  text-wrap: balance;
  line-height: 1.02;
  hyphens: manual;
  overflow-wrap: break-word;
}
h3, h4 { font-weight: 800; letter-spacing: 0; line-height: 1.12; }
p { text-wrap: pretty; }
strong { font-weight: 700; color: var(--noir); }

/* Étiquette : capitales étroites, rouge ce qui guide, grise ce qui classe. */
.lab {
  display: block;
  font-size: 0.875rem;
  font-weight: 800;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.3;
  color: var(--rouge);
}
.lab.g { color: var(--gris); }
.lab.n { color: var(--marine); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute;
  left: var(--gut);
  top: -80px;
  z-index: 100;
  background: var(--noir);
  color: var(--blanc);
  padding: 12px 18px;
  font-weight: 700;
}
.skip:focus { top: 12px; }

/* Flèche dessinée : même trait partout, la police n'a pas le glyphe. */
.arr {
  display: inline-block;
  width: 1.05em;
  height: 0.8em;
  margin-left: 0.55em;
  background: currentColor;
  vertical-align: -0.02em;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 16'%3E%3Cpath d='M0 8h18M11 1l7 7-7 7' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 16'%3E%3Cpath d='M0 8h18M11 1l7 7-7 7' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 220ms var(--sortie);
}

/* ---------- Grille ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
.wrap.etroit { max-width: calc(1040px + 2 * var(--gut)); }

.cols {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 80px);
}
.cols > .rail { align-self: start; }

/* ---------- En-tête ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blanc);
  border-bottom: 1px solid var(--filet);
}
.top-in {
  height: var(--haut);
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
  max-width: calc(var(--max) + 2 * var(--gut));
  margin-inline: auto;
  padding-inline: var(--gut);
}
.brand {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--noir);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.brand::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  background: var(--rouge);
  margin-left: 0.14em;
}
.menu { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); }
.menu a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--noir);
  text-decoration: none;
  padding-top: 6px; padding-bottom: 6px;
  position: relative;
}
.menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--trait);
  background: var(--noir);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms var(--sortie);
}
.menu a[aria-current="page"] { font-weight: 800; }
.menu a[aria-current="page"]::after { transform: scaleX(1); }
.lang { display: flex; gap: 6px; font-size: 0.875rem; font-weight: 800; font-stretch: 75%; letter-spacing: 0.1em; text-transform: uppercase; }
.lang a { color: var(--gris); text-decoration: none; padding: 12px 6px; }
.lang a[aria-current="true"] { color: var(--noir); text-decoration: underline; text-decoration-thickness: var(--trait); }
.lang .sep { color: var(--filet); padding-top: 12px; padding-bottom: 12px; }

.cta-s {
  background: var(--noir);
  color: var(--blanc);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 13px 20px;
  white-space: nowrap;
  transition: background-color 180ms ease, transform 120ms var(--sortie);
}
.cta-s:active { transform: scale(0.97); }
.cta-s .court { display: none; }

.burger { display: none; }
.menu-pied, .menu .cta-menu { display: none; }

/* Quatre rayures : une fois par page, sous l'en-tête. */
.stripes {
  display: block;
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gut));
  margin: 0 auto;
  padding: 0 var(--gut);
}
.stripes i { display: block; height: 4px; background: var(--rayure); margin-top: 5px; }
.stripes i:first-child { margin-top: 0; }
.stripes-box { padding-top: 0; }

/* ---------- Pied de page ---------- */
.foot { margin-top: clamp(72px, 10vw, 144px); border-top: var(--trait-l) solid var(--noir); }
.foot-in {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 72px);
  align-items: start;
  padding-top: 40px; padding-bottom: 56px;
}
.foot-logo { width: 120px; }
.foot-liens { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 1rem; font-weight: 500; }
.foot-liens a { position: relative; text-decoration: none; padding-top: 12px; padding-bottom: 12px; }
.foot-liens a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--noir); transform: scaleX(0); transform-origin: left center; transition: transform 240ms var(--sortie); }
.foot-meta { font-size: 0.875rem; color: var(--gris); font-stretch: 75%; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.6; text-align: right; }

/* ---------- Adaptation ---------- */
@media (hover: hover) and (pointer: fine) {
  .menu a:hover::after { transform: scaleX(1); }
  .cta-s:hover { background: var(--rouge); }
  .foot-liens a:hover::after { transform: scaleX(1); }
}

/* En-tête : serré d'abord, puis replié en panneau. Les seuils sont en em : ils suivent la taille de texte choisie dans le navigateur. */
@media (max-width: 89.9375em) {
  .menu { gap: 16px; }
  .menu a { font-size: 0.875rem; }
  .top-in { gap: 24px; }
}

@media (max-width: 70em) {
  :root { --haut: 64px; }
  .burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 48px;
    height: 48px;
    padding: 0 10px;
    margin-right: -10px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .burger span { display: block; height: 3px; background: var(--noir); transition: transform 200ms var(--sortie), opacity 120ms ease; }
  .top[data-ouvert="true"] .burger span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
  .top[data-ouvert="true"] .burger span:nth-child(2) { opacity: 0; }
  .top[data-ouvert="true"] .burger span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

  .brand { font-size: 1.2rem; }
  .top-in > .lang { display: none; }
  .menu-pied { display: flex; padding-top: 18px; border-top: var(--trait) solid var(--noir); }
  .menu .menu-pied a { font-size: 0.9375rem; font-weight: 800; letter-spacing: 0.1em; padding: 14px 10px; border-top: 0; }
  .cta-s .long { display: none; }
  .cta-s .court { display: inline; }
  .cta-s { padding: 13px 14px; font-size: 0.875rem; }

  /* Sans JavaScript, le menu reste visible sous l'en-tête. */
  .top-in { flex-wrap: wrap; height: auto; min-height: var(--haut); row-gap: 0; }
  .menu { order: 9; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 12px; }
  .menu a { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; padding: 14px 0; border-top: var(--trait) solid var(--noir); }
  .menu a::after { display: none; }
  .menu a[aria-current="page"] { color: var(--rouge); }
  .js .menu { display: none; }
  .js .top[data-ouvert="true"] .menu { display: flex; animation: menu-entre 200ms var(--sortie) both; }
  .js .top[data-ouvert="true"] { height: 100dvh; overflow-y: auto; }
  .js .top[data-ouvert="true"] .top-in { align-content: flex-start; }
}

@media (max-width: 60em) {
  .cols { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .sec .cols > .rail { position: static; }
  .cols > div > .sec-tete { border-top: 0; padding-top: 0; }
  .foot-in { grid-template-columns: 1fr; }
  .foot-meta { text-align: left; }
}

/* Petits téléphones : le bouton de rendez-vous passe dans le panneau du menu, la barre garde le nom et le menu. */
@media (max-width: 27.5em) {
  .top-in > .cta-s { display: none; }
  .menu .cta-menu { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 18px 20px; border-top: 0; background: var(--noir); color: var(--blanc); font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; }
  .menu .cta-menu[aria-current="page"] { color: var(--blanc); }
}

@keyframes menu-entre { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Mouvement réduit : plus aucun déplacement ni dessin de trait, les changements de couleur restent. */
@media (prefers-reduced-motion: reduce) {
  .frise::before, .frise li::before, .temps .piste i, .barreau .jauge i, .row .bar i, .doc img, .arr, .menu a::after, .foot-liens a::after, .burger span, .btn, .cta-s, .seg button { transition-property: color, background-color, opacity; }
  .btn:active, .cta-s:active, .seg button:active { transform: none; }
  .js .top[data-ouvert="true"] .menu { animation: none; }
}

/* Impression : la page Ordre de marche sert de PDF. Pas de navigation, texte noir sur blanc, blocs entiers. */
@media print {
  .top, .stripes, .som, .skip, .row-cta, .burger, .legende { display: none !important; }
  body { font-size: 11pt; }
  .pdf body { font-size: 14pt; }
  .wrap { max-width: none; padding-inline: 0; }
  .page-som { display: block; }
  .sec, .fin, .question { padding-top: 28pt; }
  .ph { padding-top: 0; }
  .ph h1 { font-size: 30pt; max-width: none; }
  h2, h3, .sec-tete { break-after: avoid; }
  .etape, .barreau, .regime, .famille, .qa, .vignette, .doc, .terme, .flux > div { break-inside: avoid; }
  .doc img, .etape figure img { max-width: 60mm; }
  .js .frise::before, .js .temps .piste i, .js .barreau .jauge i { transform: none !important; }
  .js .frise:not(.is-in) li::before { transform: none !important; opacity: 1 !important; }
  a { text-decoration: none; }
  .foot { margin-top: 24pt; }
}
