/* Le musée nouvelle génération : écran d'accueil, interface de visite,
   cartel, plan, zoom. S'ajoute à museum.css (mêmes couleurs, mêmes polices). */

.nx { --nx-ink: #f5f2eb; --nx-gold: #c6a675; --nx-glass: rgba(12, 12, 14, 0.62); --nx-line: rgba(198, 166, 117, 0.45); }
.nx .m3d-canvas { cursor: grab; }
.nx::after { background: radial-gradient(ellipse at 50% 48%, transparent 62%, rgba(0, 0, 0, 0.28) 100%); }

/* L'écran d'accueil : un rideau sombre sur le premier plan du musée. */
.nx-veil { background: linear-gradient(100deg, #0b0c10f5 0%, #0b0c10e0 42%, #0b0c1088 100%); }
.nx-veil h1 { letter-spacing: -0.01em; }
.nx-badge { color: var(--nx-gold); border: 1px solid var(--nx-line); padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.68rem; }
.nx-progress {
  position: relative;
  width: min(26rem, 100%);
  height: 2px;
  margin: 0.4rem 0 0.7rem;
  background: rgba(245, 242, 235, 0.14);
  overflow: hidden;
}
.nx-progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #a98552, #e2c792);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease-out;
}
.nx-progress-text { margin: 0 0 1.6rem; color: #a8a196; font-size: 0.78rem; letter-spacing: 0.04em; min-height: 1.2em; }
.nx-veil .m3d-error p { margin: 0.3rem 0; }

.nx-fade { position: absolute; inset: 0; z-index: 2; background: #050506; opacity: 0; pointer-events: none; transition: opacity 0.38s ease; }
.nx-fade.is-on { opacity: 1; }

.nx-skip {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); z-index: 4;
  border: 1px solid var(--nx-line); background: var(--nx-glass); color: var(--nx-ink);
  font: inherit; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.75rem 1.1rem; cursor: pointer; backdrop-filter: blur(8px);
}

/* L'interface de visite : discrète, en verre fumé, jamais sur les œuvres. */
.nx-hud button, .nx-hud select, .nx-card button, .nx-map-panel button, .nx-zoom button, .nx-toast button, .nx-bird button {
  border: 1px solid var(--nx-line);
  background: var(--nx-glass);
  color: var(--nx-ink);
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  min-height: 2.4rem;
  padding: 0 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nx-hud button:hover, .nx-card button:hover { border-color: var(--nx-gold); color: #e8cf9f; }
.nx-hud button[aria-pressed="true"], .nx-hud button[aria-expanded="true"] { border-color: var(--nx-gold); color: #e8cf9f; background: rgba(36, 30, 22, 0.75); }
.nx-hud :focus-visible, .nx-card :focus-visible, .nx-zoom :focus-visible { outline: 2px solid #e8cf9f; outline-offset: 2px; }
.nx-top { position: absolute; left: 1.2rem; right: 1.2rem; top: 1rem; display: flex; align-items: center; gap: 1rem; justify-content: space-between; pointer-events: none; }
.nx-top > * { pointer-events: auto; }
.nx .m3d-exit { position: static; background: var(--nx-glass); backdrop-filter: blur(10px); }
.nx-where {
  margin: 0; flex: 1; text-align: center; color: var(--nx-gold);
  font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.nx-modes { display: flex; gap: 0.25rem; }
.nx-tools { position: absolute; left: 1.2rem; top: 4.2rem; display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 22rem; align-items: center; }
.nx-quality { display: flex; align-items: center; gap: 0.4rem; color: #f5f2ebcc; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nx-tour { position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); display: flex; gap: 0.35rem; align-items: stretch; }
.nx-tour select { max-width: 18rem; }
.nx[data-visit="libre"] .nx-tour select { display: none; }
.nx-aria-tour { position: absolute; left: 50%; bottom: 4.6rem; transform: translateX(-50%); border-color: var(--nx-gold) !important; color: #e8cf9f !important; }
.nx-pad { left: 1.2rem; bottom: 1.4rem; }
.nx-pad button { padding: 0; min-height: 0; }

/* Le joystick : seulement sur écran tactile. */
.nx-joystick {
  position: absolute; left: 1.4rem; bottom: 1.6rem; width: 7.5rem; height: 7.5rem; border-radius: 50%;
  border: 1px solid rgba(245, 242, 235, 0.35); background: rgba(10, 10, 12, 0.32); backdrop-filter: blur(6px);
  touch-action: none; display: none;
}
.nx-joystick span {
  position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; margin: -21% 0 0 -21%; border-radius: 50%;
  background: rgba(245, 242, 235, 0.75); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); transition: transform 0.08s linear;
}
@media (pointer: coarse) {
  .nx-joystick { display: block; }
  .nx-pad { display: none; }
}

/* Le texte d'entrée de salle. */
.nx-toast {
  position: absolute; left: 50%; top: 4.4rem; transform: translateX(-50%); z-index: 3;
  width: min(30rem, calc(100% - 2.4rem)); padding: 1rem 2.6rem 1rem 1.3rem;
  background: var(--nx-glass); border: 1px solid var(--nx-line); color: var(--nx-ink); backdrop-filter: blur(12px);
  animation: nx-in 0.6s ease-out;
}
.nx-toast p { margin: 0; }
.nx-toast-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; line-height: 1.1; margin: 0.35rem 0 0.25rem !important; }
.nx-toast-text { color: #c8c1b6; font-size: 0.82rem; line-height: 1.55; }
.nx-toast a { color: var(--nx-gold); font-size: 0.8rem; display: inline-block; margin-top: 0.5rem; margin-right: 0.8rem; }
.nx-toast .nx-toast-aria { margin-top: 0.5rem; min-height: 2rem; border-style: dashed; }
.nx-toast [data-toast-close] { position: absolute; right: 0.5rem; top: 0.5rem; min-height: 2rem !important; width: 2rem; padding: 0 !important; }
@keyframes nx-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* L'oiseau d'ARIA : ce qu'il propose, et ses réglages. */
.nx-bird {
  position: absolute; right: 1.2rem; bottom: 5.2rem; z-index: 4; width: min(21rem, calc(100% - 2.4rem));
  padding: 0.9rem 1rem 1rem; background: var(--nx-glass); border: 1px solid var(--nx-line); color: var(--nx-ink);
  backdrop-filter: blur(12px); animation: nx-bird-in 0.35s ease-out;
}
.nx-bird[hidden] { display: none; }
.nx-bird-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.6rem; }
.nx-bird-head p { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.25rem; line-height: 1.1; }
.nx-bird-actions { display: grid; gap: 0.35rem; }
.nx-bird-actions button { text-align: left; }
.nx-bird-prefs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--nx-line); }
.nx-bird-prefs button { border-style: dashed; font-size: 0.74rem; }
.nx-bird-prefs button[aria-pressed="true"] { border-style: solid; border-color: var(--nx-gold); color: #e8cf9f; }
.nx-bird-credit { margin: 0.6rem 0 0; font-size: 0.66rem; color: #8f887d; line-height: 1.4; }
.nx-bird-credit a { color: inherit; }
.nx-bird [data-bird-close] { min-height: 2rem !important; width: 2rem; padding: 0 !important; }
@keyframes nx-bird-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .nx-bird { right: 0.8rem; left: 0.8rem; width: auto; bottom: 9.5rem; } }
@media (prefers-reduced-motion: reduce) { .nx-bird { animation: none; } }

/* Le cartel. */
.nx-card { background: rgba(11, 12, 16, 0.86); backdrop-filter: blur(14px); top: 4.4rem; max-height: calc(100% - 9rem); overflow: auto; }
.nx-card-description { color: #c8c1b6; font-size: 0.84rem; line-height: 1.6; margin: 0.8rem 0 0; max-height: 9.5em; overflow: auto; white-space: pre-line; }
.nx-card-status { margin: 0.35rem 0 0; font-size: 0.74rem; letter-spacing: 0.06em; color: #8796a3; }
.nx-card-status[data-available="1"] { color: #b9d3a8; }
.nx-card-actions, .nx-card-aria { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.nx-card-aria { margin-top: 0.5rem; }
.nx-card-aria button { border-style: dashed; }
.nx-card .m3d-buy { border: 0; min-height: 2.4rem; background: var(--nx-gold); color: #0b0c10; }
.nx-card [data-favorite][aria-pressed="true"] { color: #e8cf9f; border-color: var(--nx-gold); }
.nx-card [data-favorite][aria-pressed="true"]::before { content: "♥ "; }
.nx-card-links { margin: 1rem 0 0; font-size: 0.8rem; }
.nx-card-links a { color: var(--nx-ink); }

/* Le plan. */
.nx-map-panel {
  position: absolute; inset: 4rem 1.2rem 1.2rem; z-index: 4; display: flex; flex-direction: column;
  background: rgba(11, 12, 16, 0.9); border: 1px solid var(--nx-line); backdrop-filter: blur(12px);
}
.nx-map-panel[hidden] { display: none; }
.nx-map-head { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.9rem; color: #c8c1b6; font-size: 0.78rem; letter-spacing: 0.06em; }
.nx-map-head p { margin: 0; }
.nx-map { flex: 1; width: 100%; min-height: 0; cursor: pointer; }

/* Le zoom haute définition. */
.nx-zoom { position: absolute; inset: 0; z-index: 6; background: rgba(6, 6, 7, 0.96); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nx-zoom[hidden] { display: none; }
.nx-zoom img { max-width: 92%; max-height: 84%; object-fit: contain; cursor: grab; touch-action: none; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.nx-zoom-caption { position: absolute; left: 1.4rem; bottom: 1.2rem; margin: 0; color: #c8c1b6; font-size: 0.82rem; }
.nx-zoom-tools { position: absolute; right: 1.2rem; top: 1.2rem; display: flex; gap: 0.35rem; }

.museum-nextgen .aria-open { top: auto; bottom: 1.4rem; right: 1.2rem; }

@media (max-width: 760px) {
  .nx-top { top: 0.7rem; left: 0.8rem; right: 0.8rem; flex-wrap: wrap; gap: 0.45rem; }
  .nx-where { order: 3; flex-basis: 100%; text-align: left; }
  .nx-modes button { padding: 0 0.6rem; }
  .nx-tools { top: auto; bottom: 10.4rem; left: auto; right: 0.8rem; flex-direction: column; align-items: flex-end; }
  .nx-quality { display: none; }
  .nx-tour { left: auto; right: 0.8rem; transform: none; bottom: 1rem; }
  .nx-tour select { max-width: 9rem; }
  .nx-next-label { display: none; }
  .nx-joystick { left: 1rem; bottom: 1rem; width: 6.4rem; height: 6.4rem; }
  .nx-card { left: 0.8rem; right: 0.8rem; width: auto; top: auto; bottom: 8.4rem; max-height: 40vh; padding: 0.9rem 1rem; }
  .nx-card h2 { font-size: 1.4rem; margin: 0.3rem 0; }
  .nx-card-description { max-height: 4.8em; font-size: 0.78rem; }
  .nx-card button { min-height: 2.1rem; padding: 0 0.6rem; font-size: 0.7rem; }
  .nx-card-actions, .nx-card-aria { margin-top: 0.6rem; gap: 0.3rem; }
  .nx-toast { top: 6.2rem; }
  .nx-aria-tour { bottom: 8.6rem; max-width: calc(100% - 2rem); }
  .museum-nextgen .aria-open { bottom: 4.2rem; right: 0.8rem; }
  .nx-map-panel { inset: 3.2rem 0.5rem 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nx-fade, .nx-progress-fill, .nx-joystick span { transition: none; }
  .nx-toast { animation: none; }
}

/* La visite occupe tout l'écran une fois entrée : l'en-tête du site s'efface
   (« Quitter » ramène à la collection). ARIA et le bandeau cookies restent au-dessus. */
.museum-nextgen.m3d-running .nx { position: fixed; inset: 0; z-index: 50; min-height: 0; }
.museum-nextgen.m3d-running { overflow: hidden; }
.museum-nextgen.m3d-running .aria-open { display: flex; bottom: 1.4rem; right: 1.2rem; top: auto; }
@media (max-width: 760px) {
  .museum-nextgen.m3d-running .aria-open { display: flex; bottom: 4.6rem; right: 0.8rem; }
}
@media (max-height: 560px) {
  .nx-tools { top: 3.6rem; }
  .nx-pad { display: none; }
}
.museum-nextgen.m3d-running .aw-languages { display: none; }
