/* Стили только для страницы списка статей (/stati). Хедер/футер — из site-chrome.css,
   как и на страницах статей (см. article.css) — здесь не дублируются. */

:root {
  --color-brand-dark: #0b6349;
  --color-brand: #0e7c5a;
  --color-brand-soft: #e7f5ef;
  --color-ink: #1a1d23;
  --color-muted: #6b7280;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Nunito", sans-serif;
  color: var(--color-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.stati { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

.stati {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.stati__breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}
.stati__breadcrumbs a { color: var(--color-muted); text-decoration: none; }
.stati__breadcrumbs a:hover { color: var(--color-brand-dark); text-decoration: underline; }

.stati h1 {
  font-family: "Unbounded", sans-serif;
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 1.5rem;
}

.stati__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.stati__filter {
  font: inherit;
  cursor: pointer;
  background: #fff;
  border: 1px solid #e2e5ea;
  color: var(--color-ink);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.stati__filter:hover { border-color: var(--color-brand); }
.stati__filter.is-active {
  background: var(--color-brand-dark);
  border-color: var(--color-brand-dark);
  color: #fff;
}

.stati__grid {
  display: grid;
  /* Верхняя граница трека (не 1fr) — иначе один-два элемента в первом ряду растягивают
     свою колонку на всю ширину контейнера и картинка выглядит потерянной в пустоте. */
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  justify-content: start;
  gap: 2.5rem 2rem;
}

.stati__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.stati__thumb {
  /* На 15% меньше полной ширины колонки (была 100%) — по прямому запросу пользователя. */
  width: 85%;
  aspect-ratio: 1 / 1;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 40, 30, 0.1);
  transition: transform 0.15s;
}
/* Картинка — во всю рамку край-в-край: у обложек уже есть свой прямоугольный фон
   (встроен при генерации), поэтому рамка со своим фоном + отступ давали "два фона"
   друг на друге. Без отступа и без фона .stati__thumb — фон картинки и есть фон рамки. */
.stati__thumb img { width: 100%; height: 100%; object-fit: cover; }
.stati__thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-brand-soft);
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--color-brand-dark);
}

/* Скруглённый прямоугольник вместо органичной кляксы — с обложками-иллюстрациями
   (свой прямоугольный фон) он не создаёт стыков/срезов, только небольшой наклон
   через раз для разнообразия. */
.stati__thumb--shape-0 { border-radius: 28px; }
.stati__thumb--shape-1 { border-radius: 28px; transform: rotate(-2deg); }
.stati__thumb--shape-2 { border-radius: 28px; transform: rotate(2deg); }
.stati__card:hover .stati__thumb--shape-0 { transform: scale(1.03); }
.stati__card:hover .stati__thumb--shape-1 { transform: scale(1.03) rotate(-2deg); }
.stati__card:hover .stati__thumb--shape-2 { transform: scale(1.03) rotate(2deg); }

.stati__card-title {
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.35;
}
.stati__card:hover .stati__card-title { color: var(--color-brand-dark); }

.stati__more {
  display: block;
  margin: 3rem auto 0;
  font: inherit;
  cursor: pointer;
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
  border: none;
  font-weight: 700;
  padding: 0.7rem 1.75rem;
  border-radius: 999px;
  transition: background 0.15s;
}
.stati__more:hover { background: #d7ece2; }

.stati__top-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-brand-dark);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 50;
}
.stati__top-btn:hover { background: var(--color-brand); }

@media (max-width: 640px) {
  .stati { padding: 1.5rem 1.25rem 3rem; }
  .stati h1 { font-size: 1.5rem; }
  .stati__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1.75rem 1rem; }
}
