/* Каталог моделей /models (макет Models.dc.html). Только токены кита --st-*: в тёмной теме страница меняется сама. */

.models-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 64px;
}

.models-page h2 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--st-color-foreground);
}

/* Заголовок и счётчик */
.models-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.models-head-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.models-head-text p {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--st-color-muted-foreground);
}

/* margin: 0 — у прежнего правила .models-count в style.css есть отступ сверху */
.models-count {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--st-color-muted);
  color: var(--st-color-muted-foreground);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

/* Карточки: на узком экране — одна колонка */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 16px;
}

.models-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  background: var(--st-color-card);
  color: var(--st-color-card-foreground);
  border: 1px solid var(--st-color-border);
  border-radius: var(--st-radius-xl);
}

.models-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.models-card-head h2 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.models-card-icon,
.models-empty-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
}

.models-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--st-radius-lg);
  background: var(--st-color-accent);
  color: var(--st-color-accent-foreground);
}

.models-card > p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--st-color-muted-foreground);
}

.models-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.models-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--st-color-border);
}

.models-card-foot code {
  min-width: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--st-color-muted-foreground);
}

.models-more {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--st-radius-lg);
  background: var(--st-color-primary);
  color: var(--st-color-primary-foreground);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--st-duration-fast) ease;
}

.models-more:hover {
  background: var(--st-color-primary-hover);
}

/* Пустой каталог */
.models-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
  background: var(--st-color-card);
  color: var(--st-color-card-foreground);
  border: 1px dashed var(--st-color-input);
  border-radius: var(--st-radius-xl);
}

.models-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--st-radius-xl);
  background: var(--st-color-muted);
  color: var(--st-color-muted-foreground);
}

.models-page .models-empty h2 {
  font-size: 17px;
}

.models-empty p {
  max-width: 420px;
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--st-color-muted-foreground);
}

/* Заявка и документация */
.models-help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-top: 8px;
}

.models-help-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
}

.models-help-card p {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--st-color-muted-foreground);
}

.models-help-card a {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 500;
  color: var(--st-color-link);
  text-decoration: none;
}

.models-help-card a:hover {
  color: var(--st-color-primary-hover);
}

.models-more:focus-visible,
.models-help-card a:focus-visible {
  outline: 2px solid var(--st-color-ring);
  outline-offset: 2px;
}
