@charset "utf-8";

/* FibroMate — feuille de style unique.
   Palette : papier (fond), encre (texte), rouge PLA PolyTerra (accent unique).
   Fontes système uniquement : aucune requête vers un tiers. */

:root {
  --papier: #f3f0e9;
  --papier-creux: #ebe7dd;
  --encre: #1c1a17;
  --encre-pale: #55504a;
  --accent: #a6342a;
  --accent-sombre: #8a2b22;
  --filet: rgba(28, 26, 23, 0.16);
  --filet-pale: rgba(28, 26, 23, 0.09);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Charter, "Bitstream Charter", "Liberation Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Liberation Sans", Arial, sans-serif;

  --mesure: 36rem;
  --gouttiere: 9rem;
  --page: 60rem;
  --marge: clamp(1.25rem, 5vw, 3rem);

  color-scheme: light;
}

*, *::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;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Grain de papier : SVG en ligne, aucune ressource externe. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
}

/* ---------- liens ---------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { color: var(--accent-sombre); }

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

.evitement {
  position: absolute;
  left: -9999px;
  top: 0;
}

.evitement:focus {
  left: 0;
  padding: 0.6rem 1rem;
  background: var(--encre);
  color: var(--papier);
  text-decoration: none;
  z-index: 10;
}

/* ---------- gabarit ---------- */

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

.grille { display: grid; gap: 0.75rem 3rem; }

@media (min-width: 60rem) {
  .grille {
    grid-template-columns: var(--gouttiere) minmax(0, 1fr);
  }
  .grille > .rubrique { grid-column: 1; }
  .grille > :not(.rubrique) { grid-column: 2; }
}

.corps > * + * { margin-top: 1.15em; }
.corps p { max-width: var(--mesure); }

/* ---------- bandeau ---------- */

.bandeau {
  border-bottom: 1px solid var(--filet);
  padding-block: 1.1rem;
}

.bandeau .page {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
}

.marque {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.005em;
}

.marque span { color: var(--accent); font-weight: inherit; }

.bandeau-contact {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--encre-pale);
}

.bandeau-contact a {
  color: var(--encre);
  white-space: nowrap;
  padding-block: 0.45rem; /* surface de touche élargie, sans effet sur l’interligne */
}

.bandeau-contact .sep { padding-inline: 0.5rem; color: var(--filet); }

/* ---------- accroche ---------- */

.accroche { padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 7vw, 5rem); }

h1 {
  margin: 0 0 1.4rem;
  max-width: 30ch;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 1.2rem + 4.1vw, 3.6rem);
  line-height: 1.07;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 .nom { color: var(--accent); }

.chapeau {
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem);
  line-height: 1.5;
}

.signature {
  max-width: var(--mesure);
  margin: 1.5rem 0 0;
  color: var(--encre-pale);
}

/* ---------- contact ---------- */

.contact-direct {
  margin-top: clamp(2rem, 5vw, 2.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--filet);
  font-style: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 3rem;
}

.contact-direct > div { min-width: min(10rem, 100%); }

.etiquette {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-pale);
}

.contact-direct .fil {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.1rem + 1.1vw, 1.7rem);
  line-height: 1.25;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  word-break: break-word;
}

.contact-direct .nom-personne {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.1rem + 1.1vw, 1.7rem);
}

/* ---------- blocs de contenu ---------- */

.bloc {
  counter-increment: bloc;
  border-top: 1px solid var(--filet);
  padding-block: clamp(2.75rem, 7vw, 5rem);
}

.rubrique {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-pale);
  white-space: nowrap;
}

.rubrique::before {
  content: counter(bloc, decimal-leading-zero);
  color: var(--accent);
  padding-right: 0.5ch;
}

@media (min-width: 60rem) {
  .rubrique { padding-top: 0.55rem; }
}

h2 {
  margin: 0 0 1.1rem;
  max-width: 28ch;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 1.25rem + 1.5vw, 2.15rem);
  line-height: 1.14;
  letter-spacing: -0.008em;
  text-wrap: balance;
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.3rem);
  line-height: 1.25;
}

p { margin: 0; }

strong { font-weight: 600; }

.appui {
  margin-top: 2rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.45;
}

/* ---------- notes de l’évaluation ---------- */

.notes {
  margin: 2.25rem 0 0;
  max-width: 40rem;
  border-top: 1px solid var(--filet-pale);
}

.note {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.2rem 1.75rem;
  align-items: baseline;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--filet-pale);
}

.note dt {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
}

.note .precision {
  margin: 0;
  grid-column: 2;
  grid-row: 2;
  color: var(--encre-pale);
}

.note .score {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 1.5rem + 1.5vw, 2.4rem);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.note .score .sur {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-pale);
}

.note--faible .score { color: var(--encre); }

@media (max-width: 29.99rem) {
  .note { grid-template-columns: minmax(0, 1fr); }
  /* L’ordre du source est dt → dd (exigence du <dl>) ; les rangées
     rétablissent l’ordre visuel : note, intitulé, précision. */
  .note .score { grid-column: 1; grid-row: 1; margin-bottom: 0.15rem; }
  .note dt { grid-column: 1; grid-row: 2; }
  .note .precision { grid-column: 1; grid-row: 3; }
}

/* ---------- visuels (photos à venir) ---------- */

.visuel {
  margin: 2.5rem 0 0;
  max-width: var(--mesure);
}

.visuel img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--papier-creux);
}

.visuel figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--encre-pale);
  border-top: 1px solid var(--filet-pale);
  padding-top: 0.5rem;
}

@media (min-width: 58rem) {
  .visuel-large { max-width: none; }
}

/* ---------- fiche technique ---------- */

.fiche {
  margin: 2rem 0 0;
  max-width: 42rem;
  border-top: 1px solid var(--filet-pale);
}

.fiche > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 2rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--filet-pale);
}

@media (min-width: 34rem) {
  .fiche > div { grid-template-columns: 13rem minmax(0, 1fr); }
}

.fiche dt {
  color: var(--encre-pale);
  font-size: 0.9375rem;
}

.fiche dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* ---------- pied ---------- */

.pied {
  border-top: 1px solid var(--filet);
  padding-block: 2.5rem 3.5rem;
  color: var(--encre-pale);
  font-size: 0.9375rem;
}

.pied p { margin: 0; max-width: 42rem; }
.pied p + p { margin-top: 0.6rem; }

/* ---------- barre de contact au pouce (petits écrans) ---------- */

.pouce {
  position: fixed;
  inset: auto 0 0 0;
  display: flex;
  background: var(--papier);
  border-top: 1px solid var(--filet);
  box-shadow: 0 -8px 20px -14px rgba(28, 26, 23, 0.5);
  z-index: 5;
}

.pouce a {
  flex: 1 1 50%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.pouce a + a { border-left: 1px solid var(--filet); }
.pouce a:first-child { color: var(--accent-sombre); }

@media (min-width: 48rem) {
  .pouce { display: none; }
}

@media (max-width: 47.99rem) {
  body { padding-bottom: 3.25rem; }
}

/* ---------- mentions légales ---------- */

.texte-legal { padding-block: clamp(2.5rem, 7vw, 4rem) 3rem; }
.texte-legal h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.5rem); max-width: 24ch; }
.texte-legal h2 { margin-top: 2.75rem; font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem); }
.texte-legal p, .texte-legal li { max-width: var(--mesure); }
.texte-legal ul { margin: 1.15em 0 0; padding-left: 1.2rem; }
.texte-legal li + li { margin-top: 0.4rem; }
.texte-legal .retour { display: inline-block; margin-top: 2.75rem; }

.a-completer {
  color: var(--accent-sombre);
  border-bottom: 1px dotted var(--accent);
}

/* ---------- impression ---------- */

@media print {
  :root { --papier: #fff; --encre: #000; --encre-pale: #333; }
  body { font-size: 10.5pt; }
  body::before, .pouce, .evitement { display: none; }
  .page { max-width: none; padding-inline: 0; }
  .bloc { padding-block: 1.2rem; break-inside: avoid; }
  .accroche { padding-block: 0 1.2rem; }
  h1 { font-size: 22pt; }
  h2 { font-size: 14pt; }
  a { text-decoration: none; }
  .contact-direct .fil::after { content: ""; }
}

/* ---------- galerie de vues endoluminales ---------- */

.galerie-grille {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.galerie-grille img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--papier-creux);
}

@media (min-width: 40rem) {
  .galerie { max-width: 45rem; }
  .galerie-grille { grid-template-columns: repeat(5, 1fr); }
}

/* Deux vidéos verticales côte à côte : hauteur commune, pas de recadrage. */
.galerie-grille--video {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.galerie-grille--video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--encre);
}

@media (min-width: 40rem) {
  .galerie-video { max-width: 40rem; }
  .galerie-grille--video {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    justify-items: center;
  }
  /* Hauteur commune : les deux séquences n'ont pas le même format. */
  .galerie-grille--video video { width: auto; max-width: 100%; max-height: 22rem; }
}

/* ---------- bouton de contact ---------- */

.action {
  margin: 2rem 0 0;
  max-width: var(--mesure);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.bouton {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--papier);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border: 1px solid var(--accent-sombre);
  border-radius: 2px;
}

.bouton:hover,
.bouton:focus-visible {
  background: var(--accent-sombre);
  color: var(--papier);
}

.action-note {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--encre-pale);
  flex: 1 1 14rem;
}

@media print {
  .bouton { background: none; color: #000; border-color: #000; }
}

/* ---------- vidéo ---------- */

.visuel video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--encre);
}

@media print {
  .visuel video { display: none; }
}

/* Vignette orpheline sur la dernière ligne (grille à 2 colonnes) : centrée. */
@media (max-width: 39.99rem) {
  .galerie-grille > img:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.25rem);
  }
}
