/* ---------------------------------------------------------------
   Nesw.ru — SEO-Optimized Stylesheet
   Mobile-first // Core Web Vitals // Readability
   --------------------------------------------------------------- */

/* ── Custom Properties ────────────────────────────────────── */
:root {
  --c-brand:      #b91c1c;
  --c-brand-dark: #991b1b;
  --c-text:       #18181b;
  --c-text-2:     #52525b;
  --c-text-3:     #a1a1aa;
  --c-border:     #e4e4e7;
  --c-border-2:   #f4f4f5;
  --c-bg:         #ffffff;
  --c-bg-2:       #fafafa;
  --c-bg-3:       #f4f4f5;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Merriweather', 'Georgia', 'Times New Roman', serif;

  --max-w:    1120px;
  --max-w-sm: 720px;

  --radius-sm: 6px;
  --radius-md: 10px;

  --header-h: 56px;

  --transition: 0.15s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Focus visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}

/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px)  { .container { padding-inline: 24px; } }
@media (min-width: 1024px) { .container { padding-inline: 32px; } }

/* ---------------------------------------------------------------
   HEADER
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  height: var(--header-h);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: baseline;
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.03em;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo__mark {
  color: var(--c-brand);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ---------------------------------------------------------------
   PAGE SECTION & BREADCRUMB
   --------------------------------------------------------------- */
.page-section {
  padding-top: 24px;
  padding-bottom: 40px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--c-text);
}
@media (min-width: 640px)  { .page-title { font-size: 28px; } }
@media (min-width: 1024px) { .page-title { font-size: 32px; } }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { margin-bottom: 10px; }
.breadcrumb__list {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: var(--c-text-3);
}
.breadcrumb__list a {
  color: var(--c-text-2);
  transition: color var(--transition);
}
.breadcrumb__list a:hover { color: var(--c-brand); }
.breadcrumb__list li + li::before {
  content: '//';
  color: var(--c-text-3);
  margin: 0 8px 0 6px;
  font-size: 11px;
  letter-spacing: -0.05em;
}

/* ---------------------------------------------------------------
   CARDS
   --------------------------------------------------------------- */
.feed { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Card base */
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  color: var(--c-text);
  background: var(--c-bg);
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  border-color: #d4d4d8;
  transform: translateY(-1px);
}

/* Hero card */
.card--hero { flex-direction: column; }
@media (min-width: 768px) {
  .card--hero {
    flex-direction: row;
    align-items: stretch;
  }
  .card--hero .card__image {
    width: 55%;
    aspect-ratio: auto;
    min-height: 280px;
  }
  .card--hero .card__body {
    flex: 1;
    justify-content: center;
    padding: 24px 28px;
  }
  .card--hero .card__title { font-size: 22px; line-height: 1.3; }
}

/* Card image */
.card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-bg-3);
  position: relative;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card__image img { transform: scale(1.03); }

/* Card body */
.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.card__title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--c-text);
  transition: color var(--transition);
}
.card:hover .card__title { color: var(--c-brand); }
.card__desc {
  font-size: 14px;
  color: var(--c-text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card__date {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   BADGE
   --------------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  background: #f4f4f5;
  color: #52525b;
  align-self: flex-start;
  transition: background var(--transition);
}
.card:hover .badge { background: #fef2f2; color: var(--c-brand-dark); }

/* ---------------------------------------------------------------
   ARTICLE PAGE
   --------------------------------------------------------------- */
.article {
  max-width: var(--max-w-sm);
  margin-inline: auto;
  padding-bottom: 48px;
}

.article__hero {
  margin: 0 -16px;
  max-height: 480px;
  overflow: hidden;
  background: var(--c-bg-3);
}
@media (min-width: 640px) { .article__hero { margin: 0 -24px; } }
@media (min-width: 1024px) { .article__hero { margin: 0 -32px; } }
.article__hero-img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
}

.article__header {
  padding-top: 24px;
  padding-bottom: 16px;
}

.article__category-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-brand);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color var(--transition);
}
.article__category-link:hover { color: var(--c-brand-dark); }

.article__title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  color: var(--c-text);
}
@media (min-width: 640px)  { .article__title { font-size: 32px; } }
@media (min-width: 1024px) { .article__title { font-size: 38px; } }

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-3);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}
.article__sep {
  color: var(--c-text-3);
  font-size: 11px;
  letter-spacing: -0.05em;
  margin: 0 2px;
}

/* Article footer */
.article__footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}
.article__source {
  font-size: 13px;
  color: var(--c-text-3);
}
.article__source a {
  color: var(--c-brand);
  font-weight: 500;
  transition: color var(--transition);
}
.article__source a:hover { color: var(--c-brand-dark); text-decoration: underline; }
.article__source span { color: var(--c-text-3); }

/* ---------------------------------------------------------------
   PROSE (Article body)
   --------------------------------------------------------------- */
.prose {
  margin-top: 28px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.85;
  color: var(--c-text);
}
@media (min-width: 640px) { .prose { font-size: 18px; } }

.prose p { margin-bottom: 1.3em; }
.prose h2 {
  font-family: var(--font-sans);
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  margin: 2.2em 0 0.7em; line-height: 1.3;
  color: var(--c-text);
}
.prose h3 {
  font-family: var(--font-sans);
  font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
  margin: 1.8em 0 0.5em; line-height: 1.35;
  color: var(--c-text);
}
.prose a {
  color: var(--c-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-thickness var(--transition);
}
.prose a:hover { color: var(--c-brand-dark); text-decoration-thickness: 2px; }

.prose img {
  border-radius: var(--radius-sm);
  margin: 1.5em auto;
  max-width: 100%;
}
.prose figure {
  margin: 2em auto;
  max-width: 100%;
}
.prose figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--c-text-3);
  text-align: center;
  margin-top: 0.6em;
  line-height: 1.5;
}
.prose blockquote {
  border-left: 3px solid var(--c-brand);
  padding: 4px 0 4px 20px;
  font-style: italic;
  color: var(--c-text-2);
  margin: 1.8em 0;
}
.prose ul, .prose ol { margin-bottom: 1.2em; padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; }
.prose strong { font-weight: 700; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  font-family: var(--font-sans);
}
.prose th, .prose td {
  border: 1px solid var(--c-border);
  padding: 10px 14px;
  text-align: left;
}
.prose th {
  background: var(--c-bg-2);
  font-weight: 600;
  font-size: 14px;
  color: var(--c-text-2);
}
.prose iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
}

/* ---------------------------------------------------------------
   PAGINATION
   --------------------------------------------------------------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0 8px;
  flex-wrap: wrap;
}
.pager__btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: all var(--transition);
  background: var(--c-bg);
}
.pager__btn:hover { border-color: var(--c-brand); color: var(--c-brand); }
.pager__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager__list li { display: contents; }
.pager__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: all var(--transition);
  background: var(--c-bg);
}
.pager__num:hover { border-color: var(--c-brand); color: var(--c-brand); }
.pager__num--active {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
  font-weight: 600;
}

/* ---------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--c-border);
  padding: 16px 0;
  font-size: 13px;
  color: var(--c-text-3);
  background: var(--c-bg-2);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.site-footer__copy { font-weight: 500; color: var(--c-text-2); }
.site-footer a { color: var(--c-text-2); transition: color var(--transition); }
.site-footer a:hover { color: var(--c-brand); }
.site-footer__sep {
  margin: 0 6px;
  font-size: 11px;
  letter-spacing: -0.05em;
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .pager, .article__footer { display: none !important; }
  .article { max-width: 100%; }
  .prose { font-size: 12pt; line-height: 1.5; }
}