:focus-visible {
  outline: 2px solid var(--quarto-accent-color, #0d6efd);
  outline-offset: 3px;
}

/* Компактные таблицы только в области контента страницы (modern, без дублей) */
#quarto-content table {
  border-collapse: collapse; /* линии без «щелей» */
  width: 100%;
  max-width: 100%;
  table-layout: auto; /* ширина колонок по содержимому */
  font-size: 0.92rem; /* компактнее текст */
}

#quarto-content .table {
  /* bootstrap-таблицы в контенте — такой же текст */
  font-size: 0.92rem;
}

#quarto-content table th,
#quarto-content table td {
  padding: 0.22rem 0.45rem; /* ниже строки */
  line-height: 1.15;
  vertical-align: top;
}

#quarto-content table td p,
#quarto-content table th p {
  margin: 0;
}

#quarto-content table td p + p,
#quarto-content table th p + p {
  margin-top: 0.25rem;
}

#quarto-content table td:first-child,
#quarto-content table th:first-child {
  white-space: nowrap;
}

#quarto-content tbody tr:has(td:first-child:empty) td {
  padding-top: 0.12rem; /* меньше «воздуха» у продолжений */
  border-top: 0; /* визуально одна группа */
}

#quarto-content table td strong,
#quarto-content table th strong {
  font-weight: 600;
}

#quarto-content table th:not(:first-child),
#quarto-content table td:not(:first-child) {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

#quarto-content table th:not(:first-child) code,
#quarto-content table td:not(:first-child) code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#quarto-content table th pre,
#quarto-content table td pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

#quarto-content table td a,
#quarto-content table th a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#quarto-content table img {
  max-width: 100%;
  height: auto;
}

/* .navbar-brand больше не сжимается при нехватке места */
.navbar .navbar-brand {
  flex: 0 0 auto;
}

/* Размер логотипа (SVG/PNG) и снятие старых лимитов темы */
.navbar .navbar-brand img.navbar-logo,
.navbar .navbar-brand > img {
  height: 36px; /* выбери 36–40px на десктопе */
  max-height: none !important;
  width: auto;
  display: block;
}

/* Авто-ширина меню по содержимому */
.navbar .dropdown-menu {
  min-width: 0; /* убрать фиксированный минимум Bootstrap */
  width: auto; /* пусть ширина подстраивается */
  padding-right: 0.25rem; /* чуть воздуха справа, необязательно */
}

/* Чтобы элементы не переносились и ширина считалась корректно */
.navbar .dropdown-menu .dropdown-item {
  white-space: nowrap;
}

@media (width >= 600px) {
  .languages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width >= 900px) {
  .languages-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Hero ===== */
.hero {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid var(--quarto-border-color);
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-inner {
  max-width: 980px;
}

.hero-logo {
  height: 56px;
  width: auto;
  margin: 0 auto 0.5rem;
  display: block;
  opacity: 0.95;
}

.hero-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--quarto-text-muted);
  margin: 0.25rem 0 1rem;
}

/* ===== Hero bullets (семантика + управляемый отступ) ===== */

/* Контейнер секции */
.hero-bullets {
  margin: 0.75rem auto 1.25rem;
  max-width: 820px;
  text-align: left;
}

/* Сам список внутри блока */
.hero-bullets ul {
  /* настраиваемые параметры */
  --bullet-size: 0.55rem;
  --bullet-gap: 0.75rem;
  --bullet-color: var(--quarto-accent-color, #0d6efd);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid; /* вертикальные интервалы между пунктами */
  row-gap: 0.35rem;
}

/* Строка списка: маркер + текст */
.hero-bullets li {
  display: flex;
  align-items: flex-start;
  gap: var(--bullet-gap); /* <<< расстояние между точкой и текстом */
  min-width: 0;
  margin: 0;
}

/* Кастомная «точка» */
.hero-bullets li::before {
  content: "";
  flex: 0 0 var(--bullet-size);
  width: var(--bullet-size);
  height: var(--bullet-size);
  border-radius: 9999px;
  background: var(--bullet-color);
  margin-top: 0.35em; /* лёгкая подстройка по базовой линии */
}

/* Если shortcode рендерит <p> внутри <li> — убираем внешние отступы */
.hero-bullets li p {
  margin: 0;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta p {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  border: 1px solid var(--quarto-border-color);
}

.btn-primary {
  background: var(--quarto-accent-color, #0d6efd);
  color: #fff;
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  color: inherit;
}

/* ===== Languages ===== */
.languages-section {
  padding: 1.5rem 0 2rem;
}

.section-title {
  text-align: center;
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.languages-grid {
  --col-min: 16rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--col-min), 1fr));
  gap: 0.9rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0.25rem 1rem 0;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--quarto-border-color);
  border-radius: 0.85rem;
  text-decoration: none;
  background: var(--quarto-body-bg);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.lang-card:hover {
  transform: translateY(-2px);
  border-color: var(--quarto-accent-color, #0d6efd);
  box-shadow: 0 8px 18px rgb(0 0 0 / 6%);
}

/* Флаги в карточках языков — рамка + размер + скругление */
.lang-card .fi {
  display: inline-block;
  width: 2rem; /* размер флага */
  aspect-ratio: 4 / 3; /* правильные пропорции */
  background-size: cover; /* чтобы SVG не мыло */
  box-shadow: 0 0 0 1px rgb(0 0 0 / 60%);
  vertical-align: -0.15em;
}

.lang-meta {
  display: grid;
  line-height: 1.15;
}

.lang-name {
  font-weight: 600;
}

.lang-variant {
  font-size: 0.9rem;
  color: var(--quarto-text-muted);
}

/* ===== About ===== */
.about {
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
}

.about-text {
  margin: 0.5rem 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--quarto-text);
}

/* Мелочи */
:root {
  --quarto-text-muted: rgb(127 127 127 / 90%);
}

.about-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.brand-copy .section-title {
  margin: 0.1rem 0 0.5rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
}

.brand-name {
  letter-spacing: 0.2px;
}

.about-text em {
  color: var(--quarto-text-muted, rgb(120 120 120 / 95%));
}

.about-text strong {
  font-weight: 650;
}

.page-container {
  max-width: 960px; /* ширина контента */
  margin: 0 auto; /* выравнивание по центру */
  padding: 0 1rem; /* чтобы текст не лип к краям */
}

.page-container img,
.page-container .hero,
.page-container .languages-grid,
.page-container .about {
  max-width: 100%; /* всё внутри не вылазит за пределы */
  box-sizing: border-box;
}

/* === Theme-aware hero logos (последним в файле!) === */
.only-dark {
  display: none !important;
}

.quarto-dark .only-light {
  display: none !important;
}

.quarto-dark .only-dark {
  display: block !important;
}
