/* =========================================================================
   TABLEAUX DÉCOU — squelette « galerie-visuelle » rhabillé (préfixe tbd-)
   Vocabulaire : l’accrochage. Cimaise, tirage, cadrage, cartel, planche,
   passe, registre, corniche, socle, fil. Angles vifs (--rayon: 0).
   ========================================================================= */

:root {

  /* ---- 1. COULEURS ------------------------------------------------------ */
  --fond:          #c9c2b4;  /* le mur de la galerie, plâtre chaud          */
  --fond-creux:    #a79e8c;  /* le socle, les renfoncements                 */
  --fond-clair:    #dbd4c5;  /* réserves, cartels flottants                 */
  --encre:         #221c13;  /* titres et texte principal                   */
  --encre-douce:   #4e4636;  /* légendes, mentions                          */
  --accent:        #7a2e1f;  /* garance : liens, filets d’appui, focus      */
  --accent-appuye: #5b2116;  /* survol : plus foncé que l’accent, toujours  */
  --trait:         #b1a78f;  /* filets sur le mur                           */
  --vide:          #efe9dc;  /* fond des réserves de texte long             */

  /* Textes propres au socle (contraste ≥ 4,5:1 sur --fond-creux). */
  --socle-texte:   #3a3325;
  --socle-lien:    #5b2116;

  /* ---- 2. TYPOGRAPHIE (piles système, aucune police distante) ----------- */
  --titre-police: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --texte-police: Seravek, "Gill Sans", "Gill Sans MT", "Trebuchet MS", "Segoe UI", Verdana, sans-serif;

  --titre-graisse: 400;
  --titre-interlettre: 0.004em;
  --cote-interlettre: 0.22em;   /* petites capitales des cotes et surtitres */

  --corps-taille: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --corps-interligne: 1.62;

  /* ---- 3. RYTHME ET MESURES -------------------------------------------- */
  --mesure:        64ch;
  --mesure-large:  1400px;
  --marge-page:    clamp(1.1rem, 4vw, 4.2rem);
  --gouttiere:     clamp(0.9rem, 2.2vw, 2.2rem);
  --souffle:       clamp(3rem, 7vw, 7rem);
  --decalage:      clamp(1.4rem, 3.6vw, 4rem);

  /* ---- 4. DÉTAILS ------------------------------------------------------- */
  --rayon:     0;                     /* la galerie reste à angles vifs    */
  --filet:     1px solid var(--trait);
  --transition: 180ms ease;
}

/* =========================================================================
   BASE
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte-police);
  font-size: var(--corps-taille);
  line-height: var(--corps-interligne);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--titre-police);
  font-weight: var(--titre-graisse);
  letter-spacing: var(--titre-interlettre);
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 4rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem); }
h3 { font-size: clamp(1.12rem, 1rem + 0.6vw, 1.45rem); }
h4 { font-size: 1.02rem; }

p, ul, ol { margin: 0 0 1.12em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-appuye); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
hr { border: 0; border-top: var(--filet); margin: var(--souffle) 0; }

/* =========================================================================
   OSSATURE
   ========================================================================= */

/* Lien d’évitement. NE PAS SUPPRIMER. */
.tbd-evite {
  position: absolute; left: -9999px; top: 0;
  background: var(--encre); color: var(--fond-clair);
  padding: 0.7rem 1.1rem; z-index: 50;
}
.tbd-evite:focus { left: 0.6rem; top: 0.6rem; }

/* Le passe-partout : largeur utile de toute zone de contenu. */
.tbd-passe {
  width: 100%;
  max-width: var(--mesure-large);
  margin-inline: auto;
  padding-inline: var(--marge-page);
}
.tbd-scene { display: block; }

/* --- Corniche (en-tête) -------------------------------------------------- */
.tbd-corniche { border-bottom: var(--filet); padding-block: clamp(0.8rem, 1.8vw, 1.4rem); }
.tbd-corniche__rang {
  display: flex; flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem 1.6rem;
}
.tbd-marque {
  font-family: var(--titre-police);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.8rem);
  color: var(--encre); text-decoration: none;
}
.tbd-marque span {
  display: block;
  font-family: var(--texte-police);
  font-size: 0.66rem;
  letter-spacing: var(--cote-interlettre);
  text-transform: uppercase;
  color: var(--encre-douce);
  margin-top: 0.3rem;
}
.tbd-visite ul {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  list-style: none; margin: 0; padding: 0;
}
.tbd-visite a {
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--encre); text-decoration: none;
  padding-bottom: 0.2rem; border-bottom: 1px solid transparent;
}
.tbd-visite a:hover, .tbd-visite [aria-current="page"] {
  border-bottom-color: var(--accent); color: var(--accent);
}

/* --- Fil (chemin de navigation) ------------------------------------------ */
.tbd-fil { font-size: 0.78rem; color: var(--encre-douce); padding-block: 1.1rem; }
.tbd-fil ol {
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.55rem;
  list-style: none; margin: 0; padding: 0;
}
.tbd-fil li + li::before { content: "›"; margin-right: 0.55rem; color: var(--accent); }

/* =========================================================================
   BANDE D’ACCUEIL : l’image commande, le voile est EN DUR
   ========================================================================= */

.tbd-bande { position: relative; }
.tbd-bande__photo {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
.tbd-bande__voile {
  position: absolute; inset: 0;
  background: rgba(31, 23, 15, 0.74);   /* couleur EN DUR, jamais var() */
}
.tbd-bande__texte {
  position: relative;
  padding-block: clamp(1.6rem, 3.8vw, 2.6rem);
  color: #f3ece0;
}
.tbd-bande__texte h1 { color: inherit; max-width: 24ch; }
.tbd-bande__texte p {
  margin: 0.9rem 0 0; max-width: 58ch;
  font-size: clamp(0.98rem, 0.94rem + 0.25vw, 1.1rem);
}
.tbd-bande__verbes {
  margin: 1.1rem 0 0 !important;
  font-size: 0.72rem !important;
  letter-spacing: var(--cote-interlettre);
  text-transform: uppercase;
  color: #e4d7c2 !important;
}

/* =========================================================================
   SALLE : une section de page
   ========================================================================= */

.tbd-salle { margin-top: clamp(1.8rem, 4vw, 3.2rem); }
.tbd-salle__bandeau {
  display: flex; flex-wrap: wrap;
  align-items: end; justify-content: space-between;
  gap: 0.6rem 2rem;
  border-top: var(--filet);
  padding-top: 0.85rem;
  margin-bottom: clamp(1.4rem, 3vw, 2.6rem);
}
.tbd-salle__titre { max-width: 30ch; }
.tbd-salle__note { font-size: 0.8rem; color: var(--encre-douce); max-width: 42ch; margin: 0; }

/* Cote : petit numéro de catalogue, marqueur de style. */
.tbd-inventaire {
  display: block;
  font-size: 0.67rem; letter-spacing: var(--cote-interlettre);
  text-transform: uppercase; color: var(--encre-douce);
  margin-bottom: 0.5rem;
}

/* =========================================================================
   CIMAISE : la mosaïque irrégulée (cœur du squelette)
   ========================================================================= */

.tbd-cimaise {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gouttiere);
  align-items: start;
  list-style: none; margin: 0; padding: 0;
}
.tbd-tirage { grid-column: span 3; margin: 0; position: relative; }
.tbd-tirage--plein  { grid-column: span 6; }
.tbd-tirage--large  { grid-column: span 4; }
.tbd-tirage--moyen  { grid-column: span 3; }
.tbd-tirage--petit  { grid-column: span 2; }

/* Désalignement vertical : casse la grille régulière. */
.tbd-tirage--decale  { margin-top: var(--decalage); }
.tbd-tirage--decale2 { margin-top: calc(var(--decalage) * 2); }

.tbd-tirage__cadrage { overflow: hidden; background: var(--fond-creux); border-radius: var(--rayon); }
.tbd-tirage__vue {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition), filter var(--transition);
}
.tbd-tirage__cadrage--portrait { aspect-ratio: 3 / 4; }
.tbd-tirage__cadrage--paysage  { aspect-ratio: 4 / 3; }
.tbd-tirage__cadrage--carre    { aspect-ratio: 1 / 1; }
.tbd-tirage__cadrage--pano     { aspect-ratio: 21 / 9; }
.tbd-tirage__cadrage--haut     { aspect-ratio: 2 / 3; }

/* Cartel : légende discrète sous l’image, jamais un pavé. */
.tbd-tirage__cartel { padding-top: 0.75rem; margin-top: 0.75rem; border-top: var(--filet); }
.tbd-tirage__titre {
  font-family: var(--titre-police);
  font-size: clamp(1.02rem, 0.94rem + 0.5vw, 1.3rem);
  line-height: 1.16; margin: 0;
}
.tbd-tirage--plein .tbd-tirage__titre,
.tbd-tirage--large .tbd-tirage__titre { font-size: clamp(1.25rem, 1rem + 1vw, 1.9rem); }
.tbd-tirage__lien { color: var(--encre); text-decoration: none; }
.tbd-tirage__lien:hover { color: var(--accent); }
.tbd-tirage__lien::after { content: ""; position: absolute; inset: 0; }
.tbd-tirage:hover .tbd-tirage__vue { transform: scale(1.02); }
.tbd-tirage__mot { margin: 0.45rem 0 0; color: var(--encre-douce); font-size: 0.85rem; max-width: 44ch; }
.tbd-tirage__indication {
  margin: 0.5rem 0 0;
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--encre-douce);
}
.tbd-cimaise--dense { --gouttiere: clamp(0.7rem, 1.5vw, 1.3rem); }

/* =========================================================================
   REGISTRE : le flux daté de l’accueil et des salles
   ========================================================================= */

.tbd-registre { list-style: none; margin: 0; padding: 0; }
.tbd-entree {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: clamp(1rem, 2.4vw, 2rem);
  padding-block: clamp(1rem, 2.2vw, 1.5rem);
  border-top: var(--filet);
}
.tbd-entree:first-child { border-top: 0; }
.tbd-entree__vue {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--fond-creux);
}
.tbd-date {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--encre-douce); margin: 0 0 0.3rem;
}
.tbd-entree h3 { margin: 0 0 0.35rem; }
.tbd-entree p { margin: 0; color: var(--encre-douce); font-size: 0.94rem; max-width: 70ch; }

/* =========================================================================
   PAGE DE FOND (article, dossier, confiance)
   ========================================================================= */

.tbd-ouverture {
  padding-block: clamp(1.4rem, 3.6vw, 3rem) clamp(1.2rem, 2.6vw, 2.2rem);
  max-width: 54rem;
}
.tbd-ouverture__chapo {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.28rem);
  color: var(--encre-douce); margin-top: 1rem; max-width: 56ch;
}
.tbd-indications {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  list-style: none; margin: 1.4rem 0 0; padding: 0;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--encre-douce);
}
.tbd-indications a { color: var(--encre-douce); }

/* Planche : image pleine largeur, enfant direct de .tbd-scene. */
.tbd-planche { margin: 0; }
.tbd-planche__vue { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--fond-creux); }
.tbd-planche__vue--haute { aspect-ratio: 4 / 3; }
.tbd-planche__cartel {
  max-width: var(--mesure-large); margin-inline: auto;
  padding: 0.75rem var(--marge-page) 0;
  font-size: 0.78rem; color: var(--encre-douce);
}

/* Diptyque : deux images côte à côte. */
.tbd-diptyque {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gouttiere); margin: var(--souffle) 0 0;
}
.tbd-diptyque figure { margin: 0; }
.tbd-diptyque img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--fond-creux); }
.tbd-diptyque figcaption { margin-top: 0.65rem; font-size: 0.78rem; color: var(--encre-douce); }

/* Colonne de lecture. */
.tbd-colonne { max-width: var(--mesure); margin-top: var(--souffle); }
.tbd-colonne--centree { margin-inline: auto; }
.tbd-colonne h2 { margin-top: 2.3rem; }
.tbd-colonne h3 { margin-top: 1.8rem; }
.tbd-colonne h2:first-child, .tbd-colonne h3:first-child { margin-top: 0; }
.tbd-colonne ul, .tbd-colonne ol { padding-left: 1.15rem; }
.tbd-colonne li { margin-bottom: 0.42em; }

.tbd-exergue {
  margin: 2.1rem 0; padding-left: 1.3rem;
  border-left: 3px solid var(--accent);
  font-family: var(--titre-police);
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  line-height: 1.32;
}
.tbd-reserve { background: var(--vide); padding: clamp(1.1rem, 2.8vw, 1.9rem); margin: 2.3rem 0; }
.tbd-reserve > :last-child { margin-bottom: 0; }

/* Tableau : toujours dans un conteneur à défilement propre. */
.tbd-defile {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 2.1rem 0; border-top: var(--filet); border-bottom: var(--filet);
}
.tbd-defile table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.92rem; }
.tbd-defile th, .tbd-defile td {
  text-align: left; padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--trait); vertical-align: top;
}
.tbd-defile th {
  font-weight: 600; font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--encre-douce);
}
.tbd-defile tr:last-child td { border-bottom: 0; }

/* Appuis. */
.tbd-poursuivre {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent); padding-bottom: 0.25rem;
}
.tbd-poursuivre::after { content: "\203A"; font-size: 1.1em; line-height: 1; }
.tbd-poursuivre:hover { color: var(--encre); border-bottom-color: var(--encre); }

.tbd-suite { border-top: var(--filet); margin-top: var(--souffle); padding-top: 1.1rem; }
.tbd-suite ul { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.tbd-suite li { margin-bottom: 0.6rem; }

/* =========================================================================
   SOCLE (pied de page)
   ========================================================================= */

.tbd-socle {
  margin-top: var(--souffle);
  background: var(--fond-creux);
  border-top: var(--filet);
  padding-block: clamp(2.2rem, 5.5vw, 4rem);
  color: var(--socle-texte);
}
.tbd-socle__rang {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1.5rem, 4vw, 3.4rem);
}
.tbd-socle h2 { font-size: 1.15rem; margin-bottom: 0.85rem; color: var(--encre); }
.tbd-socle ul { list-style: none; margin: 0; padding: 0; }
.tbd-socle li { margin-bottom: 0.48rem; }
.tbd-socle a { color: var(--socle-lien); text-decoration: none; border-bottom: 1px solid transparent; }
.tbd-socle a:hover { border-bottom-color: var(--socle-lien); }
.tbd-socle p { color: var(--socle-texte); font-size: 0.9rem; }
.tbd-socle__bas {
  margin-top: clamp(1.8rem, 4.5vw, 3rem); padding-top: 1.1rem;
  border-top: var(--filet);
  font-size: 0.74rem; color: var(--socle-texte);
}

/* =========================================================================
   RESPONSIVE : la grille se replie, aucun débordement horizontal
   ========================================================================= */

@media (max-width: 960px) {
  .tbd-cimaise { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tbd-tirage, .tbd-tirage--moyen, .tbd-tirage--petit { grid-column: span 2; }
  .tbd-tirage--large, .tbd-tirage--plein { grid-column: span 4; }
  .tbd-tirage--decale, .tbd-tirage--decale2 { margin-top: calc(var(--decalage) / 2); }
}
@media (max-width: 620px) {
  .tbd-cimaise { grid-template-columns: minmax(0, 1fr); }
  .tbd-tirage, .tbd-tirage--petit, .tbd-tirage--moyen,
  .tbd-tirage--large, .tbd-tirage--plein { grid-column: span 1; }
  .tbd-tirage--decale, .tbd-tirage--decale2 { margin-top: 0; }
  .tbd-diptyque { grid-template-columns: minmax(0, 1fr); }
  .tbd-tirage__cadrage--haut { aspect-ratio: 3 / 4; }
  .tbd-entree { grid-template-columns: 1fr; }
  .tbd-entree__vue { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .tbd-tirage:hover .tbd-tirage__vue { transform: none; }
}
