/* ==========================================================================
   FULL EXCELLENCE DETAILING — Page Réalisations (/realisations)
   Nécessite main.css et prestation.css (en-tête, sections, titres). Script : assets/js/realisations.js
   ========================================================================== */

/* ---------- Navigation par rubrique (reste visible sous l'en-tête) ---------- */
.works-nav {
  position: sticky; top: 76px; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.works-nav__inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 12px; }
.works-nav__inner::-webkit-scrollbar { display: none; }
.works-nav__link {
  display: inline-flex; align-items: center; gap: 10px; flex: none; min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; white-space: nowrap;
  font-family: var(--f-tech); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--bone-70);
  transition: color .3s, border-color .3s, background-color .3s;
}
.works-nav__link span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line); font-family: var(--f-body); font-size: 11px; letter-spacing: 0; color: var(--bone-50); }
.works-nav__link:hover { color: var(--gold-light); }
.works-nav__link.is-active { border-color: var(--line-gold); background: rgb(var(--gold-rgb) / .08); color: var(--bone); }
.works-nav__link.is-active span { border-color: var(--gold); color: var(--gold-light); }
.works-anchor, .works-cat { scroll-margin-top: 140px; }

/* ---------- Rubrique ---------- */
.works-cat__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; }
.works-cat__num { margin-right: 14px; color: var(--gold-light); }
.works-cat__more {
  display: inline-flex; align-items: center; gap: 10px; flex: none; padding-bottom: 6px;
  font-family: var(--f-tech); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
  border-bottom: 1px solid var(--line-gold); transition: color .3s, border-color .3s;
}
.works-cat__more .icon { width: 15px; height: 15px; transition: transform .45s var(--ease-out); }
.works-cat__more:hover { color: var(--gold-light); border-color: var(--gold); }
.works-cat__more:hover .icon { transform: translateX(4px); }

/* ---------- Vignettes ---------- */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 1.6vw, 22px); margin: clamp(28px, 4vh, 44px) 0 0; padding: 0; list-style: none; }
.work { min-width: 0; }
.work__open { display: block; color: inherit; }
.work__media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--line); background: var(--ink-3); }
.work__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), filter .6s; }
.work__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .45)); opacity: 0; transition: opacity .5s; pointer-events: none; }
.work__open:hover .work__media img, .work__open:focus-visible .work__media img { transform: scale(1.045); }
.work__open:hover .work__media::after, .work__open:focus-visible .work__media::after { opacity: 1; }
.work__count {
  position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
  background: rgba(8, 8, 8, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgb(170 151 99 / .5); color: #F4F1EA; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.work__count .icon { width: 15px; height: 15px; color: #CDBB86; }
.work__zoom {
  position: absolute; right: 14px; bottom: 14px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold-grad); color: var(--on-gold); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .5s var(--ease-out);
}
.work__zoom .icon { width: 18px; height: 18px; }
/* Vidéo : bouton lecture au centre de l'aperçu, pastille « vidéos » dans le compteur */
.work__play {
  position: absolute; left: 50%; top: 50%; z-index: 1; display: grid; place-items: center; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(8, 8, 8, .5); border: 1px solid rgb(205 187 134 / .75); color: #F4F1EA;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .6s var(--ease-out), background-color .4s, border-color .4s;
}
.work__play .icon { width: 22px; height: 22px; margin-left: 4px; }
.work__open:hover .work__play, .work__open:focus-visible .work__play { transform: scale(1.08); background: rgb(170 151 99 / .88); border-color: #CDBB86; color: #0A0A0A; }
.work__count-sep { width: 1px; height: 12px; margin: 0 2px; background: rgb(205 187 134 / .45); }
.work__count .work__count-play { width: 12px; height: 12px; }
.work__open:hover .work__zoom, .work__open:focus-visible .work__zoom { opacity: 1; transform: none; }
.work__meta { display: grid; gap: 4px; padding: 14px 2px 0; }
.work__title { font-weight: 500; font-size: 16px; line-height: 1.35; transition: color .3s; }
.work__open:hover .work__title { color: var(--gold-light); }
.work__vehicle { font-family: var(--f-tech); font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--bone-50); }

/* ---------- Visionneuse (série de photos d'une réalisation) ---------- */
.wlb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #060606; color: #F4F1EA; }
.wlb::backdrop { background: rgba(0, 0, 0, .7); }
.wlb[open] { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: minmax(0, 100dvh); animation: wlbIn .35s var(--ease-out); }
@keyframes wlbIn { from { opacity: 0; } }
.wlb__stage { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; min-width: 0; min-height: 0; }
.wlb__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; font-family: var(--f-tech); font-size: 10px; letter-spacing: .22em; color: #CDBB86; }
.wlb__view { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; overflow: hidden; padding: 0 78px; }
.wlb__img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: wlbImg .45s var(--ease-out); }
@keyframes wlbImg { from { opacity: 0; transform: scale(.985); } }
/* Vidéo : occupe toute la zone (bandes noires si besoin), dimensions stables avant le chargement */
.wlb__img.wlb__video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; background: transparent; box-shadow: none; outline: none; }
.wlb__video:focus-visible { outline: 1px solid #CDBB86; outline-offset: 3px; }
.wlb__btn { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgb(170 151 99 / .55); background: rgba(10, 10, 10, .6); color: #CDBB86; transition: border-color .3s, background-color .3s; }
.wlb__btn:hover { border-color: #CDBB86; background: rgba(170, 151, 99, .15); }
.wlb__btn .icon { width: 20px; height: 20px; }
.wlb__prev, .wlb__next { position: absolute; top: 50%; margin-top: -24px; }
.wlb__prev { left: 16px; }
.wlb__next { right: 16px; }
.wlb__thumbs { display: flex; gap: 8px; justify-content: center; overflow-x: auto; scrollbar-width: none; padding: 16px 20px 20px; }
.wlb__thumbs::-webkit-scrollbar { display: none; }
.wlb__thumb { flex: none; width: 76px; height: 56px; padding: 0; border: 1px solid transparent; opacity: .45; background: #111 center / cover no-repeat; transition: opacity .3s, border-color .3s; }
.wlb__thumb:hover { opacity: .8; }
.wlb__thumb[aria-current="true"] { opacity: 1; border-color: #CDBB86; }
.wlb__thumb.is-video { position: relative; display: grid; place-items: center; color: #F4F1EA; }
.wlb__thumb.is-video .icon { width: 16px; height: 16px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .8)); }
.wlb__aside { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; padding: 72px 32px 32px; border-left: 1px solid rgb(170 151 99 / .25); background: linear-gradient(180deg, #0d0d0d, #080808); }
.wlb__cat { font-family: var(--f-tech); font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: #CDBB86; }
.wlb__title { margin: 0; font-weight: 300; font-size: 1.9rem; line-height: 1.15; letter-spacing: -.02em; }
.wlb__vehicle { font-family: var(--f-tech); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 241, 234, .55); }
.wlb__desc { font-size: 14.5px; line-height: 1.8; color: rgba(244, 241, 234, .75); white-space: pre-line; }
.wlb__caption { padding: 14px 16px; border-left: 2px solid #AA9763; background: rgb(170 151 99 / .08); font-size: 14px; line-height: 1.6; color: #F4F1EA; }
.wlb__caption:empty { display: none; }
.wlb__actions { display: grid; gap: 10px; margin-top: auto; padding-top: 12px; }
.wlb__actions .btn { width: 100%; }
.wlb .btn--ghost { color: #F4F1EA; border-color: rgba(244, 241, 234, .28); }

/* ---------- Aucune réalisation / appel à l'action ---------- */
.works-empty__inner { max-width: 760px; }
.works-cta__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 60px; }
.works-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .wlb[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64dvh auto; overflow-y: auto; }
  .wlb__stage { height: 64dvh; }
  .wlb__aside { padding: 22px 20px 28px; border-left: 0; border-top: 1px solid rgb(170 151 99 / .25); overflow: visible; }
  .wlb__view { padding: 0 12px; }
  .wlb__prev, .wlb__next { top: auto; bottom: 8px; margin: 0; }
  .wlb__prev { left: 12px; } .wlb__next { right: 12px; }
  .wlb__thumbs { padding-inline: 70px; }
}
@media (max-width: 760px) {
  .works-nav { top: 66px; }
  .works-cta__actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .work__media img, .work__zoom, .work__play { transition: none; }
  .wlb[open], .wlb__img { animation: none; }
}
