/* CMS Django — main custom styles */

[x-cloak] { display: none !important; }

/* ─── Скрываем UI Google Translate (плашку сверху, всплывашки, инфо-бар) ─── */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
iframe.skiptranslate,
.goog-te-gadget,
.goog-logo-link,
.goog-te-spinner-pos,
#goog-gt-tt,
#goog-gt-,
.goog-tooltip,
.goog-tooltip:hover,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
.VIpgJd-ZVi9od-ORHb-OEVmcd {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}
html, body {
  top: 0 !important;
  position: static !important;
  margin-top: 0 !important;
}
.goog-text-highlight { background: transparent !important; box-shadow: none !important; }
font[style] { background: transparent !important; }

/* ─── Логотип-баннер (отдельная строка над навбаром) ─── */
.logo-banner-img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 96px;
  object-fit: contain;
}
@media (max-width: 768px) {
  .logo-banner-img { max-height: 56px; }
}

/* ─── Умный навбар — auto-shrink по количеству пунктов ─── */
.cms-nav {
  gap: 4px;
  flex-wrap: wrap;            /* допускаем перенос на 2-ю строку, чтобы не резать слова */
  row-gap: 4px;
}
.cms-nav-item { flex-shrink: 1; min-width: 0; }
.cms-nav-link {
  padding: 8px 14px;
  font-size: 19px;
  gap: 6px;
  white-space: nowrap;         /* сам пункт не переносится — переносится весь блок-пункт */
  line-height: 1.2;
}
.cms-nav-link span {
  display: inline-block;
  min-width: 0;
  /* НЕ режем многоточием — пусть лучше пункт перейдёт на новую строку */
}
.cms-nav-link > i { flex-shrink: 0; }

/* Адаптив через CSS — стартовая ширина >=1024px (lg в Tailwind) */

/* 5–6 пунктов: умеренное сжатие */
.cms-nav.is-md .cms-nav-link {
  padding: 7px 11px;
  font-size: 17px;
  gap: 5px;
}

/* 7–8 пунктов: меньше */
.cms-nav.is-sm .cms-nav-link {
  padding: 6px 9px;
  font-size: 15.5px;
  gap: 4px;
}

/* 9+ пунктов: компактный режим */
.cms-nav.is-xs .cms-nav-link {
  padding: 6px 7px;
  font-size: 14.5px;
  gap: 3px;
  letter-spacing: -0.01em;
}
.cms-nav.is-xs .cms-nav-link > i:last-child { display: none; } /* убираем chevron у dropdown */
.cms-nav.is-xs .cms-nav-link > i:first-child { display: none; } /* и иконку слева — место экономим */

/* Сверхкомпактный режим (длинные русские/английские подписи) */
.cms-nav.is-xxs .cms-nav-link {
  padding: 5px 6px;
  font-size: 13.5px;
  gap: 2px;
  letter-spacing: -0.02em;
}
.cms-nav.is-xxs .cms-nav-link > i { display: none; }

/* Запасной адаптив через viewport — на узких lg-экранах сжимаемся ещё */
@media (max-width: 1180px) {
  .cms-nav .cms-nav-link { padding: 7px 10px; font-size: 17px; }
}
@media (max-width: 1080px) {
  .cms-nav .cms-nav-link { padding: 6px 8px; font-size: 15.5px; }
}

/* ─── Переключатель языков — компактный режим (только код языка) ─── */
.cms-lang .cms-lang-label {
  display: inline-block;
}
/* Если меню перегружено — навбар получает класс .is-tight, и язык схлопывается */
.cms-nav.is-sm ~ * .cms-lang .cms-lang-label,
.cms-nav.is-xs ~ * .cms-lang .cms-lang-label,
.cms-nav.is-xxs ~ * .cms-lang .cms-lang-label { display: none; }

html { scroll-behavior: smooth; }

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  font-size: 0.95rem;
  transition: all .2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* ─── Prose images — красивый вывод картинок из CKEditor ─── */
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;          /* центрируем по горизонтали + отступы */
  border-radius: var(--radius-image, 12px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.10);
  transition: transform .3s ease, box-shadow .3s ease;
}
.prose img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15);
}

/* Wrapper <a class="glightbox"> вокруг картинки — должен быть строго по размеру img,
   иначе клик в пустую часть параграфа открывает lightbox */
.prose a.glightbox {
  display: inline-block !important;
  line-height: 0;
  max-width: 100%;
  cursor: zoom-in;
  text-decoration: none !important;
  border: 0 !important;
}
.prose a.glightbox img { margin: 2rem auto; }
/* Центрируем параграф, если внутри только картинка-ссылка */
.prose p:has(> a.glightbox:only-child),
.prose p:has(> img:only-child) {
  text-align: center;
  margin: 0;
}

/* CKEditor — выравнивание картинок (alignleft/alignright/aligncenter) */
.prose img.align-left,
.prose img[align="left"]   { float: left;  margin: .5rem 1.5rem 1rem 0; max-width: 50%; }
.prose img.align-right,
.prose img[align="right"]  { float: right; margin: .5rem 0 1rem 1.5rem; max-width: 50%; }
.prose img.align-center,
.prose img[align="center"] { display: block; margin: 1.5rem auto; }
.prose figure { margin: 2rem 0; text-align: center; }
.prose figure img { margin: 0 auto .5rem; }
.prose figure figcaption {
  font-size: .875rem;
  color: var(--muted, #64748b);
  font-style: italic;
}
.prose blockquote {
  border-left: 4px solid var(--brand, #6366f1);
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
}
.prose code {
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #db2777;
}
.prose pre code { background: transparent; color: inherit; padding: 0; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Hero ambient background — размытое фото текущего слайда ─── */
.hero-section { isolation: isolate; }

.hero-bg {
  position: absolute;
  inset: -40px;                          /* выходим за края, чтобы скрыть размытые «обрезанные» границы */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(48px) saturate(2.1) brightness(1.18) contrast(1.05);  /* ярче + насыщеннее */
  transform: scale(1.18);
  transition: background-image 800ms ease, opacity 800ms ease;
  z-index: 0;
  pointer-events: none;
}
/* Liquid glass overlay поверх фона — светлый блик-sheen + лёгкое затемнение снизу для читаемости */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 90% at 16% -12%, rgba(255,255,255,.34), transparent 48%),
    radial-gradient(120% 90% at 100% 110%, rgba(255,255,255,.14), transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 40%, rgba(0,0,0,.12) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ─── Liquid Glass панель — стеклянная плашка с подписью под обложкой ─── */
.liquid-glass {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(2.2) brightness(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(2.2) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 20px;
  box-shadow:
    0 8px 32px 0 rgba(0, 0, 0, 0.22),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}
/* Зеркальный блик сверху — суть liquid glass */
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 12% -20%, rgba(255,255,255,0.40), transparent 45%),
    linear-gradient(135deg, rgba(255,255,255,0.22) 0%, transparent 40%, transparent 62%, rgba(255,255,255,0.10) 100%);
  pointer-events: none;
  border-radius: inherit;
}

/* ─── Liquid Glass кнопки навигации карусели ─── */
.liquid-glass-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all .25s ease;
  opacity: 0;
}
.liquid-glass-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%) scale(1.08);
}
.hero-swiper:hover .liquid-glass-btn { opacity: 1; }

/* ─── Баннер поста: яркое матовое стекло (liquid glass) с тёмным текстом ─── */
.post-cover-glass {
  background: rgba(255, 255, 255, 0.34);          /* тоньше / прозрачнее */
  backdrop-filter: blur(30px) saturate(1.9) brightness(1.1);
  -webkit-backdrop-filter: blur(30px) saturate(1.9) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  box-shadow: 0 14px 44px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.6);
  position: relative;
  overflow: hidden;
}
/* Текст всегда над бликом */
.post-cover-glass > * { position: relative; z-index: 1; }
/* Liquid: медленно дрейфующие световые блики */
.post-cover-glass::before {
  content: ''; position: absolute; inset: -55%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 40% at 30% 28%, rgba(255,255,255,.40), transparent 60%),
    radial-gradient(34% 34% at 72% 64%, rgba(255,255,255,.22), transparent 60%);
}
@media (prefers-reduced-motion: no-preference) {
  .post-cover-glass::before { animation: glassLiquid 9s ease-in-out infinite alternate; }
  @keyframes glassLiquid {
    0%   { transform: translate(-4%, -3%) rotate(0deg) scale(1); }
    50%  { transform: translate(4%, 3%) rotate(9deg) scale(1.09); }
    100% { transform: translate(-2%, 5%) rotate(-7deg) scale(1.05); }
  }
}
/* Тёмный текст на стеклянной плашке (есть обложка) */
.post-hero-dark, .post-hero-dark h1 { color: #0f172a; }
.post-hero-dark .hero-nav, .post-hero-dark .hero-nav a,
.post-hero-dark .hero-sub, .post-hero-dark .hero-meta { color: #475569; }
.post-hero-dark .hero-nav a:hover { color: #0f172a; }
.post-hero-dark .meta-pill { background: rgba(15,23,42,.07); color: #334155; }
/* Белый текст, если обложки нет (на цветном градиенте) */
.post-hero-white, .post-hero-white h1 { color: #fff; }
.post-hero-white .hero-nav, .post-hero-white .hero-nav a,
.post-hero-white .hero-sub, .post-hero-white .hero-meta { color: rgba(255,255,255,.82); }
.post-hero-white .meta-pill { background: rgba(255,255,255,.12); color: #fff; }

/* ─── Свой полноэкранный просмотр фото (.cms-fullscreen) — фото целиком, без зума ─── */
.cms-fs {
  position: fixed; inset: 0; z-index: 99999; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(8, 12, 22, 0.94); backdrop-filter: blur(6px);
  animation: cmsFsIn .18s ease;
}
.cms-fs.open { display: flex; }
@keyframes cmsFsIn { from { opacity: 0; } to { opacity: 1; } }
.cms-fs img {
  max-width: 96vw; max-height: 94vh; width: auto; height: auto;
  object-fit: contain; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
  user-select: none;
}
.cms-fs-close {
  position: fixed; top: 18px; right: 22px; width: 46px; height: 46px; border: 0;
  background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; font-size: 26px;
  line-height: 1; cursor: pointer; transition: background .15s; z-index: 1;
}
.cms-fs-close:hover { background: rgba(255,255,255,.30); }
.cms-fs-nav {
  position: fixed; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border: 0;
  background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; font-size: 28px; line-height: 1;
  cursor: pointer; transition: background .15s; z-index: 1; display: flex; align-items: center; justify-content: center;
}
.cms-fs-nav:hover { background: rgba(255,255,255,.30); }
.cms-fs-prev { left: 22px; }
.cms-fs-next { right: 22px; }
.cms-fs[data-single="1"] .cms-fs-nav { display: none; }

/* ─── GLightbox: фото всегда целиком в экране (без зума и прокрутки) ─── */
.glightbox-container img,
.glightbox-container .gslide-image img,
.glightbox-container .gslide-media img {
  max-width: 94vw !important;
  max-height: 90vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  cursor: default !important;
}
/* Все контейнеры слайда — не прокручиваются, центрируют фото */
.glightbox-container .gslide,
.glightbox-container .gslide-inner-content,
.glightbox-container .ginner-container,
.glightbox-container .gslide-media,
.glightbox-container .gslide-image {
  overflow: hidden !important;
  max-width: 96vw !important;
  max-height: 92vh !important;
}
.glightbox-container .gslide-inner-content {
  display: flex !important; align-items: center !important; justify-content: center !important;
}
/* Описание под фото убираем — оно ломало вписывание (появлялась прокрутка) */
.glightbox-container .gslide-description,
.glightbox-container .gslide-desc { display: none !important; }

/* ─── Табы / Вкладки (блок конструктора) ─── */
.cms-tabs { margin: 28px 0; }
.cms-tabs__nav { display: flex; flex-wrap: wrap; gap: 6px; }
.cms-tab-btn {
  background: var(--card-bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer;
  border-radius: var(--radius-button); transition: all .15s ease; font-family: inherit; line-height: 1.2;
}
.cms-tab-btn:hover { border-color: var(--primary); }
.cms-tab-btn.is-active {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px -4px var(--primary);
}
.cms-tabs__panels { padding-top: 20px; }
.cms-tab-panel:not(.is-active) { display: none; }

/* Большие табы (moh.tj-style) — подчёркивание снизу, плотные */
.cms-tabs.cms-tabs--lg .cms-tabs__nav {
  border-bottom: 2px solid var(--border);
  gap: 0;
  flex-wrap: wrap;
}
.cms-tabs.cms-tabs--lg .cms-tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 14px 22px;
  font-size: 15.5px;
  color: var(--muted);
  margin-bottom: -2px;
  font-weight: 600;
  white-space: nowrap;
}
.cms-tabs.cms-tabs--lg .cms-tab-btn:hover { color: var(--text); border-color: var(--border); background: transparent; }
.cms-tabs.cms-tabs--lg .cms-tab-btn.is-active {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--primary);
  box-shadow: none;
}

/* Табы с иконками — иконка слева, текст справа */
.cms-tabs--icons .cms-tab-btn { display: inline-flex; align-items: center; gap: 8px; }
.cms-tabs--icons .cms-tab-btn .bi { font-size: 18px; opacity: .85; }

/* Вертикальные табы (сайдбар слева) */
.cms-tabs.cms-tabs--vertical {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 28px;
  align-items: start;
}
.cms-tabs.cms-tabs--vertical .cms-tabs__nav {
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 90px;
}
.cms-tabs.cms-tabs--vertical .cms-tab-btn {
  width: 100%;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.cms-tabs.cms-tabs--vertical .cms-tab-btn .bi { font-size: 17px; }
.cms-tabs.cms-tabs--vertical .cms-tabs__panels { padding-top: 0; }

@media (max-width: 768px) {
  .cms-tabs.cms-tabs--vertical {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cms-tabs.cms-tabs--vertical .cms-tabs__nav { flex-direction: row; flex-wrap: wrap; position: static; }
}

/* ─── Карточка стратегии: GPU-композитинг, чтобы при hover не «мигали» углы ─── */
.strategy-card {
  /* Принудительно создаём свой композитный слой — браузер заранее
     рассчитывает clipping для скруглённых углов */
  transform: translateZ(0);
  will-change: transform, box-shadow;
  isolation: isolate;
  /* Сглаживание края при анимации трансформа */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  backface-visibility: hidden;
}
.strategy-card,
.strategy-card * { -webkit-backface-visibility: hidden; }

/* ─── Liquid Glass плашка стратегий — светлое стекло с глянцем, тёмный текст ─── */
.strategy-card__glass {
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(26px) saturate(2);
  -webkit-backdrop-filter: blur(26px) saturate(2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow:
    0 12px 40px 0 rgba(15, 23, 42, 0.22),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}
/* Зеркальный косой блик сверху — настоящий «liquid glass» как у Apple */
.strategy-card__glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg,
      rgba(255,255,255,0)   28%,
      rgba(255,255,255,.55) 44%,
      rgba(255,255,255,.10) 52%,
      rgba(255,255,255,0)   65%),
    linear-gradient(160deg,
      rgba(255,255,255,.35) 0%,
      transparent          40%,
      transparent          60%,
      rgba(255,255,255,.18) 100%);
  pointer-events: none;
  border-radius: inherit;
}
/* Подсветка нижнего края — лёгкое свечение */
.strategy-card__glass::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,.7),
    transparent);
  pointer-events: none;
}
.strategy-card:hover .strategy-card__glass {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.75);
}

/* ─── Глянцевый «жидкое стекло» блик поверх самой обложки поста ─── */
.post-cover-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(115deg,
      rgba(255,255,255,0) 32%,
      rgba(255,255,255,.22) 46%,
      rgba(255,255,255,.06) 53%,
      rgba(255,255,255,0) 62%),
    radial-gradient(150% 70% at 50% -25%, rgba(255,255,255,.26), transparent 55%);
  mix-blend-mode: screen;
}
/* Тонкая стеклянная рамка-блик по краям обложки */
.post-cover-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40), inset 0 0 70px rgba(255,255,255,.07);
}
/* Лёгкая «дышащая» анимация блика — настоящий liquid-эффект */
@media (prefers-reduced-motion: no-preference) {
  .post-cover-sheen { animation: coverSheen 7s ease-in-out infinite alternate; }
  @keyframes coverSheen {
    0%   { background-position: 0% 0%, 50% -25%; opacity: .9; }
    100% { background-position: 18% 0%, 55% -20%; opacity: 1; }
  }
}

/* Точки пагинации поверх ambient-фона */
.hero-swiper .swiper-pagination-bullet {
  width: 10px; height: 10px;
  background: rgba(255, 255, 255, .55);
  opacity: 1;
  transition: all .25s ease;
}
.hero-swiper .swiper-pagination-bullet-active {
  background: #fff;
  width: 32px;
  border-radius: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   GLightbox — полноэкранное красивое открытие фото (overrides)
   ═══════════════════════════════════════════════════════════════ */

/* Фон-затемнение: глубокий чёрный с небольшим блюром фона */
.glightbox-clean .gcontainer,
.goverlay {
  background: rgba(2, 6, 23, 0.94) !important;
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}

/* Внешняя обёртка слайда — растягиваем во весь экран, без скроллов */
.gslide,
.gslide-inner-content,
.gslide-media {
  width: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
}
.gslide-image {
  overflow: hidden !important;
  background: transparent !important;
}
/* Само фото — всегда вписывается в экран целиком, никаких скроллов */
.gslide-image img,
.gslide-media img,
img.gslide-media {
  display: block !important;
  max-width: min(96vw, 1800px) !important;
  max-height: 92vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  background: transparent !important;
}

/* Подпись под фото — аккуратная плашка */
.gslide-description.gdesc-inner {
  background: rgba(15, 23, 42, .6) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f1f5f9 !important;
  border-radius: 12px;
  padding: 12px 18px;
  margin-top: 14px;
  max-width: min(90vw, 900px);
}
.gdesc-inner .gslide-title,
.gdesc-inner .gslide-desc { color: #f1f5f9 !important; }

/* Кнопки навигации (стрелки влево/вправо) — крупные стеклянные круги */
.gnext, .gprev, .gclose {
  background: rgba(255, 255, 255, .12) !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  backdrop-filter: blur(12px) !important;
  border-radius: 50% !important;
  width: 50px !important;
  height: 50px !important;
  transition: all .2s ease !important;
  opacity: 1 !important;
}
.gnext:hover, .gprev:hover, .gclose:hover {
  background: rgba(255, 255, 255, .22) !important;
  transform: scale(1.05);
}
.gnext svg, .gprev svg, .gclose svg {
  fill: #fff !important;
  width: 22px !important;
  height: 22px !important;
}
.gclose { top: 22px !important; right: 22px !important; }
.gprev  { left: 24px !important; }
.gnext  { right: 24px !important; }

/* Счётчик «1 / 4» — мелким серым в углу */
.gprev + .gnext + .gcounter,
.gcounter {
  color: rgba(255, 255, 255, .55) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  top: 28px !important;
  left: 24px !important;
}

/* Скрываем горизонтальный скроллбар, если вдруг появился */
.glightbox-container .gcontainer { overflow: hidden !important; }
.glightbox-container .gslider { overflow: hidden !important; }

/* Плавное появление */
.glightbox-open .goverlay { animation: gl-fade .25s ease-out; }
@keyframes gl-fade { from { opacity: 0; } to { opacity: 1; } }

/* На телефоне — поля по краям меньше */
@media (max-width: 640px) {
  .gslide-image img,
  .gslide-media img,
  img.gslide-media {
    max-width: 100vw !important;
    max-height: 80vh !important;
    border-radius: 8px;
  }
  .gnext, .gprev { width: 42px !important; height: 42px !important; }
  .gclose { top: 14px !important; right: 14px !important; }
  .gprev  { left: 12px !important; }
  .gnext  { right: 12px !important; }
}

/* ═══════════════════════════════════════════════════════════════
   ГЛАВНАЯ — компактный режим для телефона
   Все блоки получают плотные отступы, уменьшенные заголовки и кнопки.
   Применяется только к ширине <640px (телефон).
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {

  /* Общие контейнеры — узкие боковые поля и плотный вертикальный воздух */
  .container-cms {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Большие отступы секций py-12 / py-16 → плотные */
  .container-cms.py-12,
  .container-cms.py-16,
  .container-cms.lg\:py-16 { padding-top: 22px !important; padding-bottom: 22px !important; }

  /* Заголовки секций главной (h2 размером text-3xl/text-4xl/text-5xl) */
  .font-display.text-3xl,
  .font-display.text-4xl,
  .font-display.text-5xl,
  .lg\:text-4xl.font-display,
  .lg\:text-5xl.font-display {
    font-size: 1.45rem !important;     /* ~23px */
    line-height: 1.2 !important;
  }
  /* Маленькие надзаголовки «УГОЛОВНЫМИ» */
  .text-sm.uppercase.tracking-wider { font-size: 11px !important; margin-bottom: 4px !important; }

  /* Кнопка «Все →» в шапке секции — плотная пилюля */
  a[style*="brand-grad"], button[style*="brand-grad"] {
    padding: 8px 14px !important;
    font-size: 13px !important;
  }

  /* ─── Карточки постов на главной ─── */
  /* Внутренний padding p-6 (24px) → 16px на мобильном */
  article .p-6 { padding: 14px !important; }
  article h3.font-display.text-xl { font-size: 1.05rem !important; line-height: 1.3 !important; }
  article .text-sm.leading-relaxed { font-size: 13px !important; -webkit-line-clamp: 2 !important; }
  /* Низ карточки (автор + дата) — плотнее */
  article .pt-4 { padding-top: 10px !important; }

  /* Сетки карточек последних постов — отступы между карточками меньше */
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-6 { gap: 14px !important; }

  /* «Хабарҳои охирин» — отступ сверху меньше, заголовок сразу */
  .container-cms[style*="margin-top:30px"] { margin-top: 10px !important; }

  /* ─── Newsletter CTA (большой градиентный блок) — компактнее ─── */
  .container-cms > .relative.rounded-3xl { padding: 22px 18px !important; border-radius: 18px !important; }
  .container-cms > .relative.rounded-3xl .grid.gap-10 { gap: 18px !important; }
  .container-cms > .relative.rounded-3xl h2 { font-size: 1.4rem !important; margin-bottom: 8px !important; }
  .container-cms > .relative.rounded-3xl p { font-size: 14px !important; }
  .container-cms > .relative.rounded-3xl input { padding: 11px 14px !important; font-size: 14px !important; }
  .container-cms > .relative.rounded-3xl button { padding: 12px !important; font-size: 14.5px !important; }
  /* Бейдж «ПОДПИСКА» — мельче */
  .container-cms > .relative.rounded-3xl .inline-flex.gap-2.rounded-full { padding: 4px 10px !important; font-size: 10.5px !important; margin-bottom: 10px !important; }

  /* ─── Стратегии / Полезные ресурсы — отступы между заголовком и каруселью ─── */
  .container-cms .flex.items-end.justify-between.mb-8,
  .container-cms .flex.items-end.justify-between.mb-10 {
    margin-bottom: 12px !important;
    gap: 10px !important;
  }
  /* Стрелки prev/next карусели — спрятать на телефоне, листать свайпом */
  .strategies-prev, .strategies-next,
  .resources-prev, .resources-next { display: none !important; }

  /* ─── Сайдбар (виджеты домашней) — плотнее ─── */
  aside .p-5 { padding: 14px !important; }
  aside .px-5.py-3 { padding: 8px 12px !important; }

  /* Категории-плитки (если рендерится сетка) — меньше padding и текст */
  .grid > a[style*="background"] .text-3xl { font-size: 1.4rem !important; }
  .grid > a[style*="background"] .font-display.font-bold.text-lg { font-size: 0.95rem !important; line-height: 1.2 !important; }
  .grid > a[style*="background"] { padding: 14px !important; }

  /* Воздух между блоками главной — плотнее */
  .container-cms { margin-top: 14px !important; margin-bottom: 14px !important; }

  /* ─── Компактный мобильный навбар (шапка сайта) ─── */
  #cms-header > .container-cms { padding-top: 6px !important; padding-bottom: 6px !important; }
  #cms-logo-banner .container-cms { padding-top: 8px !important; padding-bottom: 8px !important; }
  /* Логотип слева — меньше */
  #cms-logo-left img { max-height: 32px !important; }
  /* Кнопка-гамбургер — плотная */
  #cms-header .lg\:hidden.p-2\.5 { padding: 6px !important; font-size: 18px !important; }
  /* Иконки справа (язык, поиск) — плотнее */
  .cms-lang button { padding: 5px 7px !important; }
  #cms-search button { padding: 5px !important; }
  /* Скрываем подпись «🇹🇯 Русский» рядом с флагом на мобильном — только флаг */
  .cms-lang .cms-lang-label { display: none !important; }
  /* Верхняя полоска контактов — компактнее */
  .hidden.md\:block.text-xs .container-cms.py-2 { padding-top: 4px !important; padding-bottom: 4px !important; }

  /* ─── Мобильный сайдбар (off-canvas drawer) ─── */
  /* Сами стили лежат вне media-query, чтобы работали и в превью при ресайзе.
     Здесь только проверка, что аватар-шапки не вылезает. */

  /* ─── Поиск в шапке (мобильная версия) — красивая liquid glass плашка ─── */
  /* Иконка-кнопка поиска — плотнее */
  #cms-search > button { padding: 6px !important; font-size: 17px !important; }

  /* Выпадающая панель поиска — на телефоне расползаемся почти на весь экран */
  #cms-search > div[x-show="open"] {
    position: fixed !important;
    top: 56px !important;        /* под шапку */
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    margin-top: 0 !important;

    /* Liquid glass */
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(24px) saturate(2.2) !important;
    -webkit-backdrop-filter: blur(24px) saturate(2.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .18),
                inset 0 1px 0 rgba(255, 255, 255, .55) !important;
    padding: 10px !important;
  }

  /* Само поле ввода — крупнее, удобнее на пальце */
  #cms-search input[type="text"] {
    width: 100% !important;
    padding: 12px 16px 12px 42px !important;   /* место под иконку слева */
    font-size: 15px !important;
    background: rgba(255, 255, 255, .85) !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    border-radius: 12px !important;
    color: var(--text, #0f172a) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
  }
  #cms-search input[type="text"]::placeholder {
    color: #94a3b8 !important;
  }
  #cms-search input[type="text"]:focus {
    border-color: var(--primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15),
                inset 0 1px 0 rgba(255, 255, 255, .55) !important;
    outline: 0 !important;
  }

  /* Декоративная иконка-лупа в инпуте (через ::before на обёртке) */
  #cms-search > div[x-show="open"] {
    position: fixed;
  }
  #cms-search > div[x-show="open"]::before {
    content: '\F52A';            /* bootstrap-icons bi-search */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary, #6366f1);
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
  }

  /* ─── Карточки «Сомонаҳои мақомоти давлатӣ ва шарикони мо» (resources) ─── */
  /* Делаем плотнее: меньший padding, меньший логотип, меньший текст */
  .resources-swiper .swiper-slide a {
    padding: 12px 8px !important;
  }
  /* Контейнер логотипа: с 80×80 → 56×56, отступ снизу 8 вместо 16 */
  .resources-swiper .swiper-slide a > div:first-child {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
  }
  /* Подпись под логотипом — компактный текст в 2 строки */
  .resources-swiper .swiper-slide a > div.font-display {
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  /* Точки пагинации ресурсов — поменьше и поближе */
  .resources-swiper .swiper-pagination.mt-6 { margin-top: 10px !important; }
  .resources-swiper .swiper-pagination-bullet { width: 6px; height: 6px; }
}

/* ─── Мобильная адаптация hero-карусели — плотно, аккуратно ─── */
@media (max-width: 639px) {
  .hero-swiper .swiper-pagination-bullet { width: 6px; height: 6px; }
  .hero-swiper .swiper-pagination-bullet-active { width: 18px; height: 6px; }

  /* Стеклянная плашка с подписью — компактнее, мягкий blur */
  .hero-swiper .liquid-glass {
    border-radius: 14px;
    backdrop-filter: blur(18px) saturate(1.8);
    -webkit-backdrop-filter: blur(18px) saturate(1.8);
  }
  /* Чуть-чуть тоньше тень, чтобы карточка не «давила» на маленьком экране */
  .hero-swiper .swiper-slide > a > div {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .22) !important;
  }
}

/* ─── Liquid glass карточка (для виджетов сайдбара поверх ambient-фона) ─── */
.liquid-glass-card {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.liquid-glass-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 35%, transparent 65%, rgba(255,255,255,0.08) 100%);
  pointer-events: none;
  border-radius: inherit;
}
/* Содержимое виджета — белый цвет текста и инверсия некоторых стилей */
.liquid-glass-content { color: #fff; position: relative; z-index: 1; }
.liquid-glass-content a { color: #fff; }
.liquid-glass-content .text-slate-800,
.liquid-glass-content .text-slate-900,
.liquid-glass-content .text-slate-700,
.liquid-glass-content .text-slate-500,
.liquid-glass-content .text-slate-400 { color: rgba(255,255,255,.85) !important; }
.liquid-glass-content [style*="color:var(--text)"] { color: rgba(255,255,255,.95) !important; }
.liquid-glass-content [style*="color:var(--muted)"] { color: rgba(255,255,255,.65) !important; }
.liquid-glass-content [style*="color:var(--primary)"] { color: #fff !important; }
.liquid-glass-content input,
.liquid-glass-content textarea {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.25) !important;
}
.liquid-glass-content input::placeholder,
.liquid-glass-content textarea::placeholder { color: rgba(255,255,255,.55) !important; }


/* Swiper tweaks */
.swiper-pagination-bullet {
  background: rgba(255,255,255,.5);
  opacity: 1;
}
.swiper-pagination-bullet-active {
  background: #fff;
  width: 24px;
  border-radius: 4px;
}

/* Soft gradient borders for cards */
.gradient-border {
  position: relative;
  background: #fff;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ═══════════════════════════════════════════════════════════════
   📱 Мобильный сайдбар (off-canvas drawer)
   Тонкие линии между пунктами, чёткая иерархия родитель/ребёнок.
   ═══════════════════════════════════════════════════════════════ */

/* Затемнение фона */
.cms-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99;
}

/* Сам сайдбар — выезжает СЛЕВА, liquid glass эффект */
.cms-sidebar {
  position: fixed;
  top: 0;
  left: 0;                 /* было right: 0 — теперь выезжает слева */
  bottom: 0;
  width: min(86vw, 340px);
  height: 100vh;
  /* Liquid glass: полупрозрачный фон + сильный blur + saturate */
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(28px) saturate(2.2);
  -webkit-backdrop-filter: blur(28px) saturate(2.2);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  /* Тень теперь справа от сайдбара */
  box-shadow: 10px 0 40px rgba(0, 0, 0, .18),
              inset -1px 0 0 rgba(255, 255, 255, .35);
  overflow: hidden;
  isolation: isolate;
  /* GPU-композитинг для плавной анимации без джанков */
  will-change: transform;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Плавная transition сама по себе (на случай если Alpine x-transition не сработает) */
  transition: transform 280ms cubic-bezier(.22, 1, .36, 1);
}
/* Тот же GPU-композитинг на бэкдропе — для плавной opacity-анимации */
.cms-sidebar-backdrop {
  will-change: opacity;
  transform: translateZ(0);
  transition: opacity 280ms ease;
}
/* Глянцевый блик «liquid glass» поверх сайдбара */
.cms-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.55), transparent 50%),
    linear-gradient(135deg, rgba(255,255,255,.30) 0%, transparent 35%, transparent 65%, rgba(255,255,255,.18) 100%);
  pointer-events: none;
  z-index: 0;
}
/* Контент сайдбара выше блика */
.cms-sidebar > * { position: relative; z-index: 1; }

/* ── Шапка сайдбара (логотип + крестик) — на glass-фоне ── */
.cms-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.15) 100%);
  flex-shrink: 0;
}
.cms-sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text, #0f172a);
  min-width: 0;
}
.cms-sidebar__brand img {
  max-height: 36px;
  width: auto;
  display: block;
  border-radius: 6px;
}
.cms-sidebar__title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.cms-sidebar__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.cms-sidebar__close:hover { background: rgba(255, 255, 255, .85); transform: rotate(90deg); }

/* ── Список пунктов меню ── */
.cms-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 12px;
}

/* Группа (родитель + его дети) */
.cms-sidebar__group { border-bottom: 1px solid rgba(15, 23, 42, .06); }
.cms-sidebar__group:last-child { border-bottom: 0; }
.cms-sidebar__group--nested { border-bottom: 0; }

/* Базовая ссылка-пункт */
.cms-sidebar__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 14.5px;
  color: var(--text, #0f172a);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: background .15s, color .15s;
  gap: 8px;
}
.cms-sidebar__link:hover,
.cms-sidebar__link:focus-visible {
  background: rgba(99, 102, 241, .06);
  outline: 0;
}
.cms-sidebar__link.is-open { background: rgba(99, 102, 241, .08); }

/* Корневой пункт — пожирнее */
.cms-sidebar__link--root,
.cms-sidebar__link--parent {
  font-weight: 700;
  font-size: 15px;
  color: var(--text, #0f172a);
}

/* Дочерний пункт — тоньше, бледнее, со сдвигом влево */
.cms-sidebar__link--child {
  padding-left: 26px;
  font-weight: 500;
  font-size: 14px;
  color: #475569;
}
.cms-sidebar__link--leaf {
  padding-left: 38px;
  font-weight: 500;
  font-size: 13.5px;
  color: #64748b;
}

/* Подсветка-линия слева у дочерних пунктов = «дерево» */
.cms-sidebar__group .cms-sidebar__sub {
  position: relative;
  padding: 2px 0 6px;
  border-top: 1px dashed rgba(15, 23, 42, .1);
  background: rgba(255, 255, 255, .25);
}
.cms-sidebar__sub::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 4px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary, #6366f1) 35%, transparent), transparent);
  border-radius: 1px;
  pointer-events: none;
}
.cms-sidebar__sub--nested::before { left: 38px; }

/* Точка-маркер перед дочерним пунктом — показывает уровень */
.cms-sidebar__bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  flex-shrink: 0;
  opacity: .55;
  transition: opacity .15s, transform .15s;
}
.cms-sidebar__link:hover .cms-sidebar__bullet { opacity: 1; transform: scale(1.25); }

/* Метка + иконка */
.cms-sidebar__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.cms-sidebar__icon {
  font-size: 16px;
  color: var(--primary, #6366f1);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Шеврон у родителя — плавно поворачивается */
.cms-sidebar__chevron {
  font-size: 12px;
  color: #94a3b8;
  transition: transform .25s ease;
  flex-shrink: 0;
}
.cms-sidebar__chevron.is-open { transform: rotate(180deg); color: var(--primary, #6366f1); }

/* Стрелочка у листового (без детей) корневого пункта */
.cms-sidebar__leaf-arrow {
  color: #cbd5e1;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Подвал сайдбара (телефон, email, соцсети) — glass-стиль ── */
.cms-sidebar__foot {
  border-top: 1px solid rgba(15, 23, 42, .08);
  padding: 10px 14px 12px;
  background: linear-gradient(0deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.15) 100%);
  flex-shrink: 0;
}
.cms-sidebar__contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text, #0f172a);
  text-decoration: none;
}
.cms-sidebar__contact i { color: var(--primary, #6366f1); }
.cms-sidebar__socials {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cms-sidebar__socials a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--primary, #6366f1);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  transition: all .15s;
}
.cms-sidebar__socials a:hover {
  background: var(--primary, #6366f1);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* На очень узких телефонах — занимаем больше ширины */
@media (max-width: 380px) {
  .cms-sidebar { width: 92vw; }
}
