/* =========================================================================
   ON3 — space photo galleries (js/space-gallery.js), on the About tabs and
   the booking card: a big photo over a row of thumbnails. A scroll-snap row
   that loops; the script adds the counter, arrows, thumbnails and a
   full-screen viewer.
   ========================================================================= */
.sg {
  --sg-r: 14px;
  --sg-accent: var(--amber, var(--accent-text, #e0a458));
  --sg-ratio: 16 / 10;
  position: relative; display: grid; gap: 10px; min-width: 0;
}
.sg__track {
  position: relative; display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; border-radius: var(--sg-r);
}
.sg__track::-webkit-scrollbar { display: none; }
.sg__track:focus-visible { outline: 2px solid var(--sg-accent); outline-offset: 3px; }
.sg__slide {
  flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always;
  aspect-ratio: var(--sg-ratio); border-radius: var(--sg-r); overflow: hidden; cursor: zoom-in;
  background: rgba(127, 127, 127, 0.12);
}
.sg__slide img { width: 100%; height: 100%; object-fit: cover; }

/* A video slide: the still, with the muted loop laid over it once it's actually
   playing (so there's never a black frame), and a small play mark until then. */
.sg__slide--video { position: relative; }
.sg__vid {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 400ms ease; pointer-events: none;
}
.sg__slide.is-playing .sg__vid { opacity: 1; }
.sg__play {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 52px; height: 52px;
  margin: -26px 0 0 -26px; border-radius: 50%; pointer-events: none;
  background: rgba(14, 10, 8, 0.55); color: #f6efe4; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity 400ms ease;
}
.sg__play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; stroke: none; }
.sg__slide.is-playing .sg__play { opacity: 0; }

/* Controls sit on the photo, so they're dark glass in both themes. */
.sg__count, .sg__nav, .sg__zoom {
  position: absolute; z-index: 1; margin: 0;
  background: rgba(14, 10, 8, 0.55); color: #f6efe4;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sg__count {
  top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; line-height: 1.5; font-variant-numeric: tabular-nums; pointer-events: none;
}
.sg__zoom, .sg__nav {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
}
.sg__zoom { top: 8px; right: 8px; }
/* Centred on the big photo, above the thumbnail row. */
.sg__nav { top: 0; bottom: 64px; margin-block: auto; }
.sg__nav--prev { left: 8px; }
.sg__nav--next { right: 8px; }
.sg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sg__zoom:focus-visible, .sg__nav:focus-visible { outline: 2px solid var(--sg-accent); outline-offset: 2px; }
/* Phones swipe; the arrows are for mouse and keyboard. */
@media (hover: none) { .sg__nav { display: none; } }

/* ---- the thumbnail row */
.sg__thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.sg__thumbs::-webkit-scrollbar { display: none; }
.sg__thumb {
  flex: none; width: 72px; height: 50px; padding: 0; border: 0; border-radius: 8px; overflow: hidden;
  cursor: pointer; opacity: 0.5; outline: 2px solid transparent; outline-offset: 1px;
  transition: opacity var(--t-fast, 280ms) ease, outline-color var(--t-fast, 280ms) ease; background: none;
}
.sg__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sg__thumb--video { position: relative; }
.sg__thumb--video::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -6px 0 0 -3px;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent #f6efe4;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.sg__thumb.is-on { opacity: 1; outline-color: var(--sg-accent); }
@media (hover: hover) { .sg__thumb:hover { opacity: 0.85; } }

/* ---------------------------------------------------------- full screen */
html.sgv-open { overflow: hidden; }
.sgv {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0b0908; color: #f6efe4;
}
.sgv::backdrop { background: #0b0908; }
.sgv__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.sgv__track::-webkit-scrollbar { display: none; }
.sgv__slide { flex: 0 0 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; padding: 56px 0; }
.sgv__slide img, .sgv__slide video { max-width: 100%; max-height: 100%; object-fit: contain; }
.sgv__slide video { width: 100%; background: #000; }
.sgv__count { position: fixed; top: 16px; left: 16px; margin: 0; font-size: 0.875rem; font-variant-numeric: tabular-nums; opacity: 0.8; }
.sgv__close, .sgv__nav {
  position: fixed; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: inherit; font-size: 28px; line-height: 1; cursor: pointer;
}
.sgv__close { top: 10px; right: 10px; }
.sgv__nav { top: 50%; transform: translateY(-50%); }
.sgv__nav--prev { left: 12px; }
.sgv__nav--next { right: 12px; }
@media (hover: none) { .sgv__nav { display: none; } }
