/* reefhub print files: download grid + a modal 3D viewer. Loaded after site.css and manual.css. */

/* part grid */
.content ul.parts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.content ul.parts > li { margin: 0; padding: 0; position: relative; border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, background-color .15s; }
.content ul.parts:not(.steps):not(.cards) > li::before { content: none; }
.parts li:hover { border-color: rgba(230,0,126,.7); background: rgba(255,255,255,.02); }
.parts .view { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; width: 100%; height: 100%; padding: 12px 14px 44px; cursor: default; border-radius: 14px; }
html.has-viewer .parts .view { cursor: pointer; }
.parts .view:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.parts img { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 8px; }
.parts .name { color: var(--fg); font-weight: 600; font-size: 15px; line-height: 1.3; }
.parts .meta { font: 400 11px/1.4 var(--mono); color: var(--muted); }
.parts .fits { margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--text); }
.content .parts a.get { position: absolute; left: 14px; bottom: 12px; font: 400 12px/1 var(--mono); color: var(--muted); border-bottom: 0; padding: 4px 0; }
.content .parts a.get:hover, .content .parts a.get:focus-visible { color: var(--pink); }

/* modal viewer */
html.modal-open { overflow: hidden; }
dialog.viewer { width: min(920px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; margin: auto;
  background: #16171b; color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden;
  display: none; flex-direction: column; }
dialog.viewer[open] { display: flex; }
dialog.viewer::backdrop { background: rgba(8,9,11,.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.stage { position: relative; flex: 1 1 auto; height: min(62vh, 600px); min-height: 260px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.07), rgba(255,255,255,0) 70%); }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.v-status { position: absolute; left: 16px; top: 16px; font: 400 12px/1.4 var(--mono); color: var(--pink); }
.v-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 400 11px/1.4 var(--mono); color: var(--muted); pointer-events: none; }
.v-close { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%;
  background: rgba(18,19,22,.7); color: var(--fg); font: 400 22px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.v-close:hover, .v-close:focus-visible { border-color: var(--pink); color: var(--pink); outline: none; }
dialog.loading canvas { opacity: .35; transition: opacity .2s; }
.v-info { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 18px 16px; border-top: 1px solid var(--line); overflow: auto; }
.v-info p { margin: 0; line-height: 1.4; }
.v-name { color: var(--fg); font-weight: 600; }
.v-meta { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.v-info .v-fits { margin-top: 6px; font-size: 13px; line-height: 1.5; max-width: 46em; }
.v-fits[hidden], .v-actions a[hidden] { display: none; }
.v-actions { display: flex; gap: 10px; }
.v-actions a { font: 400 13px/1 var(--mono); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--fg); text-decoration: none; }
.v-actions a.v-download { border-color: rgba(230,0,126,.7); }
.v-actions a:hover, .v-actions a:focus-visible { border-color: var(--pink); background: rgba(230,0,126,.12); }
