/* =====================================================================
   V5 — Luxury / Collection, galerie, chambre en coupe en deux vues, sons, télévision.
   Se charge après tour-v4.css.
   ===================================================================== */

/* la vidéo, calée en perspective sur l'écran de la chambre Luxury */
#tv { position: fixed; left: 0; top: 0; z-index: 8; width: 960px; height: 540px; transform-origin: 0 0; background: #0b0d0f; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease-out); will-change: transform, opacity; filter: brightness(.94) saturate(.96); }
#tv.on { opacity: 1; }
body.has-compare #tv, body.is-entry #tv, body.is-stills #tv, body.is-sheet #tv { display: none; }

/* en-tête : galerie, espaces, son */
body.is-entry #btn-gallery, body.is-sheet #btn-gallery { display: none; }
#btn-gallery { margin-right: 4px; }
.top-actions #btn-gallery { height: 40px; padding: 0 16px; }
#audio-ctl { display: flex; gap: 2px; margin-left: 6px; }
.ic { position: relative; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(41, 52, 61, .72); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.ic svg { width: 20px; height: 20px; display: block; }
.ic:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .ic:hover { background: var(--slate-3); color: #fff; } }
.ic[aria-pressed="true"] { color: #fff; }
#btn-music.is-playing { background: var(--red); }
#btn-music .ic-bars { position: absolute; right: 6px; bottom: 7px; display: none; gap: 1.5px; align-items: flex-end; height: 8px; }
#btn-music.is-playing .ic-bars { display: flex; }
.ic-bars i { width: 2px; height: 100%; background: #fff; transform-origin: bottom; animation: eq 900ms ease-in-out infinite; }
.ic-bars i:nth-child(2) { animation-delay: -300ms; } .ic-bars i:nth-child(3) { animation-delay: -600ms; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
#btn-sfx.is-off { color: var(--ink-dim); }
#btn-sfx.is-off .sfx-w { display: none; }
#btn-sfx.is-off::after { content: ""; position: absolute; left: 11px; top: 19px; width: 18px; height: 2px; background: currentColor; transform: rotate(-45deg); }
#v3-tools-toggle { right: calc(var(--m) + 640px); }
body.v3-free #tools { right: calc(var(--m) + 740px); }

/* l'histoire : le dernier écran invite à visiter */
body.is-story .top-actions { display: flex !important; }
body.is-story .top-actions > :not(#audio-ctl) { display: none !important; }
.st-skip { right: calc(var(--m) + 96px); }
.st-visit { display: none; align-self: center; margin-right: -8px; font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; }
.st-nav .st-visit { align-self: flex-end; margin-bottom: 20px; }
#story.is-last .st-visit { display: block; animation: rise 520ms var(--ease-out) both; }

/* le rail : quatre marques */
#ladder { grid-template-columns: repeat(4, 1fr); }

/* boutons de passage entre panoramas : une flèche qui avance */
.hs-go .hs-dot { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: #fff; border: 0; }
.hs-go .hs-dot::before { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: rgba(255, 255, 255, .34); animation-duration: 2.2s; }
.hs-go .hs-dot::after { width: 13px; height: 13px; margin: -4px 0 0 -9px; border-radius: 0; background: none; border: solid var(--red); border-width: 3px 3px 0 0; transform: translate(0, 2px) rotate(-45deg); animation: nudge 1.5s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translate(0, 3px) rotate(-45deg); } 50% { transform: translate(0, -2px) rotate(-45deg); } }
@media (hover: hover) and (pointer: fine) { .hs-go:hover .hs-dot { transform: scale(1.12); } }

/* légende des images fixes : au-dessus des miniatures */
body.is-stills #card { left: auto; right: var(--m); bottom: calc(var(--rail-h) + var(--m) + 24px + 78px + 22px); width: min(440px, calc(100vw - 2 * var(--m))); }

/* chambre en coupe : deux vues */
.sb-tabs { display: flex; gap: 6px; }
.sb-tab { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--slate-3); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.sb-tab:active { transform: scale(.97); }
.sb-tab.is-on { background: #fff; color: var(--slate); }
@media (hover: hover) and (pointer: fine) { .sb-tab:not(.is-on):hover { background: #5b656e; } }
#plan-markers { position: absolute; inset: 0; }
#sb-slide-1 { aspect-ratio: 1600 / 947; }

/* galerie photo */
.gallery { padding-bottom: 0; }
.gl-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 2px calc(var(--m) + 24px) 0; scrollbar-width: thin; scrollbar-color: var(--slate-3) transparent; }
.gl-scroll.in { animation: fade 320ms var(--ease-out) both; }
.gl-h { margin: 56px 0 4px; font-size: clamp(30px, 4vw, 60px); line-height: .98; letter-spacing: -.035em; font-weight: 700; }
.gl-brand:first-child .gl-h, .gl-brand:not([hidden]):first-of-type .gl-h { margin-top: 8px; }
.gl-g { margin: 20px 0 12px; font-size: 16px; font-weight: 400; color: var(--ink-soft); }
.gl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.gl-item { min-width: 0; padding: 0; border: 0; border-radius: 0; background: var(--slate-2); overflow: hidden; cursor: pointer; display: block; }
.gl-item img { width: 100%; height: auto; display: block; transition: transform 500ms var(--ease-out), opacity 300ms var(--ease-out); }
.gl-item:active img { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .gl-item:hover img { transform: scale(1.035); } }
.gl-scroll.in .gl-item { animation: rise 520ms var(--ease-out) both; }
.gl-scroll.in .gl-item:nth-child(2) { animation-delay: 50ms; } .gl-scroll.in .gl-item:nth-child(3) { animation-delay: 100ms; } .gl-scroll.in .gl-item:nth-child(4) { animation-delay: 150ms; } .gl-scroll.in .gl-item:nth-child(n+5) { animation-delay: 200ms; }
.gl-view { position: absolute; inset: 0; z-index: 2; background: #12181d; display: flex; flex-direction: column; }
.gl-view[hidden] { display: none; }
.gl-view.in { animation: fade 260ms var(--ease-out) both; }
.gl-view > img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.gl-cap { padding: 14px 18px; }
.gallery .sp-tabs { flex-wrap: wrap; }

/* bouton « photos de la chambre » */
.ph-fab .sb-fab-img img { transform: none; }

@media (max-width: 900px) {
  .x { display: none; }
  #btn-gallery { display: inline-flex !important; }
  body.is-entry #btn-gallery, body.is-sheet #btn-gallery { display: none !important; }
  .top-actions .pill:not(#btn-spaces):not(#btn-gallery) { display: none; }
  .top-actions #btn-gallery, .top-actions #btn-spaces { padding: 0 11px; height: 36px; font-size: 13px; margin-right: 0; }
  #audio-ctl { margin-left: 2px; }
  .ic { width: 36px; height: 36px; background: rgba(41, 52, 61, .8); }
  #btn-sfx { display: none; }
  #ladder { grid-template-columns: repeat(4, minmax(80px, 1fr)); }
  #v3-tools-toggle { right: var(--m); }
  .st-skip { right: calc(var(--m) + 44px); }
  .st-nav .st-visit { align-self: center; margin: 0 0 -4px; }
  .gallery { overflow: hidden; }
  .gallery .sp-head { padding-right: 90px; }
  .gl-h { margin-top: 40px; }
  .gl-item { flex-basis: 46% !important; }
  .gl-cap { bottom: calc(var(--m) + 140px); }
  body.is-stills #card { right: var(--m); left: var(--m); width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-go .hs-dot::after, .ic-bars i { animation: none !important; }
  .gl-scroll.in, .gl-scroll.in .gl-item, #story.is-last .st-visit { animation: none !important; }
  .gl-item img, #tv { transition-duration: 1ms !important; }
}

.spaces .sp-close { background: var(--slate-3); }
.ph-fab { margin-top: 130px; }
@media (max-width: 900px) { .ph-fab { margin-top: 0; top: 78px; } }
