/* Styles specific to Room 4 (rooms/4/index.html). Loaded after the shared CSS, so it can override it. */

kbd {
  font-family: monospace;
  font-size: 0.8em;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

nav a:focus-visible,
nav a.real-link:focus-visible {
  outline: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px var(--accent-light);
  pointer-events: auto;
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  width: 100%;
}

h1 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.intro-text {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 2rem;
  max-width: 32ch;
}

/* ── Hint box ── */
.hint-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: 0 6px 6px 0;
  padding: 0.875rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Report banner ── */
.report-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-banner .report-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.report-banner .classification-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--danger);
  color: var(--danger);
}

/*
  ── Report grid ──
  Three columns at full width: main body, signal metrics, priority annotations.

  At normal zoom: three columns side-by-side. The annotations column is narrow
  and renders at a tiny font size, easy to miss.

  At ≈200% zoom: the viewport effectively halves in CSS pixels, dropping below
  the 680px breakpoint. All three columns stack vertically in DOM order
  (body → metrics → annotations). The annotations become full-width and readable.
  This is CSS reflow — content adapts to viewport width rather than forcing
  horizontal scrolling.
*/
.report-grid {
  display: grid;
  grid-template-columns: 3fr 1.6fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

@media (max-width: 960px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Shared panel base ── */
.report-panel {
  background: var(--surface);
  padding: 1.25rem;
}

.panel-heading {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.6rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}

/* ── Main report body ── */
.body-col {
  /* Nothing unusual — this column looks normal at all zoom levels */
}

.log-entry {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.log-entry:last-child { border-bottom: none; }

.log-entry .log-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.log-entry .log-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--accent-light);
  font-weight: 700;
}

.log-entry .log-ts {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.log-entry .log-status {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
.status-open {
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  color: var(--warning);
}
.status-closed {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}
.status-review {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-light);
}

.log-entry p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Signal metrics column ── */
.metrics-col { /* Normal styling, not the point of the room */ }

.metric-block {
  margin-bottom: 1rem;
}

.metric-block:last-child { margin-bottom: 0; }

.metric-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.metric-value {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.metric-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.metric-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.metric-row:last-child { border-bottom: none; }

.metric-row .row-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric-row .row-val {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text);
}

/*
  ── Priority annotations column ──
  This is the column that matters.

  At normal zoom: narrow, tiny text (0.67rem) in a cramped, height-clipped
  column — looks like boilerplate metadata, easy to dismiss visually.
  (Text colours still meet WCAG AA contrast; the challenge comes from
  size and clipping, not from illegible colour.)

  At ≈200%+ zoom: column becomes full-width. Browser zoom makes 0.67rem
  effectively larger. The content is now obviously readable and the
  acknowledge button is clearly visible.

  This is intentionally awkward design: critical controls buried in small
  type in a cramped column. The fix is proper reflow support.
*/
.annotations-col {
  font-size: 0.67rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-height: 17rem;
  overflow: hidden;
}

@media (max-width: 960px) {
  /*
    At high zoom / narrower viewport, remove clipping so the hidden control
    in the annotations panel becomes visible.
  */
  .annotations-col {
    max-height: none;
    overflow: visible;
  }
}

.annotations-col .panel-heading {
  font-size: 0.58rem;
}

.annotation-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.annotation-entry:last-child { border-bottom: none; }

.annotation-entry .ann-priority {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.58rem;
  display: block;
  margin-bottom: 0.15rem;
}
.ann-p1 { color: var(--danger); }
.ann-p2 { color: var(--warning); }
.ann-p3 { color: var(--text-muted); }

.annotation-entry p {
  color: var(--text-faint);
  font-size: 0.65rem;
}

/*
  The acknowledge button.

  At normal zoom: tiny, styled to blend with the surrounding annotation text.
  Low padding, small font — looks like a metadata tag, not a button.

  At high zoom: full width, clearly a button, easy to read and activate.
  This is the control the user needs to find.
*/
.acknowledge-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: monospace;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.acknowledge-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.acknowledge-btn:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 3px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(5rem);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  z-index: 100;
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-width: min(400px, calc(100vw - 2rem));
  text-align: center;
  pointer-events: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--success);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.modal .success-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
}

.btn-close {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

@media (max-width: 560px) {
  main { padding: 2rem 1.25rem 3rem; }
  header { padding: 0.75rem 1.25rem; }
}

/*
  ── Embed mode: simulated zoom (see js/room-4-zoom.js) ──
  The embed is narrower than 960px, so the media queries above would always stack the report.
  Inside the simulated screen, the three-column clipped layout holds until the *simulated* screen
  is 960px or narrower (.is-reflowed), exactly like real zoom on the full site.
*/
.embed .zoom-canvas .report-grid {
  grid-template-columns: 3fr 1.6fr 1fr;
}

.embed .zoom-canvas .annotations-col {
  max-height: 17rem;
  overflow: hidden;
}

.embed .zoom-canvas.is-reflowed .report-grid {
  grid-template-columns: 1fr;
}

.embed .zoom-canvas.is-reflowed .annotations-col {
  max-height: none;
  overflow: visible;
}

.zoom-sim {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
}

.zoom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-strong);
}

.zoom-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zoom-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.zoom-btn:hover {
  border-color: var(--accent-light);
}

.zoom-btn:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.zoom-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.zoom-reset {
  font-weight: 400;
  color: var(--text-muted);
}

.zoom-level {
  min-width: 3.5rem;
  text-align: center;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
}

.zoom-viewport {
  background: var(--bg);
  padding: 0;
}

/* Embed hint: a smaller note under the main hint explaining real browser zoom. */
.hint-box .hint-note {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

/* Narrow embeds: controls take the full row under the label. */
@media (max-width: 480px) {
  .zoom-controls {
    width: 100%;
    gap: 0.35rem;
  }

  .zoom-btn {
    padding: 0.35rem 0.55rem;
  }

  .zoom-level {
    min-width: 3rem;
    flex: 1;
  }
}

/* The report's own corners/borders sit flush inside the simulated screen. */
.embed .zoom-canvas .report-banner {
  border-radius: 0;
}

.embed .zoom-canvas .report-grid {
  border-radius: 0;
}
