/* ---- Hilbert HTML Sitemap Styles ---- */
:root {
  --hb-accent: #af0b0b;
  --hb-text: #222;
  --hb-muted: #7a7a7a;
  --hb-border: #e8e8e8;
  --hb-gap: 28px;
  --hb-cols: 2;
}

.hb-sitemap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hb-sitemap__title h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: .3px;
}

.hb-sitemap__toc {
  margin: 0 0 18px;
  border: 1px solid var(--hb-border);
  border-left: 4px solid var(--hb-accent);
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
}
.hb-sitemap__toc-list {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  list-style: none; margin: 0; padding: 0;
}
.hb-sitemap__toc-item a {
  text-decoration: none;
  color: #1d1d1d;
}
.hb-sitemap__toc-item a:hover { border-bottom-style: solid; }

.hb-sitemap__grid {
  display: grid;
  grid-template-columns: repeat(var(--hb-cols), minmax(0, 1fr));
  gap: var(--hb-gap);
}
@media (max-width: 1024px) {
  .hb-sitemap__grid { --hb-cols: 2; }
}
@media (max-width: 640px) {
  .hb-sitemap__grid { --hb-cols: 1; }
}

.hb-sitemap__section {
  border: 1px solid var(--hb-border);
  border-radius: 14px;
  padding: 18px 16px;
  background: #fff;
}

.hb-sitemap__section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
  color: #1d1d1d;
}
.hb-sitemap__section-title a {
  color: var(--hb-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.hb-sitemap__section-title a:hover {
  border-bottom-color: var(--hb-accent);
}

.hb-sitemap__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 20px;
}
@media (max-width: 640px) {
  .hb-sitemap__columns { grid-template-columns: 1fr; }
}

.hb-sitemap__col { min-width: 0; }

.hb-sitemap__group-title {
  font-size: 16px; font-weight: 600; margin: 10px 0;
}
.hb-sitemap__group-title a {
  color: var(--hb-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.hb-sitemap__group-title a:hover { border-bottom-color: var(--hb-accent); }

.hb-sitemap__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0;
}
.hb-sitemap__list .hb-sitemap__list { margin-top: 6px; padding-left: 14px; }

.hb-sitemap__item {
  position: relative;
  padding: 6px 0 6px 16px;
}
.hb-sitemap__item::before {
  content: "›";
  position: absolute;
  left: 0; top: 6px;
  line-height: 1;
  color: var(--hb-accent);
  font-size: 18px;
  transform: translateX(-2px);
}

.hb-sitemap__link {
  color: var(--hb-text);
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.hb-sitemap__link:hover {
  color: var(--hb-accent);
  border-bottom-style: solid;
  border-bottom-color: var(--hb-accent);
}

.hb-sitemap__muted {
  color: var(--hb-muted);
  margin: 4px 0 0;
  font-size: 14px;
}

.hb-sitemap__backtop {
  text-align: right;
  margin-top: 22px;
}
.hb-sitemap__backtop-link {
  text-decoration: none;
  color: var(--hb-accent);
  border-bottom: 1px solid transparent;
}
.hb-sitemap__backtop-link:hover { border-bottom-color: var(--hb-accent); }

/* ===== Mobile fixes: single column + better wrapping ===== */
@media (max-width: 768px) {
  /* сетка секций — всегда одна колонка */
  .hb-sitemap__grid {
    grid-template-columns: 1fr !important; /* перекрываем inline --hb-cols */
  }
  /* внутренние колонки (например, рубрики блога) — тоже одна */
  .hb-sitemap__columns {
    grid-template-columns: 1fr !important;
  }
}

/* умный перенос слов в названиях */
.hb-sitemap, 
.hb-sitemap * {
  word-break: normal;
}

.hb-sitemap__link,
.hb-sitemap__group-title a,
.hb-sitemap__section-title a {
  overflow-wrap: anywhere;   /* ломаем очень длинные слова/URL */
  word-break: break-word;    /* fallback */
  hyphens: auto;             /* перенос по слогам (нужно lang=ru) */
}