/* 🌐 Общие стили */
body {
  font-family: Arial, sans-serif;
  background-color: #f8f9fa;
  color: #222;
  margin: 0;
  padding: 0 20px;
  line-height: 1.6;
  padding-bottom: 60px; /* ⬅️ отступ под фиксированный подвал */
}

h1, h2, h3 {
  color: #333;
  margin: 0;
}

a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 🧠 Верхняя панель */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  height: 50px;
  width: auto;
}

.site-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

/* 🔍 Форма поиска */
.search-form input {
  padding: 6px 10px;
  width: 250px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search-form button {
  padding: 6px 12px;
  margin-left: 5px;
  cursor: pointer;
  font-size: 14px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
}

.search-form button:hover {
  background-color: #0056b3;
}

/* 📄 Основная структура */
.main-layout {
  display: flex;
  gap: 40px;
  height: 80vh;
  overflow: hidden;
}

.article-list {
  flex: 3;
  overflow-y: auto;
  padding-right: 10px;
  padding-bottom: 50px;
}

#scroll-sentinel {
  height: 1px;
}

.sidebar {
  flex: 1;
  align-self: flex-start;
  border-left: none; /* отключаем стандартную границу */
  padding-left: 20px;
  position: relative;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4px;
  width: 1px;
  height: 100vh;
  background-color: #ccc;
  z-index: 0;
}

/* 🧾 Карточки статей */
.article-card {
  background-color: #fff;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 4px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.article-card h2 {
  margin: 0 0 4px 0;
}

.article-category {
  color: #555;
  font-size: 14px;
  margin: 0 0 3px 0;
}

.article-card p {
  margin: 0;
}

.article-card * {
  line-height: 1.4;
}

/* 📊 Таблицы */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

/* 📂 Категории */
.category-tree,
.category-tree ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.category-tree li::marker {
  content: none;
}

.category-tree ul {
  position: relative;
  margin-left: 12px;
  padding-left: 10px;
}

.category-tree ul::before {
  content: none; /* отключаем короткую линию */
}

.category-tree li {
  margin-bottom: 5px;
  cursor: default;
}

.category-tree .toggle {
  display: inline-block;
  width: 1em;
  text-align: center;
  margin-right: 4px;
  font-size: 14px;
  vertical-align: middle;
  font-weight: bold;
  cursor: pointer;
}

.category-tree .category-name {
  cursor: pointer;
}

.category-content {
  display: none;
}

/* 🦶 Подвал */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f8f9fa;
  border-top: 1px solid #ccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  font-size: 13px;
  color: #555;
  flex-wrap: wrap;
  z-index: 10;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
}

.tg-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0088cc;
  font-weight: 500;
  text-decoration: none;
}

.tg-link:hover {
  text-decoration: underline;
}

.tg-icon {
  width: 20px;
  height: 20px;
}
.form-inline {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
}
