/* ============================================================
   Interactive room — SVG-overlay hotspots, inline callouts,
   spotlight dimming, and the design-note side panel.
   ============================================================ */

.room-main { padding: clamp(1.5rem, 3vw, 2.5rem) 0 3rem; }

.room-head { margin-bottom: 1.4rem; }
.room-head h1 { margin: 0 0 0.3rem; }
.room-head .lede { max-width: 60ch; }

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: clamp(1.2rem, 2.5vw, 2rem);
  align-items: start;
}

/* ---- stage column ---- */
.room-stage { min-width: 0; }

.room-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.room-toolbar .spacer { flex: 1; }
.room-hint {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}
.chip {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.chip:hover { background: #fff8e7; border-color: var(--red); }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }

.room-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 1448 / 1086;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ded7c9;
  box-shadow: var(--shadow-md);
}
.room-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.room-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* dimming spotlight overlay */
#roomDim {
  fill: rgba(26, 23, 18, 0.6);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.room-figure.has-selection #roomDim { opacity: 1; }

/* hotspots */
.hotspot {
  fill: transparent;
  stroke: transparent;
  stroke-width: 3;
  stroke-linejoin: round;
  cursor: pointer;
  outline: none;
  transition: fill 0.18s ease, stroke 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.hotspot.is-revealed {
  fill: rgba(199, 154, 95, 0.14);
  stroke: rgba(163, 59, 46, 0.5);
  stroke-dasharray: 7 6;
}
.hotspot.is-hover {
  fill: rgba(199, 154, 95, 0.26);
  stroke: var(--red);
  stroke-dasharray: none;
}
.hotspot.is-selected {
  fill: rgba(199, 154, 95, 0.12);
  stroke: var(--red);
  stroke-width: 3.5;
  stroke-dasharray: none;
}
.hotspot.is-dimmed { pointer-events: none; }
.hotspot:focus-visible { stroke: var(--navy); fill: rgba(27, 42, 74, 0.2); }

/* ---- inline callout anchored on the image ---- */
.callout-layer { position: absolute; inset: 0; pointer-events: none; }
.callout-layer.show { pointer-events: none; }
.callout {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  width: min(300px, 62%);
  padding: 0.7rem 0.85rem 0.8rem;
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  animation: callout-in 0.16s ease both;
}
.callout::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(255, 253, 248, 0.97);
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 var(--line-strong));
}
.callout--left  { transform: translate(-14%, calc(-100% - 12px)); }
.callout--left::after  { left: 14%; }
.callout--right { transform: translate(-86%, calc(-100% - 12px)); }
.callout--right::after { left: 86%; }
.callout--pinned { border-color: var(--red); box-shadow: 0 14px 34px rgba(138, 48, 37, 0.24); }

@keyframes callout-in {
  from { opacity: 0; transform: translate(-50%, calc(-100% - 4px)); }
}

.callout__layer {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.callout__title { font-family: var(--serif); font-weight: 600; font-size: 1.06rem; line-height: 1.1; }
.callout__overview { font-family: var(--serif); font-size: 0.9rem; line-height: 1.35; color: var(--ink-soft); }
.callout__hint {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ---- side panel ---- */
.room-panel {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding-right: 2px;
}
.panel-card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
}
.panel-card h2 { font-size: 1.55rem; margin: 0 0 0.5rem; }
.panel-card[hidden] { display: none; }

#detailOverview {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--red);
}
#detailThumb {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  margin: 0 0 1.1rem;
}
.detail-section + .detail-section {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line-strong);
}
.detail-section h3 {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 0.3rem;
}
.detail-section p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; }

/* object browser */
.browser-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.7rem;
}
.browser-head .eyebrow { margin: 0; }
#objectCount { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }
.object-list { display: grid; gap: 0.5rem; }
.object-list button {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.7);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.object-list button:hover, .object-list button.hovering { background: #fff8e7; border-color: var(--line-strong); }
.object-list button.active { background: var(--red-tint); border-color: var(--red); }
.object-list strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 0.98rem; }
.object-list span {
  display: block; margin-top: 0.15rem;
  font-family: var(--sans); font-size: 0.72rem; color: var(--muted);
}

/* ---- responsive ---- */
@media (max-width: 980px) {
  .room-layout { grid-template-columns: 1fr; }
  .room-panel { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
  .callout { width: min(240px, 74%); }
  .callout__overview { font-size: 0.84rem; }
}
