/* ============================================================================
   РАЗДЕЛ «ПРИМЕРЫ»: КАРТОЧКА-«СТОПКА» СБОРКИ И ПРОСМОТРЩИК КОМПЛЕКТА
   SITE.GALLERY-KITS (26.09.2026). Карточки деталей — прежние (.gcard в site.css); здесь только
   сборка: обложка — главный сборочный чертёж, за ней два смещённых края листов, полоска
   мини-превью остальных листов и диалог #kit-viewer. Токены темы — из начала site.css.
   ========================================================================== */
:root {
  --kit-sheet-1: #e8ecf2;           /* край второго листа стопки */
  --kit-sheet-2: #d6dce6;           /* край третьего листа */
  --kit-edge: rgba(8, 14, 26, .55); /* тонкая кромка листа */
}
html[data-theme="light"] {
  --kit-sheet-1: #f4f6fa;
  --kit-sheet-2: #e6eaf1;
  --kit-edge: rgba(15, 25, 45, .30);
}

/* Лист карточки — <img class="sheet">, и на него же попадало правило страницы задачи `.sheet`
   (site.css: padding-bottom 40px, margin-bottom 48px, border-bottom): под листом каждой карточки
   была тёмная полоса с линией, а края «стопки» уходили ниже обложки. Сброс — только в разделе. */
.gcard-media img.sheet { display: block; margin: 0; padding: 0; border: 0; }

/* обложка: лист с двумя смещёнными краями под ним (тени box-shadow — без лишних элементов) */
.gcard-kit .kit-stack { color: inherit; text-decoration: none; padding-top: clamp(22px, 3vw, 36px); padding-right: clamp(22px, 3vw, 36px); }
.gcard-kit .kit-stack:hover { text-decoration: none; color: inherit; }
.gcard-kit .kit-stack .sheet {
  box-shadow:
    7px -7px 0 -1px var(--kit-sheet-1), 7px -7px 0 0 var(--kit-edge),
    14px -14px 0 -2px var(--kit-sheet-2), 14px -14px 0 -1px var(--kit-edge),
    var(--paper-shadow);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.gcard-kit:hover .kit-stack .sheet, .gcard-kit .kit-stack:focus-visible .sheet {
  transform: translate(-3px, 3px);
  box-shadow:
    10px -10px 0 -1px var(--kit-sheet-1), 10px -10px 0 0 var(--kit-edge),
    20px -20px 0 -2px var(--kit-sheet-2), 20px -20px 0 -1px var(--kit-edge),
    var(--paper-shadow);
}
.gcard-kit .kit-badge { color: var(--accent-ink); border-color: var(--accent); }

/* полоска мини-превью под обложкой: 5 листов и «+K» */
.kit-strip { list-style: none; margin: 0; padding: 12px clamp(14px, 2.5vw, 22px) 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.kit-strip li { min-width: 0; }
.kit-strip button { display: block; width: 100%; aspect-ratio: 1.414; padding: 3px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); cursor: pointer; transition: border-color .2s, transform .2s; }
.kit-strip button:hover, .kit-strip button:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.kit-strip img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--paper); border-radius: 2px; }
.kit-more button { font: inherit; font-family: var(--font-mono); font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.kit-more button:hover { color: var(--ink); }

/* ---- просмотрщик комплекта ---- */
dialog.kitv { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100vh; max-height: 100dvh; background: rgba(6, 8, 12, .98); color: #eef1f6; overflow: hidden; }
.kitv-stage:focus { outline: none; }
dialog.kitv[open] { display: flex; flex-direction: column; }
dialog.kitv::backdrop { background: rgba(6, 8, 12, .85); }
html:has(dialog.kitv[open]) { overflow: hidden; }
.kitv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px 8px; flex: none; min-width: 0; }
.kitv-title { margin-right: auto; display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; min-width: 0; }
.kitv-name, .kitv-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kitv-title small { font-family: var(--font-mono); font-size: .74rem; color: #a7b0bf; font-weight: 400; letter-spacing: .04em; }
.kitv-count { font-family: var(--font-mono); font-size: .85rem; color: #dfe5ee; min-width: 64px; text-align: center; white-space: nowrap; }
.kitv-bar button, .kitv-orig, .kitv-tabs button { font: inherit; font-family: var(--font-mono); font-size: .8rem; line-height: 1.2; color: #eef1f6; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 7px 11px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.kitv-bar button:hover, .kitv-orig:hover, .kitv-tabs button:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.kitv-tabs { display: flex; gap: 6px; padding: 0 14px 8px; overflow-x: auto; flex: none; scrollbar-width: none; }
.kitv-tabs::-webkit-scrollbar { display: none; }
.kitv-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.kitv-main { position: relative; flex: 1; min-height: 0; }
.kitv-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6px 70px; overflow: hidden; touch-action: pan-y; }
.kitv-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 2px; box-shadow: 0 40px 100px rgba(0, 0, 0, .6); cursor: zoom-in; user-select: none; -webkit-user-drag: none; transition: opacity .25s; }
.kitv-stage.is-zoomed { display: block; overflow: auto; padding: 0; touch-action: auto; }
.kitv-stage.is-zoomed img { max-width: none; max-height: none; cursor: zoom-out; box-shadow: none; }
.kitv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(6, 8, 12, .6); color: #fff; cursor: pointer; display: grid; place-items: center; }
.kitv-nav:hover { background: rgba(255, 255, 255, .15); }
.kitv-nav[hidden] { display: none; }
.kitv-nav svg { width: 20px; height: 20px; }
.kitv-prev { left: 12px; } .kitv-next { right: 12px; }
.kitv-caption { margin: 0; padding: 8px 14px 4px; text-align: center; font-family: var(--font-mono); font-size: .8rem; color: #dfe5ee; flex: none; overflow-wrap: anywhere; }
.kitv-ribbon { list-style: none; margin: 0; padding: 6px 14px 10px; display: flex; gap: 8px; overflow-x: auto; flex: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.kitv-ribbon li { flex: none; scroll-snap-align: center; }
.kitv-ribbon button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; padding: 4px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 6px; background: rgba(255, 255, 255, .04); color: #a7b0bf; cursor: pointer; font: inherit; font-family: var(--font-mono); font-size: .66rem; line-height: 1.2; }
.kitv-ribbon button:hover { border-color: rgba(255, 255, 255, .35); color: #eef1f6; }
.kitv-ribbon button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: #fff; }
.kitv-ribbon img { display: block; width: 100%; height: 60px; object-fit: contain; background: #fff; border-radius: 2px; }
.kitv-ribbon span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kitv-hint { flex: none; text-align: center; font-family: var(--font-mono); font-size: .7rem; color: #7d8697; letter-spacing: .06em; padding: 0 14px 10px; }

@media (max-width: 600px) {
  .kit-strip { gap: 6px; }
  .kitv-bar { padding: 8px 10px 6px; gap: 6px; }
  .kitv-orig { display: none; }
  .kitv-tabs { padding: 0 10px 6px; }
  .kitv-stage { padding: 4px 8px; }
  .kitv-nav, .kitv-hint { display: none; }
  .kitv-ribbon { padding: 6px 10px 12px; }
  .kitv-ribbon button { width: 70px; }
  .kitv-ribbon img { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .gcard-kit .kit-stack .sheet, .kit-strip button, .kitv-stage img { transition: none; }
}
@media print {
  .kit-strip, dialog.kitv { display: none !important; }
}
