/* Страницы статей lestvitsa.life/articles.
   Базовое (шрифт NT Somic, цветовые токены --bg/--ink/--gold…, шапка с меню «Скачать»,
   значки магазинов, подвал, тёмная тема) подключается из style.css лендинга —
   здесь только то, чего на лендинге нет. Цвета берём только из токенов лендинга,
   тогда тёмная тема работает без отдельных правил. */

.site-body {
  background: var(--bg);
}

/* ── Раскладка ── */
.site-main {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 36px var(--gutter) 80px;
  flex: 1;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: '›';
  margin-right: 6px;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--gold-text);
}

.page-title {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.page-lead {
  max-width: 640px;
  margin-bottom: 30px;
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--muted);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.category-tabs a {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.category-tabs a:hover {
  color: var(--gold-text);
}

.category-tabs a.is-active {
  background: var(--button-bg);
  color: var(--button-fg);
  font-weight: 600;
}

/* ── Карточки ── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}

.article-card {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .article-card:hover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.article-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.article-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-soft);
}

.article-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article-card-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.article-meta > * + *::before {
  content: '·';
  margin-right: 6px;
}

.article-meta > :first-child {
  color: var(--gold-text);
  font-weight: 600;
}

.article-meta a {
  text-decoration: none;
}

.article-meta a:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 48px 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 44px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}

.pagination a:hover {
  background: var(--surface-soft);
}

.pagination .is-current {
  background: var(--button-bg);
  color: var(--button-fg);
  font-weight: 600;
}

/* ── Статья ── */
.article-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 36px var(--gutter) 64px;
  flex: 1;
}

.article-header {
  margin-bottom: 32px;
}

.article-title {
  margin: 14px 0 18px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.article-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--muted);
}

.article-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.article-tags li {
  padding: 6px 13px;
  border: 1px solid var(--tile-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.article-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 40px;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

/* Длинный текст набран антиквой: гротеск хорош в заголовках, но в абзацах читать тяжелее */
.article-body {
  font-family: Georgia, 'PT Serif', 'Times New Roman', serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.article-body h2 {
  margin: 44px 0 14px;
  font-family: 'NT Somic', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.article-body p {
  margin-bottom: 20px;
  white-space: pre-line;
}

.article-body figure {
  margin: 32px 0;
}

.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.article-body hr {
  margin: 40px 0;
  border: none;
  text-align: center;
  color: var(--gold);
}

.article-body hr::after {
  content: '· · ·';
  letter-spacing: 0.4em;
  font-size: 1.4rem;
}

/* ── Блок приложения ── */
.app-cta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px 22px;
  margin-top: 64px;
  padding: 32px;
  border-radius: 28px;
  background: #131313;
  color: #EDEBE8;
}

html[data-theme="dark"] .app-cta {
  background: #0F0F0F;
  box-shadow: inset 0 0 0 1px #262626;
}

.app-cta-icon {
  align-self: start;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
}

.app-cta-title {
  margin-bottom: 6px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #FFFFFF;
}

.app-cta-text p:not(.app-cta-title) {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #A8A8A8;
}

.app-cta-badges {
  grid-column: 1 / -1;
}

.app-cta-badges .store-badge img {
  height: 50px;
}

.related {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
}

.related-title {
  margin-bottom: 24px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* ── Ошибки ── */
.error-page {
  padding-top: 72px;
  text-align: center;
}

.error-page .page-lead {
  margin-left: auto;
  margin-right: auto;
}

.error-code {
  margin-bottom: 16px;
  font-size: 4.5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--gold);
}

/* ── Адаптив ── */
@media (max-width: 640px) {
  .site-main {
    padding-top: 24px;
    padding-bottom: 56px;
  }

  .related {
    padding-bottom: 56px;
  }

  .article-page {
    padding-top: 24px;
    padding-bottom: 48px;
  }

  .article-body {
    font-size: 1.0625rem;
  }

  .article-cover {
    margin-bottom: 28px;
    border-radius: 18px;
  }

  .app-cta {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .app-cta-badges .store-badge img {
    height: 46px;
  }
}
