/* Раздел «Презентации» в библиотеке знаний: сетка колод.
   Просмотрщик живёт на deck.html и оформлен в deck.css. */

.kb-decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  padding: 4px 0 12px;
}

.kb-deck-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--color-bg-card, #fff);
  overflow: hidden;
}

.kb-deck-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-hover, #f1f5f9);
  overflow: hidden;
}
.kb-deck-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-deck-cover-fallback { font-size: 34px; opacity: .5; }

.kb-deck-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .6);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.kb-deck-meta { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 3px; }
.kb-deck-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.kb-deck-sub { font-size: 12px; color: var(--color-text-secondary, #64748b); }

.kb-deck-progress {
  position: relative;
  height: 16px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--color-bg-hover, #f1f5f9);
  overflow: hidden;
}
.kb-deck-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary-soft-bg, rgba(109, 40, 217, .18));
}
.kb-deck-progress span {
  position: relative;
  display: block;
  line-height: 16px;
  text-align: center;
  font-size: 10px;
  color: var(--color-text-secondary, #64748b);
}

.kb-deck-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity .12s ease;
}
.kb-deck-card:hover .kb-deck-actions, .kb-deck-card:focus-within .kb-deck-actions { opacity: 1; }
.kb-deck-actions button, .kb-deck-action {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: rgba(15, 23, 42, .6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

/* Кнопки-действия всегда видны на тач-устройстве: наводить там нечем. */
@media (hover: none) {
  .kb-deck-actions { opacity: 1; }
}

.kb-deck-uploads { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.kb-deck-upload {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--color-bg-hover, #f1f5f9);
  font-size: 12px;
  overflow: hidden;
}
.kb-deck-upload i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary-soft-bg, rgba(109, 40, 217, .18));
  transition: width .2s ease;
}
.kb-deck-upload span { position: relative; }
.kb-deck-upload.is-error { color: var(--color-danger, #f5576c); }
