/* ===================================================
   НовыйДом — Shared Styles v2
   Чистый, минималистичный, блог-ориентированный
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Merriweather:wght@400;700&display=swap');

:root {
  --primary: #0f2744;
  --primary-hover: #1a3a60;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-hover: #1d4ed8;
  --warm: #ea580c;
  --warm-light: #fff7ed;

  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f2744;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;

  --container: 1200px;
  --sidebar: 340px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── CONTAINER ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── HEADER ─── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg { width: 20px; height: 20px; }

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.logo-text span { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--primary); background: var(--bg-alt); }
.site-nav a.active { color: var(--primary); font-weight: 600; }

.site-nav a.soon {
  color: var(--text-secondary);
  font-size: 14px;
}

.site-nav a.soon::after {
  content: '';
  font-size: 9px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-search {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}

.btn-search:hover { background: var(--bg-alt); color: var(--primary); }

.btn-subscribe {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.btn-subscribe:hover { background: var(--primary-hover); }

/* ─── NAV DROPDOWN ─── */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
/* bridge: keeps menu open when crossing the 6px gap */
.nav-dropdown:hover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 199;
}

.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown > a::after {
  content: '▾';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .2s;
}

.nav-dropdown:hover > a::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: background .12s, color .12s;
}

.nav-dropdown-menu a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-dropdown-menu a .dm-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}

.nav-dropdown-menu .dm-all {
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}

/* footer calc links */
.footer-links a { display: block; padding: 3px 0; }

/* ─── BREADCRUMB ─── */
.breadcrumb {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text-secondary); }

/* ─── ARTICLE CARD ─── */
.article-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.article-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-alt);
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.article-card:hover .article-card__image img { transform: scale(1.03); }

.article-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
}

.tag.orange { background: var(--warm-light); color: var(--warm); }
.tag.green { background: #f0fdf4; color: #16a34a; }
.tag.purple { background: #faf5ff; color: #7c3aed; }
.tag.gray { background: var(--bg-alt); color: var(--text-secondary); }

.article-card__date {
  font-size: 12px;
  color: var(--text-muted);
}

.article-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  transition: color .15s;
}

.article-card:hover .article-card__title { color: var(--accent); }

.article-card__excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

.article-card__readmore {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── ARTICLE CARD HORIZONTAL ─── */
.article-card-h {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.article-card-h:last-child { border-bottom: none; }

.article-card-h__image {
  width: 100px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
}

.article-card-h__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-h__body { flex: 1; min-width: 0; }

.article-card-h__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  transition: color .15s;
}

.article-card-h__title:hover { color: var(--accent); }

.article-card-h__meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

/* ─── SECTION TITLE ─── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}

.section-header.no-border { border-bottom: none; padding-bottom: 0; }

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.section-title-sm {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover { color: var(--accent-hover); }

/* ─── GRID ─── */
.articles-grid {
  display: grid;
  gap: 20px;
}

.articles-grid-3 { grid-template-columns: repeat(3, 1fr); }
.articles-grid-2 { grid-template-columns: repeat(2, 1fr); }
.articles-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── SIDEBAR ─── */
.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  gap: 40px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-self: start;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-block {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.sidebar-block__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* ─── CATEGORIES BLOCK ─── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: box-shadow .2s, border-color .2s;
  cursor: pointer;
}

.category-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.category-card__icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.category-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.category-card__count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}

.pagination a, .pagination span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.pagination a {
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.pagination a:hover { background: var(--bg-alt); color: var(--primary); }

.pagination .current {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.pagination .dots { color: var(--text-muted); }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.8);
  margin-top: 80px;
}

.footer-top {
  padding: 48px 0 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.footer-logo span { color: var(--accent); }

.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.55);
  margin-bottom: 20px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  transition: color .15s;
}

.footer-links a:hover { color: #fff; }

.footer-disclaimer {
  padding: 20px 0;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(255,255,255,.3);
  border-top: 1px solid rgba(255,255,255,.06);
}

.footer-bottom {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ─── HERO ─── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
  color: #fff;
  padding: 56px 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 12px;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero__excerpt {
  font-size: 16px;
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

.hero__read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  transition: background .15s;
}

.hero__read-btn:hover { background: #eff6ff; }

.hero__image {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: rgba(255,255,255,.1);
}

.hero__image img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }

/* ─── SECTION SPACER ─── */
.section { padding: 48px 0; }
.section + .section { padding-top: 0; }

/* ─── FEATURED ARTICLE (wide card) ─── */
.article-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.article-featured__image {
  aspect-ratio: auto;
  min-height: 280px;
  background: var(--bg-alt);
  overflow: hidden;
}

.article-featured__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-featured__body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.article-featured__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  transition: color .15s;
}

.article-featured:hover .article-featured__title { color: var(--accent); }

.article-featured__excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.article-featured__read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* ─── COMING SOON BLOCK ─── */
.coming-soon-block {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  text-align: center;
}

.coming-soon-block__icon { font-size: 48px; margin-bottom: 16px; }
.coming-soon-block__title { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.coming-soon-block__text { font-size: 15px; color: var(--text-secondary); max-width: 480px; margin: 0 auto 24px; line-height: 1.7; }

.subscribe-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color .15s;
}

.subscribe-form input:focus { border-color: var(--accent); }

.subscribe-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.subscribe-form button:hover { background: var(--primary-hover); }

/* ─── ARTICLE BODY (typography) ─── */
.article-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  max-width: 720px;
}

.article-body h2 {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.article-body h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}

.article-body p { margin-bottom: 20px; }

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-body li { margin-bottom: 8px; }

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--accent-light);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 17px;
  color: var(--primary);
}

.article-body img {
  width: 100%;
  border-radius: 12px;
  margin: 28px 0;
}

.article-body a { color: var(--accent); text-decoration: underline; }

/* ─── TABLES IN ARTICLE ─── */

/* wrapper для горизонтального скролла на мобильных — ВСЕГДА вокруг таблицы */
.article-body .tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 28px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.article-body .tbl-wrap table {
  min-width: 420px;
}

.article-body table thead tr {
  background: var(--primary);
  color: #fff;
}

.article-body table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.article-body table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.article-body table tbody tr:nth-child(even) {
  background: var(--bg-alt);
}

.article-body table tbody tr:hover {
  background: var(--accent-light);
}

.article-body table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* Адаптив таблиц для мобильных */
@media (max-width: 640px) {
  .article-body .tbl-wrap table {
    min-width: 0;
    font-size: 13px;
  }
  .article-body table th,
  .article-body table td {
    padding: 8px 10px;
    white-space: normal;
  }
  .article-body table td:first-child {
    white-space: normal;
  }
}

/* ─── BADGES / STATS ─── */
.stats-bar {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  gap: 32px;
}

.stat-item { text-align: center; }
.stat-item__num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-item__label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ─── TAGS CLOUD ─── */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-link {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  transition: all .15s;
}

.tag-link:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── NOTICE BANNER ─── */
.notice-banner {
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  padding: 16px 0;
}

.notice-banner__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.notice-banner strong { font-weight: 700; }

.notice-banner a {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
  flex-shrink: 0;
}

.notice-banner a:hover { background: rgba(255,255,255,.3); }

/* ─── FILTER BAR ─── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 24px;
}

.filter-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── DEVELOPER CARD ─── */
.developer-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .2s;
}

.developer-card:hover { box-shadow: var(--shadow); }

.developer-card__logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.developer-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.developer-card__stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.developer-card__stat strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

/* ─── READING PROGRESS ─── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 200;
  transition: width .1s linear;
}

/* ─── UTILITIES ─── */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 32px 0;
}

/* ─── PLACEHOLDER IMAGES ─── */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #94a3b8;
}

/* ── Categories grid 4-col ── */
.categories-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card--accent {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.category-card--accent .category-card__name,
.category-card--accent .category-card__count { color: rgba(255,255,255,.9) !important; }
.category-card--accent .category-card__icon { background: rgba(255,255,255,.15) !important; }

/* ── Calculators promo block ── */
.calculators-promo {
  background: var(--bg-alt);
  padding: 56px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.calc-promo-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.calc-promo-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.calc-promo-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.calc-promo-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}
.calc-promo-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.calc-mini-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37,99,235,.1);
}
.calc-mini-icon { font-size: 20px; }

/* ── SEO text block ── */
.seo-text-block {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
.seo-text-inner {
  max-width: 900px;
}
.seo-text-inner h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 24px;
  font-weight: 700;
}
.seo-text-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.seo-text-cols p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}
.seo-text-cols p:last-child { margin-bottom: 0; }
.seo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seo-tag {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: color .15s, border-color .15s;
}
.seo-tag:hover { color: var(--accent); border-color: var(--accent); }

/* ── btn-primary ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); }

/* ── Real card images ── */
.article-card__image {
  overflow: hidden;
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  display: block;
}
.article-card:hover .article-card__image img {
  transform: scale(1.04);
}
.article-card-h__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-image-real {
  background: none !important;
}
.hero-image-real img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ═══════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ — HAMBURGER MENU
   ═══════════════════════════════════════════════ */

/* Кнопка гамбургера — скрыта на десктопе */
.btn-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.btn-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all .25s ease;
  transform-origin: center;
}
.btn-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.btn-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Затемнение фона при открытом меню */
body.nav-overlay-active::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 98;
}

/* ═══════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ — BREAKPOINT 768px
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Гамбургер кнопка видна ── */
  .btn-burger { display: flex; }

  /* ── Навигация — выезжает снизу ── */
  .site-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,.15);
    z-index: 99;
    transform: translateY(110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    max-height: 80vh;
    overflow-y: auto;
    flex: none;
  }
  .site-nav.nav-open {
    transform: translateY(0);
  }
  .site-nav a {
    font-size: 16px;
    padding: 14px 20px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-light);
  }
  .site-nav a:last-child { border-bottom: none; }

  /* ── Dropdown в мобильном меню ── */
  .nav-dropdown { position: static; }
  .nav-dropdown > a::after { display: none; }
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    border: none;
    background: var(--bg-alt);
    padding: 0;
    min-width: auto;
  }
  .nav-dropdown:hover::after { display: none; }
  .nav-dropdown-menu a {
    padding: 12px 20px 12px 36px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
  }
  .nav-dropdown-divider { margin: 0; }

  /* ── Хедер ── */
  .header-inner { gap: 12px; }
  .logo-text { font-size: 16px; }

  /* ── Hero (главная) ── */
  .hero { padding: 32px 0; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero__title { font-size: 26px; }
  .hero__desc { font-size: 15px; }
  .hero__image { display: none; }

  /* ── Сетки статей ── */
  .articles-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .articles-grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* ── Article hero ── */
  .article-hero__title { font-size: 24px; line-height: 1.3; }
  .article-hero__excerpt { font-size: 15px; }
  .article-hero__image { aspect-ratio: 16/9; margin: 20px 0 0; border-radius: 12px; }
  .article-meta-bar { gap: 12px; flex-wrap: wrap; }
  .meta-sep { display: none; }

  /* ── Article layout — убираем сайдбар в одну колонку ── */
  .page-with-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .article-sidebar,
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 40px;
  }

  /* ── key-facts ── */
  .key-facts { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ── Хлебные крошки — обрезаем длинные ── */
  .breadcrumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .breadcrumb .current {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  /* ── Футер ── */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 36px 0 28px;
  }
  .footer-top > div:first-child {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px 0;
  }

  /* ── Калькуляторы на мобильном ── */
  .calc-grid { grid-template-columns: 1fr !important; }

  /* ── Карточки горизонтальные ── */
  .article-card-h {
    grid-template-columns: 100px 1fr;
  }
  .article-card-h__image { height: 80px; }
}

/* ═══════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ — BREAKPOINT 480px
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .articles-grid-3,
  .articles-grid-2 { grid-template-columns: 1fr; }
  .articles-grid-4 { grid-template-columns: 1fr 1fr; }
  .key-facts { grid-template-columns: 1fr; }
  .article-hero__title { font-size: 22px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-top > div:first-child { grid-column: auto; }
  .stats-bar { flex-direction: column; gap: 16px; }
  .related-section .articles-grid-3 { grid-template-columns: 1fr; }
  .article-faq { padding: 20px; }
}
