/* Галерея примеров перевода документов (/document-translate/examples/).
   Цвета и радиусы — переменные lp.css. */

.dg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 22px;
}

.dg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--lp-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--lp-text-soft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.dg-chip:hover {
  color: var(--lp-text);
  border-color: rgba(255, 255, 255, 0.32);
}

.dg-chip[aria-pressed="true"] {
  background: var(--lp-text);
  border-color: var(--lp-text);
  color: #04121a;
}

.dg-count {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.6;
}

.dg-status {
  color: var(--lp-text-muted);
  margin: 12px 0;
}

.dg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.dg-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-border);
  background: var(--lp-card);
  color: var(--lp-text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.dg-card:hover,
.dg-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(18, 214, 223, 0.6);
  outline: none;
}

.dg-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #fff;
  overflow: hidden;
}

.dg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.dg-type {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 18, 26, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dg-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.dg-name {
  font-size: 15px;
  font-weight: 620;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dg-meta {
  font-size: 13px;
  color: var(--lp-text-muted);
}

/* ---- Просмотр ---- */

.dg-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #0d1118;
}

.dg-viewer[hidden] {
  display: none;
}

.dg-vbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--lp-border);
  background: #101722;
}

.dg-vtitle {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dg-toggle {
  display: inline-flex;
  border: 1px solid var(--lp-border-strong);
  border-radius: 10px;
  overflow: hidden;
}

.dg-toggle button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  background: transparent;
  color: var(--lp-text-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.dg-toggle button[aria-pressed="true"] {
  background: var(--lp-text);
  color: #04121a;
}

.dg-zoom,
.dg-nav,
.dg-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 38px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--lp-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--lp-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.dg-btn:hover,
.dg-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.4);
}

.dg-zval {
  min-width: 64px;
  font-variant-numeric: tabular-nums;
}

.dg-btn-primary {
  border: 0;
  background: linear-gradient(135deg, #12d6df 0%, #2563eb 100%);
  color: #04121a;
}

.dg-btn-ask {
  background: #fff;
  border-color: #fff;
  color: #08111b;
}

.dg-vbody {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 48px;
  touch-action: pan-x pan-y pinch-zoom;
}

.dg-vinfo {
  max-width: 1100px;
  margin: 0 auto 14px;
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--lp-text-soft);
}

.dg-vinfo p {
  margin: 0;
}

.dg-hint {
  color: var(--lp-text-muted);
  font-size: 13px;
}

.dg-vpages {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.dg-zoomed .dg-vpages {
  max-width: none;
  margin: 0;
}

.dg-vpage {
  position: relative;
}

.dg-vpage img {
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}

.dg-pno {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(4, 18, 26, 0.75);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Подсказка про клавиши на сенсорном экране ни к чему. */
@media (hover: none) {
  .dg-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .dg-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .dg-vtitle {
    flex-basis: 100%;
  }
  .dg-zoom {
    display: none;
  }
  .dg-actions {
    order: 5;
    width: 100%;
  }
  .dg-actions .dg-btn {
    flex: 1 1 0;
  }
}
