/*
Theme Name: MacroRussia MVP
Description: Макроэкономические показатели России (MVP)
Version: 2.5
*/

:root {
  --primary: #0B74D1;
  --primary-soft: #E5F1FF;
  --text-dark: #1F2933;
  --text-muted: #6B7280;
  --border: #E0E4EA;
  --bg: #F3F5F8;
  --card-bg: #FFFFFF;
}

* { box-sizing:border-box; }
*:focus { outline: none; }

body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; 
  margin:0; padding:0; 
  background:var(--bg); 
  color:var(--text-dark);
  font-size: 14px; 
  display: flex; flex-direction: column; min-height: 100vh;
}

h1 { font-size: 26px; font-weight: 700; margin: 0 0 12px 0; color: var(--text-dark); }
h2 { font-size: 20px; font-weight: 600; margin: 24px 0 16px 0; color: var(--text-dark); }
h3 { font-size: 16px; font-weight: 600; margin: 0; color: var(--text-dark); }

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* HEADER */
header {
  position: sticky; top: 0; z-index: 10;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: -1;
}
.container-header {
    width: 92%;
    max-width: 1280px;
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(160deg, var(--primary) 0%, #1a5fb4 100%);
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; letter-spacing: 0.06em;
  box-shadow: 0 4px 12px rgba(11,116,209,0.25); flex-shrink: 0;
}
.brand-copy strong { display: block; font-size: 15px; font-weight: 700; color: var(--text-dark); }
.brand-copy span   { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Site nav */
.site-nav { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: all 0.18s ease;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
}
.nav-link:hover  { color: var(--text-dark); background: var(--bg); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

/* Burger button */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s ease;
}
.burger:hover { border-color: var(--primary); }
.burger span {
  display: block;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Buttons (general) */
.btn {
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-dark);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.18s ease; line-height: 1;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(21,34,53,0.08); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: #0a65b8; color: white; }

@media (max-width: 860px) {
  .brand-copy { display: none; }
  .site-nav { gap: 0; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
}
@keyframes nav-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  header { padding: 0 16px; }
  .burger { display: flex; }

  .site-nav {
    display: none;
  }
  .site-nav.is-open {
    display: flex;
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    animation: nav-open 0.22s ease forwards;
  }
  .site-nav .nav-link {
    font-size: 18px;
    font-weight: 600;
    padding: 14px 32px;
    width: 260px;
    text-align: center;
    border-radius: 14px;
  }
}

.container { width:92%; max-width:1280px; margin:12px auto 60px auto; flex: 1; }

.top-row { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:28px; }
.top-text p { margin:0; color:var(--text-muted); font-size:14px; }

/* BUTTONS */
.categories { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:24px; }
.cat-btn, .range-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #ffffff; color: var(--text-dark); font-size: 12px; cursor: pointer; transition: all 0.2s ease; user-select: none;
}
.cat-btn:hover, .range-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cat-btn.cat-active, .range-btn.active { background: var(--primary); border-color: var(--primary); color: #ffffff; box-shadow: 0 2px 4px rgba(11, 116, 209, 0.2); }
.range-switch { display: flex; gap: 6px; }

/* TILES */
.two-col { display:grid; grid-template-columns:2fr 1.3fr; gap:22px; align-items:flex-start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.top-metrics { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:18px; margin-bottom:40px; }
.top-card {
  background:var(--card-bg); padding: 18px 20px; border-radius:14px; border:1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03); display: block; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.top-card:hover { transform:translateY(-2px); border-color: #c5d4f0; box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.top-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.top-card h3 { margin:0; font-size:16px; font-weight:600; color: var(--text-dark); }
.tag { font-size:11px; padding:2px 8px; border-radius:999px; background:var(--primary-soft); color:var(--primary); font-weight: 500; }
.value { font-size:26px; font-weight:700; margin:4px 0 4px 0; letter-spacing: -0.5px; color: var(--text-dark); }
.value-trend { font-size:12px; font-weight: 500; color:#059669; }
.value-trend.down { color:#b91c1c; }
.date { font-size:12px; color:var(--text-muted); margin-top:12px; }

.updates-list { background:var(--card-bg); padding:18px; border-radius:14px; border:1px solid var(--border); }
.update-item { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid #f2f4f7; font-size:14px; }
.update-item:last-child { border-bottom:none; }
.update-item:hover .update-title { color: var(--primary); }
.update-title { font-weight:500; color: var(--text-dark); }
.update-date { color:var(--text-muted); font-size:13px; }

/* --- ARCHIVE LIST (5 COLUMNS UPDATE) --- */
.indicator-list-container {
  display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.list-row {
  display: grid; 
  /* ИЗМЕНЕНО: 5 колонок для выноса единиц измерения */
  grid-template-columns: 2fr 1.2fr 0.8fr 0.5fr 1fr; 
  align-items: center; padding: 14px 20px;
  border-bottom: 1px solid #f2f4f7; transition: background 0.1s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #f9fafb; }
.list-row-header { background: #f9fafb; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.list-title { font-weight: 600; font-size: 14px; color: var(--primary); }
.list-cat { font-size: 12px; color: var(--text-muted); }
.list-val { font-weight: 500; font-size: 14px; text-align: right; color: var(--text-dark); }
/* НОВОЕ: Колонка единиц */
.list-unit { font-size: 12px; color: var(--text-muted); padding-left: 8px; }
.list-date { font-size: 12px; color: var(--text-muted); text-align: right; }

@media(max-width: 600px) {
    .list-row { 
        /* Мобильная сетка: Title | Value | Unit */
        grid-template-columns: 1fr auto auto; 
        gap: 10px; 
    }
    .list-row-header { display: none; }
    .list-cat { display: none; }
    .list-date { display: none; } /* Скрываем дату на очень узких экранах для чистоты */
    .list-val { text-align: right; }
    .list-unit { padding-left: 4px; }
}

/* INDICATOR PAGE */
.indicator-hero { margin-bottom: 24px; }
.indicator-hero h1 { font-size: 26px; margin: 0 0 10px 0; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.meta-badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.meta-badge strong { color: var(--text-dark); font-weight: 600; }
.main-stat-row { display: flex; align-items: baseline; gap: 12px; }
.main-val { font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1; color: var(--text-dark); }
.trend-pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.trend-pill.up { background: #d1fae5; color: #065f46; }
.trend-pill.down { background: #fee2e2; color: #991b1b; }
.trend-pill.neutral { background: #f3f4f6; color: #374151; }

.chart-block { background:var(--card-bg); border-radius:16px; border:1px solid var(--border); padding: 20px; margin-bottom:24px; min-height: 380px; }
.chart-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }

/* TABLES */
.bottom-grid { display:grid; grid-template-columns:2fr 1.2fr; gap:22px; align-items:flex-start; }
@media(max-width: 768px) { .bottom-grid { grid-template-columns: 1fr; } }
.data-card, .info-card { background:var(--card-bg); border-radius:14px; border:1px solid var(--border); padding:18px 20px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:8px 6px; text-align:left; border-bottom: 1px solid #f2f4f7; }
thead tr { border-bottom: 1px solid var(--border); }
th { font-weight:500; color:var(--text-muted); font-size:12px; text-transform: uppercase; padding-top: 0; padding-bottom: 12px; }
td { color: var(--text-dark); }
tr:last-child td { border-bottom: none; }
td strong { font-weight: 500; }

/* FOOTER */
footer { background: #111827; color: #d1d5db; padding: 18px 40px; margin-top:auto; border-top: 1px solid #1f2937; }
.footer-inner { width:92%; max-width:1280px; margin:0 auto; display:flex; flex-wrap:wrap; gap:24px; justify-content:space-between; }
.footer-title { font-weight:600; margin-bottom:8px; color:#fff; font-size:12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-links a { display:block; color:#9ca3af; text-decoration:none; margin-bottom:4px; font-size:12px; }
.footer-links a:hover { color:#fff; }

/* WP CONTENT (About page) */
.page-content { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 30px; margin-bottom: 40px; }
.page-content h1 { margin-top: 0; }
.page-content ul { padding-left: 20px; }
.page-content li { margin-bottom: 6px; }

/* --- GUTENBERG FIXES --- */
.page-content ul, 
.page-content ol { 
    padding-left: 20px; 
    margin-bottom: 16px; 
}
.page-content li {
    margin-bottom: 6px;
}
.wp-block-columns {
    display: flex;
    gap: 2em;
    margin-bottom: 1.5em;
}
.wp-block-columns .wp-block-column {
    flex-grow: 1;
}
@media (max-width: 781px) {
    .wp-block-columns { flex-direction: column; }
    .wp-block-columns .wp-block-column { flex-basis: 100% !important; }
}
.wp-block-button__link {
    text-decoration: none;
}
.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dark);
}
.is-style-outline .wp-block-button__link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* --- BENTO GRID STYLES --- */
.page-content:has(.bento-grid-wrapper) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.bento-card > *:last-child {
    margin-bottom: 0;
}
.bento-card h1, 
.bento-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
}
.bento-card ul {
    padding-left: 20px;
    margin-bottom: 16px;
}
.bento-card li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}
.disclaimer-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================
   BLOG COMPONENTS — Stage 2
   ============================================================ */

:root {
  --shadow-md: 0 10px 32px rgba(21,34,53,0.06);
  --radius-xl: 20px;
  --surface-soft: #f8fafc;
}

/* Eyebrow label */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary); font-weight: 700; margin-bottom: 10px;
}

/* Panel (white rounded card) */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.card-pad { padding: 24px; }

/* Section spacing */
.section { margin-top: 16px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 26px; line-height: 1.1; }
.section-head p  { margin: 0; max-width: 560px; color: var(--text-muted); line-height: 1.65; font-size: 14px; }

/* ---- Category pills ---- */
.category-row { display: flex; gap: 10px; flex-wrap: wrap; }
.category-pill {
  padding: 9px 16px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--border);
  color: var(--text-dark); font-weight: 600; font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04); text-decoration: none;
  transition: all 0.15s ease; display: inline-block;
}
.category-pill:hover { border-color: var(--primary); color: var(--primary); }
.category-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- Split layout: content + sidebar ---- */
.blog-split {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 960px) { .blog-split { grid-template-columns: 1fr; } }
.blog-split > .sidebar-stack { margin-top: 12px; }

/* ---- Feed list ---- */
.feed-list { display: grid; gap: 14px; }
.feed-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feed-item:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(21,34,53,0.09); }
.feed-date { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.feed-item h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.2; font-weight: 700; color: var(--text-dark); }
.feed-item p  { margin: 0; color: var(--text-muted); line-height: 1.7; font-size: 14px; }
@media (max-width: 640px) { .feed-item { grid-template-columns: 1fr; gap: 10px; } }

/* ---- Sidebar ---- */
.sidebar-stack { display: grid; gap: 16px; position: sticky; top: 88px; }
@media (max-width: 960px) { .sidebar-stack { position: static; } }
.sidebar-card {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.sidebar-card h4 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.sidebar-metrics { display: grid; gap: 10px; margin-top: 4px; }
.sidebar-metric {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none; color: inherit; display: block;
  transition: border-color 0.15s;
}
.sidebar-metric:hover { border-color: var(--primary); }
.sidebar-metric small  { display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-metric strong { display: block; font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 3px; }
.sidebar-metric span   { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ---- Home hero ---- */
.home-hero {
  padding: 20px 24px;
  background: radial-gradient(circle at top right, rgba(11,116,209,0.07), transparent 40%), var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.home-hero h1 {
  margin: 0 0 12px; font-size: 34px; line-height: 1.1;
  font-weight: 700; letter-spacing: -0.02em;
}
.home-hero p { margin: 0; color: var(--text-muted); line-height: 1.8; font-size: 15px; max-width: 760px; }
@media (max-width: 600px) { .home-hero { padding: 20px; } .home-hero h1 { font-size: 26px; } }

/* ---- Article layout: article + sidebar ---- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1000px) { .article-layout { grid-template-columns: 1fr; } }

/* Article shell */
.article-shell {
  padding: 28px 32px 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
@media (max-width: 600px) { .article-shell { padding: 18px; } }

/* Breadcrumb */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-bottom: 16px; align-items: center; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb__sep { color: var(--border); font-size: 12px; }

/* Kicker (category badge in article) */
.kicker {
  display: inline-flex; align-items: center; padding: 5px 12px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
}

/* Article title */
.article-title { margin: 14px 0 12px; font-size: 34px; line-height: 1.1; font-weight: 700; color: var(--text-dark); letter-spacing: -0.02em; }
@media (max-width: 600px) { .article-title { font-size: 24px; } }

/* Article meta */
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.article-meta a { color: var(--text-muted); }
.article-meta a:hover { color: var(--primary); }

/* Article lead */
.article-lead { font-size: 17px; line-height: 1.8; color: #33455d; margin: 0 0 22px; }

/* Article content */
.article-content { font-size: 16px; line-height: 1.82; color: #223248; }
.article-content p  { margin: 0 0 16px; }
.article-content h2 { margin: 32px 0 12px; font-size: 22px; line-height: 1.15; color: var(--text-dark); }
.article-content h3 { margin: 24px 0 10px; font-size: 18px; color: var(--text-dark); }
.article-content ul,
.article-content ol   { padding-left: 22px; margin-bottom: 16px; }
.article-content li   { margin-bottom: 6px; }
.article-content img  { max-width: 100%; border-radius: 12px; margin: 8px 0; display: block; }
.article-content blockquote {
  margin: 22px 0; padding: 14px 18px;
  border-left: 3px solid var(--primary); background: var(--primary-soft);
  border-radius: 0 12px 12px 0; color: var(--text-dark);
}
.article-content .note {
  margin-top: 24px; padding: 16px 20px;
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 16px; color: var(--text-muted); font-size: 14px; line-height: 1.75;
}

/* Author box (in article) */
.author-box {
  margin-top: 30px; padding: 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  display: grid; grid-template-columns: 72px 1fr;
  gap: 16px; align-items: start;
}
.author-box__avatar         { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; flex-shrink: 0; }
.author-box__avatar img     { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-box__initials {
  width: 72px; height: 72px; border-radius: 16px;
  background: linear-gradient(160deg, var(--primary), #1a5fb4);
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 20px; letter-spacing: 0.04em; flex-shrink: 0;
}
.author-box h3 { margin: 0 0 6px; font-size: 17px; }
.author-box p  { margin: 0; color: var(--text-muted); line-height: 1.7; font-size: 14px; }
@media (max-width: 600px) { .author-box { grid-template-columns: 1fr; } }

/* ---- Category page ---- */
.category-header {
  padding: 26px 28px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  margin-bottom: 26px;
}
.category-header h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.category-header p  { margin: 0; color: var(--text-muted); line-height: 1.75; max-width: 680px; font-size: 15px; }

/* Grid 2 columns (for category cards) */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Article card */
.article-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  overflow: hidden; text-decoration: none; color: inherit; display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(21,34,53,0.09); }
.article-card .card-pad { padding: 22px; }
.article-card h3 { margin: 10px 0 10px; font-size: 18px; line-height: 1.25; font-weight: 700; color: var(--text-dark); }
.article-card p  { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.65; }

/* ---- Author page ---- */
.author-hero {
  padding: 26px 28px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: 110px 1fr 280px;
  gap: 24px; align-items: start;
}
@media (max-width: 900px)  { .author-hero { grid-template-columns: 110px 1fr; } }
@media (max-width: 600px)  { .author-hero { grid-template-columns: 1fr; } }

.avatar-lg              { width: 110px; height: 110px; border-radius: 22px; overflow: hidden; }
.avatar-lg img          { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg-initials {
  width: 110px; height: 110px; border-radius: 22px;
  background: linear-gradient(160deg, var(--primary), #1a5fb4);
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 28px; letter-spacing: 0.04em;
}
.author-hero h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.05; letter-spacing: -0.02em; }
.author-hero > div > p { margin: 0; color: var(--text-muted); line-height: 1.8; font-size: 15px; }

.author-stats       { display: grid; gap: 10px; }
.author-stat {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
}
.author-stat small  { display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.author-stat strong { display: block; font-size: 22px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.author-stat span   { font-size: 12px; color: var(--text-muted); }

/* Simple list (author page topics) */
.simple-list { display: grid; }
.simple-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.simple-row:last-child { border-bottom: none; }
.simple-row span    { color: var(--text-dark); }
.simple-row strong  { color: var(--primary); font-weight: 600; white-space: nowrap; font-size: 13px; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 36px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-muted);
  text-decoration: none; transition: all 0.15s ease; display: inline-block;
}
.pagination .page-numbers:hover   { border-color: var(--primary); color: var(--primary); }
.pagination .page-numbers.current { background: var(--primary); color: white; border-color: var(--primary); }
/* ============================================================
   AUTH, PROFILE, COMMENTS — Stage 2
   ============================================================ */

/* ---- Form fields (shared) ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-dark); margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-bg); color: var(--text-dark);
  font-family: inherit; transition: border-color 0.18s;
  box-sizing: border-box;
}
.field input:focus,
.field textarea:focus { border-color: var(--primary); outline: none; }
.field input:disabled,
.field input:disabled:hover { background: var(--bg-muted, #f5f5f5); color: var(--text-muted); cursor: not-allowed; }
.field-grid { gap: 12px; margin-bottom: 14px; }

/* ---- Auth pages ---- */
.auth-wrap {
  display: flex; justify-content: center;
  padding: 40px 0 60px;
}
.auth-card {
  width: 100%; max-width: 480px;
  border-radius: var(--radius-xl);
}
.auth-card h1 { margin: 6px 0 6px; font-size: 28px; }
.auth-desc { color: var(--text-muted); font-size: 14px; margin: 0 0 22px; line-height: 1.65; }
.auth-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.auth-error {
  padding: 12px 16px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca;
  color: #991b1b; font-size: 14px; margin-bottom: 18px;
}
.auth-success {
  padding: 12px 16px; border-radius: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  color: #166534; font-size: 14px; margin-bottom: 18px;
}

/* ---- Header auth area ---- */
.header-auth { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg);
  text-decoration: none; color: var(--text-dark); font-size: 13px; font-weight: 500;
  transition: border-color 0.18s;
}
.header-user:hover { border-color: var(--primary); }
.header-user__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; display: block; flex-shrink: 0;
}
.header-user__initials {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(160deg, var(--primary), #1a5fb4);
  color: white; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.header-user__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-user__logout {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fee2e2; color: #991b1b; border: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background 0.18s;
}
.header-user__logout:hover { background: #fecaca; color: #7f1d1d; }

@media (max-width: 600px) {
  .header-user__name { display: none; }
  .header-user { padding: 5px 6px; }
}

/* ---- Profile / Cabinet ---- */
.cabinet-wrap { padding-bottom: 40px; }
.cabinet-grid {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 24px; align-items: start;
}
@media (max-width: 760px) { .cabinet-grid { grid-template-columns: 1fr; } }

.cabinet-nav {
  display: grid; gap: 4px; border-radius: var(--radius-xl);
  position: sticky; top: 88px;
}
.cabinet-nav__link {
  display: block; padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; transition: all 0.15s;
}
.cabinet-nav__link:hover { color: var(--text-dark); background: var(--bg); }
.cabinet-nav__link.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.cabinet-nav__logout {
  display: block; padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: #991b1b;
  text-decoration: none; transition: background 0.15s;
  margin-top: 8px; border-top: 1px solid var(--border); padding-top: 16px;
}
.cabinet-nav__logout:hover { background: #fef2f2; }

.settings-card { border-radius: var(--radius-xl); }
.settings-card h3 { margin: 0 0 4px; font-size: 18px; }
.settings-desc { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; line-height: 1.6; }

/* Avatar row in profile */
.profile-avatar-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px; background: var(--surface-soft);
  border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 14px;
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(160deg, var(--primary), #1a5fb4);
  display: grid; place-items: center;
}
.profile-avatar img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar span { color: white; font-weight: 700; font-size: 16px; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border); border-radius: 22px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- Comments ---- */
.comments-wrap { margin-top: 28px; }
.comments-locked {
  padding: 18px 22px; border-radius: 14px;
  background: var(--surface-soft); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted);
}
.comments-locked a { color: var(--primary); }

.comments-section { margin-top: 8px; }
.comments-title { font-size: 18px; font-weight: 700; margin: 0 0 18px; color: var(--text-dark); }

.comments-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.comment-item { display: block; }
.comment-body {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px;
  padding: 16px 18px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 14px;
}
.comment-avatar img    { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: block; }
.comment-avatar        { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.comment-header        { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.comment-author        { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.comment-date          { font-size: 12px; color: var(--text-muted); }
.comment-text          { font-size: 14px; line-height: 1.75; color: var(--text-dark); }
.comment-text p        { margin: 0 0 8px; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-reply         { margin-top: 10px; }
.comment-reply a       { font-size: 12px; color: var(--primary); font-weight: 600; text-decoration: none; }
.comment-reply a:hover { opacity: 0.75; }
.comment-moderation    { font-size: 12px; color: var(--text-muted); font-style: italic; margin: 0 0 8px; }

/* Nested comments (depth 2) */
.comment-item .children {
  list-style: none; padding: 0; margin: 10px 0 0 52px;
  display: grid; gap: 10px;
}

/* Comment form */
.comment-form { margin-top: 24px; }
.comment-form-comment .field { margin: 0; }
.comment-submit { margin-top: 14px; display: flex; gap: 12px; align-items: center; }
#cancel-comment-reply-link { font-size: 13px; color: var(--text-muted); text-decoration: none; }
#cancel-comment-reply-link:hover { color: var(--text-dark); }

/* ============================================================
   ДОДЕЛКИ — Stage 2 patch
   ============================================================ */

/* ---- feed-cat-pill (рубрика в ленте) ---- */
.feed-cat-pill {
  display: inline-block;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  margin-top: 4px;
}

/* ---- Indicators hero ---- */
.indicators-hero {
  padding: 28px 32px; margin-top: 8px;
  border-radius: var(--radius-xl);
}
.indicators-hero h1 { margin: 6px 0 10px; font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; }
.indicators-hero p  { margin: 0; color: var(--text-muted); line-height: 1.8; max-width: 780px; font-size: 15px; }
@media (max-width: 600px) { .indicators-hero h1 { font-size: 26px; } .indicators-hero { padding: 20px; } }

/* ---- Metric grid + card ---- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.metric-card {
  display: block;
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.metric-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.metric-card small  { display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 6px; line-height: 1.4; }
.metric-card strong { display: block; font-size: 22px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; letter-spacing: -0.03em; white-space: nowrap; }
.metric-card strong span { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.metric-card span   { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ---- #respond — comment reply block ---- */
#reply-title {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 16px;
  margin-bottom: 18px; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#reply-title::before {
  content: '↩';
  color: var(--primary); font-size: 18px; line-height: 1; flex-shrink: 0;
}
#reply-title small { font-size: inherit; line-height: inherit; }
#cancel-comment-reply-link {
  display: inline-flex; align-items: center;
  background: rgba(185,28,28,0.10); color: #991b1b;
  border-radius: 999px; padding: 3px 12px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background 0.15s;
}
#cancel-comment-reply-link:hover { background: rgba(185,28,28,0.18); }
