/* =========================================================================
   DOME GALLERY : vanilla JS port (no React, no build step)
   Ported from https://reactbits.dev/components/dome-gallery, same visuals
   and drag/enlarge behavior, reimplemented with plain pointer events and
   DOM APIs so it drops into this static site with no new dependencies.
   ========================================================================= */

.dome-gallery-frame {
  position: relative;
  width: 100%;
  height: 680px;
  overflow: hidden;
  margin-top: 48px;
}
@media (max-width: 760px) {
  .dome-gallery-frame { height: 500px; }
}

/* No-JS / pre-mount fallback: the real <img> tags read by dome-gallery.js
   are visible as a plain wrapped grid until the script replaces them. If
   JS is blocked entirely, this is the permanent state visitors see. */
.dome-gallery-frame img {
  display: inline-block;
  width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  margin: 8px;
}

.dg-root {
  position: relative;
  width: 100%;
  height: 100%;
  --radius: 520px;
  --viewer-pad: 72px;
  --circ: calc(var(--radius) * 3.14);
  --rot-y: calc((360deg / var(--segments-x)) / 2);
  --rot-x: calc((360deg / var(--segments-y)) / 2);
  --item-width: calc(var(--circ) / var(--segments-x));
  --item-height: calc(var(--circ) / var(--segments-y));
}

.dg-root * { box-sizing: border-box; }

.dg-sphere,
.dg-item,
.dg-item__image {
  transform-style: preserve-3d;
}

.dg-main {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
  cursor: grab;
}
.dg-main:active { cursor: grabbing; }

.dg-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  perspective: calc(var(--radius) * 2);
  perspective-origin: 50% 50%;
  contain: layout paint size;
}

.dg-sphere {
  transform: translateZ(calc(var(--radius) * -1));
  will-change: transform;
}

.dg-overlay,
.dg-overlay--blur {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 3;
  pointer-events: none;
}

.dg-overlay {
  /* Softened vignette: the fade to the background colour now starts further
     out and never reaches full opacity within the frame, so edge photos stay
     legible instead of washing into the background. */
  background-image: radial-gradient(rgba(235, 235, 235, 0) 80%, var(--overlay-blur-color, #060D1A) 112%);
}

.dg-overlay--blur {
  -webkit-mask-image: radial-gradient(rgba(235, 235, 235, 0) 84%, var(--overlay-blur-color, #060D1A) 102%);
  mask-image: radial-gradient(rgba(235, 235, 235, 0) 84%, var(--overlay-blur-color, #060D1A) 102%);
  backdrop-filter: blur(1.5px);
}

.dg-item {
  width: calc(var(--item-width) * var(--item-size-x));
  height: calc(var(--item-height) * var(--item-size-y));
  position: absolute;
  top: -999px;
  bottom: -999px;
  left: -999px;
  right: -999px;
  margin: auto;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transition: transform 300ms;
  transform: rotateY(calc(var(--rot-y) * (var(--offset-x) + ((var(--item-size-x) - 1) / 2)) + var(--rot-y-delta, 0deg)))
    rotateX(calc(var(--rot-x) * (var(--offset-y) - ((var(--item-size-y) - 1) / 2)) + var(--rot-x-delta, 0deg)))
    translateZ(var(--radius));
}

.dg-item__image {
  position: absolute;
  display: block;
  inset: 18px;                 /* larger gap so tiles never touch */
  border-radius: var(--tile-radius, 12px);
  background: transparent;
  border: 0;                   /* no border on the tiles */
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 300ms, box-shadow 200ms;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.dg-item__image:hover {
  box-shadow: 0 0 0 3px rgba(0, 206, 255, .65), 0 10px 30px rgba(0, 0, 0, .28);
  z-index: 5;
}
.dg-item__image:hover img {
  filter: brightness(1.15) contrast(1.06) saturate(1.15);
}

.dg-item__image:focus-visible {
  outline: 2px solid var(--blue, #1F6FD6);
  outline-offset: 2px;
}

.dg-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  backface-visibility: hidden;
  filter: var(--image-filter, none);
}

.dg-viewer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--viewer-pad);
}

.dg-viewer .dg-frame {
  height: 100%;
  aspect-ratio: 1;
  border-radius: var(--enlarge-radius, 20px);
  display: flex;
}

@media (max-aspect-ratio: 1/1) {
  .dg-viewer .dg-frame { height: auto; width: 100%; }
}

.dg-viewer .dg-scrim {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, .5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms ease;
  backdrop-filter: blur(3px);
}

.dg-root[data-enlarging='true'] .dg-viewer .dg-scrim {
  opacity: 1;
  pointer-events: all;
}

.dg-viewer .dg-enlarge {
  position: absolute;
  z-index: 30;
  border-radius: var(--enlarge-radius, 20px);
  overflow: hidden;
  transition: transform 400ms ease, opacity 400ms ease;
  transform-origin: top left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.dg-viewer .dg-enlarge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--image-filter, none);
}

.dg-root .dg-enlarge-closing img {
  filter: var(--image-filter, none);
}

.dg-edge-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--overlay-blur-color, #060D1A));
}
.dg-edge-fade--top { top: 0; transform: rotate(180deg); }
.dg-edge-fade--bottom { bottom: 0; }

.dg-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  font-family: var(--fh, inherit);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  background: rgba(6, 13, 26, .5);
  border: 1px solid var(--line, rgba(148, 180, 220, .16));
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
}

body.dg-scroll-lock { overflow: hidden; }
