/* Robin Olivy HVAC : page « Réalisations » (galerie portfolio) et pages de chantier (realisations/<slug>.html).
   Jetons, socle et kit futuriste : commun.css. Filtres, visionneuse et lien de retour : realisations.js.
   - /realisations : introduction, filtres (un par catégorie qui a au moins un chantier), galerie de cartes (une photo par chantier :
     3 par ligne sur ordinateur, 2 sur tablette, 1 sur téléphone), dernier bandeau. Texte de Robin, mail du 26/11 01:45 (M8).
   - Page de chantier : retour, catégorie et lieu, titre, grande photo et vignettes (visionneuse plein écran), puis les trois
     rubriques et la phrase de conclusion QUAND elles existent (champ inconnu = absent). Deux colonnes sur ordinateur. */

/* ============================================================ INTRODUCTION */
.rea-tete { padding-top: calc(var(--s6) + var(--s1)); padding-bottom: var(--s4); --grille-x: 78%; --grille-y: 22%; }
.rea-h1 { margin-top: var(--s3); font-size: var(--t-xl); }
.rea-h1 .doux { color: var(--c-doux); }
.rea-lead { max-width: 62ch; margin-top: var(--s4); text-wrap: pretty; }
.rea-fil ol { display: flex; flex-wrap: wrap; gap: 0 var(--s1); margin: 0 0 var(--s3); padding: 0; list-style: none; font-size: var(--t-xs); font-weight: 600; color: var(--c-doux); }
.rea-fil li + li::before { content: "›"; margin-right: var(--s1); color: var(--c-gris); }
.rea-fil a { display: inline-block; padding: var(--s1) 0; color: var(--c-doux); text-decoration: none; }
.rea-fil a:hover { color: var(--c-azur); }
.rea-fil [aria-current] { padding: var(--s1) 0; color: var(--c-clair); }

/* ============================================================ FILTRES (fabriqués par le script ; sans JS : tous les chantiers sont visibles) */
.rea-galerie { padding-top: var(--s4); padding-bottom: var(--s6); }
.rea-filtres { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.rea-filtres button { min-height: 2.75rem; padding: 0 var(--s3); border: 1px solid var(--c-ligne-forte); border-radius: var(--r3); background: color-mix(in srgb, var(--c-nuit) 25%, transparent); color: var(--c-texte); font: inherit; font-size: var(--t-base); font-weight: 600; cursor: pointer; }
.rea-filtres button:hover { border-color: var(--c-azur); color: var(--c-blanc); }
.rea-filtres button[aria-pressed="true"] { border-color: var(--c-bleu); background: var(--c-bleu); color: var(--c-blanc); }

/* ============================================================ GALERIE : une carte = un chantier, une seule photo */
.rea-liste { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s3); margin: 0; padding: 0; list-style: none; }
.rea-carte { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--c-ligne-forte); border-radius: var(--r2); background: var(--c-nuit-2); color: inherit; text-decoration: none; }
.rea-photo { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--c-nuit-3); }
.rea-photo img, .ch-grande img, .ch-vignette img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--x, 50%) var(--y, 50%); }
.rea-corps { display: flex; flex: 1; flex-direction: column; gap: var(--s1); padding: var(--s3); border-top: 1px solid var(--c-ligne); }
.rea-cat { font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c-azur); }
.rea-titre { font-size: var(--t-sm); letter-spacing: -.02em; line-height: var(--lh-t); text-wrap: balance; }
.rea-lieu { color: var(--c-doux); }
.rea-voir { display: inline-flex; align-items: center; gap: var(--s1); margin-top: auto; padding-top: var(--s2); font-weight: 600; color: var(--c-azur); }
.rea-voir svg { width: 1.125rem; height: 1.125rem; }
.rea-carte:hover { border-color: var(--c-azur); }
.rea-carte:focus-visible { outline-offset: var(--s1); }


/* ============================================================ PAGE DE CHANTIER */
.ch { padding-top: calc(var(--s6) + var(--s1)); padding-bottom: var(--s6); --grille-x: 85%; --grille-y: 15%; }
.ch-retour { display: inline-flex; align-items: center; gap: var(--s2); padding: var(--s2) 0; color: var(--c-doux); font-weight: 600; text-decoration: none; }
.ch-retour svg { width: 1.125rem; height: 1.125rem; }
.ch-retour:hover { color: var(--c-azur); }
.ch-retour-bas { margin-top: var(--s5); }
.ch-grille { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-rows: auto 1fr; grid-template-areas: "galerie tete" "galerie texte"; gap: var(--s4) var(--s5); align-items: start; margin-top: var(--s3); }
.ch-tete { grid-area: tete; }
.ch-galerie { grid-area: galerie; }
.ch-texte { grid-area: texte; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.ch-lieu { display: inline-flex; align-items: center; gap: var(--s1); color: var(--c-clair); font-weight: 600; }
.ch-lieu svg { width: 1.125rem; height: 1.125rem; color: var(--c-azur); }
.ch-h1 { margin-top: var(--s3); font-size: var(--t-lg); text-wrap: balance; }
.ch-accroche { margin-top: var(--s3); color: var(--c-azur); font-size: var(--t-sm); font-weight: 600; line-height: var(--lh-t); text-wrap: balance; }
.ch-tete .lead { margin-top: var(--s3); }
.ch-grande { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--c-ligne-forte); border-radius: var(--r2); background: var(--c-nuit-3); cursor: zoom-in; }
.ch-vignettes { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 0; padding: 0; list-style: none; }
.ch-vignette { position: relative; display: block; width: 5.5rem; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--c-ligne-forte); border-radius: var(--r1); background: var(--c-nuit-3); cursor: zoom-in; }
.ch-vignette:hover { border-color: var(--c-azur); }
.ch-rubs { display: flex; flex-direction: column; gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.ch-rub { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start; }
.ch-picto { flex: none; width: var(--s5); height: var(--s5); padding: var(--s2); border: 1px solid var(--c-ligne-forte); border-radius: var(--r1); background: var(--c-nuit-3); color: var(--c-azur); }
.ch-picto svg { display: block; width: 100%; height: 100%; }
.ch-rub-titre { font-size: var(--t-sm); font-weight: 600; letter-spacing: -.02em; }
.ch-rub p { margin-top: var(--s1); max-width: var(--mesure); color: var(--c-doux); }
.ch-conclusion { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--c-ligne-forte); border-left: 2px solid var(--c-vif); border-radius: var(--r2); background: var(--c-nuit-2); font-size: var(--t-sm); line-height: var(--lh-t); text-wrap: balance; }
.ch-texte > :first-child { margin-top: 0; }

/* ============================================================ VISIONNEUSE (photo agrandie ; realisations.js) */
.visionneuse { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: color-mix(in srgb, var(--c-ombre) 96%, transparent); color: var(--c-texte); }
.visionneuse::backdrop { background: color-mix(in srgb, var(--c-ombre) 90%, transparent); }
.vis-in { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: var(--s6) var(--s6) var(--s4); }
.vis-in img { flex: 1 1 0; min-height: 0; width: auto; max-width: 100%; object-fit: contain; border-radius: var(--r1); }
.vis-leg { display: flex; align-items: baseline; gap: var(--s3); margin-top: var(--s3); color: var(--c-clair); text-align: center; }
.vis-leg b { flex: none; font-size: var(--t-xs); font-weight: 600; white-space: nowrap; color: var(--c-azur); }
.vis-btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border: 1px solid var(--c-ligne-forte); border-radius: 50%; background: color-mix(in srgb, var(--c-nuit) 70%, transparent); cursor: pointer; }
.vis-btn:hover { border-color: var(--c-azur); }
.vis-btn svg { width: 1.25rem; height: 1.25rem; }
.vis-fermer { top: var(--s3); right: var(--s3); }
.vis-prec { left: var(--s3); inset-block: 0; margin-block: auto; }
.vis-suiv { right: var(--s3); inset-block: 0; margin-block: auto; }

/* ============================================================ RESPONSIVE */
@media (max-width: 960px) {
  .rea-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-grille { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "tete" "galerie" "texte"; gap: var(--s4); }
  .ch-galerie { max-width: 34rem; }
  .vis-in { padding: var(--s6) var(--s2) var(--s6); }
  .vis-prec, .vis-suiv { top: auto; bottom: var(--s3); margin-block: 0; }
  .vis-leg { padding: 0 var(--s2); }
}
/* téléphone : une carte par ligne ; seule la rangée de filtres défile */
@media (max-width: 600px) {
  .rea-tete { padding-top: var(--s6); padding-bottom: var(--s3); }
  .rea-galerie { padding-top: var(--s3); padding-bottom: var(--s5); }
  .rea-liste { grid-template-columns: minmax(0, 1fr); }
  .rea-filtres { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rea-filtres::-webkit-scrollbar { display: none; }
  .rea-filtres button { flex: none; }
  .ch { padding-top: var(--s6); }
}

/* ============================================================ MOUVEMENT (sous no-preference seulement) */
@media (prefers-reduced-motion: no-preference) {
  .rea-carte { transition: border-color var(--d2) var(--e1); }
  .rea-filtres button, .ch-vignette { transition: border-color var(--d2) var(--e1), background-color var(--d2) var(--e1); }
  .rea-photo img, .ch-grande img { transition: transform var(--d3) var(--e1); }
  .rea-carte:hover .rea-photo img, .ch-grande:hover img { transform: scale(1.03); }
  .rea-voir svg { transition: transform var(--d2) var(--e1); }
  .rea-carte:hover .rea-voir svg { transform: translateX(var(--s1)); }
}
