/* 03-final — object panels: a transparent, non-modal <dialog> covering the page
   under the top bar (which stays usable) and holding a frame: a bottom sheet
   by default, a side panel in the landscape layout. The plain section is
   moved inside .panel__body while it is open. */

.panel {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  z-index: 800;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  overflow: hidden;
}
.panel::backdrop { background: transparent; }
.panel__frame {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  height: min(72svh, calc(100% - 96px));
  border: 3px solid #000;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #121117;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.panel__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border-bottom: 3px solid #000;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 204, 0, 0.08) 0 10px, transparent 10px 20px),
    #1c1b22;
}
.panel__obj {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--amber);
  font: 400 20px/1 var(--ff-pixel);
  letter-spacing: 0.05em;
}
.panel__navs { display: inline-flex; gap: 6px; margin-left: auto; }
.panel__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 2px solid #000;
  border-radius: 12px;
  background: var(--btc);
  color: #000;
  font: 400 19px/1 var(--ff-display);
  letter-spacing: 0.04em;
  box-shadow: 2px 2px 0 #000;
}
.panel__close .ico { stroke-width: 2.8; }
.panel__body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px clamp(14px, 3vw, 30px) 48px;
  scrollbar-width: thin;
  scrollbar-color: #3a3940 transparent;
}
.panel__body:focus { outline: none; }
.panel .sec__in { max-width: none; }
.panel .sec__head { margin-bottom: 24px; }
.panel .sec__title { font-size: clamp(40px, 6vw, 64px); }
.panel .sec__room { display: none; }
.panel .fineprint { color: #b3ab9b; }

@media (min-aspect-ratio: 5/4) and (min-width: 760px) and (min-height: 600px) {
  .panel__frame {
    top: 12px;
    bottom: 12px;
    left: auto;
    right: 12px;
    width: min(720px, calc(50% - 12px));
    height: auto;
    border: 3px solid #000;
    border-radius: 22px;
    box-shadow: 8px 8px 0 #000, 0 30px 90px rgba(0, 0, 0, 0.6);
  }
  .panel.is-left .panel__frame { right: auto; left: 12px; }
  .panel__close span { display: inline; }
}
/* small phones: the close buttons keep only their icon on screen, and their
   name for assistive tech */
@media (max-width: 420px) {
  .panel__close span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .panel__close { position: relative; padding: 0 10px; }
}

/* placeholder left in the page while a section lives in a panel */
.sec__ghost { display: block; }

/* vignette over the zoomed room while a panel is open (sits in the stage) */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 42;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 40%, transparent 30%, rgba(4, 4, 8, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.5s;
}
.is-zoomed .stage::after { opacity: 1; }
