:root {
  font-family: system-ui, sans-serif;
  color: #1d2722;
  background: #f6f3eb;
  --serif: Georgia, 'Times New Roman', serif;
  --line: #d7d1c3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; padding: 0 clamp(1rem, 5vw, 5rem) 2rem; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .65rem .95rem; color: inherit; background: transparent;
  border: 1px solid var(--line); border-radius: .2rem; text-decoration: none; font: inherit; cursor: pointer;
}
button:hover, .button:hover { background: #81807126; }
:focus-visible { outline: 3px solid #b8842e; outline-offset: 3px; }
.masthead, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.5rem; flex-wrap: wrap; }
.masthead { padding: 1.1rem 0; border-bottom: 1px solid var(--line); font-size: .87rem; }
.wordmark { font: 1.23rem var(--serif); text-decoration: none; }
.navigation { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem clamp(1rem, 3vw, 2rem); }
.navigation a { display: inline-flex; align-items: center; gap: .45rem; min-height: 2rem; text-decoration: none; }
.navigation a:hover { text-decoration: underline; text-underline-offset: .28rem; }
.period { font-size: .76rem; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
.catalog-page { max-width: 94rem; }
.intro {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.7rem, 5vw, 5.5rem); align-items: center;
  padding: clamp(1.5rem, 4.5vw, 4.2rem) 0 clamp(2.2rem, 5vw, 4.6rem);
}
.intro .period { color: #745a30; }
.intro h1 { margin: .85rem 0 1rem; font: 400 clamp(2.55rem, 6.6vw, 6.65rem)/.94 var(--serif); letter-spacing: -.061em; }
.intro-description { max-width: 24rem; color: #49554c; font-size: clamp(.97rem, 2vw, 1.12rem); line-height: 1.58; }
.button-primary { margin-top: 1.5rem; min-height: 2.85rem; background: #24352b; color: #fff9eb; border-color: #24352b; }
.button-primary:hover { background: #3a5142; }
.intro-art {
  position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden;
  min-width: 0; aspect-ratio: 1.17; border-radius: .25rem;
  background: radial-gradient(ellipse at 63% 34%, #3b503b, #1d3129 53%, #101e19 100%);
}
.intro-art::before {
  content: ""; position: absolute; inset: 7%; border: 1px solid #c8b8973d;
  background: linear-gradient(90deg, transparent calc(50% - .5px), #e5cf9130 50%, transparent calc(50% + .5px)),
    linear-gradient(transparent calc(50% - .5px), #e5cf9130 50%, transparent calc(50% + .5px));
}
.orbital { position: relative; width: 61%; aspect-ratio: 1; }
.orbital-ring {
  position: absolute; inset: 7% 15%; border: clamp(2px, .7vw, 10px) solid #dcb273;
  border-top-color: #f9dfa1; border-bottom-color: #a06f3c; border-radius: 50%;
  box-shadow: inset 0 0 .4rem #362817b3, 0 .5rem 1.6rem #0d1b14a6;
  transform: rotate(38deg);
}
.orbital-ring:nth-child(2) { border-color: #a68b56 #d7b97e #d7b97e #6d7049; transform: rotate(-37deg); }
.orbital-ring:nth-child(3) { border-width: 1px; border-color: #c0c6a179; inset: 15% 2%; transform: rotate(-10deg); box-shadow: none; }
#catalogue { border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
#catalog-title { padding: 1.15rem 0; font: 400 clamp(1.6rem, 3.2vw, 2.6rem) var(--serif); }
.entry {
  display: grid; grid-template-columns: minmax(4.2rem, .45fr) minmax(12rem, 1.2fr) minmax(14rem, 1.65fr);
  align-items: start; gap: .75rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line); padding: clamp(1.05rem, 3vw, 1.85rem) 0;
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry-date { font: clamp(1.35rem, 3vw, 2.05rem) var(--serif); font-variant-numeric: lining-nums; color: #715b36; }
.entry[data-form="city"] .entry-date { color: #3e665c; }
.entry .period { color: #4a544c; }
.entry h3 { margin-top: .35rem; font: 400 clamp(1.26rem, 2.2vw, 1.85rem)/1.13 var(--serif); }
.entry > p:last-child { line-height: 1.65; font-size: .93rem; color: #424a43; max-width: 43rem; }

.visit-page {
  max-width: 110rem; padding-inline: clamp(.75rem, 3vw, 3rem);
  color-scheme: dark; color: #f5f0e5; background: #151815; --line: #454b43;
}
html:has(.visit-page) { background: #151815; }
.visit-page :focus-visible { outline-color: #f0cb82; }
.visit { margin-top: .75rem; }
.viewport { height: min(79svh, 64rem); min-height: 19rem; position: relative; border: 1px solid var(--line); border-radius: .35rem; background: #262c27; }
canvas { display: block; width: 100%; height: 100%; border-radius: inherit; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
.room { position: absolute; inset: 1rem auto auto 1rem; background: #f6f3ecdd; border: 1px solid #1d1b1814; border-radius: 2px; padding: .55rem 1rem .5rem; pointer-events: none; backdrop-filter: blur(6px); box-shadow: 0 6px 18px #0000001f; }
.room h2 { font-family: "Helvetica Neue", Inter, Arial, sans-serif; font-size: .7rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: #1d1b18; }
.reticle { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: .3rem; aspect-ratio: 1; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px #19221c; pointer-events: none; }
.inspect { position: absolute; top: 57%; left: 50%; translate: -50% 0; width: max-content; max-width: 90%; border-radius: 2rem; background: #171c19ed; }
.inspect:hover { background: #292f28; }
.toolbar { padding: .7rem 0; font-size: .83rem; color: #e4e6dc; }
.toolbar button { padding: .48rem .7rem; }
.mobile-controls { display: none; position: absolute; left: .65rem; bottom: .65rem; gap: .35rem; }
.mobile-controls button { width: 2.85rem; height: 2.85rem; padding: 0; touch-action: none; user-select: none; background: #171c19ed; }
#graphics-status { margin-top: 1rem; color: #f0cb82; }
dialog { color: inherit; background: #222b25; border: 1px solid var(--line); border-radius: .25rem; width: min(90vw, 34rem); padding: 1.4rem; }
dialog::backdrop { background: #0a110dd9; }
dialog form { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
dialog h2 { margin: .5rem 0 .65rem; font: 400 1.8rem var(--serif); }
dialog p { line-height: 1.56; }
@media (max-width: 42rem) {
  .intro { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .intro-art { width: 100%; aspect-ratio: 1.65; }
  .orbital { width: 47%; }
  .entry { grid-template-columns: 3.8rem minmax(0, 1fr); }
  .entry > p:last-child { grid-column: 2; }
}
@media (any-pointer: coarse) {
  .mobile-controls { display: flex; }
  .viewport { height: min(73svh, 48rem); }
}

.visit-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
#cartel h3 { margin-top: 1.15rem; font: 1.2rem var(--serif); color: #ebd5a5; }
.cartel-meta { color: #e0d1b3; font-size: .85rem; margin-top: .55rem; }
#cartel-source { display: inline-block; margin-top: .85rem; color: #f0cb82; }
#plan { width: min(94vw, 46rem); max-height: 92svh; }
.plan-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 1.2rem; margin: 1rem 0; }
#museum-map, #room-map { position: relative; width: 100%; background: #171d19; }
#museum-map { width: min(100%, 24rem); aspect-ratio: 70 / 46; justify-self: center; }
#room-map { background: color-mix(in srgb, var(--room-color) 62%, #fff6dd); outline: 1px solid #d5bb86; overflow: clip; }
#museum-map > span, #room-map > span { position: absolute; display: grid; place-items: center; }
.map-public { background: #c1a982; color: #292520; font-size: clamp(.52rem, 1.65vw, .73rem); }
.map-room { color: #221e1a; border: 1px solid #b89a6b; font-weight: 720; font-size: .75rem; }
.map-room::after { content: ''; position: absolute; inset: 0; background: #e9d8b962; pointer-events: none; }
.map-door { background: #655235; }
.map-object { background: #5a4940; outline: 1px solid #e8ceb0; }
.map-highlight { background: #a76e24; outline: 1px dashed #633d19; }
.map-number { font-weight: 720; font-size: .68rem; border-radius: 50%; min-width: 1.05rem; min-height: 1.05rem; background: #221b15; color: #fbecd2; }
#plan-rooms { display: grid; gap: .35rem; }
#plan-rooms button { justify-content: flex-start; text-align: left; font-size: .85rem; padding: .38rem .55rem; }
#plan-entries { margin: 0; padding-left: 1.3rem; font-size: .87rem; line-height: 1.62; }
.plan-masterpiece { color: #f0cb82; }
#plan-enter { background: #ddb983; color: #241e19; }
#plan-enter:hover { background: #edcc9d; }
.catalog-room { padding-block: 1rem 1.8rem; }
.catalog-room > h3 { font: 400 clamp(1.55rem, 3vw, 2.45rem) var(--serif); }
.catalog-room > p { margin: .35rem 0 1.2rem; color: #49554c; }
.entry h4 { margin: .1rem 0 0; font: 400 clamp(1.26rem, 2.2vw, 1.85rem)/1.13 var(--serif); }
.entry > div:last-child { color: #424a43; line-height: 1.65; font-size: .93rem; }
.entry [href] { font-size: .88rem; }
.catalog-credit { margin-top: .4rem; font-size: .83rem; color: #655332; }
@media (max-width: 42rem) {
  .entry > div:last-child { grid-column: 2; }
  .plan-content { gap: .75rem; }
  #museum-map { width: min(100%, 18rem); }
}
@media (max-width: 32rem) {
  #room-map:not([hidden]) { grid-column: 1 / -1; max-width: 14rem; justify-self: center; }
  #plan-entries:not([hidden]) { grid-column: 1 / -1; }
  #plan { padding: .8rem; }
}
.catalog-image { margin: .85rem 0; max-width: 20rem; }
.catalog-image img { display: block; max-width: 100%; max-height: 12rem; border-radius: .2rem; }
.catalog-image figcaption { margin-top: .3rem; font-size: .79rem; }


/* Pied de page légal, partage et pages juridiques */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .85rem; }
.site-footer nav, .share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; }
.share ul { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.share a, .share button { display: inline-block; padding: .35rem .7rem; font-size: .85rem; line-height: 1.4; border: 1px solid var(--line); border-radius: .2rem; text-decoration: none; }
.visit-page .site-footer { color: #e4e6dc; }
.legal-page { max-width: 50rem; line-height: 1.6; }
.legal h1 { margin: 2rem 0 1rem; font: 400 clamp(2rem, 5vw, 3rem) var(--serif); }
.legal h2 { margin: 2.2rem 0 .6rem; font: 400 1.5rem var(--serif); }
.legal h3 { margin: 1.4rem 0 .4rem; font-size: 1rem; }
.legal p, .legal ul, .legal table { margin: 0 0 .9rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.legal th, .legal td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-note { font-size: .85rem; color: #49554c; }
.a-completer { background: #ffe08a; padding: 0 .25rem; }
/* Barre latérale et progression du parcours */
.sidebar { position: absolute; top: .75rem; right: .75rem; bottom: .75rem; width: 16rem; display: flex; flex-direction: column; gap: .55rem;
  padding: .9rem .9rem .8rem; border-radius: .45rem; background: #14110ec2; border: 1px solid #ffffff26; backdrop-filter: blur(8px);
  color: #f5f0e5; transition: translate .35s ease, opacity .35s ease; z-index: 2; }
.sidebar.is-collapsed { translate: calc(100% + .75rem) 0; }
.side-toggle { position: absolute; left: -2.1rem; top: .4rem; width: 1.8rem; height: 2.4rem; padding: 0; border-radius: .35rem 0 0 .35rem;
  background: #14110ec2; border: 1px solid #ffffff26; border-right: 0; font-size: 1.1rem; }
.side-kicker { font: 500 .62rem "Helvetica Neue", Inter, Arial, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #bfb6a6; }
.sidebar h2 { font: 400 1.5rem var(--serif); margin-top: -.2rem; }
.side-description { font-size: .78rem; line-height: 1.45; color: #d6cfc1; }
.minimap { width: 100%; height: 10.5rem; flex: none; border-radius: .3rem; background: #0b0a09a6; border: 1px solid #ffffff1f; pointer-events: none; cursor: default; }
.side-next { justify-content: space-between; width: 100%; white-space: nowrap; background: #ffffff0f; color: #fff; border-color: #ffffff4d; font-weight: 500; font-size: .78rem; letter-spacing: .02em; }
.side-next:hover { background: #ffffff1f; border-color: #ffffff99; }
.side-next::after { content: '→'; margin-left: .4rem; }
.side-next span { font-weight: 400; font-size: .72rem; max-width: 9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .8; }
.side-list { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; }
.side-list button { display: grid; grid-template-columns: 3.3rem 1fr; gap: .4rem; width: 100%; text-align: left; justify-content: stretch;
  border: 0; border-bottom: 1px solid #ffffff14; border-radius: 0; padding: .42rem .2rem; font-size: .76rem; line-height: 1.3; }
.side-list button:hover { background: #ffffff12; }
.side-year { color: #bfb6a6; font-variant-numeric: tabular-nums; }
.side-list .is-seen .side-year { color: #f0cb82; }
.side-list .is-seen .side-year::after { content: ' ✓'; }
.progress { position: absolute; left: 0; right: 17.5rem; bottom: 0; display: flex; gap: 1.6rem;
  padding: 2.4rem 1.6rem 1rem; background: linear-gradient(to top, #0a0908cc, #0a090866 55%, transparent);
  border-radius: 0 0 0 .35rem; pointer-events: none; }
.sidebar.is-collapsed ~ .progress { right: 0; }
.progress-room { flex: var(--grow, 1); display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label count" "track track";
  row-gap: .45rem; min-width: 0; padding: 0; border: 0; background: none; text-align: left; pointer-events: auto; cursor: pointer; }
.progress-room:hover { background: none; }
.progress-room:hover .progress-label { color: #fff; }
.progress-label { grid-area: label; font: 500 .64rem "Helvetica Neue", Inter, Arial, sans-serif; letter-spacing: .26em;
  text-transform: uppercase; color: #ffffff8c; transition: color .3s; }
.progress-room.is-current .progress-label { color: #fff; }
.progress-room.is-current .progress-label::before { content: ''; display: inline-block; width: .38rem; height: .38rem; margin-right: .55rem;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 .2rem #ffffff2e; vertical-align: .08rem; }
.progress-count { grid-area: count; font: 300 .66rem "Helvetica Neue", Inter, Arial, sans-serif; color: #ffffff80; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.progress-track { grid-area: track; position: relative; display: flex; justify-content: space-between; align-items: center; height: .55rem; min-width: 0; }
.progress-track::before, .progress-track::after { content: ''; position: absolute; left: 0; top: 50%; height: 1px; translate: 0 -50%; }
.progress-track::before { right: 0; background: #ffffff33; }
.progress-track::after { width: var(--done, 0%); height: 2px; background: linear-gradient(90deg, #ffffffb3, #fff); transition: width .6s ease; }
.progress-dot { position: relative; z-index: 1; width: 1px; height: .3rem; background: #ffffff59; flex: none; transition: height .3s, background .3s; }
.progress-dot.is-seen { height: .55rem; background: #fff; box-shadow: none; }
.progress-room.is-complete .progress-count { color: #fff; }
@media (max-width: 52rem) {
  .sidebar { width: 13rem; }
  .progress { right: 14.5rem; flex-direction: column; gap: .2rem; }
  .side-list { display: none; }
}
.room { display: none; }
