/* Artworks Héritage — identité propre (pierre, or discret, serif) dans la charte du site. */
.hx { --hx-stone: #f8f6fb; --hx-stone-2: #efeaf5; --hx-ink: #1d1630; --hx-gold: #7053b7; --hx-line: #dfd9e8;
  --room: #46576a; --room-accent: #c9bdf5; color: var(--ink); }
:root[data-theme="dark"] .hx { --hx-stone: #191722; --hx-stone-2: #211e2d; --hx-ink: #f4f0f7; --hx-gold: #b8a0ee; --hx-line: #332d41; }

.hx-hero { position: relative; padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); isolation: isolate;
  background: radial-gradient(70% 90% at 80% 0%, color-mix(in srgb, var(--hx-gold) 16%, transparent), transparent 70%),
              linear-gradient(180deg, var(--hx-stone) 0%, var(--hx-stone-2) 100%); border-bottom: 1px solid var(--hx-line); }
.hx-hero--artist { background: radial-gradient(60% 90% at 85% 0%, color-mix(in srgb, var(--room-accent) 30%, transparent), transparent 70%),
              linear-gradient(180deg, var(--hx-stone) 0%, color-mix(in srgb, var(--room) 14%, var(--hx-stone-2)) 100%); }
.hx-hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1; margin: .3rem 0 1rem; letter-spacing: -.01em; }
.hx-hero .lead { max-width: 46rem; font-size: clamp(1.05rem, 1.6vw, 1.22rem); }
.hx-hero .kicker, .hx .kicker { color: var(--hx-gold); }
.hx-hero .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.hx-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 2rem; padding: 0; margin: 2rem 0 0; color: var(--quiet); font-size: .95rem; }
.hx-facts b { display: block; font: 500 2rem/1 var(--serif); color: var(--hx-ink); }

.hx-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.2rem; }
.hx-room { display: grid; grid-template-rows: auto 1fr; border-radius: 4px; overflow: hidden; text-decoration: none; color: #f6f1e7;
  background: var(--room); box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .55); transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.hx-room:hover { transform: translateY(-4px); box-shadow: 0 28px 50px -28px rgba(0, 0, 0, .6); }
.hx-room__img { display: flex; align-items: center; justify-content: center; height: clamp(13rem, 20vw, 16rem); padding: 1.4rem; overflow: hidden;
  background: color-mix(in srgb, var(--room) 82%, #000); }
.hx-room__img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; min-height: 0;
  box-shadow: 0 0 0 6px #b08a4f, 0 16px 28px -10px rgba(0, 0, 0, .6); }
.hx-room__body { display: grid; gap: .2rem; padding: 1rem 1.2rem 1.2rem; }
.hx-room__body b { font: 500 1.6rem/1.1 var(--serif); }
.hx-room__body span { opacity: .82; font-size: .9rem; }
.hx-room__movement { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem !important; color: var(--room-accent); opacity: 1 !important; }

.hx-band { background: var(--hx-stone); border-block: 1px solid var(--hx-line); }
.hx-expos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.hx-expo { display: grid; gap: .5rem; padding: 1.3rem 1.4rem; border: 1px solid var(--hx-line); border-radius: 4px; background: var(--paper);
  text-decoration: none; color: var(--ink); transition: border-color .2s; }
.hx-expo:hover { border-color: var(--hx-gold); }
.hx-expo b { font: 500 1.45rem/1.15 var(--serif); }
.hx-expo span { color: var(--quiet); font-size: .95rem; }

.hx-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.hx-prose p { line-height: 1.85; font-size: 1.06rem; max-width: 42rem; }
.hx-aside { position: sticky; top: 6rem; padding: 1.4rem; border: 1px solid var(--hx-line); background: var(--hx-stone); border-radius: 4px; }
.hx-facts-list { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0 0 1.4rem; }
.hx-facts-list dt { color: var(--quiet); font-size: .85rem; }
.hx-facts-list dd { margin: 0; }
.hx-timeline { list-style: none; margin: .6rem 0 0; padding: 0 0 0 1rem; border-left: 1px solid var(--hx-gold); display: grid; gap: .7rem; }
.hx-timeline li { display: grid; gap: .1rem; position: relative; }
.hx-timeline li::before { content: ""; position: absolute; left: calc(-1rem - 4px); top: .45rem; width: 7px; height: 7px; border-radius: 50%; background: var(--hx-gold); }
.hx-timeline time { font: 600 .82rem/1 var(--sans); color: var(--hx-gold); letter-spacing: .04em; }
.hx-timeline span { font-size: .95rem; }

.hx-grid { columns: 4 13rem; column-gap: 1.1rem; }
.hx-card { display: block; break-inside: avoid; margin-bottom: 1.1rem; text-decoration: none; color: inherit; }
.hx-card__img { display: block; background: var(--hx-stone-2); padding: 7%; border-radius: 3px; transition: background .3s; }
.hx-card__img img { display: block; width: 100%; height: auto; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .55); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.hx-card:hover .hx-card__img img { transform: translateY(-3px); }
.hx-card__cap { display: grid; gap: .1rem; padding: .55rem .1rem 0; font-size: .88rem; }
.hx-card__cap b { font: 500 1.08rem/1.2 var(--serif); }
.hx-card__cap span { color: var(--quiet); }

.hx-faq { display: grid; gap: .6rem; }
.hx-faq details { border: 1px solid var(--hx-line); border-radius: 4px; padding: .9rem 1.1rem; background: var(--paper); }
.hx-faq summary { cursor: pointer; font-weight: 500; }
.hx-faq p { margin: .7rem 0 0; line-height: 1.75; }
.hx-sources { padding-left: 1.1rem; display: grid; gap: .3rem; }

.hx-work__layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; margin-top: 1.4rem; }
.hx-work__figure { margin: 0; position: sticky; top: 5.5rem; }
.hx-work__zoom { display: grid; place-items: center; width: 100%; padding: clamp(1rem, 4vw, 2.4rem); border: 0; cursor: zoom-in; position: relative;
  background: radial-gradient(80% 70% at 50% 30%, color-mix(in srgb, var(--room) 70%, #fff 6%), var(--room)); border-radius: 3px; }
.hx-work__zoom img { max-width: 100%; max-height: 74vh; width: auto; height: auto;
  box-shadow: 0 0 0 8px #b08a4f, 0 28px 50px -18px rgba(0, 0, 0, .7); }
.hx-work__zoom-hint { position: absolute; right: .8rem; bottom: .8rem; padding: .35rem .7rem; border-radius: 999px; font-size: .78rem;
  background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .25s; }
.hx-work__zoom:hover .hx-work__zoom-hint, .hx-work__zoom:focus-visible .hx-work__zoom-hint { opacity: 1; }
.hx-work__figure figcaption { margin-top: .6rem; }
.hx-work__text h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.05; margin: .3rem 0 1rem; }
.hx-cartel { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.1rem; margin: 1.4rem 0; padding: 1.1rem 1.2rem;
  border-left: 3px solid var(--hx-gold); background: var(--hx-stone); }
.hx-cartel dt { color: var(--quiet); font-size: .85rem; }
.hx-cartel dd { margin: 0; overflow-wrap: anywhere; }
.hx-work .actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hx-rights { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--hx-line); }
.hx-rights h2 { font-size: 1.35rem; }
.hx-rights ul { padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .95rem; overflow-wrap: anywhere; }
.hx-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--hx-line); }

.hx-contemporary { padding: clamp(2rem, 5vw, 3.5rem) 0; background: var(--paper); border-top: 1px solid var(--hx-line); }
.hx-contemporary h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 44rem; }
.hx-contemporary__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 11rem), 1fr)); gap: 1rem; margin-top: 1.2rem; }
.hx-notice { margin: 2rem 0; padding: 1.1rem 1.3rem; border: 1px solid var(--hx-line); border-radius: 4px; background: var(--hx-stone); font-size: .95rem; }
.hx-notice p { margin: 0 0 .5rem; }
.hx-notice p:last-child { margin: 0; }

/* -- zoom */
.hx-zoom { width: min(96vw, 1400px); height: min(92vh, 1000px); max-width: none; max-height: none; padding: 0; border: 0; background: #120f1a; color: #fff; overflow: hidden; }
.hx-zoom::backdrop { background: rgba(14, 11, 22, .86); }
.hx-zoom__stage { position: absolute; inset: 0 0 3.4rem; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: grab; }
.hx-zoom__stage img { max-width: 100%; max-height: 100%; transform-origin: center; transition: transform .08s linear; user-select: none; -webkit-user-drag: none; }
.hx-zoom__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3.4rem; display: flex; gap: .5rem; justify-content: center; align-items: center; background: #1d1630; }
.hx-zoom__bar button { min-width: 2.6rem; height: 2.2rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid #4b4166; background: transparent; color: #fff; cursor: pointer; font-size: 1rem; }

/* -- musée 3D */
.hx-museum__stage { position: relative; height: calc(100svh - 4.2rem); min-height: 480px; background: #16131f; overflow: hidden; color: #f4f0f7; }
.hx-museum__stage:fullscreen { height: 100vh; }
.hx-museum__canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.hx-museum__canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--hx-gold); }
.hx-museum__loading { position: absolute; inset: 0; display: grid; place-content: center; gap: .6rem; text-align: center; background: #16131f; transition: opacity .6s; z-index: 5; }
.hx-museum__loading.is-done { opacity: 0; pointer-events: none; }
.hx-museum__loading b { font: 400 2rem/1.1 var(--serif); }
.hx-museum__bar { width: 220px; height: 2px; background: #3a3150; margin: .4rem auto 0; overflow: hidden; }
.hx-museum__bar i { display: block; height: 100%; width: 8%; background: #b8a0ee; transition: width .3s; }
.hx-museum__top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; z-index: 3;
  background: linear-gradient(180deg, rgba(22, 19, 31, .72), transparent); }
.hx-museum__brand { font: 500 1.15rem/1 var(--serif); color: #f4f0f7; text-decoration: none; white-space: nowrap; }
.hx-museum__room { flex: 1; min-width: 0; font-size: .88rem; color: #d8cff0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-museum__tools { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.hx-museum__tools button, .hx-museum__menu button, .hx-museum__nav button { font: 500 .82rem/1 var(--sans); padding: .55rem .8rem; border-radius: 999px;
  border: 1px solid rgba(243, 237, 226, .28); background: rgba(29, 22, 48, .55); color: #f4f0f7; cursor: pointer; backdrop-filter: blur(6px); }
.hx-museum__tools button:hover, .hx-museum__menu button:hover { border-color: #b8a0ee; }
.hx-museum__tools button[aria-pressed="true"] { background: #b8a0ee; color: #16131f; }
.hx-museum__menu { position: absolute; top: 3.6rem; right: .9rem; z-index: 4; display: grid; gap: .35rem; padding: .7rem; border-radius: 10px;
  background: rgba(29, 22, 48, .94); border: 1px solid rgba(243, 237, 226, .15); max-height: calc(100% - 5rem); overflow: auto; }
.hx-museum__menu button { text-align: left; border-radius: 6px; border-left: 3px solid var(--room-accent, #b8a0ee); }
.hx-museum__menu small { opacity: .6; margin-left: .3rem; }
.hx-museum__help { position: absolute; top: 3.6rem; right: .9rem; z-index: 4; max-width: 24rem; padding: 1rem 1.1rem; border-radius: 10px; background: rgba(29, 22, 48, .95);
  border: 1px solid rgba(243, 237, 226, .15); font-size: .88rem; line-height: 1.6; }
.hx-museum__help p { margin: 0 0 .5rem; }
.hx-museum__panel { position: absolute; right: .9rem; bottom: 5.4rem; z-index: 3; width: min(24rem, calc(100% - 1.8rem)); padding: 1.1rem 1.2rem;
  border-radius: 12px; background: rgba(248, 246, 251, .97); color: #1d1630; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); }
.hx-museum__panel h2 { font-size: 1.5rem; margin: .2rem 0 .4rem; color: #1d1630; }
.hx-museum__panel .kicker { color: #7053b7; margin-bottom: .3rem; }
.hx-museum__panel .muted { color: #5d5577; }
.hx-museum__panel .actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.hx-museum__panel .btn.ghost { color: #1d1630; border-color: #1d1630; }
.hx-museum__close { position: absolute; top: .45rem; right: .55rem; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #1d1630; }
.hx-museum__nav { display: flex; justify-content: space-between; margin-top: .8rem; }
.hx-museum__nav button { background: transparent; color: #1d1630; border-color: #cdc3e3; backdrop-filter: none; }
.hx-museum__hint { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); margin: 0; padding: .45rem .9rem; border-radius: 999px;
  background: rgba(29, 22, 48, .6); font-size: .82rem; z-index: 2; transition: opacity .8s; pointer-events: none; white-space: nowrap; }
.hx-museum__hint.is-faded { opacity: 0; }
.hx-museum__fallback { position: absolute; inset: 0; display: grid; place-content: center; padding: 2rem; text-align: center; z-index: 6; background: #16131f; }
.hx-museum.is-flat .hx-museum__stage { height: auto; min-height: 0; }
.hx-museum.is-flat .hx-museum__fallback { position: static; }
.hx-museum.is-flat .hx-museum__top, .hx-museum.is-flat .hx-museum__hint, .hx-museum.is-flat canvas { display: none; }
.hx-flat__room { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 2px solid var(--room-accent); }
.hx-flat__room h2 a { color: inherit; }

/* Sur la page du musée, le pied de page et le dock restent accessibles sous la version texte. */
body[data-page="heritage.musee"] main { padding-bottom: 0; }

@media (max-width: 900px) {
  .hx-split, .hx-work__layout { grid-template-columns: 1fr; }
  .hx-aside, .hx-work__figure { position: static; }
  .hx-museum__brand { display: none; }
  .hx-museum__panel { left: .6rem; right: .6rem; bottom: .6rem; width: auto; max-height: 55%; overflow: auto; }
  .hx-museum__hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 2rem); }
}
@media (prefers-reduced-motion: reduce) {
  .hx-room, .hx-card__img img, .hx-museum__loading, .hx-museum__hint { transition: none; }
  .hx-room:hover, .hx-card:hover .hx-card__img img { transform: none; }
}

/* Mode immersion (bouton « Immersion ») : au-dessus de l'en-tête (36) et de la barre d'onglets (35), sous le bouton
   et le tiroir d'ARIA (40, 60) ; zones système respectées. */
html.museum-immersive, html.museum-immersive body { overflow: hidden; }
.hx-museum.is-immersive .hx-museum__stage { position: fixed; inset: 0; z-index: 38; height: 100vh; height: 100dvh; min-height: 0; }
.hx-museum.is-immersive .hx-museum__brand, .hx-museum.is-immersive [data-hx-help], .hx-museum.is-immersive [data-hx-fullscreen],
.hx-museum.is-immersive [data-hx-quality], .hx-museum.is-immersive .hx-museum__hint { display: none; }
.hx-museum__tools button[aria-pressed="true"][data-hx-immersive] { background: #d9b77c; color: #16131f; }
.hx-museum__top { padding-top: max(.7rem, env(safe-area-inset-top, 0px)); padding-left: max(.9rem, env(safe-area-inset-left, 0px));
  padding-right: max(.9rem, env(safe-area-inset-right, 0px)); }
@media (max-width: 600px) {
  /* Commandes plus discrètes sur téléphone : la scène d'abord. */
  .hx-museum__top { gap: .5rem; padding-bottom: 1.2rem; }
  .hx-museum__tools { gap: .25rem; }
  .hx-museum__tools button { font-size: .74rem; padding: .5rem .62rem; }
  .hx-museum__room { font-size: .8rem; }
  .hx-museum__panel { bottom: calc(.6rem + env(safe-area-inset-bottom, 0px)); }
}
