/*
  Azatora Premium Minimalist Design System
*/

:root {
  /* Colors */
  --bg-main: #000000;
  --bg-light: #010409;
  --bg-lighter: #1e293b;
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --accent: #0044cc;
  --border: rgba(51, 65, 85, 0.55);
  --glass-bg: rgba(255, 255, 255, 0.04);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing & Utilities */
  --container-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  /* Подстраховка на случай отскока за пределы body (см. ниже) в браузерах,
     где overscroll-behavior не поддерживается: без своего фона html
     показывал бы белый холст вместо чёрного. */
  background: var(--bg-main);
}

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at center, #0d123d 0%, #000000 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Отключает «отскок» при докрутке до конца страницы (rubber-band на
     трекпаде/тач-устройствах) — иначе за пределами body на мгновение
     виден фон окна браузера. Свойство ставится на body, а не html:
     часть браузеров overscroll-behavior на html не поддерживает. */
  overscroll-behavior-y: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Typography Classes */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  /* Сплошной, а не прозрачный: шапка фиксированная, и сквозь прозрачную
     при прокрутке просвечивал контент под ней. */
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  height: 52px;
  width: auto;
}

.nav-logo {
  height: 40px;
  width: auto;
}

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

.nav a, .footer-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav a:hover, .footer-nav a:hover,
.nav a:active, .footer-nav a:active {
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Switcher Dropdown (Onlink Style) */
.topbar-lang {
  position: relative;
  flex-shrink: 0;
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.topbar-lang.open .topbar-icon-btn,
.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.topbar-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  left: auto;
  transform: none;
  background: rgba(1, 4, 9, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  display: none;
  flex-direction: column;
  min-width: 120px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
  z-index: 200;
}

.topbar-lang.open .topbar-lang-menu {
  display: flex;
}

.lang-switch-item {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-switch-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lang-name-native {
  font-size: 0.9375rem; /* 15px */
  color: var(--text-main);
  transition: all 0.2s;
}

.lang-name-en {
  font-size: 0.75rem; /* 12px */
  color: var(--text-muted);
  transition: all 0.2s;
}

.lang-switch-item:hover .lang-name-native,
.lang-switch-item.active .lang-name-native {
  color: #fff;
}

.lang-switch-item.active .lang-name-native {
  font-weight: 500;
}

.mobile-menu-btn {
  display: none;
  /* Крупнее, чем базовые 32px у .topbar-icon-btn — на мобильном это
     основная кнопка навигации, ей нужна цель побольше под палец. */
  width: 40px;
  height: 40px;
}

.burger-icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.burger-icon-bar {
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: top .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}

.burger-icon-bar:nth-child(1) { top: 3px; }
.burger-icon-bar:nth-child(2) { top: 9px; }
.burger-icon-bar:nth-child(3) { top: 15px; }

.mobile-menu-btn.open .burger-icon-bar:nth-child(1) { top: 9px; transform: rotate(45deg); }
.mobile-menu-btn.open .burger-icon-bar:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open .burger-icon-bar:nth-child(3) { top: 9px; transform: rotate(-45deg); }

/* Hero Section */
.hero {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: fade-up 600ms ease-out both;
}

.hero-content {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.hero__title {
  margin: 0;
  font-size: clamp(2rem, 4vw + 0.5rem, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer (Onlink style, dark theme) */
.site-footer {
  background: var(--bg-main);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.site-footer-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 28px;
  display: flex;
  justify-content: space-between;
  /* stretch, а не start: колонки получают высоту всей строки (=высота самой
     высокой колонки, обычно «Контакты» с адресом в 3 строки), иначе бейджу
     Astana Hub ниже не от чего оттолкнуться, чтобы прижаться к низу. */
  align-items: stretch;
  gap: 40px;
  padding-block: 64px;
}

.site-footer-col-brand {
  margin-right: 20px;
  display: flex;
  flex-direction: column;
}

/* Astana Hub Badge */
.astanahub-badge {
  border-radius: 0;
  padding: 0;
  margin-top: 48px;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

/* На десктопе прижимаем бейдж к низу колонки — вровень с адресом во второй
   колонке. margin-top: 48px выше остаётся для мобильного блока
   (.site-footer-mobile-brand — там колонка не растянута по высоте, auto там
   ничего не даст без flex-контекста, поэтому переопределяем адресно). */
.site-footer-col-brand .astanahub-badge {
  margin-top: auto;
}

.astanahub-badge:hover {
  opacity: 0.75;
}

.astanahub-logo {
  height: 36px;
  width: auto;
  align-self: flex-start;
}

.astanahub-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  /* Тот же line-height, что у .site-footer-address рядом — иначе при
     одинаковом font-size строки бейджа визуально гуще, чем у адреса. */
  line-height: 1.6;
}

@media (max-width: 900px) {
  /* 24px — тот же горизонтальный отступ, что у общего .container (шапка,
     секции страниц): раньше здесь было 16px, и весь футер съезжал левее
     логотипа в шапке на 8px. */
  .site-footer-shell { padding-inline: 24px; gap: 40px; }
  .site-footer-col-brand { margin-right: 80px; }
}
@media (max-width: 720px) {
  .site-footer-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }
}
@media (max-width: 640px) {
  .site-footer-shell { padding-block-start: 32px; }
}
@media (max-width: 480px) {
  /* 32px — тот же отступ, что и от текста Astana Hub до заголовка
     «Контакты» (.site-footer-shell padding-block-start выше): было 20px,
     колонки стояли теснее, чем блок с логотипом над ними. */
  .site-footer-shell { grid-template-columns: 1fr; gap: 32px; }
}

.site-footer-heading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.site-footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.site-footer-list a {
  /* Как .nav a: серый по умолчанию, белый при наведении. */
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.site-footer-list a:hover, .site-footer-list a:active {
  color: #fff;
}

.site-footer-contact-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  opacity: .75;
  margin-top: 2px;
}

.site-footer-address {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.site-footer-list-wide { gap: 20px; }

/* Bottom bar */
.site-footer-bottom {
  border-top: 1px solid var(--border);
}

.site-footer-bottom-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

@media (max-width: 900px) {
  .site-footer-bottom-inner { padding-inline: 24px; }
}

.site-footer-copy {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer-social {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}

.site-footer-social a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}

.site-footer-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Mobile brand (shown above columns on <=640px) */
.site-footer-mobile-brand { display: none; }
.site-footer-mobile-brand .brand-logo { height: 40px; width: auto; }
/* Паддинг — из общего .container (24px), переопределять не нужно: теперь
   это тот же отступ, что и у .site-footer-shell (см. брейкпоинт 900px). */

@media (max-width: 640px) {
  .site-footer-col-brand { display: none; }
  .site-footer-mobile-brand { display: block; padding-top: 32px; }
  .site-footer-bottom { border-top: none; }
  .site-footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }

  /* На мобильном экране те же кегли, что на десктопе, читаются слишком
     мелко — крупнее только здесь, десктопная плотность не трогается. */
  .site-footer-heading { font-size: 16px; }
  .site-footer-list a { font-size: 16px; }
  .site-footer-address { font-size: 16px; line-height: 1.6; }
  .site-footer-contact-sub { font-size: 13px; }
  .astanahub-text { font-size: 16px; }
  .site-footer-copy { font-size: 14px; }
}

/* Responsive */
@media (max-width: 992px) {
  h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 80px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    background: rgba(1, 4, 9, 0.98);
    display: flex;
    flex-direction: column;
    /* gap: 0, а не наследуемый от базового .nav, .footer-nav { gap: 2rem }
       (тот для десктопного горизонтального меню) — на мобильном этот зазор
       никто не переопределял, пункты стояли с 32px пустоты между собой,
       и разделитель повисал в этом пустом промежутке вместо того, чтобы
       делить два соседних вплотную пункта. */
    gap: 0;
    /* Горизонтальный паддинг убран отсюда и перенесён на .nav a: иначе
       разделитель между пунктами не дотягивался до края панели.
       Верхний паддинг тоже убран (было 1rem): иначе от border-top панели
       до «Услуги» был 16px зазор, а между остальными пунктами — 0, и ритм
       разделителей выглядел неровным именно в самом верху списка. */
    padding: 0 0 2rem;
    /* Панель всегда стоит на месте (top: 80px, под шапкой) — двигать сам
       блок translateY нельзя: на середине пути его верхний край заходит
       выше шапки и перекрывает её. Вместо этого раскрываем панель через
       clip-path — сверху вниз при открытии, обратно к границе шапки при
       закрытии, — сама шапка при этом никогда не задевается. */
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .3s;
    border-bottom: none;
    /* Панель стартует ровно на границе шапки (top: 80px) и перекрывает её
       собственный border-bottom — без своей верхней границы стык совсем
       не было видно. */
    border-top: 1px solid var(--border);
  }
  .nav.active {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
  }
  .nav a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 14px 20px;
    /* Без скруглений — прямые, чёткие разделители на всю ширину панели. */
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
    font-size: 17px;
    /* Тот же цвет, что у ссылок в десктопном навбаре: серый по умолчанию,
       белый при наведении/тапе — раньше здесь было безусловно белым. */
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
  }
  .nav a:hover, .nav a:active {
    /* :active — не только :hover: на тач-экране палец не наводит, а сразу
       нажимает, и без :active подсветка на тапе не появлялась вовсе. */
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .header-actions {
    display: none;
  }
  /* При открытом мобильном меню переключатель языка появляется левее
     крестика — .nav в разметке идёт раньше .header-actions, поэтому
     класс .active на нём открывает соседа через ~. margin-left: auto
     прижимает его вплотную к бургеру: без него justify-content:
     space-between у .header-inner развёл бы три элемента поровну. */
  .nav.active ~ .header-actions {
    display: flex;
    margin-left: auto;
    margin-right: 12px;
  }
  /* Тот же размер, что у кнопки бургера/крестика (40px, а не базовые
     32px .topbar-icon-btn) — рядом друг с другом они должны быть
     одной высоты. */
  .header-actions .topbar-icon-btn {
    width: 40px;
    height: 40px;
  }
}


/* ─────────────────────────────────────────────────────────────
   Блог
   ───────────────────────────────────────────────────────────── */

/* Первый блок под фиксированной шапкой (80px) — раньше отступ давала
   .page-hero, убранная вместе с заголовком списка блога и хлебными
   крошками статьи; теперь секция сама отвечает за отступ. */
.section--top { margin-top: 80px; padding-top: 3rem; }

.section__title {
  font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  margin-bottom: 2rem;
}

/* Фильтр по рубрикам */
.chip-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.chip__count {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Карточки статей */
.post-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.post-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-lighter);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.post-card__cat {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

a.post-card__cat:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.post-card__title {
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 0;
}

.post-card__title a:hover { opacity: 0.8; }

.post-card__excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 4rem 0;
}

/* Постраничная навигация */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pager__link {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.pager__link:hover { border-color: rgba(255, 255, 255, 0.3); }

.pager__status {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Страница статьи */
.post {
  max-width: 760px;
  margin-inline: auto;
}

.post__title {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.post__cover {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.post__back {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.post__back a:hover { opacity: 0.8; }

/* Текст статьи из редактора */
.prose {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #e2e8f0;
}

.prose > * + * { margin-top: 1.25rem; }

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.prose h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.prose a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}

.prose a:hover { text-decoration-color: #fff; }

.prose ul, .prose ol {
  padding-left: 1.5rem;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.5rem; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 2.5rem;
}

@media (max-width: 640px) {
  .post-cards { grid-template-columns: 1fr; gap: 1.5rem; }
}
