/* Sphere gallery styles. The page defines --accent, --ink, --surface.
   Canvas theming: set --sphere-bg and --sphere-glow on the canvas or an ancestor. */

.sg-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}
.sg-canvas.sg-grabbing { cursor: grabbing; }
.sg-canvas:focus-visible {
  outline: 3px solid var(--accent, #e0a15a);
  outline-offset: -3px;
}

/* Visually hidden, still read by screen readers. Use on the plain grid while the
   sphere is active. Never use the hidden attribute for that. */
.sg-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 3.5rem 1rem 1.5rem;
  background: color-mix(in srgb, var(--ink, #1b1410) 92%, transparent);
  color: var(--surface, #fbf6ee);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sg-lightbox[hidden] { display: none; }
.sg-lightbox.is-open { opacity: 1; }

.sg-lb-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-height: 100%;
}
.sg-lb-media { display: flex; justify-content: center; max-width: 100%; }
.sg-lb-media img,
.sg-lb-media video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink, #1b1410) 60%, transparent);
}
.sg-lb-cap {
  max-width: 60ch;
  text-align: center;
  font-size: 1rem;
  line-height: 1.45;
}

.sg-lightbox button {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--surface, #fbf6ee) 35%, transparent);
  background: color-mix(in srgb, var(--ink, #1b1410) 70%, transparent);
  color: var(--surface, #fbf6ee);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.sg-lightbox button:hover {
  background: var(--accent, #e0a15a);
  color: var(--ink, #1b1410);
}
.sg-lightbox button:focus-visible {
  outline: 3px solid var(--accent, #e0a15a);
  outline-offset: 3px;
}
.sg-lb-close { position: absolute; top: 0.75rem; right: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  .sg-lightbox { transition: none; }
}
