/*
Theme Name: Heion Studio
Theme URI: https://heion.studio
Author: Heion Studio
Description: Тёмная тема-лендинг для студии разработки лендингов и настройки Яндекс Директа. Все секции настраиваются через Кастомайзер (Внешний вид → Настроить): главный экран с фоном из медиатеки, преимущества, услуги, портфолио, блок Яндекс Директа, контакты, подвал и SEO.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: heion
Tags: dark, one-column, custom-logo, portfolio, translation-ready
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --purple: #7c5cbf;
  --purple-dim: rgba(124, 92, 191, 0.15);
  --purple-glow: rgba(124, 92, 191, 0.08);
  --bg-card: #121212;
  --bg-card-hover: #181818;
  --border-card: #252525;
  --border-light: #2a2a2a;
  --text-primary: #ececec;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 0 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0 40px;
}

.card, .service-item, .portfolio-item, .block {
  background: var(--bg-card);
  border-radius: 28px;
  padding: 30px 28px;
  transition: all 0.25s ease;
  border: 1px solid var(--border-card);
}

.card:hover, .service-item:hover, .portfolio-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.gradient-text {
  background: linear-gradient(145deg, #c8b8e8, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Анимация для SVG-логотипа — переливающийся градиент */
@keyframes logoShimmer {
  0%   { fill: #7c5cbf; }
  25%  { fill: #b8a0d8; }
  50%  { fill: #e8d8ff; }
  75%  { fill: #b8a0d8; }
  100% { fill: #7c5cbf; }
}

.logo-svg-animated .cls-1 {
  animation: logoShimmer 5s ease-in-out infinite;
}

/* Разъезжающиеся половинки букв (буквы разрезаны по горизонтали пополам) */
@keyframes logoSliceTop {
  0%, 78%, 100% { transform: translate(0, 0); }
  8%  { transform: translate(10px, -6px); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  16% { transform: translate(8px, -5px); animation-timing-function: ease-in-out; }
  55% { transform: translate(8px, -5px); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  68% { transform: translate(-2px, 1px); animation-timing-function: ease-out; }
}

@keyframes logoSliceBottom {
  0%, 78%, 100% { transform: translate(0, 0); }
  8%  { transform: translate(-10px, 6px); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  16% { transform: translate(-8px, 5px); animation-timing-function: ease-in-out; }
  55% { transform: translate(-8px, 5px); animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  68% { transform: translate(2px, -1px); animation-timing-function: ease-out; }
}

.logo-svg-animated .lg-top {
  animation: logoSliceTop 4.5s ease-in-out infinite;
}

.logo-svg-animated .lg-bot {
  animation: logoSliceBottom 4.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .logo-svg-animated .cls-1,
  .logo-svg-animated .lg-top,
  .logo-svg-animated .lg-bot {
    animation: none;
  }
}

.btn {
  display: inline-block;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  padding: 13px 36px;
  border-radius: 60px;
  text-decoration: none;
  letter-spacing: 0.2px;
  border: 1px solid #3a3a3a;
  transition: all 0.25s;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
}

.btn:hover {
  border-color: var(--purple);
  color: var(--white);
  box-shadow: 0 0 30px var(--purple-glow);
  background: var(--purple-dim);
}

.btn-primary {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 92, 191, 0.15);
}

.btn-primary:hover {
  background: #8b6fd0;
  border-color: #8b6fd0;
  box-shadow: 0 4px 30px rgba(124, 92, 191, 0.25);
  transform: scale(1.02);
}

/* header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 28px;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 40px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
}

.logo-wrapper a {
  display: block;
  line-height: 0;
}

.custom-logo {
  max-height: 44px;
  width: auto;
}

.logo-svg-animated {
  height: 44px;
  width: auto;
  display: block;
}

.logo-svg-animated svg {
  height: 100%;
  width: auto;
  display: block;
}

.site-title-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.contacts {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.contacts a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  transition: 0.2s;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.contacts a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--purple);
}

/* hero */
.hero {
  padding: 56px 40px;
  border-radius: 36px;
  margin-bottom: 30px;
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  background-color: rgba(8, 8, 8, 0.75);
  border: 1px solid #1e1e1e;
}

.hero--nobg {
  background-image: radial-gradient(ellipse at 20% 0%, rgba(124, 92, 191, 0.22), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(124, 92, 191, 0.12), transparent 50%);
  background-color: #0d0d0d;
  background-blend-mode: normal;
}

.hero h1 {
  font-size: 50px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -1px;
  max-width: 700px;
}

.hero p {
  font-size: 19px;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero .btn {
  font-size: 17px;
  padding: 15px 44px;
}

/* features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 44px 0 36px;
}

.feature-item {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px 20px;
  border: 1px solid var(--border-card);
  transition: 0.2s;
}

.feature-item:hover {
  border-color: var(--purple);
  background: var(--bg-card-hover);
}

.feature-item .icon {
  margin-bottom: 12px;
  width: 36px;
  height: 36px;
  color: var(--purple);
  opacity: 0.7;
}

.feature-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.feature-item p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* services */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 36px 0 44px;
}

.service-item {
  background: var(--bg-card);
  border-radius: 28px;
  padding: 28px 24px;
  border: 1px solid var(--border-card);
}

.service-item:hover {
  border-color: var(--purple);
  background: var(--bg-card-hover);
}

.service-item .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  color: var(--purple);
  opacity: 0.7;
}

.service-item h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.service-item p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
}

.service-tag {
  display: inline-block;
  background: #1a1a1a;
  padding: 4px 16px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid #2a2a2a;
}

.service-tag.purple {
  border-color: var(--purple);
  color: var(--purple);
}

/* portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 28px 0 44px;
}

.portfolio-item {
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-card);
}

.portfolio-item:hover {
  border-color: var(--purple);
}

.portfolio-item {
  cursor: pointer;
}

.portfolio-item:focus-visible {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-dim);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #181818;
  user-select: none;
  -webkit-user-drag: none;
}

.portfolio-item .no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #181818, rgba(124, 92, 191, 0.18));
}

/* мини-галерея на карточке: кадр всегда 16:9 */
.pi-media {
  position: relative;
  overflow: hidden;
  /* pan-y — вертикальный скролл страницы, pinch-zoom — масштабирование
     двумя пальцами. Горизонтальный свайп остаётся галерее (JS). */
  touch-action: pan-y pinch-zoom;
  aspect-ratio: 16 / 9;
  background: #141414;
}

.pi-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.pi-track img {
  flex: 0 0 100%;
}

.portfolio-item.has-gallery .pi-media::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
  z-index: 1;
}

/* точки */
.pi-dots,
.hpf-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

.hp-dot {
  width: 7px;
  height: 7px;
  border-radius: 20px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.25s;
}

.hp-dot:hover {
  background: #fff;
}

.hp-dot.active {
  background: #fff;
  width: 18px;
}

/* стрелки */
.pi-arrow,
.hpf-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 10, 10, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  transition: opacity 0.2s, background 0.2s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pi-arrow:hover,
.hpf-arrow:hover {
  background: var(--purple);
}

.pi-prev { left: 10px; }
.pi-next { right: 10px; }

.pi-arrow { opacity: 0; }

.portfolio-item:hover .pi-arrow,
.portfolio-item:focus-within .pi-arrow {
  opacity: 1;
}

@media (hover: none) {
  .pi-arrow { display: none; }
}

/* ===== попап портфолио ===== */
html.hpf-lock,
html.hpf-lock body {
  overflow: hidden;
}

.hpf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hpf-modal[hidden] {
  display: none;
}

.hpf-backdrop {
  /* fixed, а не absolute: на мобильном модалка прокручивается и может
     быть выше экрана — absolute-бэкдроп покрыл бы только первый экран,
     и сверху/снизу оставались бы незаблюренные полосы. fixed всегда
     закрывает весь вьюпорт. */
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hpf-dialog {
  position: relative;
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 28px;
  /* Крупный попап на десктопе — фото должно быть хорошо видно,
     а не мелким окошком. */
  max-width: 1440px;
  width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: grid;
  /* Высоту строки задаёт только медиа-колонка: текст в .hpf-infowrap
     позиционируется абсолютно и не растягивает попап. */
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  animation: hpfIn 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes hpfIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hpf-media {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  background: #0d0d0d;
  /* Кадр всегда 16:9 — длинный текст справа не растягивает фото.
     width:100% обязателен: иначе при срабатывании max-height браузер
     сохраняет пропорцию, ужимая ширину, и по бокам появляются пустоты. */
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  min-height: 0;
  cursor: zoom-in;
}

.hpf-expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.6);
  color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: 0.2s;
}

.hpf-expand svg {
  width: 15px;
  height: 15px;
}

.hpf-media:hover .hpf-expand {
  background: var(--purple);
  color: #fff;
}

.hpf-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.hpf-slide {
  flex: 0 0 100%;
  height: 100%;
}

.hpf-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.hpf-slide .no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #181818, rgba(124, 92, 191, 0.18));
}

.hpf-arrow {
  width: 40px;
  height: 40px;
}

.hpf-prev { left: 14px; }
.hpf-next { right: 14px; }

.hpf-dots { bottom: 14px; }

.hpf-counter {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 3;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 30px;
  background: rgba(10, 10, 10, 0.6);
  color: #ddd;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hpf-close {
  position: absolute;
  /* env(safe-area-inset-top) — отступ от чёлки/статус-бара на iPhone,
     чтобы крестик закрытия не оказывался под ней и был всегда нажимаем. */
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #333;
  background: rgba(10, 10, 10, 0.6);
  color: #eee;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hpf-close:hover {
  background: var(--purple);
  border-color: var(--purple);
}

/* Обёртка не имеет потоковых детей — поэтому не влияет на высоту попапа */
.hpf-infowrap {
  position: relative;
  min-height: 0;
}

.hpf-info {
  position: absolute;
  inset: 0;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

/* Скроллится только текст, кнопка остаётся на месте */
.hpf-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}

.hpf-scroll::-webkit-scrollbar {
  width: 6px;
}

.hpf-scroll::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 10px;
}

.hpf-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

.hpf-tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 500;
  color: var(--purple);
  padding: 3px 14px;
  border-radius: 40px;
  border: 1px solid var(--purple);
  background: var(--purple-glow);
}

.hpf-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.hpf-text {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-line;
}

.hpf-link {
  align-self: flex-start;
  flex: 0 0 auto;
  margin-top: 20px;
}

/* До 900px две колонки становятся тесными для текста — раскладываем столбиком */
@media (max-width: 900px) {
  .hpf-modal {
    /* На iPhone верх/низ экрана перекрыты чёлкой, статус-баром и
       индикатором свайпа — учитываем это отступами через safe-area,
       иначе крестик закрытия оказывается под чёлкой и недоступен.
       align-items:flex-start + overflow-y:auto — если попап всё же
       не влезает по высоте, его можно прокрутить целиком, а не
       упереться в обрезанный сверху угол без возможности прокрутки. */
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .hpf-dialog {
    /* Столбиком: фото сверху (16:9), текст занимает остаток и скроллится */
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: none;
    margin: auto 0;
    border-radius: 22px;
  }
  .hpf-media {
    /* на узких и на альбомных экранах фото не съедает весь попап */
    max-height: 46vh;
  }
  .hpf-infowrap {
    position: static;
    display: flex;
    min-height: 0;
  }
  .hpf-info {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 20px 24px;
  }
  .hpf-title {
    font-size: 21px;
  }
  .hpf-link {
    margin-top: 14px;
  }
}

/* ===== Полноэкранный просмотр фото ===== */
.hpf-zoom {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 4, 4, 0.96);
  animation: hpfFade 0.2s ease;
}

.hpf-zoom[hidden] {
  display: none;
}

@keyframes hpfFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hpf-zoom-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* На полном экране важнее всего пинч-зум фото; горизонтальный свайп
     между фото обрабатывает JS. Вертикального скролла тут нет. */
  touch-action: pinch-zoom;
}

.hpf-zoom-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.hpf-zoom-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* поля, чтобы фото не заезжало под стрелки, счётчик и точки;
     сверху добавляем safe-area — иначе фото полезет под чёлку/статус-бар */
  padding: calc(60px + env(safe-area-inset-top)) 64px 70px;
}

/* Фото целиком, без обрезки, максимально крупно под любой экран */
.hpf-zoom-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  cursor: default;
}

.hpf-zoom-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #3a3a3a;
  background: rgba(20, 20, 20, 0.7);
  color: #eee;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hpf-zoom-close:hover {
  background: var(--purple);
  border-color: var(--purple);
}

.hpf-zoom .hpf-arrow {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.hpf-zoom .hpf-prev { left: 16px; }
.hpf-zoom .hpf-next { right: 16px; }
.hpf-zoom .hpf-dots { bottom: 22px; }

.hpf-zoom .hpf-counter {
  top: max(22px, env(safe-area-inset-top));
  left: max(22px, env(safe-area-inset-left));
  font-size: 13px;
  padding: 5px 14px;
}

@media (max-width: 760px) {
  .hpf-zoom-slide {
    padding: calc(56px + env(safe-area-inset-top)) 12px 60px;
  }
  .hpf-zoom-close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 38px;
    height: 38px;
  }
  .hpf-zoom .hpf-counter {
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
  }
  .hpf-zoom .hpf-dots { bottom: 16px; }
}

/* На тач-экранах стрелки не нужны — листаем свайпом */
@media (hover: none) {
  .hpf-zoom .hpf-arrow { display: none; }
  .hpf-zoom-slide { padding: calc(56px + env(safe-area-inset-top)) 10px 56px; }
}

.portfolio-item .desc {
  padding: 16px 20px 20px;
}

.portfolio-item .desc h4 {
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.portfolio-item .desc p {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== FAQ ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0 44px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item.is-open,
.faq-item:has(.faq-question:hover) {
  border-color: var(--purple);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 20px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a1a1a;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s, background 0.25s;
}

.faq-icon svg {
  width: 14px;
  height: 14px;
}

.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
  background: var(--purple);
  color: #fff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 24px 22px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
}

@media (max-width: 700px) {
  .faq-question {
    padding: 16px 18px;
    font-size: 15px;
    gap: 14px;
  }
  .faq-answer-inner {
    padding: 0 18px 18px;
  }
}

/* direct block */
.direct-block {
  background: var(--bg-card);
  border-radius: 32px;
  padding: 36px 34px;
  margin: 44px 0 36px;
  border: 1px solid var(--border-card);
}

.direct-block:hover {
  border-color: var(--purple);
}

.direct-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.direct-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 10px;
  border-radius: 40px;
  border: 1px solid #2a2a2a;
  background: #141414;
}

.direct-logo svg {
  height: 28px;
  width: auto;
  display: block;
}

.direct-logo span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.cert-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 3px 14px;
  border-radius: 40px;
  border: 1px solid #2a2a2a;
  background: #141414;
}

.direct-block h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 10px;
}

.direct-block .sub {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 560px;
  margin-bottom: 18px;
}

.direct-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 28px;
  margin-top: 12px;
}

.direct-features li {
  list-style: none;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.direct-features li svg {
  width: 16px;
  height: 16px;
  color: var(--purple);
  opacity: 0.6;
  flex-shrink: 0;
}

/* contact online */
.contact-online {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 44px;
  justify-content: center;
  padding: 18px 0 8px;
  border-top: 1px solid #1a1a1a;
  margin-top: 28px;
  scroll-margin-top: 30px;
}

.contact-online a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.contact-online a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--purple);
}

.contact-online a svg {
  width: 20px;
  height: 20px;
  color: var(--purple);
  opacity: 0.5;
}

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 0 6px;
  letter-spacing: 0.2px;
}

/* headings */
.section-title {
  font-weight: 600;
  font-size: 26px;
  margin: 32px 0 18px;
  letter-spacing: -0.3px;
}

/* ===== Блог, страницы, записи ===== */

.page-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 10px 0 24px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 10px 0 40px;
}

.post-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border-card);
  transition: 0.2s;
}

.post-card:hover {
  border-color: var(--purple);
  background: var(--bg-card-hover);
}

.post-card .post-thumb img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
}

.post-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.post-card h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--purple);
}

.post-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.post-card .excerpt {
  color: var(--text-secondary);
  font-size: 14px;
}

article.block {
  margin-bottom: 30px;
}

.entry-content {
  color: var(--text-secondary);
  font-size: 16px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--text-primary);
  margin: 28px 0 12px;
  letter-spacing: -0.3px;
}

.entry-content p {
  margin-bottom: 16px;
}

.entry-content a {
  color: var(--purple);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 16px 22px;
}

.entry-content li {
  margin-bottom: 6px;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.entry-content blockquote {
  border-left: 3px solid var(--purple);
  padding: 4px 0 4px 20px;
  margin: 20px 0;
  color: var(--text-primary);
}

.entry-content code {
  background: #1a1a1a;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
}

.entry-content pre {
  background: #1a1a1a;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}

/* pagination */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 30px;
}

.nav-links .page-numbers {
  padding: 8px 15px;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: 0.2s;
}

.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
  border-color: var(--purple);
  color: var(--white);
}

/* forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea {
  background: #141414;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 10px 14px;
  width: 100%;
  max-width: 100%;
  font-family: inherit;
  font-size: 15px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
}

input[type="submit"] {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  font-weight: 500;
  padding: 12px 32px;
  border-radius: 60px;
  border: 1px solid var(--purple);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  transition: 0.25s;
  width: auto;
}

input[type="submit"]:hover {
  background: #8b6fd0;
}

/* comments */
.comments-area {
  margin: 20px 0 40px;
}

.comments-title,
.comment-reply-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 18px;
}

.comment-list {
  list-style: none;
  margin-bottom: 24px;
}

.comment-list .children {
  list-style: none;
  margin-left: 26px;
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--text-secondary);
}

.comment-author,
.comment-metadata a {
  color: var(--text-primary);
  font-size: 14px;
}

.comment-metadata {
  font-size: 12px;
  margin-bottom: 8px;
}

.comment-metadata a {
  color: var(--text-muted);
  text-decoration: none;
}

.comment-form p {
  margin-bottom: 14px;
}

.comment-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ===== Обязательные классы WordPress ===== */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--bg-card);
  border-radius: 8px;
  clip: auto !important;
  clip-path: none;
  color: var(--text-primary);
  display: block;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 14px 22px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

.alignleft {
  float: left;
  margin: 4px 24px 16px 0;
}

.alignright {
  float: right;
  margin: 4px 0 16px 24px;
}

.aligncenter {
  display: block;
  margin: 16px auto;
  clear: both;
}

.wp-caption {
  max-width: 100%;
  margin-bottom: 16px;
}

.wp-caption img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wp-caption-text,
.gallery-caption {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0 0;
  text-align: center;
}

.sticky {
  border-color: var(--purple);
}

.bypostauthor {
  display: block;
}

/* adaptive */
@media (max-width: 700px) {
  .hero { padding: 36px 24px; }
  .hero h1 { font-size: 34px; }

  /* Шапка остаётся в одну строку: лого слева, почта справа —
     не переносится под лого. Telegram/WhatsApp в шапке на узких
     экранах скрываем: они не помещаются рядом с почтой без переноса,
     а полный набор контактов с иконками уже есть внизу страницы. */
  .header {
    flex-wrap: nowrap;
    gap: 12px;
  }
  .logo-wrapper {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
  }
  .contacts {
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
  }
  .contacts a:not(:first-child) {
    display: none;
  }
  .contacts a:first-child {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
  }
  .direct-block { padding: 24px 20px; }
  .direct-features { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .btn { padding: 11px 24px; font-size: 15px; }
  .logo-svg-animated { height: 28px; }
}
