/* Site de Tristan Carric Pelhâtre (ticket 1477) : téléphone d'abord, puis écrans plus larges.
   Polices servies par le site (polices/LISEZMOI.md), aucun appel externe. */

@font-face {
  font-family: 'Josefin Sans';
  src: url('polices/JosefinSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Josefin Sans';
  src: url('polices/JosefinSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Josefin Sans';
  src: url('polices/JosefinSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --encre: #1c1c1c;
  --encre-douce: #5c5c5c;
  --fond: #faf8f5;
  --trait: #e2ddd5;
  --accent: #b5462d;
  --largeur: 72rem;
  --marge: 1.25rem;
  --police: 'Josefin Sans', system-ui, sans-serif;
  /* Réglables dans l'admin (#1497) : posées par un <style> de base.html, mêmes valeurs ici. */
  --police-titres: var(--police);
  --taille-texte: 1.0625rem;
  --echelle-titres: 1;
  --espacement: 1;
  --colonnes-book: 3;
}

/* Titres : police des titres (#1497). */
h1, h2, h3, .logo, .accroche, .intertitre, .projet__titre { font-family: var(--police-titres); }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Un élément atteint au clavier ne se cache pas sous le menu collé en haut (hauteur réelle
     posée par site.js, valeur de repli sinon). */
  scroll-padding-top: calc(var(--hauteur-entete, 6rem) + 1.5rem);
  /* Changement de rubrique (#1495) : la page s'efface sur la couleur du fond, jamais sur du
     blanc ; place de la barre de défilement réservée, pas de saut quand la hauteur change. */
  background: var(--fond);
  scrollbar-gutter: stable;
}
/* Limiter les animations : saut direct, pas de défilement doux ni d'effet au survol. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--police);
  font-size: var(--taille-texte);
  line-height: 1.6;
  color: var(--encre);
  background: var(--fond);
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Titre présent pour les lecteurs d'écran et les moteurs, invisible à l'écran. */
.visuellement-masque {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aller-au-contenu {
  position: absolute;
  left: var(--marge);
  top: -3rem;
  padding: .5rem 1rem;
  background: var(--encre);
  color: var(--fond);
  z-index: 10;
}
.aller-au-contenu:focus { top: .5rem; }

/* En-tête : logo puis menu en dessous sur téléphone, sur une ligne au-delà. Collé en haut de
   l'écran au scroll (#1492). */
.entete {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--fond);
  border-bottom: 1px solid var(--trait);
}
.entete__interieur,
.pied__interieur,
.contenu {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding-left: var(--marge);
  padding-right: var(--marge);
}
.entete__interieur {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding-top: .5rem;
  padding-bottom: .25rem;
}
.logo {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu a {
  display: inline-block;
  padding: .5rem 0;  /* cible tactile confortable */
  text-decoration: none;
  color: var(--encre-douce);
}
.menu a:hover,
.menu a[aria-current] { color: var(--encre); }
.menu a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }

.contenu {
  flex: 1;
  padding-top: calc(2rem * var(--espacement));
  padding-bottom: calc(3rem * var(--espacement));
}

.bloc + .bloc { margin-top: calc(2.5rem * var(--espacement)); }

.texte { max-width: 42rem; }

.accroche {
  font-size: calc(1.5rem * var(--echelle-titres));
  font-weight: 300;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.bouton {
  display: inline-block;
  padding: .75rem 1.5rem;
  border: 1px solid var(--encre);
  text-decoration: none;
  font-weight: 600;
}
.bouton:hover { background: var(--encre); color: var(--fond); }

.pied {
  border-top: 1px solid var(--trait);
  font-size: .9375rem;
  color: var(--encre-douce);
}
.pied__interieur {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.pied p { margin: 0; }
.pied__nom { font-weight: 600; color: var(--encre); }

/* Logo déposé dans l'admin (#1478). */
.logo__image { max-height: 3rem; width: auto; }

.intertitre {
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin: 0 0 1rem;
}

.pied__reseaux {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Filtre du book par catégorie. */
.filtres ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.filtres a,
.filtres button {
  display: inline-block;
  font: inherit;
  background: none;
  cursor: pointer;
  padding: .4rem .9rem;
  border: 1px solid var(--trait);
  border-radius: 999px;
  text-decoration: none;
  color: var(--encre-douce);
}
.filtres a:hover,
.filtres button:hover { color: var(--encre); border-color: var(--encre-douce); }
.filtres a[aria-current],
.filtres button[aria-pressed="true"] { color: var(--fond); background: var(--encre); border-color: var(--encre); }
.filtres button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Grilles de projets : toutes les cartes à la même taille, image en haut (même cadre 4/3 pour
   toutes), titre au même endroit (conventions du workspace). */
.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  grid-auto-rows: 1fr;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Book sur ordinateur : nombre de colonnes réglé dans l'admin (#1497) ; téléphone à une colonne. */
@media (min-width: 64rem) {
  [data-grille-book] { grid-template-columns: repeat(var(--colonnes-book), minmax(0, 1fr)); }
}
.grille__case { display: flex; }
.carte {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.carte__image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--trait);
}
.carte__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.carte:hover .carte__image img { transform: scale(1.03); }
.carte__texte { display: flex; flex-direction: column; flex: 1; padding-top: .75rem; }
.carte__titre { font-weight: 600; }
.carte__meta { font-size: .875rem; color: var(--encre-douce); }

/* Page d'un projet : titre visible (écran de détail). */
.projet__entete { margin-bottom: 1.5rem; }
.projet__meta { margin: 0; color: var(--encre-douce); font-size: .9375rem; }
.projet__titre { margin: .25rem 0 0; font-size: calc(2rem * var(--echelle-titres)); font-weight: 600; line-height: 1.2; }
.projet__images { display: flex; flex-direction: column; gap: 2rem; margin-top: 2rem; }
.projet__images figure { margin: 0; }
.projet__images img { width: 100%; }
.projet__images figcaption { margin-top: .5rem; font-size: .9375rem; color: var(--encre-douce); }
.projet__navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--trait);
}
.projet__suivant { margin-left: auto; text-align: right; }

.a-propos { display: flex; flex-direction: column; gap: 2rem; }
.a-propos__photo { max-width: 24rem; width: 100%; }

@media (min-width: 48rem) {
  .a-propos { flex-direction: row; align-items: flex-start; }
  .a-propos__photo { flex: 0 0 22rem; }
  /* Disposition réglée dans l'admin (#1497) ; « gauche » = disposition d'origine. */
  .a-propos--droite { flex-direction: row-reverse; }
  .a-propos--dessus { flex-direction: column; }
  .a-propos--dessus .a-propos__photo,
  .a-propos--dessus .a-propos__cadre { flex: 0 0 auto; }
}

@media (min-width: 48rem) {
  :root { --marge: 2rem; }
  .entete__interieur { flex-direction: row; justify-content: space-between; padding-top: .75rem; padding-bottom: .75rem; }
  .menu ul { gap: 2rem; }
  .accroche { font-size: calc(2rem * var(--echelle-titres)); }
  .pied__interieur { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

/* Page Contact (#1479) : coordonnées puis formulaires, côte à côte sur grand écran. */
.contact { display: flex; flex-direction: column; gap: 2.5rem; }
.contact .bloc + .bloc { margin-top: 0; }
.contact__liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.contact__formulaires { max-width: 40rem; width: 100%; }

.formulaire { display: flex; flex-direction: column; gap: 1.25rem; }
.formulaire__champ { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.formulaire__champ > label,
.formulaire__creneaux legend { font-weight: 600; font-size: .9375rem; }
.formulaire input[type="text"],
.formulaire input[type="email"],
.formulaire input[type="date"],
.formulaire textarea {
  width: 100%;
  padding: .7rem .8rem;
  font: inherit;
  color: var(--encre);
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: 0;
}
.formulaire input:focus-visible,
.formulaire textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.formulaire [aria-invalid="true"] { border-color: var(--accent); }
.formulaire__creneaux { border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; gap: .5rem 1.25rem; }
.formulaire__creneaux legend { padding: 0; margin-bottom: .35rem; width: 100%; }
.formulaire__option { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem 0; }
.formulaire__champ--case { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: .6rem; }
.formulaire__champ--case input { margin-top: .3rem; flex: 0 0 auto; }
.formulaire__champ--case label { flex: 1; font-size: .9375rem; }
.formulaire__champ--case .formulaire__erreur { width: 100%; }
.formulaire__erreur { margin: 0; color: var(--accent); font-size: .9375rem; }
.formulaire .bouton { align-self: flex-start; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.formulaire .bouton:hover { background: var(--encre); color: var(--fond); }
/* Champ piège anti-spam : hors écran (pas display:none, que certains robots repèrent). */
.formulaire__piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.avis { padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-left: 3px solid var(--encre); background: #fff; }
.avis p { margin: 0; }
.avis p + p { margin-top: .5rem; }
.avis--erreur { border-left-color: var(--accent); }

@media (min-width: 48rem) {
  .contact { flex-direction: row; align-items: flex-start; gap: 4rem; }
  .contact__coordonnees { flex: 0 0 16rem; }
}

/* Pages légales (#1489) : texte d'optinov-legal (titres h2, tableaux des données et des cookies). */
.pied__legal { display: flex; flex-direction: column; gap: .25rem; }
.texte-legal__maj { font-size: .875rem; color: var(--encre-douce); }
.texte-legal h2 { font-size: calc(1.125rem * var(--echelle-titres)); font-weight: 600; margin: 2rem 0 .5rem; }
.texte-legal table { width: 100%; border-collapse: collapse; font-size: .875rem; display: block; overflow-x: auto; }
.texte-legal th,
.texte-legal td { border: 1px solid var(--trait); padding: .5rem; text-align: left; vertical-align: top; }

/* Fenêtre d'un projet par-dessus la page unique (#1492) : plein écran, défile seule ; la page
   derrière ne bouge pas. Ouverte sans script (adresse du projet), elle couvre aussi la page. */
.fenetre-projet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--encre);
  background: var(--fond);
  z-index: 20;
}
.fenetre-projet::backdrop { background: rgba(28, 28, 28, .5); }
html.fenetre-ouverte { overflow: hidden; }
.fenetre-projet__barre {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: .5rem var(--marge);
  background: var(--fond);
  border-bottom: 1px solid var(--trait);
}
.fenetre-projet__fermer {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;  /* cible tactile confortable */
  padding: 0 .75rem;
  text-decoration: none;
  font-weight: 600;
}
.fenetre-projet__fermer:hover { color: var(--accent); }
.fenetre-projet__contenu {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem var(--marge) 3rem;
}
.fenetre-projet__contenu:focus { outline: none; }
.projet__navigation a {
  display: inline-block;
  padding: .5rem 0;  /* cible tactile confortable */
}

/* Animations (#1493) : règles posées seulement quand animations.js tourne (classe `ct-anim` sur
   <html>). Rien n'est masqué d'avance ici : sans script, tout le contenu reste affiché. */
.a-propos__cadre { overflow: hidden; max-width: 24rem; width: 100%; }
.a-propos__cadre .a-propos__photo { max-width: none; }
@media (min-width: 48rem) {
  .a-propos__cadre { flex: 0 0 22rem; }
}
.ct-anim [data-grille-book] { position: relative; }
/* Survol des cartes piloté par GSAP (inclinaison, zoom de l'image) : plus de zoom CSS. Cartes 3D
   coupées dans l'admin (#1498) : zoom CSS d'origine. */
.ct-anim--cartes-3d:not(.ct-anim--limite) .carte__image img { transition: none; }
.ct-anim--cartes-3d:not(.ct-anim--limite) .carte:hover .carte__image img { transform: none; }
.ct-anim .grille__case { will-change: transform; }
/* Fond de la fenêtre projet en fondu à l'ouverture. */
@media (prefers-reduced-motion: no-preference) {
  .ct-anim--zoom .fenetre-projet[open]::backdrop { animation: ct-fondu .4s ease-out; }
}
@keyframes ct-fondu { from { opacity: 0; } to { opacity: 1; } }

/* Arrivée depuis une autre page du site (#1495) : page masquée le temps qu'animations.js la fasse
   apparaître en fondu (classe posée par un script de l'en-tête, retirée s'il ne tourne pas). */
.ct-arrivee body { opacity: 0; }

/* Défilement lissé par Lenis (règles de lenis.css). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Crédit d'Optinov Concept (#1494) : seul bloc aux couleurs d'Optinov, le reste garde celles du site. */
.pied__credit { display: flex; flex-direction: column; gap: .375rem; color: #003538; }
.pied__credit-lien { display: flex; flex-direction: column; gap: .375rem; color: #003538; text-decoration: none; }
.pied__credit-lien:hover,
.pied__credit-lien:focus-visible { color: #003538; }
.pied__credit-lien:hover .pied__credit-accroche,
.pied__credit-lien:focus-visible .pied__credit-accroche { text-decoration: underline; }
.pied__credit-logo { display: block; width: 9rem; max-width: 100%; height: auto; }
.pied__credit-accroche { font-size: .875rem; }
.a-propos__credit { font-size: .875rem; color: var(--encre-douce); margin-top: 1.5rem; }
