/* =========================================
   1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
   ========================================= */
:root {
  --primary: #1d7989;
  --primary-soft: #f0f7f8;
  --bg: #f4f7f6;
  --text: #2c3e50;
  --header-bg: #1d7989;
  --dark: #1a1a1a;
  --max-width: 1400px;
}
html {
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
}
.logo-image--white {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}
body {
  background-color: var(--bg) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  color: var(--text);
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 25px;
  width: 100%;
}
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.glightbox:hover {
  transform: scale(1.01);
  transition: 0.3s;
}
/* Цвет подсказки в полях ввода (Placeholder) */
::placeholder {
  color: #b6b6b6 !important; /* Здесь регулируй яркость: чем ближе к #fff, тем светлее */
  opacity: 1; /* Чтобы браузер не приглушал цвет сам */
}

/* Для старых браузеров (на всякий случай) */
:-ms-input-placeholder { color: #b6b6b6 !important; }
::-ms-input-placeholder { color: #b6b6b6 !important; }
/* Настройка рамки при клике на поле поиска/ввода */
input:focus, 
textarea:focus,
select:focus {
  /* Изменяем цвет контура на тёмно-серый */
  outline: 2px solid #555555 !important; 
  /* Скругляем углы контура, если нужно (по желанию) */
  outline-offset: 1px; 
}

/* Если ты хочешь, чтобы рамка была совсем мягкой (свечение), используй это: */
input:focus {
  border-color: #555555 !important; /* Цвет самой рамки поля */
  box-shadow: 0 0 5px rgba(85, 85, 85, 0.3) !important; /* Мягкая тень вокруг */
}
/* =========================================
   2. TOP BAR (Соцсети)
   ========================================= */
.top-bar {
  background: #243447;
  padding: 8px 0;
  color: #fff;
}
.top-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}
#mod-custom110 a,
.top-bar a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  display: inline-block;
  margin-left: 15px;
}
.top-bar a:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}
/* =========================================
   3. ШАПКА (HEADER)
   ========================================= */
.site-header {
  background: var(--header-bg) !important;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Базовый уровень шапки */
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  transition: padding 0.3s ease;
}
.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 40px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Логотип */
.logo {
  flex-shrink: 0;
}
.logo a {
  text-decoration: none !important;
  border-bottom: none !important;
}
.logo-text {
  font-size: 1.6rem;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}
/* Логика Brand Header (Большой логотип) */
.brand-header {
  transition: transform 0.3s ease, opacity 0.3s ease;
  padding: 32px 0;
}
.brand-header .brand-logo__image {
  height: 80px;
}
.brand-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
/* Сжатие шапки при скролле */
.brand-header.is-hidden ~ .nav-header {
  padding: 6px 0;
}
.brand-header.is-hidden ~ .nav-header .header-wrapper {
  min-height: 58px;
}

/* =========================================
   DESKTOP STYLES (min-width: 992px)
   ========================================= */
@media (min-width: 992px) {
  /* 1. Логотип в навигации - Apple-style transition 
  .nav-header .logo {
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    margin-right: 0;
    overflow: hidden;
    transform: translateX(-20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
  }
  .nav-header .logo-image {
    height: 35px;
    width: auto;
    display: block;
  }
  .brand-header.is-hidden ~ .nav-header .logo {
    max-width: 250px;
    opacity: 1;
    visibility: visible;
    margin-right: 20px;
    transform: translateX(0);
  }*/
  /* 1. Логотип в навигации - СКРЫТ НА ПК */
  .nav-header .logo {
    display: none !important;
  }

  /* 2. Навигационное меню - сетка с разделителями */
  .main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    align-items: center;
  }
  .main-nav ul li {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    margin-inline-start: 0 !important;
  }
  .main-nav ul li::after {
    content: "";
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.15);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
  .main-nav ul li:first-child::before {
    content: "";
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.15);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }
  .main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    padding: 12px 25px;
    transition: all 0.2s ease;
    display: block;
  }
  .main-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
  }
/* === НАЧАЛО: ПОДСВЕТКА ТЕКУЩЕЙ СТРАНИЦЫ === */
  .main-nav ul li:not(:first-child).current > a,
  .main-nav ul li:not(:first-child).active > a{
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    position: relative;
  }

  /* Белая полоска внизу активного пункта */
  .main-nav ul li:not(:first-child).current > a::before,
  .main-nav ul li:not(:first-child).active > a::before{
    display: none;
    content: none;
  }
  /* === КОНЕЦ ПОДСВЕТКИ === */
  /* 4. Special Menu Item: Icon Only */
  .main-nav a.menu-icon-only {
    font-size: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
  }
  .main-nav a.menu-icon-only::before {
    content: "\f015";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.2rem;
    visibility: visible;
  }

  /* 5. Фиксы для навигации и логотипа */
  .nav-header {
    min-height: 70px;
  }
  .logo-image--white {
    opacity: 0;
    transition: opacity 0.7s ease;
  }
  .brand-header.is-hidden ~ .nav-header .logo-image--white {
    opacity: 1;
  }
}

/* Элементы управления (Поиск и Бургер) */
.menu-toggle,
.mobile-search-wrapper,
.mobile-back-btn,
.menu-overlay {
  display: none !important;
}
.header-tools {
  display: flex;
  align-items: center;
}
.site-header label,
.header-tools button.btn {
  display: none !important;
}
.header-tools .search input,
.mod-finder .form-control {
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px !important;
  padding: 8px 18px !important;
  color: #fff !important;
  width: 180px !important;
  transition: all 0.3s ease !important;
}
.header-tools .search input:focus {
  background: #fff !important;
  color: #000 !important;
  width: 240px !important;
  outline: none !important;
}


/* 
  Page intro block для ПК описание Главной страницы и категорий
  Используется для вводного смыслового блока страницы (H1 + lead + текст).
  Не влияет на глобальные стили заголовков.
*/

 /* ===== Desktop (>= 992px) ===== */
 .page-intro {
  display: block;
  text-align: left;
  max-width: 75%;
  margin: 0 auto 4rem auto;
  line-height: 1.7;
 }

 @media (min-width: 992px) {
  /* Вариант 2 (по умолчанию): H1 снаружи -> вся .page-intro в правой колонке */
  .page-intro {
    display: block;
    width: 60%;
    margin-left: auto;
    border-left: 1px solid #ddd;
    padding-left: 40px;
  }

  /* Вариант 1: H1 внутри .page-intro -> 35/65 */
  .page-intro:has(> h1) {
    display: grid;
    grid-template-columns: 35% 65%;
    width: 100%;
    margin-left: 0;
    border-left: 0;
    padding-left: 0;
    align-items: start;
    column-gap: 0;
  }

  .page-intro:has(> h1) > h1 {
    margin: 0;
  }

  .page-intro:has(> h1) > :not(h1) {
    grid-column: 2;
    border-left: 1px solid #ddd;
    padding-left: 40px;
  }
 }

 /* Вводный абзац (lead) */
 .page-intro .lead {
  font-weight: 500;
  line-height: 1.7;
  font-style: normal;
 }

 /* Обычные абзацы */
 .page-intro p {
  line-height: 1.7;
  margin-bottom: 1rem;
 }

 .page-intro p:last-child {
  margin-bottom: 0;
 }

 @media (max-width: 991px) {
  .page-intro {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 2.5rem;
    border-left: 0;
    padding-left: 0;
  }
 }


/* =========================================
   4. ОСНОВНАЯ СЕТКА И САЙДБАР
   ========================================= */
.main-grid {
  display: grid;
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 60px;
  align-items: start;
}

.main-grid.has-sidebar {
  grid-template-columns: 1fr 320px;
}

.main-grid.no-sidebar {
  grid-template-columns: 1fr !important;
}

.main-grid.no-sidebar .sidebar {
  display: none !important;
}

@media (max-width: 992px) {
  .main-grid.has-sidebar {
    grid-template-columns: 1fr;
  }
}
.content-area {
  background: #ffffff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
  min-width: 0;
}

/* =========================================
   MODULE POSITIONS: CONTENT TOP/BOTTOM
   ========================================= */
.content-top-position,
.content-bottom-position {
  background: transparent;
}

.content-top-position {
  margin-bottom: 25px;
}

.content-bottom-position {
  margin-top: 25px;
}

.content-top-position .moduletable,
.content-bottom-position .moduletable {
  background: #ffffff;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e1e1;
}

.content-top-position .moduletable:last-child,
.content-bottom-position .moduletable:last-child {
  margin-bottom: 0;
}
.sidebar {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

/* Оформление модулей в сайдбаре (дизайн «карточки») */
.sidebar .moduletable,
.sidebar-sticky-wrapper > div,
.sidebar-static-wrapper > div {
  background: #ffffff;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e1e1e1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar .moduletable:hover,
#toc-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.sidebar .moduletable:last-child,
.sidebar-static-wrapper > div:last-child {
  margin-bottom: 0;
}


.sidebar h3 {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: bold;
}
/* Модуль входа (Joomla/System) */
.sidebar .mod-login label,
.sidebar .mod-login .icon-user,
.sidebar .mod-login .icon-lock {
  display: none !important;
}
.sidebar .mod-login .input-group {
  margin-bottom: 12px;
  display: flex;
  width: 100%;
}
.sidebar .mod-login .form-control {
  border: 1px solid #ddd !important;
  border-radius: 6px 0 0 6px !important;
  margin-bottom: 0 !important;
  padding: 10px;
  flex: 1;
}
.sidebar .mod-login .btn-secondary.input-password-toggle {
  background: #f8f9fa !important;
  border: 1px solid #ddd !important;
  border-left: none !important;
  color: var(--primary) !important;
  cursor: pointer;
  padding: 0 15px;
  display: flex;
  align-items: center;
  border-radius: 0 6px 6px 0 !important;
  transition: 0.2s;
  margin-bottom: 0 !important;
}
.sidebar .mod-login .btn-secondary.input-password-toggle:hover {
  background: #eef2f3 !important;
  color: var(--dark) !important;
}
.sidebar .btn-primary {
  width: 100%;
  background-color: var(--primary) !important;
  border: none !important;
  padding: 12px !important;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 5px;
}
/* =========================================
   5. ОГЛАВЛЕНИЕ (TOC) И НАВИГАЦИЯ
   ========================================= */
   /* Специальный класс для фиксации модуля при скролле */


/* Настройка для плавной прокрутки внутри самого модуля, если он очень длинный */
.sticky-module .well {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}

  /* Возможно его надо удалить */

.toc-title {
  font-size: 1.1rem !important;
  margin-bottom: 15px !important;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-soft);
  padding-bottom: 8px;
}
#toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#toc-list li {
  margin-bottom: 12px;
  line-height: 1.3;
}
#toc-list a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  transition: 0.2s;
  display: block;
}
#toc-list a:hover {
  color: var(--primary);
  padding-left: 5px;
}
/* Кнопка "Наверх" */
#back-to-top {
  position: fixed;
  bottom: 40px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: #fff;
  text-align: center;
  line-height: 45px;
  font-size: 24px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  background-color: #26a69a !important; /* Более светлый и яркий бирюзовый */
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  color: #ffffff; /* Цвет стрелки остается белым */
}
/* =========================================
   6. ОФОРМЛЕНИЕ КОНТЕНТА И СТАТЕЙ
   ========================================= */
.lead,
.article-intro {
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 25px;
  padding-left: 20px;
  border-left: 4px solid var(--primary);
  font-style: italic;
  opacity: 0.9;
  display: block;
  overflow: hidden;
}
.content-area p {
  margin-bottom: 1.5rem;
  max-width: 75ch;
}
.content-area h2,
.content-area h3 {
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  scroll-margin-top: 100px;
}
/* Блоки: Заметка, Цитата, Списки */
.content-note {
  background-color: var(--primary-soft) !important;
  border-left: 5px solid var(--primary) !important;
  padding: 25px !important;
  margin: 30px 0 !important;
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
  color: var(--text);
}
blockquote {
  font-style: italic;
  color: #576574;
  border-left: 4px solid #d1d8e0;
  padding-left: 20px;
  margin: 30px 20px;
  background: transparent;
}
.list-check {
  list-style: none !important;
  padding-left: 5px !important;
}
.list-check li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
}
.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #27ae60;
  font-weight: bold;
  font-size: 1.2rem;
}
.list-cross {
  list-style: none !important;
  padding-left: 5px !important;
}
.list-cross li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
}
.list-cross li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #e74c3c;
  font-weight: bold;
}
.img-caption {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-top: -10px;
  margin-bottom: 25px;
}
/* Кейсы, Предупреждения, Разделители */
.content-case {
  background-color: #fcfcfc !important;
  border: 1px solid #e1e8ed !important;
  border-radius: 8px;
  padding: 30px !important;
  margin: 40px 0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.content-case__title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}
.content-case__body p:last-child {
  margin-bottom: 0;
}
.content-divider {
  height: 1px;
  background-color: #e0e6ed;
  border: none;
  margin: 50px auto;
  width: 60%;
  opacity: 0.7;
}
.content-warning {
  background-color: #fff9f0 !important;
  border-left: 5px solid #f39c12 !important;
  padding: 25px !important;
  margin: 30px 0 !important;
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
.content-warning::before {
  content: "⚠️";
  display: inline-block;
  margin-right: 10px;
}
.content-image {
  display: block;
  margin: 35px 0;
  text-align: center;
}
.content-image figure {
  margin: 0;
  display: inline-block;
  width: 100%;
}
.content-image img {
  display: block;
  margin: 0 auto 15px auto;
  max-width: 100%;
  height: auto;
}
/* --- СТИЛИ ДЛЯ ХЛЕБНЫХ КРОШЕК --- */
.breadcrumb-container {
  background-color: #f0f4f5; /* Очень легкий фон, чтобы отделить от шапки */
  padding: 12px 0;
  border-bottom: 1px solid #e1e8ed;
}

/* Joomla обычно выводит крошки списком ul или span */
.breadcrumb-container .breadcrumb, 
.breadcrumb-container ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem; /* Делаем чуть меньше основного текста */
}

.breadcrumb-container li, 
.breadcrumb-container span {
  display: flex;
  align-items: center;
  color: #7f8c8d;
}

/* Символ разделителя между пунктами */
.breadcrumb-container li:not(:last-child)::after,
.breadcrumb-container span:not(:last-child)::after {
  content: "/";
  margin: 0 12px;
  color: #bdc3c7;
  font-weight: 300;
}

.breadcrumb-container a {
  color: var(--primary); /* Твой фирменный цвет */
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-container a:hover {
  color: var(--dark);
  text-decoration: underline;
}

/* Стиль для последнего (активного) пункта */
.breadcrumb-container li:last-child,
.breadcrumb-container span:last-child {
  color: #2c3e50;
  font-weight: 600;
  pointer-events: none; /* Последний пункт не кликабелен */
}
/* =========================================
   7. ФУТЕР
   ========================================= */
.site-footer {
  background: var(--dark) !important;
  color: #999;
  padding: 60px 0;
  text-align: center;
  margin-top: auto;
}
/* =========================================
   8. АДАПТИВНОСТЬ (MEDIA QUERIES)
   ========================================= */
/* Tablet (Промежуточный этап) */
@media (max-width: 992px) {
  .site-main {
    flex-direction: column;
  }
  .content-area,
  .sidebar {
    width: 100%;
  }
}
/* Mobile (Главный брейкпоинт) */
@media (max-width: 991px) {
  /* 8.1. Скрытие десктопных элементов */
  .brand-header,
  .toc-sidebar,
  .main-nav,
  .header-tools {
    display: none !important;
  }
  /* 8.2. Базовая структура шапки */
  .site-header {
    z-index: 1001 !important;
  }
  .site-header .header-wrapper {
    flex-direction: row;
    align-items: center;
    padding: 15px 20px;
  }
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  /* 8.3. Логотип */
  .nav-header .logo {
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    margin-right: 15px;
    /* Отступ от лого до меню */
    display: block;
  }
  .nav-header .logo-image {
    opacity: 1 !important;
    /* Убираем зависимость от переменной, делаем всегда видимым */
    visibility: visible !important;
    transform: translateY(0);
    height: 32px;
    width: auto;
  }
  /* 8.4. Бургер (Меню-тоггл) */
  .menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    visibility: visible;
    z-index: 1003;
    /* Поверх всего в шапке */
  }
  .hamburger {
    position: relative;
  }
  .hamburger,
  .hamburger::before,
  .hamburger::after {
    content: "";
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: 0.3s;
  }
  .hamburger::before {
    position: absolute;
    top: -8px;
    left: 0;
  }
  .hamburger::after {
    position: absolute;
    top: 8px;
    left: 0;
  }
  /* Анимация бургера при открытии */
  .menu-toggle.active .hamburger {
    background: transparent !important;
  }
  .menu-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0 !important;
  }
  .menu-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0 !important;
  }
/* 8.5. Активное мобильное меню - ИСПРАВЛЕНО */
.main-nav.active {
  display: block !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  height: auto !important;
  max-height: calc(100vh - 80px) !important;
  background: var(--header-bg) !important;
  z-index: 1002 !important;
  padding: 20px 0 !important;
  overflow-y: auto !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  border-radius: 0 0 12px 12px !important;
}
  .main-nav.active ul {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .main-nav.active li {
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  .main-nav.active li:last-child {
    border-bottom: none !important;
  }
/* СТИЛЬ ССЫЛОК В МОБИЛЬНОМ МЕНЮ - ИСПРАВЛЕНО */
.main-nav.active a {
  color: white !important; /* Четко белый цвет */
  text-decoration: none !important; /* Убираем подчеркивание */
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  padding: 18px 25px !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  text-align: left !important;
  min-height: 56px !important;
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
  transition: all 0.3s ease !important; /* Плавная анимация */
}
/* УБИРАЕМ ПРЕДЫДУЩИЙ ПСЕВДОЭЛЕМЕНТ (текущая стрелочка) */
.main-nav.active a::before {
  display: none !important; /* Убираем маленькие стрелки */
}
/* === ДОБАВЬТЕ ЭТОТ БЛОК === */
/* НОВАЯ БОЛЬШАЯ СТРЕЛКА ДЛЯ ВСЕХ ПУНКТОВ - СЛЕВА ОТ ТЕКСТА */
.main-nav.active li a::before {
  content: "→" !important; /* Жирная стрелка для всех пунктов */
  font-size: 1.5rem !important; /* Большой размер */
  font-weight: bold !important;
  margin-right: 15px !important; /* Отступ между стрелкой и текстом */
  opacity: 0.7 !important;
  transition: all 0.3s ease !important; /* Анимация для стрелки */
  pointer-events: none !important; /* Чтобы не мешала клику */
  display: block !important; /* Обязательно показываем */
}
/* ИСПРАВЛЕНИЕ: Заменяем иконку домика на стрелку в мобильном меню */
.main-nav.active a.menu-icon-only::before {
  content: "→" !important; /* Заменяем домик на стрелку */
  font-family: inherit !important; /* Наследуем основной шрифт, не Font Awesome */
  font-size: 1.5rem !important; /* Такой же размер, как у остальных стрелок */
  font-weight: bold !important;
  margin-right: 15px !important;
  opacity: 0.7 !important;
}
/* === КОНЕЦ ДОБАВЛЯЕМОГО БЛОКА === */
/* АНИМАЦИЯ ПРИ НАВЕДЕНИИ - НОВЫЙ КОД */
.main-nav.active a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: translateX(10px) !important; /* Сдвиг вправо */
  padding-left: 35px !important; /* Увеличиваем отступ слева */
}
/* Анимация стрелки при наведении */
.main-nav.active a:hover::before {
  transform: translateX(5px) !important; /* Стрелка тоже сдвигается */
  opacity: 1 !important; /* Стрелка становится ярче */
}
/* Активный пункт меню */
.main-nav.active li.current > a,
.main-nav.active a.active {
  background: rgba(255, 255, 255, 0.18) !important;
  font-weight: 700 !important;
}

/* БЕЛАЯ ПОЛОСКА СЛЕВА ДЛЯ АКТИВНОГО ПУНКТА - ВОЗВРАЩАЕМ */
.main-nav.active li.current > a,
.main-nav.active a.active {
  background: rgba(255, 255, 255, 0.18) !important;
  font-weight: 700 !important;
  position: relative;
}

/* Белая полоса слева для активного пункта */
.main-nav.active li.current > a::after,
.main-nav.active a.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: white;
  z-index: 2;
}

  /* 8.6. Мобильный поиск */
  .mobile-search-wrapper {
    display: block !important;
    width: 100% !important;
    padding: 0 25px !important;
    margin: 20px 0 15px 0 !important;
  }
  .mobile-search-wrapper input {
    width: 100% !important;
    height: 45px !important;
    padding: 0 20px !important;
    border-radius: 25px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    font-size: 16px !important;
  }
  /* 8.7. Кнопка "Назад" (если нужна) */
  .mobile-back-btn {
    display: none;
  }
  .main-nav.active .mobile-back-btn {
    display: block;
    width: 100%;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
  }
  .main-nav.active .mobile-back-btn::before {
    content: "← ";
    margin-right: 8px;
  }
  /* 8.8. Оверлей (затемнение фона) */
  .menu-overlay {
    display: block !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 999 !important;
    /* Ниже шапки, выше контента */
    opacity: 0 !important;
    visibility: hidden;
    transition: opacity 0.3s ease !important;
  }
  .menu-overlay.show {
    opacity: 1 !important;
    visibility: visible;
  }
  /* Тень шапки при открытом меню */
  .site-header.menu-open {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2) !important;
  }
  /* Эффект при наведении в мобильном меню */
  @media (hover: hover) or (pointer: fine) {
    .main-nav.active a:hover {
      padding-left: 35px !important; /* Сдвигаем текст вправо при наведении */
      background: rgba(255, 255, 255, 0.05);
    }
  }

  /* Полоска при наведении (как у активного, но со сдвигом) */
  .main-nav.active a:hover::after {
    content: "";
    position: absolute;
    left: 1px; /* Сдвиг полоски от края, чтобы отличалась от активной */
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.7); /* Чуть прозрачнее, чем у активного */
    z-index: 2;
  }

}
/* Fix for Tablet/Mobile (< 992px) - Unlock and show white logo */
@media (max-width: 991px) {
  .logo-image {
    display: none !important;
  }
  .logo-image--white {
    display: block !important;
    height: 40px;
    width: auto;
  }
  /* The "Lock" fix - Unlock container for tablet/mobile */
  .nav-header .logo {
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    margin-right: 20px;
    display: block;
  }
}
/* Жесткое обнуление тех самых 0.5rem (8px) */
.main-nav .mod-menu [class*="icon-"],
.main-nav a.menu-icon-only,
.main-nav a.menu-icon-only::before {
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
}

/* Оформление блока "Без содержания" */
.toc-placeholder {
    text-align: center;
    padding: 30px 20px;
    background: var(--primary-soft);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.toc-placeholder i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
    opacity: 0.8;
}

.toc-placeholder__text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    font-style: italic;
    opacity: 0.9;
}

.toc-placeholder:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-style: solid;
}
/* 
  Page intro block для Mobile описание Главной страницы и категорий
  Используется для вводного смыслового блока страницы (H1 + lead + текст).
  Не влияет на глобальные стили заголовков.
*/
/* ===== Mobile (< 768px) ===== */
@media (max-width: 767px) {
  .page-intro {
    text-align: center;
    max-width: 95%;
    margin: 0 auto 2.5rem auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .page-intro .lead {
    font-style: normal;
  }
}
/* =========================================
   ИСПРАВЛЕНИЕ САЙДБАРА (ФИНАЛЬНОЕ)
   ========================================= */

/* 1. Настраиваем РОДИТЕЛЯ (Серую колонку) */
.sidebar {
  /* Включаем режим колонки */
  display: flex;
  flex-direction: column;
  /* Прижимаем модули к верху (чтобы не растягивались на всю высоту) */
  justify-content: flex-start; 
  /* Гарантируем, что сам сайдбар во всю высоту статьи */
  height: 100%; 
}

/* 2. Настраиваем ВЕРХНЮЮ ПОЗИЦИЮ (Липкую) */
.sidebar-top-position {
  /* Включаем липкость */
  position: -webkit-sticky;
  position: sticky;
  top: 90px; /* Отступ от шапки */
  z-index: 4; /* Чуть ниже меню, но выше контента */
  
  /* Отступ снизу, чтобы нижние модули не "подъезжали" вплотную при скролле */
  margin-bottom: 30px; 
}

/* 3. Настраиваем НИЖНЮЮ ПОЗИЦИЮ (Обычную) */
.sidebar-main-position {
  /* Она просто идет следом */
  position: relative;
  z-index: 1;
}

/* Убираем лишние отступы у модулей внутри, чтобы они стояли ровно */
.sidebar-top-position .well,
.sidebar-main-position .well {
    margin-bottom: 20px;
}
.sidebar-top-position .well:last-child {
    margin-bottom: 0;
}

/* Глобальное исправление для Sticky */

.sidebar-sticky-wrapper {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 100px !important;
    z-index: 10;
    height: fit-content !important;
}

/* Очистка старых правил */
html, body { 
    overflow: visible !important; 
    height: auto !important; 
}
.main-grid, .content-area { overflow: visible !important; }

/* =========================================
   7. БЛОГ И КАТЕГОРИИ (НОВЫЕ СТИЛИ)
   ========================================= */

/* Сетка блога */
.articles-list:not(.row) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

/* На мобильных/узких экранах всегда 1 колонка */
@media (max-width: 991px) {
  .articles-list:not(.row) {
    display: block;
  }

  .articles-list:not(.row) .article-row {
    margin-bottom: 30px;
  }
}

/* На десктопе применяем раскладку строго по настройкам Joomla (классы columns-N / masonry-N) */
@media (min-width: 992px) {
  /* Режим "columns" (слева направо) */
  .articles-list.columns-1:not(.row),
  .articles-list.columns-2:not(.row),
  .articles-list.columns-3:not(.row),
  .articles-list.columns-4:not(.row) {
    display: grid;
    gap: 30px;
  }

  .articles-list.columns-1:not(.row) { grid-template-columns: 1fr; }
  .articles-list.columns-2:not(.row) { grid-template-columns: repeat(2, 1fr); }
  .articles-list.columns-3:not(.row) { grid-template-columns: repeat(3, 1fr); }
  .articles-list.columns-4:not(.row) { grid-template-columns: repeat(4, 1fr); }

  /* Режим "masonry" (сверху вниз) */
  .articles-list.masonry-1:not(.row),
  .articles-list.masonry-2:not(.row),
  .articles-list.masonry-3:not(.row),
  .articles-list.masonry-4:not(.row) {
    display: block;
    column-gap: 30px;
  }

  .articles-list.masonry-1:not(.row) { column-count: 1; }
  .articles-list.masonry-2:not(.row) { column-count: 2; }
  .articles-list.masonry-3:not(.row) { column-count: 3; }
  .articles-list.masonry-4:not(.row) { column-count: 4; }

  .articles-list.masonry-1:not(.row) .article-row,
  .articles-list.masonry-2:not(.row) .article-row,
  .articles-list.masonry-3:not(.row) .article-row,
  .articles-list.masonry-4:not(.row) .article-row {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 30px;
    display: inline-block;
    width: 100%;
  }
}

/* Карточка материала */
.blog-item {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 12px;
  margin-bottom: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

@media (min-width: 992px) {
  .blog-item > .item-title {
    padding: 24px 28px 0;
    margin: 0 0 15px;
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 700;
  }

  .blog-item > .item-title a {
    text-decoration: none;
    color: var(--dark);
    transition: color 0.2s;
  }

  .blog-item > .item-title a:hover {
    color: #1FA3A8;
  }

  .blog-item .article-body-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
    padding: 18px 28px 28px;
  }

  .blog-item .article-body-wrapper .blog-item-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
  }

  .blog-item .article-body-wrapper .blog-item-image img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
  }

  .blog-item .article-body-wrapper .item-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
  }

  .blog-item .article-body-wrapper .item-content .readmore {
    display: flex;
    justify-content: flex-end;
  }
}

@media (max-width: 991px) {
  .blog-item > .item-title {
    padding: 18px 20px 0;
    margin: 0 0 12px;
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
  }

  .blog-item > .item-title a {
    text-decoration: none;
    color: var(--dark);
  }
}

.item-content {
  padding: 28px;
}

.item-content .item-title a {
  text-decoration: none;
  color: var(--dark);
  transition: color 0.2s;
}

.item-content .item-title a:hover {
  color: #1FA3A8;
}

.item-content .article-info {
  margin: 0 0 15px;
  padding: 0;
  font-size: 0.95rem;
  color: #666;
}

.item-content .article-info dt {
  display: none;
}

.item-content .article-info dd {
  margin: 0 0 6px;
}

.item-content .article-info dd:last-child {
  margin-bottom: 0;
}

.item-content p {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 20px;
}

@media (min-width: 992px) {
  .content-area p,
  .content-area .lead,
  .content-area .article-intro,
  .item-content p,
  .item-content .lead {
    font-size: 1.2rem;
  }

  .content-area .article-info,
  .content-area .text-muted,
  .item-content .article-info,
  .item-content .text-muted {
    font-size: 0.95rem;
  }
}

.item-content .readmore {
  margin-top: auto;
}

.item-content .readmore a.btn {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  text-transform: none;
  text-decoration: none;
  border: none !important;
  display: inline-block;
  transition: all 0.3s ease;
}

.item-content .readmore a.btn:hover,
.item-content .readmore a.btn:focus {
  background-color: #167e82 !important;
  color: #ffffff !important;
}