/*
 * ARCHIVE FULL-ROOM REVIEW PROTOTYPE — NO DEPLOYMENT AUTHORIZED
 * The owner's approved 1448x1086 composite remains pixel-identical.
 * Transparent navigation hit regions scale in that same coordinate frame.
 * Source room + overlay do not reproduce the composite exactly; do not
 * substitute a newly reconstructed scene. No page chrome is rendered.
 * The WordPress catalogue stays in the DOM as a progressive-enhancement
 * source for the approved filing-card index, not as a second page section.
 */
html:has(body.ff-fullroom-archive) {
  height: 100%;
  overflow: hidden;
}
body.ff-fullroom-archive {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #1a211d;
}
body.ff-fullroom-archive::before,
body.ff-fullroom-archive::after {
  content: none !important;
  display: none !important;
}
body.ff-fullroom-archive .ff-archive-main {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}
body.ff-fullroom-archive .ff-archive-wrapper {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
}
body.ff-fullroom-archive .ffa-landing-desktop {
  /* Whole scene visible at any desktop aspect ratio, without cover cropping. */
  width: min(100vw, calc(100dvh * 1.3333333333));
  max-width: none;
  aspect-ratio: 1448 / 1086;
  height: auto;
  margin: 0;
  flex: none;
  position: relative;
  overflow: visible;
}
body.ff-fullroom-archive .ffa-landing-composite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
body.ff-fullroom-archive .ffa-landing-composite { z-index: 0; }
body.ff-fullroom-archive .ffa-hotspot,
body.ff-fullroom-archive .ffa-landing-desktop .ffa-landing-search-link {
  z-index: 2;
  display: block;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.ff-fullroom-archive .ffa-landing-desktop .ffa-landing-search-link {
  /* An accessible hit region, not a new white bar on approved artwork. */
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}
body.ff-fullroom-archive .ffa-hotspot:focus-visible,
body.ff-fullroom-archive .ffa-landing-desktop .ffa-landing-search-link:focus-visible {
  outline: 3px solid #85b8e4;
  outline-offset: 2px;
}
body.ff-fullroom-archive .ff-archive-skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1000;
  padding: 12px 16px;
  transform: translateY(-160%);
  background: #f6ebd5;
  color: #263223;
}
body.ff-fullroom-archive .ff-archive-skip:focus {
  transform: translateY(0);
}
/* WordPress's catalogue is never an ordinary section beneath the room.
   Without JS, native category/record URLs reveal this readable fallback
   through #archive-catalog, using the approved index texture. */
body.ff-fullroom-archive .ffa-catalog {
  position: fixed;
  z-index: 70;
  inset: 4dvh max(3vw, 12px);
  width: auto;
  max-width: 1122px;
  max-height: 92dvh;
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 58px);
  color: #382a1b;
  background: #ece1c8 url('archive/FableFey_Archive_Index_Blank_Desktop_Master.png') center top / contain no-repeat;
  border: 1px solid #a88257;
  box-shadow: 0 0 0 100vmax #0e1615a8;
  visibility: hidden;
  pointer-events: none;
}
body.ff-fullroom-archive .ffa-catalog:target {
  visibility: visible;
  pointer-events: auto;
}
/* A filtered URL may retain #archive-catalog while JS opens the real index.
   Do not reveal the inert fallback underneath/after that dialog. */
body.ff-fullroom-archive [data-archive-ready="true"] .ffa-catalog:target {
  visibility: hidden;
  pointer-events: none;
}
body.ff-fullroom-archive .ffa-catalog .ff-grid {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.ff-fullroom-archive .ffa-catalog .ff-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 16px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #ad926a;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.ff-fullroom-archive .ffa-catalog .ff-card > a:first-child {
  grid-row: span 4;
  width: 110px;
  max-width: 22vw;
}
body.ff-fullroom-archive .ffa-catalog .ff-card .ff-card-image {
  width: 100%;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  box-shadow: none;
}
body.ff-fullroom-archive .ffa-catalog .ff-card :is(h3,p) { margin: 0; }
body.ff-fullroom-archive .ffa-catalog-close {
  position: sticky;
  z-index: 1;
  top: 0;
  float: right;
  display: inline-block;
  padding: 10px 14px;
  color: #342e24;
  background: #eee0bd;
  border: 1px solid #997a50;
}
/* Real dialog content may scroll, but the room never moves with it. */
/* One static room behind the native reader: tint the room, do not reload or crop it. */
body.ff-fullroom-archive .ffa-dialog::backdrop {
  background: rgba(7, 17, 12, .68);
}
body.ff-fullroom-archive .ffa-dialog {
  z-index: 100;
  max-height: 100dvh;
  overscroll-behavior: contain;
}
@media (max-width: 800px) {
  html:has(body.ff-fullroom-archive) { height: auto; overflow-x: hidden; overflow-y: auto; }
  body.ff-fullroom-archive { min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  body.ff-fullroom-archive .ff-archive-main {
    position: relative;
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.ff-fullroom-archive .ff-archive-wrapper {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.ff-fullroom-archive .ffa-landing-desktop { display: none; }
  body.ff-fullroom-archive .ffa-landing-mobile {
    display: block;
    min-height: 100dvh;
    padding: 7vw 6vw 10vw;
    background-image: none;
    position: relative;
    isolation: isolate;
  }
  body.ff-fullroom-archive .ffa-landing-mobile::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    background: #202820 url('archive/FableFey_Archive_Room_Master.png') center / cover no-repeat;
    pointer-events: none;
  }
  body.ff-fullroom-archive .ffa-category-box {
    background-size: contain;
    background-repeat: no-repeat;
  }
  body.ff-fullroom-archive .ffa-catalog {
    inset: 2dvh 2vw;
    max-height: 96dvh;
    padding: 22px 16px;
    background-size: cover;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.ff-fullroom-archive *, body.ff-fullroom-archive *::before {
    scroll-behavior: auto !important;
  }
}
