/* 1. База ---------------------------------------------------------- */
:root {
  --ink: #1A1A1A;
  --muted: #666666;
  --brand: #3498DB;
  --brand-hover: #2980B9;
  --bg-light: #F8F9FA;
  --accent: #EEF642;
  --accent-hover: #d8e038;
  --line: #E2E8F0;
  --wrap: 1200px;
  --text-dark: #1A1A1A;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px;
}
.skip-link:focus {
  left: 8px; top: 8px; z-index: 100; padding: 10px 14px;
  background: var(--brand); color: #fff; border-radius: 8px;
}

/* Шапка + Двухуровневое меню + Элементы ------------------------- */
.site-header {
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Новый класс (срабатывает, только если включена опция в админке) */
.site-header.is-sticky {
  position: sticky;
  top: 0;
}
.header-bar { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 30px; 
}
.logo { 
  font-weight: 800; 
  font-size: 1.5rem; 
  letter-spacing: -.02em; 
  color: var(--brand); 
  white-space: nowrap;
}
.logo span { color: var(--ink); }
.logo img { max-height: 40px; width: auto; }

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-grow: 1;
  justify-content: flex-end;
}

/* Гамбургер */
.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 5px 0; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Блок двух линий меню */
.nav-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.main-nav ul,
.sub-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Главное меню (menu1) */
.main-nav a {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s ease;
}

.main-nav li.active > a,
.main-nav a:hover {
  color: var(--brand);
  background-color: rgba(52, 152, 219, 0.08);
  text-decoration: none;
}

/* Разделительная линия */
.nav-divider {
  width: 100%;
  height: 1px;
  background-color: var(--line);
}

.sub-nav {
  padding-left: 5px;
}

/* Подменю (menu2) */
.sub-nav a {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  padding: 2px 6px;
  text-decoration: none;
  transition: color 0.2s;
}

.sub-nav li.active > a,
.sub-nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

/* Телефон в шапке */
.header-phone {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap;
}

.phone-link {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.phone-link:hover {
  color: var(--brand);
  text-decoration: none;
}

.phone-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Акцентная кнопка */
.btn-accent {
  background-color: var(--accent);
  color: var(--ink);
  padding: 8px 16px;
  line-height: 1.2;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
}

/* ==========================================================================
   Секция баннеров (Hero Banners)
   ========================================================================== */
.hero-banners {
  padding: 32px 0;
  background-color: var(--brand);
  border-bottom: 1px solid var(--line);
}

.banners-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.banner-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.banner-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
  border-color: rgba(52, 152, 219, 0.4);
}

/* === 1. РЕЖИМ КАРТИНКИ (с поддержкой плашки текста) === */
.banner-card-image {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.banner-card-link,
.banner-card-static {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.banner-img-wrap {
  width: 100%;
  flex-grow: 1;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.02);
}

.banner-img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.banner-card-link:hover .banner-img {
  transform: scale(1.02);
  opacity: 0.95;
}

/* Цветная плашка с текстом $desc под картинкой */
.banner-img-caption {
  background-color: #f7e335;
  color: #0d5bb5;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* === 2. СТИЛИ ДЛЯ ТЕКСТОВОГО РЕЖИМА === */
.banner-card-text {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.banner-content {
  margin-bottom: 20px;
}

.banner-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: inline-block;
  line-height: 1;
}

.banner-icon img {
  max-height: 40px;
  width: auto;
}

.banner-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.banner-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.banner-btn {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  background-color: rgba(52, 152, 219, 0.08);
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.banner-btn:hover {
  background-color: var(--brand);
  color: #ffffff;
  text-decoration: none;
}

/* ==========================================================================
   Секция статей режим Grid
   ========================================================================== */
.articles-section {
  padding: 20px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 24px;
}

.category-description {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  background: var(--bg-light);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 6px;
}

/* Сетка карточек статей */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* Карточка статьи */
.article-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: rgba(52, 152, 219, 0.4);
}

/* Бейджик / Тэг над заголовком */
.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  background-color: rgba(52, 152, 219, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.card-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.card-content h3 a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-content h3 a:hover {
  color: var(--brand);
}

.card-content p {
  margin: 0 0 18px 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Ссылка "Читать дальше" */
.card-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.card-link:hover {
  color: #1b6fa8;
  text-decoration: none;
}
/* ==========================================================================
   Конец секции статей режим Grid
   ========================================================================== */
   
/* ==========================================================================
   Секция статей режим List
   ========================================================================== */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Выравниваем бедж внутри строки списка */
.articles-list .card-tag {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Контент занимает всё доступное пространство между тэгом и ссылкой */
.articles-list .card-content {
  flex-grow: 1;
}

.articles-list .card-content h3 {
  margin-bottom: 6px;
}

.articles-list .card-content p {
  margin: 0;
}

/* Ссылка "Читать дальше" не сжимается */
.articles-list .card-link {
  flex-shrink: 0;
  white-space: nowrap;
}
/* ==========================================================================
   Секция статей режим List
   ========================================================================== */

/* Стили для неопубликованных карточек (видимых только админу) */
.article-card.is-unpublished {
  opacity: 0.65;                       /* Делаем карточку полупрозрачной */
  border: 2px dashed #e74c3c;          /* Красная пунктирная рамка */
  background-color: #fff9f9;           /* Легкий розоватый фон */
}

.article-card.is-unpublished:hover {
  opacity: 1;                          /* При наведении возвращаем полную яркость */
}

/* Бейджик "Скрыто" в углу карточки */
.unpublished-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #e74c3c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 2;
}
/* ==========================================================================
   Картинки в режиме список
   ========================================================================== */
.articles-list .article-card {
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

/* Фиксируем размеры картинки, чтобы её не распирало */
.articles-list .card-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 110px;
  overflow: hidden;
  border-radius: 8px;
}

.articles-list .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* ==========================================================================
   Пагинация (Pagination)
   ========================================================================== */
.pagination-wrap {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

/* Сбрасываем стандартный список Joomla */
.pagination-wrap ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-wrap li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Ссылки и активные элементы */
.pagination-wrap a,
.pagination-wrap span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background-color: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Эффект при наведении */
.pagination-wrap a:hover {
  color: var(--brand);
  border-color: var(--brand);
  background-color: rgba(52, 152, 219, 0.05);
  text-decoration: none;
}

/* Активная (текущая) страница */
.pagination-wrap .active span,
.pagination-wrap span.pagenav {
  background-color: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  cursor: default;
}

/* Отключенные кнопки (В начало / Назад на 1-й странице) */
.pagination-wrap .disabled span,
.pagination-wrap .off span {
  color: var(--muted);
  background-color: #f5f5f5;
  border-color: var(--line);
  opacity: 0.6;
  cursor: not-allowed;
} 

/* ==========================================================================
   Sticky Bar (Плавающая панель сбоку)
   ========================================================================== */
/* Общий контейнер плавающей панели */
.sticky-bar {
  position: fixed;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 8px 6px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--line);
}

/* Элементы внутри плавающей панели (ссылки соцсетей, кнопка поиска, формы) */
.sticky-bar a,
.sticky-bar button,
.sticky-bar form {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;             /* Фиксированная ширина индивидуального кружка */
  height: 36px;            /* Фиксированная высота индивидуального кружка */
  border-radius: 50%;      /* Делает каждый кликабельный элемент кругом */
  background: #f4f5f7;     /* Фон кружка под иконкой (измените цвет при необходимости) */
  color: #333333;          /* Цвет SVG-иконки */
  text-decoration: none;
  border: none;
  margin: 0;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* Эффект при наведении на отдельный кружок */
.sticky-bar a:hover,
.sticky-bar button:hover {
  background: #e2e8f0;     /* Цвет фона при наведении */
}

/* Стили для SVG и картинок внутри индивидуальных кружков */
.sticky-bar svg {
  width: 20px;            /* Размер самой SVG иконки */
  height: 20px;
  fill: currentColor;
  display: block;
}

.sticky-bar img {
  width: 20px;            /* Размер для загруженной пользовательской картинки */
  height: 20px;
  object-fit: contain;
  display: block;
}

/* Если в плавающем баре осталась только одна кнопка */
.sticky-bar.is-single {
  padding: 4px;            /* Небольшой зазор вокруг единственного кружка */
  border-radius: 50%;      /* Сам внешний плавающий бар тоже становится кругом */
}

.sticky-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
  background-color: transparent;
  transition: all 0.2s ease;
}

.sticky-item:hover {
  color: var(--brand);
  background-color: rgba(52, 152, 219, 0.1);
  transform: scale(1.1);
}

.sticky-search {
  border-top: 1px solid var(--line);
  border-radius: 50%;
  margin-top: 4px;
  padding-top: 4px;
}

/* ==========================================================================
   Основной контейнер футера
   ========================================================================== */
.site-footer {
  background-color: var(--text-dark);
  color: #CCCCCC;
  padding-top: 30px;
  font-size: 0.90rem;
  line-height: 1.6;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Центрирует внутренние блоки */
}

/* ==========================================================================
   1. Иконки в подвале (По центру, сверху)
   ========================================================================== */
.footer-socials-wrapper {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.footer-socials-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  background: #2a2a2a;
  transition: all 0.25s ease;
}

.footer-social-link:hover {
  color: #111111;
  background-color: var(--brand, #ffc107); /* Желтый акцент */
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. Сетка колонок (Центруется, выравнивание текста по левому краю)
   ========================================================================== */
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Центрирует сами колонки */
  align-items: flex-start; /* ВЫРАВНИВАНИЕ ПО ВЕРХНЕМУ КРАЮ */
  gap: 40px;
  width: 100%;
  margin-bottom: 35px;
}

.footer-grid.has-titles {
  align-items: stretch;
}

.footer-col {
  box-sizing: border-box;
  text-align: left; /* Текст внутри колонок строго по левому краю */
  display: flex;
  flex-direction: column;
}

/* Область под заголовок активна только при наличии класса .has-titles */
.has-titles .footer-col-header {
  min-height: 32px; /* Посадочное место для заголовка */
  margin-bottom: 15px;
  display: flex;
  align-items: flex-end;
}

/* Желтые заголовки колонок */
.footer-col-title {
  color: var(--accent);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: 0.5px;
}

.footer-col-content {
  flex-grow: 1;
}

/* Распределение ширины колонок */

/* 1 колонка — на всю ширину */
.footer-grid-count-1 .footer-col {
  flex: 0 0 100%;
  max-width: 100%;
}

/* 2 колонки — 1-я обычная (33%), 2-я забирает 2 части (66%) */
.footer-grid-count-2 .footer-col:nth-child(1) {
  flex: 0 0 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
}
.footer-grid-count-2 .footer-col:nth-child(2) {
  flex: 1 1 calc(66.666% - 20px);
  max-width: calc(66.666% - 20px);
}

/* 3 колонки — ровно по 33% каждая */
.footer-grid-count-3 .footer-col {
  flex: 1 1 calc(33.333% - 27px);
  max-width: calc(33.333% - 27px);
}

/* Стилизация списков с синими точками */
.footer-col-content ul,
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col-content li,
.footer-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}

.footer-col-content li::before,
.footer-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background-color: #0088cc; /* Синяя точка */
  border-radius: 50%;
}

/* ==========================================================================
   3. Разделитель и Нижний Бар
   ========================================================================== */
.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #333333 20%, #333333 80%, transparent);
}

.footer-bottom-bar {
  background-color: var(--text-dark);
  width: 100%;
  padding: 18px 0;
  font-size: 0.88rem;
  color: #888888;
}

.footer-bottom-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
}

.footer-developer {
  text-align: left;
}

.footer-developer a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-developer a:hover {
  color: var(--brand, #ffc107);
}

.footer-copy {
  text-align: center;
  grid-column: 2;
  white-space: nowrap;
}

.footer-back-to-top {
  text-align: right;
  grid-column: 3;
}

.toplink {
  color: var(--brand);
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.2s;
  cursor: pointer;
}

.toplink:hover {
  color: var(--brand-hover);
}

/* ==========================================
   ОВЕРЛЕЙ ПОИСКА
   ========================================== */

/* Блокировка прокрутки основного сайта при открытом поиске */
body.search-open {
  overflow: hidden;
}

/* 1. Базовый контейнер оверлея (затемнение и размытие) */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  box-sizing: border-box;
}

/* Состояние при открытии */
.search-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Кнопка закрытия (Крестик) */
.search-overlay-close {
  position: absolute;
  top: 25px;
  right: 35px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.search-overlay-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Центральный блок формы */
.search-overlay-content {
  width: 90%;
  max-width: 700px;
}

/* Строка ввода и иконка */
.search-input-wrapper {
  position: relative;
  border-bottom: 2px solid var(--brand, #3498db);
  display: flex;
  align-items: center;
}

.search-overlay-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.8rem;
  padding: 12px 50px 12px 10px;
  font-weight: 500;
  box-sizing: border-box;
}

.search-overlay-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-overlay-submit {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--brand, #3498db);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

/* 2. Контейнер результатов и скроллбар */
.search-results-container {
  margin-top: 25px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 10px;
}

.search-results-container::-webkit-scrollbar {
  width: 6px;
}

.search-results-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* 3. Оформление элементов выдачи */
.search-result-item {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-result-title {
  font-size: 1.15rem;
  color: var(--brand, #3498db);
  text-decoration: none !important;
  font-weight: 600;
  display: block;
}

.search-result-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
  line-height: 1.35;
}

/* Статусы (загрузка, пусто, ошибка) */
.search-loading,
.search-empty,
.search-error {
  padding: 15px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
}

/* ==========================================
   СОВРЕМЕННАЯ СТРАНИЦА РЕЗУЛЬТАТОВ ПОИСКА
   ========================================== */

/* Контейнер формы поиска Joomla (если отображается на странице) */
#searchForm {
  margin-bottom: 2rem;
}

#searchForm .word {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  background: var(--bg-light);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 6px;
}

#searchForm input[type="text"] {
  flex: 1;
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#searchForm input[type="text"]:focus {
  border-color: var(--brand, #3498db);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

#searchForm button, 
#searchForm input[type="submit"] {
  padding: 10px 20px;
  background-color: var(--brand, #3498db);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

#searchForm button:hover, 
#searchForm input[type="submit"]:hover {
  background-color: #2980b9;
}

/* Панель-контейнер для строки со счетчиком и селектором */
.search-toolbar {
    display: flex;
    justify-content: space-between; /* Распределяет блоки по краям: слева и справа */
    align-items: center;            /* Выравнивает их по вертикальному центру */
    margin: 1.5rem 0 1rem 0;
    gap: 15px;
    flex-wrap: wrap;                /* На мобилках аккуратно перенесет на 2 строки */
}

.search-toolbar .searchintro {
    padding-left: 8px; 
}

/* Выравнивание элементов внутри блока выпадающего списка */
.search-toolbar .form-limit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto; /* На случай, если searchintro пустой — прижмет влево */
}

.search-toolbar .searchintro p,
.search-toolbar .form-limit label {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    white-space: nowrap;
}

.search-toolbar .form-limit select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    outline: none;
}

/* Список результатов */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* Карточка отдельного результата */
.search-result-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-result-card:hover {
  border-color: rgba(52, 152, 219, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Шапка карточки */
.search-result-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.search-result-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
}

.search-result-card-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.search-result-card-title a:hover {
  color: var(--brand, #3498db);
}

/* Бейдж категории/раздела */
.search-result-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--accent);
  color: var(--text-dark);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Текст совпадения */
.search-result-card-text {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

/* Подсветка искомого слова (стандартный тег span.highlight в J2.5) */
.search-result-card-text .highlight,
span.highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Мета-данные (Дата) */
.search-result-meta {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.825rem;
  color: #64748b;
}

.search-result-meta time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Подстраховка пагинации Joomla */
.search-pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.search-pagination ul {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 5px;
}

.search-pagination li a,
.search-pagination li span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.9rem;
}

.search-pagination li.active span,
.search-pagination li a:hover {
  background-color: var(--brand, #3498db);
  color: #ffffff;
  border-color: var(--brand, #3498db);
}

.article-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 4px 0 8px;
}

.article-rating-stars .star-icon.is-filled {
    fill: #f39c12; /* Золотистый цвет */
}

.article-rating-stars .star-icon.is-empty {
    fill: #e0e0e0; /* Серый цвет */
}



/* Дата справа в карточке списка */
.article-date-right {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

/* Автор статьи, если выводится под заголовком */
.article-meta {
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  margin: 4px 0 8px 0;
}

.article-meta .createdby {
  color: var(--brand);
  background-color: rgba(52, 152, 219, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.article-meta .create {
  color: #854d0e;
  background-color: #f7fea8; 
  padding: 4px 10px;
  border-radius: 20px;
}
/* ==========================================================================
   Страница отдельной статьи (View Article)
   ========================================================================== */

/* Главный контейнер статьи */
.item-page {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Главный заголовок статьи */
.item-page h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink, #1e293b);
  line-height: 1.3;
  margin: 0 0 12px 0;
}

.item-page h2 a {
  color: inherit;
  text-decoration: none;
}

.item-page h2 a:hover {
  color: var(--brand, #3498db);
}


/* Адаптив для мобилок */
@media (max-width: 768px) {
  .footer-grid-count-2 .footer-col:nth-child(1),
  .footer-grid-count-2 .footer-col:nth-child(2),
  .footer-grid-count-3 .footer-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .footer-bottom-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 12px;
  }

  .footer-developer,
  .footer-copy,
  .footer-back-to-top {
    grid-column: 1;
    text-align: center;
  }
  
  .articles-list .article-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .articles-list .card-tag {
    margin-bottom: 10px;
  }
  .articles-list .card-content h3 {
    margin-bottom: 8px;
  }
  .articles-list .card-content p {
    margin-bottom: 12px;
  }
}

/* Адаптивность шапки */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .header-bar { position: relative; }
  
  .header-right {
    display: none; /* Переключается через JS скриптом мобильного меню */
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 20px 0;
    border-top: 1px solid var(--line);
  }

  .header-right.is-open {
    display: flex;
  }

  .nav-block { align-items: center; }
  .main-nav ul, .sub-nav ul { flex-wrap: wrap; justify-content: center; }
  .header-phone { align-items: center; }
}

/* 3. Раскладка: mobile-first, сайдбары появляются позже ------------- */
.layout { display: grid; gap: 32px; padding: 20px 20px; grid-template-columns: 1fr; }
.cols-2 .sidebar { max-width: 320px; }

@media (min-width: 900px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr 300px; }
  .cols-3 { grid-template-columns: 220px 1fr 300px; }
  .cols-2.cols-left .sidebar { order: -1; }
}

/* 4. Типографика и блоки ------------------------------------------- */
h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3.2vw, 32px); line-height: 1.2; }
.content > :first-child { margin-top: 0; }

.pos { padding: 48px 0; border-bottom: 1px solid var(--line); }
.pos-top { background: linear-gradient(180deg, #f6f7fb, #fff); }

/* 5. Модули (хром html5) ------------------------------------------- */
.moduletable { background: #f7f8fc; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 0 0 24px; }
.moduletable h3 { margin: 0 0 12px; font-size: 16px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* --------------------------------------------------------------------------
   Адаптивность баннеров для мобильных и планшетов
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .banners-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  /* Горизонтальный скролл-карусель на мобильных устройствах */
  .banners-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .banner-card {
    flex: 0 0 85%; /* Каждая карточка занимает 85% ширины экрана */
    scroll-snap-align: start;
  }
}

/* 7. Печать --------------------------------------------------------- */
@media print {
  .site-header, .sidebar, .nav-toggle { display: none !important; }
  body { color: #000; }
}