/* ============================
   ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ТЕМЫ
   Цвета и тени для всего сайта
   ============================ */
:root {
  --bg: #050711;                         /* Основной фон страницы (тёмный космос) */
  --bg-alt: #0b0f1f;                     /* Альтернативный фон секций/карточек */
  --text: #e6e9ff;                       /* Базовый цвет текста */
  --text-muted: #8a90b5;                 /* Приглушённый текст (подписи, мета) */
  --accent: #ff2e9f;                     /* Розовый акцент (второй акцентный цвет) */
  --accent-alt: #33f0ff;                 /* Голубой акцент (главный неон) */
  --border: rgba(255, 255, 255, 0.08);   /* Лёгкие границы/бордеры */
  --shadow: rgba(0, 0, 0, 0.6);          /* Общая тень для блоков */
}

/* ============================
   БАЗОВЫЕ СБРОСЫ И ТИПОГРАФИКА
   ============================ */

*,
*::before,
*::after {
  box-sizing: border-box;                /* Упрощает расчёт размеров блоков */
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #101633 0, var(--bg) 55%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* ============================
   ГЛАВНЫЙ КОНТЕЙНЕР .aed-shell
   ============================ */

.aed-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ============================
   HEADER (шапка сайта)
   ============================ */

.aed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 3rem;
}

.aed-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.aed-logo-img {
  height: clamp(80px, 12vw, 120px);
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(51, 240, 255, 0.3));
}

.aed-brand-text {
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-alt), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================
   НАВИГАЦИЯ (верхнее меню)
   ============================ */

.aed-nav {
  display: flex;
  gap: 2rem;
}

.aed-nav a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.aed-nav a:hover {
  color: var(--accent-alt);
  text-shadow: 0 0 12px rgba(51, 240, 255, 0.6);
}

/* Активный пункт меню с неоновой «таблеткой» */
.aed-nav a[href="/"],
.aed-nav a[href="/home"],
.aed-nav a.is-active {
  color: #33f0ff !important;
  text-shadow:
    0 0 10px #33f0ff,
    0 0 20px #33f0ff,
    0 0 30px #33f0ff !important;
  animation: neonPulse 2s ease-in-out infinite alternate !important;
  font-weight: 600 !important;
  background: rgba(51, 240, 255, 0.15);
  backdrop-filter: blur(12px);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  box-shadow:
    0 0 20px rgba(51, 240, 255, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.aed-nav a.is-active::after {
  display: none;
}

@keyframes neonPulse {
  0% {
    text-shadow:
      0 0 10px #33f0ff,
      0 0 20px #33f0ff,
      0 0 30px #33f0ff;
  }
  100% {
    text-shadow:
      0 0 15px #33f0ff,
      0 0 25px #33f0ff,
      0 0 40px #33f0ff;
  }
}

/* ============================
   ОСНОВНОЙ КОНТЕНТ .aed-main
   ============================ */

.aed-main {
  min-height: 60vh;
  margin-bottom: 4rem;
}

/* ============================
   FOOTER
   ============================ */

.aed-footer {
  padding: 3rem 0 2rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text-muted) !important;
  margin-top: 4rem !important;
}

.aed-footer-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.aed-footer-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.aed-footer-nav a {
  opacity: 0.7;
  transition: all 0.2s ease;
  color: inherit;
  text-decoration: none;
}

.aed-footer-nav a:hover {
  opacity: 1;
  color: var(--accent-alt);
  text-shadow: 0 0 8px rgba(51, 240, 255, 0.4);
}

.aed-footer-nav span {
  opacity: 0.4;
}

.aed-footer p {
  text-align: center;
  opacity: 0.8;
  font-size: 0.9rem;
  margin: 0;
}

/* ====================================
   HERO / SERVICES / GRID (home)
   ==================================== */

.aed-hero,
.aed-card-grid {
  display: grid;
  gap: 2rem;
}

.aed-hero {
  grid-template-columns: 2fr 1fr;
  align-items: start;
}

.aed-hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(135deg, var(--text), var(--accent-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ====================================
   BLOG GRID 3×N
   ==================================== */

.aed-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  margin-top: 2rem;
}

.aed-blog-card {
  position: relative;
  height: 300px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(5, 7, 17, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.aed-blog-card-link {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  z-index: 2;
}

.aed-blog-card-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.65) contrast(1.1) saturate(1.25);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.aed-blog-card-thumb--empty {
  background: linear-gradient(
    135deg,
    #1e3a8a 0%,
    #3b82f6 25%,
    #ec4899 50%,
    #1e3a8a 75%,
    #0f172a 100%
  );
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.aed-blog-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.9) 100%
  );
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0.8;
}

.aed-blog-card-body {
  position: relative;
  z-index: 3;
  padding: 2.5rem 2.5rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.aed-blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  line-height: 1.25;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  letter-spacing: -0.01em;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aed-blog-card-teaser {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
  margin: 0 0 1.5rem;
  line-height: 1.55;
  flex: 1;
}

.aed-blog-card-meta {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #33f0ff;
  margin: 0;
  font-weight: 500;
  text-shadow: 0 0 12px rgba(51, 240, 255, 0.6);
}

/* HOVER-эффекты блога */
.aed-blog-card:hover {
  transform: translateY(-16px);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(51, 240, 255, 0.4),
    0 0 120px rgba(255, 46, 159, 0.3),
    inset 0 0 40px rgba(255, 255, 255, 0.05);
  border-color: rgba(51, 240, 255, 0.6);
}

.aed-blog-card:hover .aed-blog-card-thumb {
  filter: brightness(0.30) contrast(1.1) saturate(1.3);
}

.aed-blog-card:hover .aed-blog-card-overlay {
  opacity: 0.9;
}

.aed-blog-card:hover .aed-blog-card-title {
 /* font-size: 1.2rem;*/
  letter-spacing: 0.005em;
}

/* Розовый «фотон» вокруг текста */
.aed-blog-card:hover .aed-blog-card-title,
.aed-blog-card:hover .aed-blog-card-teaser,
.aed-blog-card:hover .aed-blog-card-meta {
  color: #ffffff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.9),
    0 0 6px rgba(255, 46, 159, 0.7),
    0 0 14px rgba(255, 46, 159, 0.8),
    0 0 22px rgba(255, 120, 200, 0.9);
}

/* ============================
   ФИРМЕННЫЙ ШРИФТ
   ============================ */

.aed-brand-text,
.aed-nav a,
.aed-hero-title,
.aed-section-title {
  font-family: "Science Gothic", system-ui, -apple-system, sans-serif;
  letter-spacing: 0.08em;
}

.aed-blog-card-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================
   ADAPTIVE / RESPONSIVE
   ============================ */

@media (max-width: 1024px) {
  .aed-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .aed-blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .aed-shell {
    padding: 1.5rem 1rem 3rem;
  }

  .aed-header {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .aed-nav {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .aed-nav a {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(12px);
  }

  .aed-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(51, 240, 255, 0.3);
    box-shadow: 0 8px 25px rgba(51, 240, 255, 0.15);
  }

  .aed-hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .aed-footer-nav {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .aed-blog-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .aed-blog-card {
    height: 280px;
  }
}

/* ════════════════════════════════════════ */
/* ВНУТРЕННЯЯ СТАТЬЯ БЛОГА                 */
/* ════════════════════════════════════════ */

.aed-post {
  padding: 3.5rem 0 4.5rem;
}

.aed-post-card {
  max-width: 880px;
  margin: 0 auto;
  background: radial-gradient(circle at top left, rgba(51, 240, 255, 0.08), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 46, 159, 0.08), transparent 55%),
              var(--bg-alt);
  border-radius: 28px;
  border: 1px solid rgba(51, 240, 255, 0.22);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.96),
    0 0 26px rgba(51, 240, 255, 0.25);
  overflow: hidden;
}

/* Хедер с обложкой */
.aed-post-hero {
  position: relative;
  height: 320px;
  overflow: hidden;
}

.aed-post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7) contrast(1.1);
  transform: scale(1.03);
}

.aed-post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(5, 7, 17, 0.94) 0%,
    rgba(5, 7, 17, 0.35) 55%,
    transparent 100%);
}

.aed-post-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.8rem 2.4rem 2.2rem;
}

.aed-post-meta {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fe9ff;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
}

.aed-post-title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 1.22;
  color: var(--text);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

.aed-post-lead {
  margin: 0;
  max-width: 46rem;
  font-size: 1.02rem;
  color: rgba(230, 233, 255, 0.9);
}

/* Вариант без обложки */
.aed-post-header {
  padding: 2.2rem 2.4rem 0.4rem;
}

/* Основной текст статьи */
.aed-post-body {
  padding: 2.2rem 2.4rem 2.4rem;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(230, 233, 255, 0.96);
}

.aed-post-body h2,
.aed-post-body h3 {
  margin-top: 2.1rem;
  margin-bottom: 0.9rem;
  position: relative;
}

/* Вариант с линией под заголовком */
.aed-post-body h2,
.aed-post-body h3 {
  margin-top: 2.1rem;
  margin-bottom: 0.9rem;
  position: relative;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(51, 240, 255, 0.8);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.aed-post-body p {
  margin: 0 0 1.1rem;
}

/* (если понадобятся списки, можно доопределить .aed-post-body ul, ol, li) */

/* ═══════════════════════════════════════ */
/* НАВИГАЦИЯ ПОД СТАТЬЁЙ БЛОГА             */
/* Кнопки "следующая / предыдущая статья" */
/* ═══════════════════════════════════════ */

/* 1. Внутренний футер статьи (запас под теги/автора и т.п.) */
.aed-post-footer {
  padding: 0 2.4rem 2.4rem;
}

/* 2. Внешняя обёртка навигации под статьёй */
.aed-post-nav-out {
  max-width: 880px;          /* та же ширина, что и .aed-post-card */
  margin: 2.4rem auto 0;     /* отступ сверху + автоцентрирование */
  padding: 0 2.4rem 2.4rem;  /* боковые и нижний отступы */
}

/* 3. Контейнер с кнопками навигации */
.aed-post-nav {
  display: flex;
  justify-content: space-between; /* "следующая" слева, "предыдущая" справа */
  gap: 1rem;
  margin-top: 2.5rem;
}

/* 4. Базовый вид ссылок-кнопок */
.aed-post-nav-link {
  display: inline-flex;
  flex-direction: column;        /* сверху подпись, снизу заголовок */
  align-items: flex-start;

  padding: 0.35rem 0.9rem;       /* компактная кнопка по умолчанию */
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.3;

  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;

  transform: scale(1);           /* базовый масштаб */
  transform-origin: center;      /* увеличение из центра */
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    background-color 0.18s ease-out,
    border-color 0.18s ease-out;
}

/* 5. Вспомогательные элементы внутри ссылки */

/* Верхняя подпись: "Следующая статья", "Предыдущая статья" */
.aed-post-nav-caption {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}

/* Нижняя строка — заголовок статьи */
.aed-post-nav-title {
  font-weight: 500;
  font-size: 0.8rem;            /* компактный заголовок */
  max-width: 14rem;             /* ограничиваем ширину */
  white-space: nowrap;          /* в одну строку */
  overflow: hidden;
  text-overflow: ellipsis;      /* троеточие при переполнении */
}

/* 6. Ховер-эффект: подъём и подсветка */
/* Увеличиваем кнопку, но НЕ меняем font-size/строк */
.aed-post-nav-link:hover {
  transform: translateY(-2px) scale(1.05);  /* лёгкое увеличение без влияния на лэйаут */
  background-color: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Текст заголовка на ховере оставляем тем же,
   чтобы высота кнопки не прыгала и страница не дёргалась */

/* 7. Адаптив для мобильных (≤ 640px) */
@media (max-width: 640px) {
  .aed-post-footer {
    padding: 0 1.4rem 1.8rem;
  }

  .aed-post-nav-out {
    padding: 0 1.4rem 1.8rem;
  }

  .aed-post-nav {
    justify-content: center;
    flex-direction: column;
    align-items: stretch;
  }

  .aed-post-nav-link {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Временно скрыть пункты Кейсы и Услуги в верхнем меню */
.aed-nav a[href="/cases"],
.aed-nav a[href="/services"] {
  display: none !important;
}
/* Временно полностью скрываем пункт "Кейсы" в верхнем меню */
.aed-nav a[href="/cases"],
.aed-nav a[href^="/cases/"] {
  display: none !important;
}
