/* ============================================================
   VISITE VIRTUELLE — styles scopés à cette page uniquement.
   Aucune règle globale : tout est préfixé .atlas-tour.
   ============================================================ */
.atlas-tour { --at-accent: var(--theme-color, #ff4136); margin-bottom: 10px; }

.atlas-tour__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    background: #101010;
    outline: none;
    user-select: none;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}
.atlas-tour__stage:focus-visible { box-shadow: 0 0 0 3px var(--at-accent); }

/* --- Scènes empilées -------------------------------------------------
   Deux couches distinctes : le conteneur porte le DÉPLACEMENT (zoom
   dirigé vers le repère cliqué), l'image porte la DÉRIVE lente. Les
   deux transformations ne se marchent donc pas dessus. */
.atlas-tour__scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(1);
    will-change: opacity, transform;
    transition: opacity .55s ease, transform .85s cubic-bezier(.22, .61, .36, 1), filter .85s ease;
}
.atlas-tour__scene-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Dérive très lente : une image parfaitement figée se lit comme une
       photo, une image qui respire se lit comme une scène. */
    animation: atlasDrift 32s ease-in-out infinite alternate;
}
@keyframes atlasDrift {
    from { transform: scale(1.04) translate3d(-.9%, -.5%, 0); }
    to   { transform: scale(1.04) translate3d(.9%, .5%, 0); }
}

.atlas-tour__scene.is-active   { opacity: 1; transform: scale(1); filter: blur(0); z-index: 2; }
/* La scène quittée s'agrandit (on avance) ou recule (on revient) :
   illusion du pas en avant. Le léger flou ajoute la sensation de vitesse. */
.atlas-tour__scene.is-out-fwd  { opacity: 0; transform: scale(1.22); filter: blur(3px); z-index: 1; }
.atlas-tour__scene.is-out-back { opacity: 0; transform: scale(.86);  filter: blur(2px); z-index: 1; }
/* Position de départ de la scène entrante */
.atlas-tour__scene.is-in-fwd   { opacity: 0; transform: scale(.88); }
.atlas-tour__scene.is-in-back  { opacity: 0; transform: scale(1.18); }
.atlas-tour__scene.is-instant  { transition: none; }

/* --- Repères cliquables posés au sol ---------------------------------
   Le pavé est basculé en perspective pour qu'il paraisse peint sur le
   plancher ; l'étiquette, elle, reste face à la caméra. */
/* z-index 6 : au-dessus du mini-plan (5), sinon un repère posé dans le
   coin bas droit passe dessous et devient inatteignable. */
.atlas-tour__spots { position: absolute; inset: 0; z-index: 6; }
.atlas-tour__spot {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    opacity: 0;
    animation: atlasSpotIn .5s ease forwards;
}
@keyframes atlasSpotIn { from { opacity: 0; transform: translate(-50%, -35%); } to { opacity: 1; transform: translate(-50%, -50%); } }

.atlas-tour__spot-pad {
    position: relative;
    width: 88px;
    height: 50px;
    border-radius: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #15181b;
    font-size: 19px;
    background: rgba(255, 255, 255, .84);
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: 0 14px 26px rgba(0, 0, 0, .42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: background .25s ease, box-shadow .25s ease, color .25s ease, border-color .25s ease;
    /* la perspective est reprise dans les keyframes, sinon l'animation
       écraserait la transformation statique */
    animation: atlasBob 2.8s ease-in-out infinite;
}
@keyframes atlasBob {
    0%, 100% { transform: perspective(300px) rotateX(56deg) translateY(0); }
    50%      { transform: perspective(300px) rotateX(56deg) translateY(-7px); }
}
.atlas-tour__spot:hover .atlas-tour__spot-pad,
.atlas-tour__spot:focus-visible .atlas-tour__spot-pad {
    background: var(--at-accent);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 18px 32px rgba(0, 0, 0, .5);
}
/* Retour en arrière : plus discret */
.atlas-tour__spot--back .atlas-tour__spot-pad {
    width: 66px; height: 40px; font-size: 15px;
    background: rgba(255, 255, 255, .62);
}
/* Escaliers : le pavé reste au sol mais se redresse un peu */
.atlas-tour__spot--up .atlas-tour__spot-pad,
.atlas-tour__spot--down .atlas-tour__spot-pad { width: 74px; }

.atlas-tour__spot-label {
    font-size: 13px;
    line-height: 1;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    padding: 7px 13px;
    border-radius: 30px;
    background: rgba(16, 16, 16, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .25s ease;
}
.atlas-tour__spot:hover .atlas-tour__spot-label { background: var(--at-accent); }
/* Anti-chevauchement : sur un couloir qui dessert 5 pièces, les étiquettes
   se recouvrent. Deux leviers combinés : une typographie compacte sur les
   vues denses (4 destinations ou plus), et le basculement de l'étiquette
   SOUS sa pastille pour celles qui gênent encore. */
.atlas-tour__spot--sous { flex-direction: column-reverse; }
.atlas-tour__spots--dense .atlas-tour__spot { gap: 6px; }
.atlas-tour__spots--dense .atlas-tour__spot-label { font-size: 11px; padding: 4px 8px; }
.atlas-tour__spots--dense .atlas-tour__spot-pad { width: 68px; height: 40px; font-size: 16px; }
.atlas-tour__spots--dense .atlas-tour__spot--back .atlas-tour__spot-pad { width: 54px; height: 34px; font-size: 13px; }

/* --- Points d'information (i) ---------------------------------------- */
.atlas-tour__spot--info { }
.atlas-tour__spot--info .atlas-tour__spot-pad {
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 14px; font-weight: 700;
    background: rgba(16, 16, 16, .55);
    color: #fff;
    border-color: rgba(255, 255, 255, .85);
    animation: atlasInfoPulse 2.4s ease-out infinite;
}
@keyframes atlasInfoPulse {
    0%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
    50%      { transform: none; box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
}
.atlas-tour__info {
    position: absolute;
    left: 50%; bottom: 74px;
    transform: translateX(-50%) translateY(8px);
    z-index: 8;
    max-width: min(380px, 82%);
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    color: #15181b;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}
.atlas-tour__info.is-open { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.atlas-tour__info b { display: block; margin-bottom: 4px; font-size: 15px; }
.atlas-tour__info-close {
    position: absolute; top: 8px; right: 10px;
    border: 0; background: none; color: #8a8f94; font-size: 15px; cursor: pointer;
}

/* --- Barre supérieure --- */
.atlas-tour__topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}
.atlas-tour__room { color: #fff; }
.atlas-tour__room b { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; }
.atlas-tour__room span { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-top: 3px; }
.atlas-tour__tools { display: flex; gap: 8px; pointer-events: auto; }
.atlas-tour__btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(16, 16, 16, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background .25s ease, border-color .25s ease;
}
.atlas-tour__btn:hover:not([disabled]) { background: var(--at-accent); border-color: var(--at-accent); }
.atlas-tour__btn[disabled] { opacity: .35; cursor: default; }
.atlas-tour__btn.is-on { background: var(--at-accent); border-color: var(--at-accent); }

/* --- Mini-plan synchronisé ------------------------------------------- */
.atlas-tour__map {
    position: absolute;
    right: 16px; bottom: 16px;
    z-index: 5;
    width: 196px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, .9);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .38);
    transition: opacity .3s ease, transform .3s ease;
}
.atlas-tour__map.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
/* Une porte tombe parfois dans le coin bas droit : le mini-plan s'efface
   alors sous le repère au lieu de le masquer. */
.atlas-tour__map--efface { opacity: .3; pointer-events: none; }
.atlas-tour__map-inner { position: relative; line-height: 0; }
.atlas-tour__map-inner img { width: 100%; display: block; }
.atlas-tour__map-title {
    position: absolute; left: 0; right: 0; top: 0;
    padding: 6px 9px;
    font-size: 10px; font-weight: 600; line-height: 1.2;
    letter-spacing: .07em; text-transform: uppercase;
    color: #15181b;
    background: linear-gradient(180deg, rgba(255, 255, 255, .95) 30%, rgba(255, 255, 255, 0) 100%);
}
.atlas-tour__map-dot {
    position: absolute;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--at-accent);
    border: 3px solid #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    transition: left .55s cubic-bezier(.22, .61, .36, 1), top .55s cubic-bezier(.22, .61, .36, 1);
}
.atlas-tour__map-dot::after {
    content: "";
    position: absolute; inset: -7px;
    border-radius: 50%;
    border: 2px solid var(--at-accent);
    animation: atlasPulse 2.1s ease-out infinite;
}
@keyframes atlasPulse {
    0% { transform: scale(.85); opacity: .9; }
    70% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- Barre de progression de la visite guidée --- */
.atlas-tour__progress {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 3px; z-index: 6;
    background: rgba(255, 255, 255, .18);
    opacity: 0; transition: opacity .3s ease;
}
.atlas-tour__progress.is-on { opacity: 1; }
.atlas-tour__progress i {
    display: block; height: 100%; width: 0;
    background: var(--at-accent);
}

/* --- Aide en bas de scène --- */
.atlas-tour__hint {
    position: absolute;
    left: 50%; bottom: 16px;
    transform: translateX(-50%);
    z-index: 4;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    color: #fff;
    background: rgba(16, 16, 16, .5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    transition: opacity .4s ease;
}
.atlas-tour__hint.is-hidden { opacity: 0; }

/* --- Sélecteur de pièces --- */
.atlas-tour__rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.atlas-tour__chip {
    border: 1px solid #e4e4e4;
    background: #fff;
    color: #4d5053;
    font-size: 13px;
    line-height: 1;
    padding: 10px 15px;
    border-radius: 30px;
    transition: all .25s ease;
}
.atlas-tour__chip:hover { border-color: var(--at-accent); color: var(--at-accent); }
.atlas-tour__chip.is-current { background: var(--at-accent); border-color: var(--at-accent); color: #fff; }

/* --- Plein écran --- */
.atlas-tour__stage:fullscreen { border-radius: 0; aspect-ratio: auto; height: 100%; }
.atlas-tour__stage:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; height: 100%; }

@media (max-width: 991px) {
    .atlas-tour__map { width: 150px; right: 12px; bottom: 12px; }
}
@media (max-width: 767px) {
    .atlas-tour__stage { border-radius: 14px; }
    .atlas-tour__spot-pad { width: 66px; height: 38px; font-size: 15px; }
    .atlas-tour__spot--back .atlas-tour__spot-pad { width: 52px; height: 32px; font-size: 12px; }
    .atlas-tour__spot--info .atlas-tour__spot-pad { width: 30px; height: 30px; font-size: 12px; }
    .atlas-tour__spot-label { font-size: 11px; padding: 5px 9px; }
    .atlas-tour__room b { font-size: 15px; }
    .atlas-tour__topbar { padding: 12px 14px; }
    .atlas-tour__hint { font-size: 11px; bottom: 10px; padding: 7px 12px; }
    .atlas-tour__map { width: 116px; }
    .atlas-tour__map-title { font-size: 8px; padding: 4px 6px; }
    .atlas-tour__info { font-size: 13px; bottom: 60px; padding: 12px 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .atlas-tour__scene { transition: opacity .25s ease; }
    .atlas-tour__scene-img { animation: none; }
    .atlas-tour__spot-pad { animation: none; transform: perspective(300px) rotateX(56deg); }
    .atlas-tour__map-dot::after { animation: none; }
}
