/* ============================================================
   OBSIDIAN — THE GALLERY (O1, Gather-style gallery-of-one)
   Instrument frame: black paper, bone-white sand, dim metadata.
   Colour comes from the artwork only. Royal Blue stays the
   single site accent, used on the two literal CTAs.
   ============================================================ */
.gallery-stage {
  --paper: #060606;
  --sand: #ffe9c4;
  --ink-dim: #8f8f8f;
  --ink-faint: #5a5a5a;
  --line: rgba(255, 233, 196, 0.22);
  --accent: #2563eb;
  position: relative;
  background: var(--paper);
  color: #f2ead8;
  height: calc(100svh - 57px);
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.gallery-stage .mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 10px;
  color: var(--ink-dim);
}

/* ── top line ─────────────────────────────── */
.gal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 26px 10px;
}
.gal-title-block .gal-wordmark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.55em;
  color: #f5efe2;
  text-transform: uppercase;
}
.gal-title-block .gal-readout { margin-top: 7px; color: var(--sand); }
.gal-title-block .gal-readout-sub { margin-top: 4px; color: var(--ink-faint); }
.gal-instr { text-align: center; padding-top: 4px; flex: 1; }
.gal-utils { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.gal-utils .dot-light { color: var(--sand); letter-spacing: 0.2em; }

/* ── middle: rail + stage ─────────────────── */
.gal-mid { flex: 1; display: flex; align-items: stretch; gap: 10px; padding: 6px 26px; min-height: 0; }
.gal-rail {
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
  width: 64px; flex: none;
}
.gal-rail button {
  appearance: none; background: none; border: 1px solid transparent;
  padding: 0; cursor: pointer; text-align: left; color: var(--ink-dim);
}
.gal-rail button .thumb {
  display: block; width: 64px; height: 44px; object-fit: cover;
  filter: grayscale(0.35) brightness(0.85);
  border: 1px solid rgba(255,255,255,0.08);
}
.gal-rail button .rnum {
  display: block; margin-top: 3px;
  font-family: ui-monospace, Menlo, monospace; font-size: 9px; letter-spacing: 0.25em;
}
.gal-rail button.on { color: var(--sand); }
.gal-rail button.on .thumb { border-color: var(--sand); filter: none; }
.gal-rail button:focus-visible, .gal-btn:focus-visible, .gal-cta:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* the ruler-framed stage */
.gal-frame {
  position: relative;
  flex: 1;
  margin: 8px 12px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 64px) top / 100% 9px no-repeat,
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 64px) bottom / 100% 9px no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 64px) left / 9px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 64px) right / 9px 100% no-repeat;
}
.gal-frame .cross { position: absolute; color: var(--sand); font-size: 15px; line-height: 1; font-family: ui-monospace, monospace; }
.gal-frame .cross.tl { top: -9px; left: -8px; }
.gal-frame .cross.tr { top: -9px; right: -8px; }
.gal-frame .cross.bl { bottom: -9px; left: -8px; }
.gal-frame .cross.br { bottom: -9px; right: -8px; }
.gal-frame canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; cursor: grab; touch-action: pan-y;
}
.gal-frame canvas:active { cursor: grabbing; }
.gal-frame .frame-readout {
  position: absolute; top: 10px; left: 12px; z-index: 3; pointer-events: none;
  background: rgba(6, 6, 6, 0.55); padding: 3px 6px;
}
.gal-frame .frame-readout-r {
  position: absolute; top: 10px; right: 12px; z-index: 3; pointer-events: none; text-align: right;
  background: rgba(6, 6, 6, 0.55); padding: 3px 6px;
}
.gal-frame .frame-readout-b {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 3; pointer-events: none; white-space: nowrap;
  background: rgba(6, 6, 6, 0.55); padding: 3px 6px;
}
/* tracker brackets */
.gal-tracker {
  position: absolute; z-index: 2; width: 34px; height: 34px; pointer-events: none;
  color: var(--ink-dim);
}
.gal-tracker::before, .gal-tracker::after,
.gal-tracker .tc::before, .gal-tracker .tc::after {
  content: ""; position: absolute; width: 9px; height: 9px; border: 1px solid currentColor;
}
.gal-tracker::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.gal-tracker::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.gal-tracker .tc::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.gal-tracker .tc::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.gal-tracker .tplus {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 10px; font-family: ui-monospace, monospace;
}
.gal-tracker .tlabel {
  position: absolute; top: 38px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 8.5px;
}

/* exhibit caption, bottom-left inside the void (below frame on mobile) */
.gal-caption { padding: 4px 26px 0; max-width: 640px; }
.gal-caption .gal-exhibit-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 400; color: #f7f1e3; line-height: 1.1; margin: 2px 0 6px;
}
.gal-caption .gal-feel {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-size: 15.5px; color: #cfc7b4; margin: 0 0 4px; line-height: 1.45;
}
.gal-caption .gal-url { color: var(--ink-faint); }

/* ── bottom control bar ───────────────────── */
.gal-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px;
  padding: 14px 26px 20px;
  border-top: 1px solid rgba(255, 233, 196, 0.1);
  margin-top: 12px;
}
.gal-btn {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: #e9e2d0; font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase; padding: 6px 2px;
}
.gal-btn:hover { color: var(--sand); }
.gal-slider { display: flex; align-items: center; gap: 10px; }
.gal-slider label { color: var(--ink-dim); }
.gal-slider input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 110px; height: 1px;
  background: rgba(255, 233, 196, 0.35); outline-offset: 4px;
}
.gal-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--sand); cursor: pointer;
}
.gal-slider input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; border: 0; background: var(--sand); cursor: pointer;
}
.gal-slider .val { color: var(--sand); min-width: 30px; }
.gal-lights { display: flex; gap: 7px; align-items: center; }
.gal-lights .ld { width: 7px; height: 7px; border-radius: 50%; }
.gal-ctas { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gal-cta {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  padding: 10px 18px; border-radius: 999px;
}
.gal-cta.primary { background: var(--accent); color: #fff; }
.gal-cta.primary:hover { background: #1d4ed8; }
.gal-cta.quiet {
  color: var(--sand); border: 1px solid rgba(255, 233, 196, 0.4);
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
  letter-spacing: 0.28em; text-transform: uppercase; padding: 11px 16px;
}
.gal-cta.quiet:hover { border-color: var(--sand); }

@media (max-width: 760px) {
  .gallery-stage { height: auto; min-height: 94svh; }
  .gal-instr { display: none; }
  .gal-top { padding: 14px 16px 6px; }
  .gal-mid { flex-direction: column; padding: 4px 16px; }
  .gal-rail { flex-direction: row; width: auto; order: 2; justify-content: flex-start; padding-top: 10px; }
  .gal-rail button .thumb { width: 46px; height: 32px; }
  .gal-frame { margin: 6px 2px; min-height: 300px; order: 1; }
  .gal-frame .frame-readout-r { display: none; }
  .gal-frame .gal-tracker.t-optional { display: none; }
  .gal-tracker .tlabel { left: -2px; transform: none; }
  .gal-caption { padding: 2px 16px 0; }
  .gal-bar { padding: 12px 16px 16px; gap: 10px 18px; }
  .gal-ctas { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-frame canvas { cursor: default; }
}
