/* ==========================================================================
   Altfair.ru — Информационно-аналитический портал выставок Алтайского края
   Custom Humanized Design System (v2.0)
   ========================================================================== */

:root {
  /* Фирменная палитра: глубокий графит/морской и теплый алтайский янтарь */
  --af-navy-900: #101720;
  --af-navy-800: #18222f;
  --af-navy-700: #223042;
  --af-primary: #e66a00;
  --af-primary-hover: #cf5e00;
  --af-accent-warm: #ff830a;
  --af-accent-light: #fff5eb;
  
  /* Нейтральные оттенки для удобного чтения */
  --af-bg-page: #ffffff;
  --af-bg-subtle: #f8fafc;
  --af-bg-card: #ffffff;
  --af-border: #e2e8f0;
  --af-border-light: #f1f5f9;
  --af-text-title: #0f172a;
  --af-text-main: #334155;
  --af-text-muted: #64748b;
  --af-text-light: #94a3b8;

  /* Типографика и радиусы */
  --af-radius-sm: 4px;
  --af-radius-md: 8px;
  --af-radius-lg: 12px;
  --af-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --af-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* 1. Базовые стили и Sticky Footer */
html {
  height: 100%;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--af-text-main);
  background-color: var(--af-bg-page);
  font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  flex: 1 0 auto;
  overflow-x: hidden;
}

.page > footer,
footer.footer-advanced {
  margin-top: auto !important;
}

/* 2. Верхняя сервисная плашка: Топ-меню сайта */
.header-top-bar {
  background-color: var(--af-navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  padding: 8px 0;
}

.top-menu-nav {
  display: flex;
  align-items: center;
}

.top-menu-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-menu-item a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.top-menu-item a:hover,
.top-menu-item.active a {
  color: var(--af-accent-warm);
}

.header-top-contacts {
  font-size: 13px;
  color: var(--af-text-light);
  gap: 12px;
}

.header-top-contacts a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
}

.header-top-contacts a:hover {
  color: #ffffff;
}

.top-location i,
.top-email i {
  color: var(--af-accent-warm);
  margin-right: 4px;
}

.top-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* 3. Основная шапка (Логотип и навигация) */
.rd-navbar-corporate .rd-navbar-aside-outer {
  background-color: var(--af-navy-800);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
}

.rd-navbar-corporate .rd-navbar-main-outer {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 23, 32, 0.06);
}

.rd-navbar-brand img {
  height: 46px;
  width: auto;
  display: block;
}

.header-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
}

.header-info-item .icon {
  font-size: 20px;
  color: var(--af-accent-warm);
}

.header-info-item a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.header-info-item a:hover {
  color: #ffffff;
}

.rd-navbar-nav > li > .rd-nav-link {
  font-weight: 600;
  font-size: 15px;
  color: var(--af-text-title);
  letter-spacing: 0.01em;
  padding: 22px 16px;
  transition: color 0.2s;
}

.rd-navbar-nav > li.active > .rd-nav-link,
.rd-navbar-nav > li:hover > .rd-nav-link {
  color: var(--af-primary);
}

.rd-navbar-dropdown,
.rd-navbar-megamenu {
  border-top: 3px solid var(--af-primary) !important;
  box-shadow: var(--af-shadow-md) !important;
  border-radius: 0 0 6px 6px;
}

/* 4. Чистые хлебные крошки (БЕЗ Hero-блока для внутренних страниц) */
.breadcrumb-trail {
  background-color: var(--af-bg-subtle);
  border-bottom: 1px solid var(--af-border);
  padding: 12px 0;
  font-size: 13px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  color: var(--af-text-muted);
}

.breadcrumb-list li + li::before {
  content: "/";
  color: #cbd5e1;
  margin-right: 8px;
  font-size: 12px;
}

.breadcrumb-list a {
  color: var(--af-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-list a:hover {
  color: var(--af-primary);
  text-decoration: underline;
}

.breadcrumb-list li.active {
  color: var(--af-text-title);
  font-weight: 600;
}

/* 5. Заголовочная секция внутренней статьи */
.article-header-clean {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--af-border);
}

.article-meta-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.badge-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--af-accent-light);
  color: var(--af-primary);
  padding: 4px 10px;
  border-radius: var(--af-radius-sm);
  border: 1px solid rgba(230, 106, 0, 0.2);
}

.meta-item {
  font-size: 13px;
  color: var(--af-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item i {
  color: var(--af-primary);
}

.article-main-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--af-text-title);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}

/* 6. Редакционная типографика статей */
.editorial-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--af-text-main);
}

.editorial-body p {
  margin-top: 0;
  margin-bottom: 1.15rem;
  line-height: 1.72;
  color: var(--af-text-main);
}

.editorial-body p:last-child {
  margin-bottom: 0;
}

.editorial-body p + p {
  margin-top: 0;
}

.editorial-body p.editorial-lead {
  font-size: 1.15rem;
  line-height: 1.68;
  color: var(--af-navy-900);
  background: var(--af-bg-subtle);
  border-left: 4px solid var(--af-primary);
  padding: 16px 22px;
  border-radius: 0 var(--af-radius-md) var(--af-radius-md) 0;
  margin-top: 0;
  margin-bottom: 1.6rem;
}

.editorial-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--af-text-title);
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--af-border-light);
  clear: both;
}

.editorial-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--af-navy-800);
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  clear: both;
}

.editorial-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--af-navy-800);
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  clear: both;
}

/* 7. Оформление списков (UL, OL) */
.editorial-body ul,
.editorial-body ol,
.editorial-list {
  padding-left: 1.6rem;
  margin: 1.2rem 0;
}

.editorial-body ul,
ul.editorial-list {
  list-style-type: disc;
}

.editorial-body ol,
ol.editorial-list {
  list-style-type: decimal;
}

.editorial-body ul li,
.editorial-body ol li,
.editorial-list li {
  display: list-item;
  margin-bottom: 0.55rem;
  line-height: 1.65;
  color: var(--af-text-main);
}

.editorial-body li::marker,
.editorial-list li::marker {
  color: var(--af-primary);
  font-weight: 700;
}

.editorial-body ul li strong,
.editorial-body ol li strong {
  color: var(--af-text-title);
}

/* 8. Адаптивные таблицы данных */
.table-responsive-clean {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.8rem 0;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  background: #ffffff;
  box-shadow: var(--af-shadow-sm);
  clear: both;
}

.table-editorial {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
  text-align: left;
}

.table-editorial th {
  background: var(--af-bg-subtle);
  color: var(--af-text-title);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 2px solid var(--af-border);
  white-space: nowrap;
}

.table-editorial td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--af-border-light);
  color: var(--af-text-main);
  vertical-align: middle;
}

.table-editorial tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.table-editorial tbody tr:hover {
  background-color: #f1f5f9;
}

/* Статусные плашки в таблицах */
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill.past {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status-pill.upcoming {
  background: rgba(255, 131, 10, 0.15);
  color: var(--af-primary);
  border: 1px solid rgba(230, 106, 0, 0.3);
}

.status-pill.annual {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* 9. Изображения, врезки и обтекание текста (Figure Floats & Center) */
.editorial-figure {
  margin: 1.8rem 0;
  border-radius: var(--af-radius-md);
  overflow: hidden;
  box-shadow: var(--af-shadow-sm);
  background: #ffffff;
  border: 1px solid var(--af-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.editorial-figure:hover {
  box-shadow: var(--af-shadow-md);
}

.editorial-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.editorial-figure figcaption {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--af-text-muted);
  background: var(--af-bg-subtle);
  border-top: 1px solid var(--af-border-light);
  line-height: 1.45;
  font-style: normal;
  text-align: left;
}

/* Обтекание текстом слева (изображение слева, абзацы справа) */
.editorial-figure.editorial-figure-left,
.editorial-figure.img-left,
.editorial-figure.figure-left,
.editorial-figure.article-image--left,
.editorial-figure.photo.left,
.editorial-figure.left {
  float: left;
  width: 44%;
  max-width: 420px;
  margin: 6px 26px 18px 0;
  clear: left;
}

/* Обтекание текстом справа (изображение справа, абзацы слева) */
.editorial-figure.editorial-figure-right,
.editorial-figure.img-right,
.editorial-figure.figure-right,
.editorial-figure.article-image--right,
.editorial-figure.photo.right,
.editorial-figure.right {
  float: right;
  width: 44%;
  max-width: 420px;
  margin: 6px 0 18px 26px;
  clear: right;
}

/* Центрированные панорамные изображения */
.editorial-figure.editorial-figure-center,
.editorial-figure.img-center,
.editorial-figure.figure-center,
.editorial-figure.article-image--center,
.editorial-figure.photo.center,
.editorial-figure.center {
  float: none;
  clear: both;
  width: 100%;
  max-width: 100%;
  margin: 2rem auto;
  display: block;
}

.editorial-quote,
blockquote {
  margin: 1.6rem 0;
  padding: 16px 22px;
  background: var(--af-bg-subtle);
  border-left: 4px solid var(--af-primary);
  border-radius: 0 var(--af-radius-sm) var(--af-radius-sm) 0;
  font-style: italic;
  color: var(--af-text-title);
  font-size: 1.05rem;
  line-height: 1.65;
  clear: both;
}

/* Чистые разделители и клиарфикс без пустых отступов */
.clearfix,
.clear {
  clear: both;
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 0;
  font-size: 0;
}
.clearfix::after,
.clear::after {
  content: "";
  display: table;
  clear: both;
}

/* 10. Рекомендательные блоки и сайдбар */
.decision-card {
  background: var(--af-bg-subtle);
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  padding: 24px;
  margin: 2.2rem 0;
  box-shadow: var(--af-shadow-sm);
  clear: both;
}

.decision-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--af-text-title);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.decision-card-title i {
  color: var(--af-accent-warm);
}

.sidebar-sticky-box {
  background: #ffffff;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--af-shadow-sm);
}

.sidebar-sticky-box h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--af-text-title);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--af-border);
}

.sidebar-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-list li {
  margin-bottom: 10px;
}

.sidebar-menu-list a {
  color: var(--af-text-main);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}

.sidebar-menu-list a:hover {
  color: var(--af-primary);
  padding-left: 4px;
}

/* 11. Карточки хаб-разделов */
.hub-header-clean {
  background: var(--af-navy-900);
  color: #ffffff;
  padding: 40px 0 35px;
  border-bottom: 3px solid var(--af-primary);
}

.hub-main-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}

.hub-lead-desc {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 720px;
  margin: 0;
  line-height: 1.6;
}

.hub-card {
  background: #ffffff;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  overflow: hidden;
  box-shadow: var(--af-shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--af-shadow-md);
  border-color: #cbd5e1;
}

.hub-card-thumb {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.hub-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hub-card:hover .hub-card-thumb img {
  transform: scale(1.04);
}

.hub-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(16, 23, 32, 0.85);
  color: #ffa347;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.hub-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.hub-card-title {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.hub-card-title a {
  color: var(--af-text-title);
  text-decoration: none;
  transition: color 0.2s;
}

.hub-card-title a:hover {
  color: var(--af-primary);
}

.hub-card-desc {
  font-size: 0.95rem;
  color: var(--af-text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1 0 auto;
}

.hub-card-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--af-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.hub-card:hover .hub-card-action {
  gap: 10px;
}

/* 12. Профессиональный футер */
footer.footer-advanced {
  background-color: var(--af-navy-900);
  color: var(--af-text-light);
  font-size: 14px;
}

footer.footer-advanced h4,
footer.footer-advanced h5 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav-list li {
  margin-bottom: 9px;
}

.footer-nav-list a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

.footer-nav-list a:hover {
  color: var(--af-accent-warm);
  padding-left: 4px;
}

.footer-bottom-line {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 0;
  margin-top: 35px;
}

.rights {
  color: var(--af-text-light);
  font-size: 13px;
  margin: 0;
}

.rights a {
  color: #cbd5e1;
  text-decoration: none;
}

.rights a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* 13. Мобильная адаптация */
/* Фиксированная шапка на мобильных */
.rd-navbar-fixed .rd-navbar-panel {
  background-color: var(--af-navy-900) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.rd-navbar-fixed .rd-navbar-toggle span,
.rd-navbar-fixed .rd-navbar-toggle span::before,
.rd-navbar-fixed .rd-navbar-toggle span::after {
  background-color: #ffffff !important;
}

.rd-navbar-fixed .rd-navbar-brand img {
  height: 38px !important;
  max-width: 100%;
}

.hero-main-title {
  font-size: 2.65rem;
  line-height: 1.2;
}

.hero-main-lead {
  font-size: 1.2rem;
}

@media (max-width: 991px) {
  .hero-main-title {
    font-size: 2rem !important;
  }
  .article-main-title,
  .hub-main-title {
    font-size: 1.85rem !important;
  }
  .editorial-body {
    font-size: 1rem;
  }
  .header-top-bar {
    display: none; /* скрываем дублирующую плашку на мобильных, навигация переходит в гамбургер */
  }
}

@media (max-width: 767px) {
  .editorial-figure.editorial-figure-left,
  .editorial-figure.editorial-figure-right,
  .editorial-figure.img-left,
  .editorial-figure.img-right,
  .editorial-figure.figure-left,
  .editorial-figure.figure-right,
  .editorial-figure.article-image--left,
  .editorial-figure.article-image--right,
  .editorial-figure.photo.left,
  .editorial-figure.photo.right,
  .editorial-figure.left,
  .editorial-figure.right {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.4rem 0 !important;
    clear: both !important;
  }
  .editorial-body p {
    font-size: 1rem;
    line-height: 1.68;
    margin-bottom: 1rem;
  }
  .article-main-title,
  .hub-main-title {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  .hero-main-title {
    font-size: 1.55rem !important;
    line-height: 1.25 !important;
  }
  .hero-main-lead {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  .editorial-lead {
    font-size: 1.02rem !important;
    padding: 14px 16px !important;
  }
  .table-editorial {
    font-size: 0.88rem;
  }
  .table-editorial th,
  .table-editorial td {
    padding: 10px 12px;
  }
}

@media (max-width: 575px) {
  .article-main-title,
  .hub-main-title {
    font-size: 1.35rem !important;
  }
  .hero-main-title {
    font-size: 1.4rem !important;
  }
  .card-counter .counter-value {
    font-size: 2rem;
  }
}
