/* ── Grid Skald 3D model viewer ──
   Shared by index.html (featured gallery) and embed.php (partner embeds).
   Edit here only; both pages load this file. */

/* ── 3D MODEL VIEWER ── */
.model-stage {
  position: absolute; inset: 0; z-index: 4;
  background: radial-gradient(circle at 50% 40%, #1c101c 0%, #0a040a 75%);
  cursor: grab;
}
.model-stage[hidden] { display: none; }
.model-stage.grabbing { cursor: grabbing; }
.model-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.model-stage { overscroll-behavior: contain; }
.model-status {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--teal); text-align: center;
  padding: 1.5rem; pointer-events: none;
}
.model-status.error { color: var(--almond); opacity: 0.7; }
.model-hint {
  position: absolute; bottom: 0.75rem; left: 1rem; right: 3.4rem; z-index: 6;
  font-family: 'Cinzel', serif; font-size: 0.56rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #f4ece6; opacity: 0.92;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  pointer-events: none;
}
@media (max-width: 600px) {
  .model-hint {
    left: 0.7rem; right: 2.8rem; bottom: 0.6rem;
    font-size: 0.5rem; letter-spacing: 0.12em; line-height: 1.5;
  }
}
.model-exit {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 7;
  font-family: 'Cinzel', serif; font-size: 0.5rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--almond); cursor: pointer;
  background: rgba(15,5,15,0.8); border: 1px solid rgba(208,184,172,0.2);
  padding: 0.35rem 0.6rem; transition: color 0.2s, border-color 0.2s;
}
.model-exit:hover { color: var(--teal); border-color: rgba(127,198,164,0.6); }

/* Sets expectations about the model on screen: it is decimated to load over the
   web, so surface detail here is not what the printed files carry. Top-left,
   clear of the exit button and the level rail on the right. */
.model-note {
  position: absolute; top: 0.6rem; left: 0.6rem; right: 5.5rem; z-index: 6;
  font-family: 'Cinzel', serif; font-size: 0.5rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.6;
  color: #f4ece6; opacity: 0.75;
  background: rgba(15,5,15,0.72);
  border-left: 2px solid rgba(127,198,164,0.55);
  padding: 0.35rem 0.55rem;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
/* Fades back once you start handling the model, so it never fights the view. */
.model-stage.touched .model-note { opacity: 0.32; }
@media (max-width: 600px) {
  .model-note {
    top: 0.5rem; left: 0.5rem; right: 4.2rem;
    font-size: 0.45rem; letter-spacing: 0.1em; padding: 0.3rem 0.45rem;
  }
}

/* Vertical level slider */
.level-rail {
  overscroll-behavior: contain;
  position: absolute; top: 3rem; bottom: 2.5rem; right: 0.85rem; z-index: 6;
  width: 34px; padding: 16px 0; display: flex; flex-direction: column;
  background: rgba(15,5,15,0.72); border: 1px solid rgba(208,184,172,0.16);
  touch-action: none; user-select: none; cursor: pointer;
}
/* touch-action is not inherited, and Android hit-tests the child the finger
   actually lands on -- the thumb or the track. Every descendant needs it too. */
.level-rail, .level-rail * {
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.level-rail:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.level-slider { flex: 1 1 auto; position: relative; }
.level-track {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px;
  background: rgba(208,184,172,0.22); transform: translateX(-50%);
}
.level-fill {
  position: absolute; left: 50%; bottom: 0; width: 3px; height: 100%;
  background: var(--teal); transform: translateX(-50%);
  transition: height 0.15s ease;
}
.level-thumb {
  position: absolute; left: 50%; bottom: 100%;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--coffee-mid); border: 2px solid var(--teal);
  box-shadow: 0 0 0 3px rgba(15,5,15,0.65);
  transform: translate(-50%, 50%);
  transition: bottom 0.15s ease, border-color 0.2s;
}
/* Only the rail is hit-tested. If a finger lands on the thumb or the track,
   Android evaluates that child's touch-action, not the rail's. */
.level-slider, .level-track, .level-fill, .level-thumb {
  pointer-events: none;
}
.level-rail.dragging .level-thumb,
.level-rail.dragging .level-fill { transition: none; }
.level-rail.dragging .level-thumb { border-color: var(--scarlet); }
.level-tick {
  position: absolute; left: 50%; bottom: 0;
  width: 13px; height: 1px; background: rgba(208,184,172,0.3);
  transform: translate(-50%, 50%); pointer-events: none;
  transition: background 0.2s, width 0.2s;
}
.level-tick.on { background: var(--teal); width: 17px; }
@media (max-width: 600px) {
  .level-rail { width: 30px; right: 0.5rem; top: 2.6rem; }
  .level-tick { width: 11px; }
  .level-tick.on { width: 15px; }
}

.thumb.thumb-3d {
  background: rgba(127,198,164,0.1) !important;
  border-color: rgba(127,198,164,0.45); opacity: 1;
}
.thumb.thumb-3d { display: grid; place-items: center; }
.thumb.thumb-3d svg {
  width: 78%; height: 78%;
  fill: none; stroke: var(--brand-3d, #7FC6A4); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s ease;
}
.thumb.thumb-3d:hover svg, .thumb.thumb-3d.active svg { transform: scale(1.08); }
.thumb.thumb-3d:hover, .thumb.thumb-3d.active { background: rgba(127,198,164,0.2) !important; }


/* "View in 3D" call to action over the featured photo */
.view-3d-cta {
  position: absolute; bottom: 0.9rem; left: 50%; transform: translateX(-50%);
  z-index: 5; cursor: pointer;
  font-family: 'Cinzel', serif; font-size: 0.58rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #f0e4dc;
  background: rgba(15,5,15,0.82); border: 1px solid rgba(127,198,164,0.55);
  padding: 0.6rem 1.4rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.view-3d-cta:hover { background: rgba(127,198,164,0.18); color: #7fc6a4; border-color: #7fc6a4; }
.view-3d-cta:focus-visible { outline: 2px solid #7fc6a4; outline-offset: 2px; }
@media (max-width: 600px) {
  .view-3d-cta { font-size: 0.52rem; padding: 0.5rem 1rem; bottom: 0.6rem; }
}
