/*
Theme Name:     Foxiz child
Template:       foxiz
Description:    Custom header for kub-inform.ru
Version:        1.0
*/

/* Настройки Соц. ярлыков в хедере */
.c-header__top-bar-list {
  display: inline-flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.c-header__top-bar-list li {
  display: inline;
}

.c-header__top-bar-list a {
  color: #444;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.c-header__top-bar-list a:hover {
  color: #181818;
}

.c-header__top-bar-right {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.c-header__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px;
  flex-shrink: 0;
}

.c-header__social-link:hover {
  color: #181818;
}

.c-header__social-icon {
  display: block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
}

.c-header__social-icon img {
  max-width: 20px;
  max-height: 20px;
  width: auto;
  height: auto;
  display: block;
}

.c-header__social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* ========================================
   WIDGETS
   ======================================== */

.c-header__weather {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #333;
  cursor: default;
}

.c-header__weather-icon {
  font-size: 16px;
  line-height: 1;
}

.c-header__weather-temp {
  font-weight: 600;
}

.c-header__rates {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #555;
}

.c-header__rate {
  display: flex;
  align-items: center;
  gap: 3px;
}

.c-header__rate-currency {
  font-weight: 600;
  color: #333;
}

.c-header__rate-value {
  color: #555;
}

.c-header__location {
  position: relative;
}

.c-header__location-btn {
  display: flex;
  align-items: center;
  width: 151px;
  gap: 5px;
  background: none;
  /*border: 1px solid #ccc;
  border-radius: 4px;*/
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  /*transition: border-color 0.2s, background 0.2s;*/
}

.c-header__location-btn svg {
  flex-shrink: 0;
}

.c-header__location-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #ddd;
  /*border-radius: 6px;*/
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 128px;
  z-index: 10000;
  display: none;
  overflow: hidden;
}

.c-header__location-dropdown.is-open {
  display: block;
}

.c-header__location-item {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
}

.c-header__location-item:hover {
  background: #f0f0f0;
  color: #181818;
}

/*--- Стили Облако свежих тегов START ---*/

.fresh-tags-cloud-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 5px;
    user-select: none;
    cursor: grab;
    touch-action: pan-x;
    position: relative;
}

.fresh-tags-cloud-wrapper::-webkit-scrollbar {
    display: none;
}

.fresh-tags-cloud-wrapper.active {
    cursor: grabbing;
}

.fresh-tags-cloud {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    min-width: max-content;
    padding: 4px 0;
}

.messenger-tag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #22bad4, #5e41df);
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

.messenger-tag:hover {
    opacity: 0.9;
    transform: none;
}

.tag-text {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    font-size: 13px;
    margin-right: 10px;
    text-transform: uppercase;
}

.line-1,
.line-2 {
    display: block;
}

.tag-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.tags-scroll-container {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.tag-item {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #f1f3f5;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.tag-item:hover {
    background: #e3e7eb;
    color: #181818;
}

.hash-symbol, 
.first-word {
    font-weight: 700;
}

.rest-text {
    font-weight: 400;
}

/*--- Стили Облако свежих тегов END ---*/

/* ========================================
   ADFOX РЕКЛАМА (НАТИВНАЯ РЕАЛИЗАЦИЯ)
   ======================================== */

/* === БРЕНДИНГ П-образный (только ПК) === */
.foxiz-ad-branding {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    pointer-events: none;
}
.foxiz-ad-branding > * {
    pointer-events: auto;
    width: 100%; height: 100%;
}

/* === Перетяжка в шапке === */
.top-site-ad,
.ad-script-wrap {
    position: relative;
    z-index: 10000;
    min-height: 209px;
}

@media (max-width: 830px) {
    .top-site-ad,
    .ad-script-wrap {
        min-height: 150px;
    }
}
/*Стили банера Рекламы ad_fox  end*/

/* Стили для 1 Блока списка На главной */
.p-wrap.p-small.p-list-small-1 {
  min-height: 155px;
  border-radius: 10px;
  padding: 15px;
}

.p-wrap.p-small.p-list-small-1:nth-child(odd) {
  background-color: #f8f7f7;
}

/* Родителю — flex-контейнер */
.p-wrap.p-small.p-list-small-1 .p-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  /* или фиксированная высота, если нужна */
}

/* Прижимаем мета-блок к низу */
.p-wrap.p-small.p-list-small-1 .p-meta.has-bookmark {
  margin-top: auto;
}

.p-wrap.p-small.p-list-small-1 .p-categories.p-top,
.p-wrap.p-small.p-list-small-1 .entry-title {
  margin-bottom: 10px !important;
}

.p-wrap.p-small.p-list-small-1 .meta-separate {
  background-color: #181818;
  border-radius: 5px;
  display: inline-block;
  transform: skewX(-15deg);
  padding: 2px 10px;
  color: #fff;
}

.p-wrap.p-small.p-list-small-1 .date.published {
  border: 1px solid #6b6b6c;
  border-radius: 5px;
  display: inline-block;
  transform: skewX(-15deg);
  padding: 2px 10px;
  color: #6b6b6c;
}

.p-wrap.p-small.p-list-small-1 .p-category:before {
  transform: none !important;
  /* Убираем наклон псевдоэлемента */
  border-radius: 5px !important;
}

/* Применяем стили к самому элементу */
.p-wrap.p-small.p-list-small-1 .p-category {
  position: relative;
  /* Для корректного позиционирования псевдоэлемента */
  display: inline-block;
  transform: skewX(-15deg);
  border-radius: 5px;
}

/* Категории (в мета и над заголовком) */
.p-category,
.p-categories.p-top>a {
  background-color: var(--g-color, #f8b408) !important;
  color: #fff !important;
  border-radius: 5px !important;
  transform: skewX(-15deg) !important;
  padding: 5px 10px !important;
  display: inline-block !important;
}

.meta-separate {
  background-color: #181818 !important;
}


/* Отключаем фоновые псевдоэлементы Foxiz */
.p-category:before,
.meta-separate:before,
.p-categories a:before {
  content: none !important;
}

/* Дата */
.date.published,
.meta-date time {
  border: 1px solid #6b6b6c !important;
  border-radius: 5px !important;
  transform: skewX(-15deg) !important;
  padding: 2px 10px !important;
  color: #6b6b6c !important;
  background: transparent !important;
}

/* === Foxiz: Скрыть лейблы Новости/Статьи (ОБНОВЛЕНО) === */

/* 1. Карточки постов и заголовки */
.p-wrap .p-categories a[href*="/news/"], 
.p-wrap .p-categories a[href*="/statii/"],
.s-cats a[href*="/news/"], 
.s-cats a[href*="/statii/"],
.c-CardPost__cats a[href*="/news/"], 
.c-CardPost__cats a[href*="/statii/"] {
    display: none !important;
}

/* 2. Мета-строка под заголовком */
.meta-separate.term-i-346, 
.meta-separate.term-i-347, 
.meta-separate a[href*="/news/"], 
.meta-separate a[href*="/statii/"] {
    display: none !important;
}

/* 3. Хлебные крошки: СКРЫВАЕМ технические рубрики по умолчанию */
/* Используем более специфичный селектор с классом темы, если он есть */
/* .breadcrumb-wrap a[href*="/news/"], 
.breadcrumb-wrap a[href*="/statii/"] {
    display: none !important;
} */

/* 4. ПОКАЗЫВАЕМ fallback (ПРИОРИТЕТ ВЫШЕ ЗА СЧЕТ ДВОЙНОГО КЛАССА ИЛИ ID) */
/* Если у ссылки есть наш спецкласс, мы принудительно отменяем display:none */
a.yoast-bc-tech-fallback,
.breadcrumb-wrap a.yoast-bc-tech-fallback {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Скрываем бейджи коллекций через :has() */
/* Используем более гибкий поиск по концу строки или наличию ярлыка */
.p-categories.p-top:has(a.p-category[href$="/anapa"]),
.p-categories.p-top:has(a.p-category[href$="/krasnodar"]),
.p-categories.p-top:has(a.p-category[href$="/novorossiisk"]),
.p-categories.p-top:has(a.p-category[href$="/sochi"]),
.p-categories.p-top:has(a.p-category[href$="/foto"]),
/* На случай, если слэш все же остался */
.p-categories.p-top:has(a.p-category[href*="/anapa/"]),
.p-categories.p-top:has(a.p-category[href*="/krasnodar/"]),
.p-categories.p-top:has(a.p-category[href*="/novorossiisk/"]),
.p-categories.p-top:has(a.p-category[href*="/sochi/"]),
.p-categories.p-top:has(a.p-category[href*="/foto/"]) {
  display: none !important;
}

/* Стили для 1 Блока списка На главной END*/

/* Приведение Хедера к макету */
/* 1. Убираем наклон с самого контейнера */
.elementor-225774 .elementor-element-38b80f9 {
  background-color: transparent !important;
  /* Убираем прямой фон */
  transform: none !important;
  /* Убираем наклон контейнера */
  position: relative;
  z-index: 1;
}

/* 2. Создаём наклонный фон через псевдоэлемент */
.elementor-225774 .elementor-element-38b80f9::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #181818 !important;
  transform: skewX(-7deg);
  transform-origin: left center;
  z-index: -1;
  border-radius: 5px;
  /* Если нужно скругление */
}

.is-form-layout .search-form-inner {
  height: 25px;
  transform: skewX(-15deg);
}

/* Исправляем вывод окна поиска в шапке */
/* 1. Поднимаем слой результатов поиска выше всего */
.live-search-response {
  z-index: 99999 !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  min-width: 300px !important;
  /* Минимальная ширина, чтобы не сжимался */
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* 2. Разрешаем элементу выходить за границы контейнера поиска */
/* Класс контейнера поиска в Elementor (виден из HTML) */
.elementor-element-f3d7c2c,
.header-search-form {
  overflow: visible !important;
}

#header-template-holder>div.header-template-inner>div>div>div>div.elementor-element.elementor-element-f3d7c2c.e-flex.e-con-boxed.e-con.e-child {
  z-index: 9999;
}

/* Исправляем вывод окна поиска в шапке END*/

/* === Foxiz: Позиционирование блока #uid_f509db3 === */

/* Контейнер блока — прозрачный фон, без границ */
#uid_f509db3.block-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
}

#uid_f509db3 .block-inner {
  background: transparent;
}

/* Карточка новости — фиксированная высота, флекс-колонка */
#uid_f509db3 .p-wrap.p-small.p-list-small-1 {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* Контент — растягивается, занимает всё место кроме мета */
#uid_f509db3 .p-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

/* Категория — строго сверху, фиксированная высота */
#uid_f509db3 .p-categories.p-top {
  margin: 0;
  flex-shrink: 0;
  align-self: flex-start;
  height: auto;
  min-height: 0;
  display: block;
  width: 100%;
}

#uid_f509db3 .p-category {
  background: #ffc107;
  color: #181818;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  margin: 0;
}

#uid_f509db3 .p-category:hover {
  background: #ffb300;
}

/* Заголовок — прижат к категории */
#uid_f509db3 .entry-title {
  margin: 0;
  flex-shrink: 0;
  line-height: 1.3;
}

#uid_f509db3 .entry-title a {
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  transition: color 0.2s ease;
  line-height: 1.3;
  min-height: 4.2em;
}

#uid_f509db3 .entry-title a:hover {
  color: #ffc107;
}

/* Описание — фиксированная высота 3 строки */
#uid_f509db3 .entry-summary {
  margin: 0;
  color: #666;
  flex-shrink: 0;
  line-height: 1.4;
  min-height: 4.2em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Мета — строго прижата к низу */
#uid_f509db3 .p-meta.has-bookmark {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  width: 100%;
}

#uid_f509db3 .meta-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

#uid_f509db3 .meta-date {
  color: #999;
  flex-shrink: 0;
}

#uid_f509db3 .meta-date time {
  font-weight: 500;
}

/* Закладка — позиционируем правильно */
#uid_f509db3 .rb-bookmark {
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: flex-end;
  margin-left: auto;
}

#uid_f509db3 .rb-bookmark:hover {
  color: #ffc107;
}

#uid_f509db3 .rb-bookmark.bookmarked {
  color: #ffc107;
}

#uid_f509db3 .rb-bookmark i {
  font-size: 16px;
  line-height: 1;
}

/* Адаптив */
@media (max-width: 768px) {
  #uid_f509db3 .p-wrap.p-small.p-list-small-1 {
    padding: 16px;
    margin-bottom: 16px;
  }

  #uid_f509db3 .entry-summary {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 2.8em;
  }
}

/* Стили для блока проишествия 3 в ряд END*/

/* Стили для кнопок пагинации в блоках Общестов, Политика, Спорт START */
/* Позиционирование контейнера пагинации */
.block-wrap .pagination-wrap.pagination-nextprev {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin: 16px 0 0;
  padding: 0;
}

/* Базовые стили кнопок */
.block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  background: #f0f0f0;
  border-radius: 4px;
  border: 1px solid #ddd;
  color: #333;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

/* Скрываем текстовые спаны, оставляем только иконки */
.block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger span {
  display: none;
}

/* Иконки */
.block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger i {
  display: block;
  margin: 0;
  line-height: 1;
}

/* Состояния */
.block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger.is-disable {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Адаптив: при необходимости уменьшить на мобильных */
@media (max-width: 768px) {
  .block-wrap .pagination-wrap.pagination-nextprev .pagination-trigger {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
  }
}

/* Стили для кнопок пагинации в блоках Общестов, Политика, Спорт END */

/* Скрываем только блок биографии, оставляя аватар, имя и мета-данные START*/
.usr-holder.entry-sec .bio-description.rb-text {
  display: none;
}
/* Скрываем только блок биографии, оставляя аватар, имя и мета-данные END*/

/* Цвета даты в мето полях где требуется белый цвет START */
#uid_fc1625e .date.published,
.meta-date time {
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
}

#uid_3c61027 .date.published,
.meta-date time {
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
}

#uid_6d5341b .date.published,
.meta-date time {
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
}

#uid_eee94fd .date.published,
.meta-date time {
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
}

/* Цвета даты в мето полях где требуется белый цвет END */

/* Секция на главной "Статьи" блок из 8 мини записей START */
#uid_d95abf4 h3.entry-title {
  min-height: 4.2em;
}

#uid_d95abf4 .meta-inner {
  display: none;
}
/* Секция на главной "Статьи" блок из 8 мини записей END */

/* Блок с каруселью "Фоторепортажи" */
#uid_eee94fd h3.entry-title {
  min-height: 4.2em;
}

/* 3 столба с мини категориями */
#section-3-mini-cat-on-photo .meta-inner {
  display: none;
}

#section-3-mini-cat-on-photo h3.entry-title {
  min-height: 4.2em;
}

/* Приведение к стиям Квиза */
.hdq_question {
  background: none !important;
}

.hdq_row_image > .hdq_label_answer > img {
  border-radius: 10px;
}
/* Приведение к стиям Квиза END */

/* ============================================================
   СЛАЙДЕР ГАЛЕРЕИ В ТЕКСТЕ СТАТЬИ (ФИНАЛЬНАЯ ЧИСТАЯ ВЕРСИЯ)
   ============================================================ */

.rb-gallery-wrapper {
    margin: 30px 0;
    position: relative;
    /* Создаем пространство для внешних стрелок */
    padding: 0 50px; 
    box-sizing: content-box;
    overflow: visible; /* Разрешаем стрелкам выходить за границы */
}

/* --- ОСНОВНОЙ СЛАЙДЕР --- */
.rb-gallery-main {
    width: 100%;
    overflow: hidden;
    border-radius: 12px; /* СКРУГЛЕНИЕ ВОЗВРАЩЕНО */
    margin-bottom: 15px;
    position: relative;
}

.rb-gallery-main .swiper-slide {
    line-height: 0;
}

.rb-gallery-main img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px; /* СКРУГЛЕНИЕ ВОЗВРАЩЕНО */
}

/* Подпись под фото */
.rb-gallery-caption {
    position: relative;
    padding: 10px 0 0;
    color: #666;
    font-size: 13px;
    text-align: left;
    margin: 0;
}

/* --- СТРЕЛКИ (ВНЕ СЛАЙДЕРА) --- */
.rb-gallery-wrapper .swiper-button-prev,
.rb-gallery-wrapper .swiper-button-next {
    color: #ffc107 !important;
    background: transparent !important;
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%); /* ТОЛЬКО центрирование, без scale */
    opacity: 0.8;
    z-index: 20;
    
    /* Позиционирование в padding обертки */
    left: 0; 
    right: auto;
}

.rb-gallery-wrapper .swiper-button-next {
    left: auto;
    right: 0;
}

.rb-gallery-wrapper .swiper-button-prev:hover,
.rb-gallery-wrapper .swiper-button-next:hover {
    opacity: 1;
    /* УБРАНО: transform: scale(1.1) */
}

.rb-gallery-wrapper .swiper-button-prev::after,
.rb-gallery-wrapper .swiper-button-next::after {
    font-size: 24px;
    font-weight: 800;
}

/* --- СЛАЙДЕР МИНИАТЮР --- */
.rb-gallery-thumbs {
    width: 100%;
    height: 80px;
    box-sizing: border-box;
}

.rb-gallery-thumbs .swiper-slide {
    width: 100px !important;
    height: 100%;
    opacity: 0.4;
    cursor: pointer;
    border-radius: 8px; /* СКРУГЛЕНИЕ ВОЗВРАЩЕНО */
    overflow: hidden;
    transition: opacity 0.3s ease, filter 0.3s ease; /* УБРАНО: transform */
    filter: grayscale(30%);
}

/* АКТИВНАЯ МИНИАТЮРА (БЕЗ РАМКИ И БЕЗ УВЕЛИЧЕНИЯ) */
.rb-gallery-thumbs .swiper-slide.swiper-slide-thumb-active {
    opacity: 1;
    filter: grayscale(0%);
    /* УБРАНО: transform: scale(1.05) */
    /* УБРАНО: box-shadow (оранжевая рамка) */
}

/* ПРИ НАВЕДЕНИИ */
.rb-gallery-thumbs .swiper-slide:hover {
    opacity: 0.8;
    filter: grayscale(0%);
}

.rb-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px; /* СКРУГЛЕНИЕ ВОЗВРАЩЕНО */
}

/* --- АДАПТИВ --- */
@media (max-width: 768px) {
    .rb-gallery-wrapper { 
        padding: 0; 
        overflow: hidden; 
    }
    
    .rb-gallery-wrapper .swiper-button-prev,
    .rb-gallery-wrapper .swiper-button-next {
        width: 32px; 
        height: 32px;
        background: rgba(255,255,255,0.8) !important;
        color: #181818 !important;
        top: 50%;
    }
    
    .rb-gallery-wrapper .swiper-button-prev { left: 10px; }
    .rb-gallery-wrapper .swiper-button-next { right: 10px; }
    
    .rb-gallery-thumbs { height: 60px; }
    .rb-gallery-thumbs .swiper-slide { width: 80px !important; }
}

/* ============================================================
   ЛАЙТБОКС (ИСПРАВЛЕННЫЙ: БЛОКИРОВКА СКРОЛЛА + ПЕРЕКРЫТИЕ МЕНЮ)
   ============================================================ */

.rb-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95); /* Более плотный фон для гарантии перекрытия */
    
    /* Z-INDEX ВЫШЕ ВСЕХ ВОЗМОЖНЫХ ЭЛЕМЕНТОВ ТЕМЫ */
    z-index: 2147483647 !important; 
    
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(8px); /* Усиленный блюр */
    
    /* ИЗОЛЯЦИЯ КОНТЕКСТА НАЛОЖЕНИЯ */
    isolation: isolate;
    contain: layout style paint;
}

.rb-lightbox-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Кнопка закрытия */
.rb-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    z-index: 2147483647 !important;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.rb-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Слайдер внутри лайтбокса */
.rb-lightbox-swiper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.rb-lightbox-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rb-lightbox-swiper img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); /* Тень для отделения от фона */
}

/* Подпись в лайтбоксе */
.rb-lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    max-width: 80%;
    text-align: center;
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* Навигация внутри лайтбокса */
.rb-lightbox-swiper .swiper-button-prev,
.rb-lightbox-swiper .swiper-button-next {
    color: #fff !important;
    background: transparent !important;
    width: 50px;
    height: 50px;
    z-index: 3;
}

.rb-lightbox-swiper .swiper-button-prev::after,
.rb-lightbox-swiper .swiper-button-next::after {
    font-size: 28px;
    font-weight: bold;
}

.rb-lightbox-swiper .swiper-pagination-fraction {
    color: #fff;
    font-size: 14px;
    bottom: 20px !important;
    width: auto !important;
    left: 50% !important;
    transform: translateX(-50%);
    z-index: 3;
}

/* Адаптив */
@media (max-width: 768px) {
    .rb-lightbox-close {
        top: 10px; right: 10px;
        width: 36px; height: 36px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.6);
    }
    .rb-lightbox-swiper img {
        max-width: 100vw;
        max-height: 85vh;
    }
    .rb-lightbox-caption {
        bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
        max-width: 90%;
    }
    .rb-lightbox-swiper .swiper-button-prev,
    .rb-lightbox-swiper .swiper-button-next {
        width: 36px; height: 36px;
    }
}

/* Принудительное скрытие хедера/меню при открытом лайтбоксе */
body.rb-lightbox-open .elementor-location-header,
body.rb-lightbox-open #header-template-holder,
body.rb-lightbox-open .foxiz-header,
body.rb-lightbox-open .sticky-header,
body.rb-lightbox-open [class*="menu"],
body.rb-lightbox-open [class*="nav"] {
    z-index: 1 !important;
    position: relative !important;
}

/* Гарантируем, что лайтбокс всегда выше всего */
.rb-lightbox-overlay {
    z-index: 2147483647 !important;
    isolation: isolate;
}
/*  СЛАЙДЕР ГАЛЕРЕИ В ТЕКСТЕ СТАТЬИ END */

/* ========================================
УНИВЕРСАЛЬНАЯ ОБРЕЗКА ЗАГОЛОВКОВ (3 СТРОКИ)
Главная, Записи ("По теме"), Архивы
======================================== */

/* 1. Базовые настройки для всех помеченных блоков (.title-short / .title-medium) 
   Работает везде: на главной, в записях и архивах */
.title-short .entry-title a,
.title-medium .entry-title a,
.title-short .entry-title,
.title-medium .entry-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    
    /* Дублируем свойство */
    -webkit-line-clamp: 3;
    line-clamp: 3;
    
    /* Фиксируем высоту ровно на 3 строки */
    line-height: 1.4;
    height: 4.2em; /* 3 * 1.4 = 4.2em */
}

/* 2. Специфичные усиления для Главной страницы (ваши UID) */
.home #uid_e677a66 .entry-title a,
.home #uid_d95abf4 .entry-title a,
.home #uid_eee94fd .entry-title a,
.home #uid_acc4809 .entry-title a,
.home #uid_d49a156 .entry-title a,
.home #uid_e0805ac .entry-title a {
    min-height: 4.2em;
    height: 4.2em;
}

/* 3. Блок "По теме" (Внутри одиночных записей) 
   Класс .single указывает, что мы на странице новости */
.single .sfoter-sec .entry-title a,
.single .sfoter-sec .entry-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    
    -webkit-line-clamp: 3;
    line-clamp: 3;
    
    line-height: 1.4;
    height: 4.2em;
}

/* 4. Архивные записи и Категории 
   Класс .archive или .category указывает на список новостей */
.archive .block-grid .entry-title a,
.archive .block-grid .entry-title,
.category .block-grid .entry-title a,
.category .block-grid .entry-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    
    -webkit-line-clamp: 3;
    line-clamp: 3;
    
    line-height: 1.4;
    height: 4.2em;
}

/* Если в архивах используются конкретные UID (как uid_2e6a515), 
   можно добавить их сюда для надежности */
.archive #uid_2e6a515 .entry-title a,
.category #uid_2e6a515 .entry-title a {
    min-height: 4.2em;
    height: 4.2em;
}
/* ТОЧЕЧНАЯ ОБРЕЗКА ЗАГОЛОВКОВ END*/

/* Fallback-изображение для записей без миниатюры в списках */
.p-featured a.p-flink:not(:has(img)),
.p-featured:empty,
.p-featured a.p-flink img[src=""] {
    display: block !important;
    min-height: 200px;
    background-image: url('assets/images/none_photo.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Для разных соотношений сторон в блоках Foxiz */
.p-featured.ratio-v2:not(:has(img)) {
    padding-top: 66.67% !important; /* 3:2 */
    position: relative;
}

.p-featured.ratio-v2:not(:has(img))::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('assets/images/none_photo.jpg');
    background-size: cover;
    background-position: center;
}