/* usinage-pehd.com : galerie des réalisations (accueil et page Réalisations). */
/* Galerie de pièces : toutes au même format, rangées centrées */
.galerie { --col: 4; --gap: clamp(16px, 2.4vw, 28px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.galerie figure { margin: 0; flex: 0 0 calc((100% - (var(--col) - 1) * var(--gap)) / var(--col)); }
.galerie img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--noir); background: var(--noir); transition: border-color .2s; }
.galerie figcaption { padding-top: 12px; }
.galerie h3 { margin: 0 0 4px; font-size: 1.4rem; }
.galerie p { margin: 0; color: var(--gris); }
.galerie--courte p { display: none; }
@media (max-width: 900px) { .galerie { --col: 2; } }
@media (max-width: 480px) { .galerie { --col: 1; } }
.galerie__secteur { display: inline-block; margin-bottom: 6px; padding: 3px 8px; background: var(--vert); color: var(--blanc); font: 700 .78rem/1.2 var(--f-titre); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
a.galerie__secteur:hover { background: var(--noir); color: var(--jaune); }

/* Accueil : défilement horizontal continu des réalisations (vitesse pilotée par realisations-defile.js) */
.defile { overflow: hidden; position: relative; }
.defile::before, .defile::after { content: ""; position: absolute; top: 0; bottom: 0; width: clamp(40px, 8vw, 120px); z-index: 1; pointer-events: none; }
.defile::before { left: 0; background: linear-gradient(90deg, var(--noir), rgba(17,17,17,0)); }
.defile::after { right: 0; background: linear-gradient(270deg, var(--noir), rgba(17,17,17,0)); }
.section--noir .defile img { border-color: var(--noir-3); }
.defile--manuel::before, .defile--manuel::after { display: none; }
.defile__piste { display: flex; gap: 24px; width: max-content; will-change: transform; }
.defile figure { margin: 0; flex: 0 0 clamp(200px, 22vw, 280px); }
.defile img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--noir); background: var(--noir); }
.defile figcaption { padding-top: 12px; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 6px; }
.defile .galerie__secteur { margin: 0; }
.defile h3 { margin: 0; font-size: 1.3rem; }
.defile p { display: none; }
.defile--manuel { overflow-x: auto; scroll-snap-type: x mandatory; }
.defile--manuel figure { scroll-snap-align: start; }
.defile--manuel figure[aria-hidden="true"] { display: none; }
.section--noir a.galerie__secteur { color: var(--blanc); }
.section--noir a.galerie__secteur:hover { background: var(--jaune); color: var(--noir); }

/* Page Réalisations : la pièce survolée ressort, les autres s'effacent */
@media (hover: hover) {
  .galerie figure, .galerie img { transition: opacity .25s ease, border-color .25s ease, box-shadow .25s ease; }
  .galerie:has(figure:hover) figure { opacity: .35; }
  .galerie:has(figure:hover) figure:hover { opacity: 1; }
  .galerie figure:hover img { border-color: var(--jaune); box-shadow: 0 0 0 3px var(--jaune), 0 0 30px 6px rgba(242, 194, 48, .45); }
}
@media (prefers-reduced-motion: reduce) { .galerie figure, .galerie img { transition: none; } }
