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

:root {
  --blue:       #325683;
  --blue-dark:  #264469;
  --blue-light: #4a72a0;
  --text:       #333333;
  --text-muted: #777777;
  --bg:         #eef1f5;
  --bg-panel:   #f4f6f9;
  --border:     #dde2e8;
  --white:      #ffffff;
  --accent:     #e8a020;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-light); text-decoration: underline; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 16px; }

/* ШАПКА */
.site-header {
  background: #284d79;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo img { height: 40px; display: block; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 4px;
  transition: background 0.15s;
}
.site-nav a:hover, .site-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* ХЛЕБНЫЕ КРОШКИ */
.breadcrumbs {
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--blue); }
.breadcrumbs span { margin: 0 5px; }

/* ОСНОВНОЙ LAYOUT */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 20px;
  padding: 20px 0 40px;
  align-items: start;
}

/* КАРТОЧКА (белый блок) */
.card {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 24px;
}

/* ГЛАВНАЯ - список статей */
.articles-list { display: flex; flex-direction: column; gap: 0; }
.article-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.article-card:first-child { padding-top: 0; }
.article-card:last-child { border-bottom: none; padding-bottom: 0; }
.article-card-img img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.article-card-img-placeholder {
  width: 140px; height: 90px;
  background: var(--bg-panel);
  border-radius: 4px;
}
.article-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.article-card-meta a { color: var(--blue); }
.article-card-title { font-size: 16px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.article-card-title a { color: var(--text); }
.article-card-title a:hover { color: var(--blue); text-decoration: none; }
.article-card-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.article-card-author { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.article-card-author a { color: var(--blue); }

/* СТРАНИЦА СТАТЬИ */
.article-title { font-size: 24px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; color: var(--text); }
.article-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.article-meta a { color: var(--blue); }
.article-meta span { margin: 0 6px; }
.article-hero { width: 100%; border-radius: 4px; margin-bottom: 20px; display: block; }
.article-content { font-size: 15px; line-height: 1.75; color: #2d2d2d; }
.article-content h2 { font-size: 19px; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.article-content h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; color: var(--text); }
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol { margin: 0 0 14px 22px; }
.article-content li { margin-bottom: 5px; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.article-content table td { border: 1px solid var(--border); padding: 8px 10px; }
.article-content table tr:nth-child(even) td { background: var(--bg-panel); }
.article-content blockquote {
  border-left: 4px solid var(--blue);
  margin: 16px 0;
  padding: 10px 16px;
  background: var(--bg-panel);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: #555;
}

/* ТЕГИ */
.article-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  transition: background 0.15s;
}
.tag:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* РЕЙТИНГ */
.article-rating { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.article-rating h4 { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.rating-stars { display: flex; gap: 4px; cursor: pointer; }
.rating-stars .star { font-size: 26px; color: #ddd; transition: color 0.1s; user-select: none; }
.rating-stars .star.active { color: var(--accent); }
.rating-info { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.rating-thanks { font-size: 13px; color: #4a9a4a; margin-top: 6px; display: none; }

/* САЙДБАР */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-author { text-align: center; }
.sidebar-author-photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
  border: 3px solid var(--border);
}
.sidebar-author-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sidebar-author-role { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.sidebar-author-bio { font-size: 13px; color: var(--text-muted); line-height: 1.5; text-align: left; }
.btn-consult {
  display: block;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  border-radius: 4px;
  margin-top: 12px;
  transition: background 0.15s;
}
.btn-consult:hover { background: #c8881a; color: #fff; text-decoration: none; }

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
  margin-bottom: 12px;
}
.sidebar-cats { list-style: none; }
.sidebar-cats li { border-bottom: 1px solid var(--border); }
.sidebar-cats li a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
  transition: color 0.15s;
}
.sidebar-cats li a:hover { color: var(--blue); text-decoration: none; }
.sidebar-cats li a span { float: right; color: var(--text-muted); font-size: 12px; }

.sidebar-experts { list-style: none; }
.sidebar-experts li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar-experts li:last-child { border-bottom: none; }
.sidebar-experts img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.sidebar-experts a { font-size: 13px; color: var(--text); line-height: 1.3; }
.sidebar-experts a:hover { color: var(--blue); text-decoration: none; }
.sidebar-experts small { display: block; font-size: 11px; color: var(--text-muted); }

/* ПАГИНАЦИЯ */
.pagination { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--blue);
  background: var(--white);
}
.pagination span { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination a:hover { background: var(--bg-panel); text-decoration: none; }

/* ФУТЕР */
.site-footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.7);
  padding: 30px 0;
  margin-top: 20px;
  font-size: 13px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col a { display: block; color: rgba(255,255,255,0.65); margin-bottom: 6px; font-size: 13px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* СТРАНИЦА РУБРИКИ / ТЕГА */
.page-header {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* АДАПТИВ */
@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
  .site-nav { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .article-card { grid-template-columns: 100px 1fr; }
  .article-card-img img { width: 100px; height: 64px; }
  .article-title { font-size: 20px; }
}
@media (max-width: 480px) {
  .article-card { grid-template-columns: 1fr; }
  .article-card-img { display: none; }
}

/* СТРЕЛКА ВВЕРХ */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, background 0.2s;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: #1a3e6b; }
.scroll-top svg { width: 20px; height: 20px; }

/* ПОПАП КУКИ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2b364a;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.3s;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; flex: 1; min-width: 200px; line-height: 1.5; }
.cookie-banner a { color: #7eb3e8; text-decoration: underline; }
.cookie-banner-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.cookie-banner-btn:hover { background: #1a3e6b; }

/* ===== КОНТЕНТ: ТАБЛИЦЫ, ЦИТАТЫ, СПИСКИ, ДИСКЛЕЙМЕР ===== */

/* Таблицы - адаптивность через обёртку */
.article-content table {
  min-width: 480px;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border-radius: 4px;
}
.table-wrap table {
  margin-bottom: 0;
}
.article-content table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}
.article-content table tr:first-child td {
  background: var(--blue-dark);
  color: #fff;
  font-weight: 600;
  border-color: var(--blue-dark);
}

/* Цитаты - улучшенный вид */
.article-content blockquote {
  border-left: 4px solid var(--blue);
  margin: 20px 0;
  padding: 14px 20px;
  background: var(--bg-panel);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  position: relative;
}
.article-content blockquote p { margin-bottom: 0; }
@media (prefers-color-scheme: dark) {
  .article-content blockquote { background: rgba(50,86,131,0.12); }
}
:root[data-theme="light"] .article-content blockquote { background: var(--bg-panel); }
:root[data-theme="dark"]  .article-content blockquote { background: rgba(50,86,131,0.12); }

/* Списки */
.article-content ul { list-style: none; margin-left: 0; padding-left: 0; }
.article-content ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 7px;
}
.article-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
}
.article-content ol { padding-left: 22px; }
.article-content ol li {
  margin-bottom: 7px;
  padding-left: 4px;
}
.article-content ol li::marker {
  color: var(--blue);
  font-weight: 600;
}

/* Дисклеймер */
.article-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 20px;
  line-height: 1.6;
}
.article-disclaimer p { margin-bottom: 4px; }

/* Блок CTA - канал ВБХ */
.article-content .cta-block {
  background: linear-gradient(135deg, #e8f0fa 0%, #f0f5fc 100%);
  border: 1px solid #c5d8f0;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 24px 0;
}
@media (prefers-color-scheme: dark) {
  .article-content .cta-block { background: rgba(50,86,131,0.15); border-color: rgba(50,86,131,0.4); }
}
:root[data-theme="dark"] .article-content .cta-block { background: rgba(50,86,131,0.15); border-color: rgba(50,86,131,0.4); }
:root[data-theme="light"] .article-content .cta-block { background: linear-gradient(135deg, #e8f0fa 0%, #f0f5fc 100%); border-color: #c5d8f0; }
