/* Плитки вложений и ссылок */

/* Контейнер плиток */
.tiles {
  --tile-w: 172px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

/* Базовая плитка */
.tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: var(--tile-w);
  height: 72px;
  padding: 0 11px;
  border-radius: 12px;
  border: 1px solid rgba(var(--warm-rgb), .18);
  background: var(--glass);
  /* Плитка — элемент интерфейса, поэтому системный шрифт, как у композера */
  font-family: var(--font-ui-plain);
  color: inherit;
  text-decoration: none;
  transition: border-color .35s ease, box-shadow .35s ease;
}

.tile:hover {
  border-color: rgba(var(--amber-rgb), .35);
  box-shadow: var(--glow-soft);
}

/* Кнопка-обёртка: обнуляет вид кнопки внутри плитки */
.tile-open {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tile-open:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}

/* Иконка файла/ссылки */
.tile-ico {
  position: relative;
  display: inline-flex;
  flex: none;
  color: var(--ink-soft);
  transition: color .35s ease;
}

.tile:hover .tile-ico {
  color: var(--amber);
}

.tile-ico svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Подпись типа файла на иконке */
.tile-badge {
  position: absolute;
  bottom: -3px;
  right: -6px;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--glass);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

/* Текстовый блок */
.tile-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.tile-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
}

/* .tile-src .tile-name — тот же вид, что и .tile-name выше */

.tile-meta {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--ink-faint);
}

/* Фото-плитка: превью на всю высоту */
.tile-photo {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.tile-photo .tile-open {
  padding: 0;
  height: 100%;
}

.tile-photo img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* Кнопка скачать — всегда в правом нижнем углу плитки */
.tile-dl {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(var(--dark-rgb), .72);
  color: var(--ctl-ink);
  text-decoration: none;
  transition: background .35s ease, box-shadow .35s ease;
}

.tile-dl:hover {
  background: var(--dark-hi);
  box-shadow: var(--glow-ring), var(--glow-halo);
}

.tile-dl:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}

.tile-dl svg {
  display: block;
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Текстовой плитке нужен отступ справа под кнопку скачать */
.tile-file {
  padding-right: 34px;
}
