/*! CubifyIt Roads. Copyright (c) 2026 Cubify It Studio. All rights reserved.
No permission is granted to copy, modify or redistribute this code. See LICENSE. */
/* ---------- 3D model ---------- */

.model {
  display: flex;
  border-left: 1px solid var(--line);
}

.view3d-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0; /* never taller than its column, or the zoom bar at its bottom is cut off */
  background: var(--field);
}
/* The 3D canvas leaves a strip on the right for the zoom buttons, so they never cover the model */
.view3d { position: absolute; inset: 0; } /* the whole view: the zoom bar floats over its bottom right corner, as on the map */
.view3d canvas { display: block; cursor: grab; }
.view3d-wrap:focus { outline: none; } /* focusable for the + / − keys; no ring around the whole view */
.view3d canvas:active { cursor: grabbing; }
.zoom3d {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: row;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border-radius: var(--ctl-r);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.zoom3d button { width: var(--zoom-btn); height: var(--zoom-btn); padding: 0; border-radius: calc(var(--ctl-r) - 3px); background: transparent; font-size: 16px; }
.zoom3d button:hover { background: var(--field); }
.zoom3d #zoom-fit { display: grid; place-items: center; }
/* The 3D view over the whole browser window */
/* Over the whole screen; its buttons and size lines clear of a notch (the bottom: --actions-bottom) */
.model.full-screen { position: fixed; inset: 0; z-index: 5000; border: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); box-sizing: border-box; }
/* The exploded view: filled while on */
.zoom3d #explode-toggle { display: grid; place-items: center; color: var(--muted); }
.zoom3d #explode-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* Full screen: the two as separate buttons as tall as Back and Download, in the same outlined style, on their row */
.model.full-screen .zoom3d { bottom: var(--actions-bottom); right: var(--panel-w); gap: 8px; padding: 0; background: none; box-shadow: none; } /* left of Back */
.model.full-screen .zoom3d button { width: var(--ctl-h); height: var(--ctl-h); border: 1px solid var(--ink); border-radius: var(--ctl-r); background: var(--surface); color: var(--ink); }
.model.full-screen .zoom3d button:hover { background: var(--field); }
.model.full-screen .zoom3d #explode-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; }
.model.full-screen .zoom3d svg { width: 22px; height: 22px; }

.status {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 76px);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  color: var(--muted);
  font-size: 12px;
}
.status.error { background: #fbeeec; color: var(--danger); }

/* When the model first appears, a pill at the bottom left says how to turn, zoom and move it: only what the user hasn't
   done yet (js/view3d.js). It fades out after a few seconds. Holding Shift over the model shows the move cursor */
.pan-hint {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 14px;
  max-width: calc(100% - 150px);
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
}
.pan-hint.show { opacity: 1; transform: none; }
.status:not([hidden]) ~ .pan-hint { opacity: 0; } /* a message takes its place */
.model.full-screen .pan-hint, .model.full-screen .model-hint { display: none; } /* full screen keeps its view clear of hints */
/* Each instruction stays whole; on a narrow view the second goes on its own line */
.pan-hint span { white-space: nowrap; }
.pan-hint span + span::before { content: '· '; opacity: .6; }
.view3d-wrap.shift-pan canvas, .view3d-wrap.shift-pan canvas:active { cursor: move; }

/* The product's size on the model (js/dims.js): a small label on the middle of each dimension line, interrupting it */
.dim-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  pointer-events: none;
}
/* The height reads upward along its line, so it takes little room beside the model (as on the map's frame) */
.dim-label.dim-upright { padding: 6px 1px; writing-mode: vertical-rl; }

/* The copyright line: small, centered along the bottom of the view below the model (it doesn't take room from it);
   in full screen larger, at the left of the row of buttons */
.legal {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
/* The count of maps made, before the copyright (js/made.js), spaced like the words after it */
.legal .made::after { content: ' '; } /* one space, as between the copyright's own words */
.pan-hint.show ~ .legal { opacity: 0; } /* the how-to, while it shows, has the bottom to itself */
.legal { transition: opacity .25s; }
.model.full-screen .legal { left: calc(var(--panel-pad) + env(safe-area-inset-left)); bottom: var(--actions-bottom); transform: none; font-size: 12px; line-height: var(--ctl-h); opacity: 1; }
