/* ============================================================
   Averon Insurance — хедер страниц статей.

   Источник: Figma «Header (open)» (node 109:7280),
   варианты Device=Desktop/Tablet/Mobile:
     Mobile   < 768px   логотип слева + бургер справа
     Tablet   768–1023  логотип по центру + бургер справа
     Desktop  ≥ 1024px  категории слева, логотип по центру, язык и Account справа

   Файл подключается только на страницах статей. Все правила скоупятся классом
   .article-header, поэтому основной хедер сайта (header.css) не затрагивается.
   Первый блок гасит глобальные стили base.css / header.css, которые иначе
   применились бы к элементам <header>, <a> и <img> внутри новой шапки.
   ============================================================ */

/* --- Нейтрализация глобальных стилей ------------------------ */
.article-header,
.article-header * {
  box-sizing: border-box;
}

.article-header a,
.article-header span,
.article-header img {
  font-family: inherit;
  color: inherit;
}

.article-header a {
  text-decoration: none;
  font-size: inherit;
}

.article-header img {
  display: block;
  max-width: none;
  object-fit: contain;
  object-position: center;
}

/* --- Каркас -------------------------------------------------
   Хедер прилипает к верху окна и едет со страницей (position: sticky).
   Прозрачные границы держат геометрию неизменной: в состоянии «close»
   им задаётся только цвет, поэтому высота 80px не скачет.
   ----------------------------------------------------------- */
.article-header {
  /* header.css задаёт <header> внешние отступы — здесь они не нужны */
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: 80px;
  overflow: hidden;
  background-color: #fdf8f4;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  color: #4a433d;
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  transition: border-color 0.25s ease-out;
}

/* Состояние «Header (close)»: включается скриптом после начала прокрутки */
.article-header--compact {
  border-top-color: #e4dcd5;
  border-bottom-color: #e4dcd5;
}

/* --- Логотип ------------------------------------------------ */
/* Вертикальное смещение центра логотипа повторяет макет: на десктопе он
   опущен на 15px, на планшете — на 17.5px, на мобильном центрирован. */
.article-header__logo {
  position: absolute;
  left: 50%;
  top: calc(50% + 15px);
  transform: translate(-50%, -50%);
  display: block;
  width: 156px;
  height: 50px;
  transition: width 0.25s ease-out, height 0.25s ease-out, top 0.25s ease-out;
}

.article-header__logo img {
  width: 100%;
  height: 100%;
}

/* «close»: логотип уменьшается и встаёт по центру высоты */
.article-header--compact .article-header__logo {
  top: 50%;
  width: 125px;
  height: 40px;
}

/* --- Категории (десктоп) ------------------------------------ */
.article-header__nav {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 32px;
}

.article-header__nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.article-header__chevron {
  width: 7.875px;
  height: 4.5px;
  flex: none;
}

/* --- Правая секция (десктоп) -------------------------------- */
.article-header__actions {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Переключатель языка: подпись + шеврон, поверх — прозрачный select */
.article-header__lang {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.article-header__lang .language-switcher {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 0;
}

.article-header__lang .language-switcher__label {
  display: none;
}

.article-header__lang .language-switcher__select {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Кнопка аккаунта */
.article-header__account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid #e4dcd5;
  border-radius: 32px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.25s ease-out, background-color 0.25s ease-out;
}

.article-header__account:hover {
  border-color: #8a817b;
  background-color: #f5efe9;
}

.article-header__account-icon {
  width: 12.25px;
  height: 12.25px;
  flex: none;
}

/* --- Бургер (планшет и мобильный) --------------------------- */
.article-header__burger {
  display: none;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}

.article-header__burger img {
  width: 20.25px;
  height: 16.5px;
}

/* --- Tablet 768–1023 ---------------------------------------- */
@media (max-width: 1023px) {
  .article-header__nav,
  .article-header__actions {
    display: none;
  }

  .article-header__burger {
    display: flex;
  }

  .article-header__logo {
    top: calc(50% + 17.5px);
    width: 141px;
    height: 45px;
  }

  .article-header--compact .article-header__logo {
    top: 50%;
    width: 125px;
    height: 40px;
  }
}

/* --- Mobile < 768 ------------------------------------------- */
@media (max-width: 767px) {
  .article-header__logo {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 125px;
    height: 40px;
  }

  .article-header--compact .article-header__logo {
    width: 109px;
    height: 35px;
  }

  .article-header__burger {
    right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-header,
  .article-header * {
    transition-duration: 0.01ms !important;
  }
}
