/* Журнал: отступ шапка↔контент = отступ верх браузера↔логотип */
.blog-hub-page {
  --landing-v2-header-gap: 0px;
  --blog-hub-edge-gap: 1.8rem;
  /* pad-top + search + pad-bottom (одинаковые крайние отступы) */
  --landing-v2-header-h: calc(
    var(--blog-hub-edge-gap) + 2.5rem + var(--blog-hub-edge-gap)
  );
}

.blog-hub-page .landing-v2-header__inner {
  padding-top: var(--blog-hub-edge-gap);
  padding-bottom: var(--blog-hub-edge-gap);
}

/* Колонки хаба: страница скроллится; боковые sticky + свой скролл */
.blog-hub-columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  /*
   * Grid на всю ширину: nav | main fluid | aside
   */
  .blog-hub-columns {
    display: grid;
    grid-template-columns: var(--blog-nav-w, 220px) minmax(0, 1fr) var(--blog-aside-w, 280px);
    align-items: start;
    gap: var(--blog-col-gap, 2rem);
    width: 100%;
  }

  .blog-hub-col--nav,
  .blog-hub-col--aside {
    height: 100%;
    min-height: 100%;
    align-self: stretch;
  }

  .blog-hub-col--main {
    min-width: 0;
  }

  .blog-hub-page .blog-hub-sticky {
    position: sticky;
    top: calc(
      var(--site-announcement-sticky-h, 0px) + var(--landing-v2-header-h)
    );
    max-height: calc(
      100dvh - var(--site-announcement-sticky-h, 0px) -
        var(--landing-v2-header-h)
    );
    /* отступ у низа скролла — последняя кнопка/баннер не впритык к краю */
    padding-bottom: 1.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .blog-hub-page .blog-hub-sticky::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

.blog-hub-header__inner {
  gap: 0.75rem 1.25rem;
}

.blog-hub-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-width: 0;
  height: 2.5rem;
}

.blog-hub-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  line-height: 0;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.blog-hub-brand__logo:hover {
  opacity: 0.7;
}

.blog-hub-header__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
  position: relative;
  width: 100%;
  height: 2.5rem;
}

.blog-hub-header__search form,
.blog-hub-search-wrap {
  margin: 0;
  height: 2.5rem;
  display: flex;
  align-items: center;
}

.blog-hub-header__search-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
}

.blog-hub-header__search-field {
  flex: 1 1 auto;
  min-width: 0;
}

.blog-hub-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex-shrink: 0;
  height: 2.5rem;
  padding: 0 0.85rem 0 0.45rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-sizing: border-box;
  font-family: "Graphik LCG", Gilroy, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #212121;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.blog-hub-back:hover {
  background: #f5f6f7;
}

.blog-hub-back__icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: #212121;
}

.blog-hub-search-wrap {
  position: relative;
  width: 100%;
}

.blog-hub-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  height: 2.5rem;
  padding-inline: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-sizing: border-box;
}

.blog-hub-search--skeleton {
  pointer-events: none;
}

.blog-hub-search__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  color: #93939f;
}

.blog-hub-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: "Graphik LCG", Gilroy, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #212121;
}

.blog-hub-search__input::placeholder {
  color: #93939f;
}

.blog-hub-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.blog-hub-search__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-sizing: border-box;
}

.blog-hub-search__option {
  display: block;
  padding: 0.7rem 0.9rem;
  font-size: 14px;
  line-height: 1.35;
  color: #212121;
  text-decoration: none;
  border-bottom: 1px solid #f2f2f2;
}

.blog-hub-search__option:last-of-type {
  border-bottom: 0;
}

.blog-hub-search__option--active,
.blog-hub-search__option:hover {
  background: #f5f6f7;
}

.blog-hub-search__hint {
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-size: 13px;
  color: #93939f;
}

.blog-hub-search__more {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-top: 1px solid #f2f2f2;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #1863dc;
  cursor: pointer;
  box-sizing: border-box;
}

.blog-hub-search__more:hover {
  background: #f5f6f7;
}

:root[data-theme="dark"] .blog-hub-back,
.dark .blog-hub-back {
  border-color: rgba(255, 255, 255, 0.14);
  background: #262626;
  color: #f4f4f5;
}

:root[data-theme="dark"] .blog-hub-back:hover,
.dark .blog-hub-back:hover {
  background: #333333;
}

:root[data-theme="dark"] .blog-hub-back__icon,
.dark .blog-hub-back__icon {
  color: #f4f4f5;
}

:root[data-theme="dark"] .blog-hub-search,
.dark .blog-hub-search {
  border-color: rgba(255, 255, 255, 0.14);
  background: #262626;
}

:root[data-theme="dark"] .blog-hub-search__icon,
.dark .blog-hub-search__icon {
  color: #b3b3b3;
}

:root[data-theme="dark"] .blog-hub-search__input,
.dark .blog-hub-search__input {
  color: #f4f4f5;
}

:root[data-theme="dark"] .blog-hub-search__input::placeholder,
.dark .blog-hub-search__input::placeholder {
  color: #8e8e8e;
}

:root[data-theme="dark"] .blog-hub-search__panel,
.dark .blog-hub-search__panel {
  border-color: rgba(255, 255, 255, 0.14);
  background: #1e1e1e;
}

:root[data-theme="dark"] .blog-hub-search__option,
.dark .blog-hub-search__option {
  color: #f4f4f5;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .blog-hub-search__option--active,
:root[data-theme="dark"] .blog-hub-search__option:hover,
.dark .blog-hub-search__option--active,
.dark .blog-hub-search__option:hover {
  background: #262626;
}

:root[data-theme="dark"] .blog-hub-search__hint,
.dark .blog-hub-search__hint {
  color: #b3b3b3;
}

:root[data-theme="dark"] .blog-hub-search__more,
.dark .blog-hub-search__more {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #6b9eff;
}

:root[data-theme="dark"] .blog-hub-search__more:hover,
.dark .blog-hub-search__more:hover {
  background: #262626;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .blog-hub-back {
    border-color: rgba(255, 255, 255, 0.14);
    background: #262626;
    color: #f4f4f5;
  }

  :root[data-theme="system"] .blog-hub-back:hover {
    background: #333333;
  }

  :root[data-theme="system"] .blog-hub-back__icon {
    color: #f4f4f5;
  }

  :root[data-theme="system"] .blog-hub-search {
    border-color: rgba(255, 255, 255, 0.14);
    background: #262626;
  }

  :root[data-theme="system"] .blog-hub-search__icon {
    color: #b3b3b3;
  }

  :root[data-theme="system"] .blog-hub-search__input {
    color: #f4f4f5;
  }

  :root[data-theme="system"] .blog-hub-search__input::placeholder {
    color: #8e8e8e;
  }

  :root[data-theme="system"] .blog-hub-search__panel {
    border-color: rgba(255, 255, 255, 0.14);
    background: #1e1e1e;
  }

  :root[data-theme="system"] .blog-hub-search__option {
    color: #f4f4f5;
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  :root[data-theme="system"] .blog-hub-search__option--active,
  :root[data-theme="system"] .blog-hub-search__option:hover {
    background: #262626;
  }

  :root[data-theme="system"] .blog-hub-search__hint {
    color: #b3b3b3;
  }

  :root[data-theme="system"] .blog-hub-search__more {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: #6b9eff;
  }

  :root[data-theme="system"] .blog-hub-search__more:hover {
    background: #262626;
  }
}

@media (max-width: 639px) {
  .blog-hub-header__inner {
    flex-wrap: nowrap;
  }
}
