/* Основной шрифт */
body {
  font-weight: 400;
}

/* Заголовки */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Единый градиент для верхней зоны (header + tabs) */
.md-header,
.md-tabs {
  background: linear-gradient(
    90deg,
    #5a7b8a 0%,
    #eb9baa 100%
  );
}

/* Табы не перекрывают фон */
.md-tabs {
  background-color: transparent;
}

/* Белый текст и иконки в шапке */
.md-header,
.md-header__title,
.md-tabs__link {
  color: #fff;
}

/* Раскрывашка */
.md-icon {
  color: rgba(45, 88, 117, 0.6);
}

/* Выпадающий список выбора языка: нормальные цвета */
.md-select__inner {
  background: #fff;
  color: #111;
}

.md-select__link {
  color: #111;
}

/* Меняем иконку у переключателя языка на 📖 */
.md-header .md-select .md-icon svg {
  display: none;
}

.md-header .md-select .md-icon::after {
  content: "📖";
  font-size: 18px;
  line-height: 1;
}

/* 2 колонки из списка внутри блока */
.md-typeset .two-cols > ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  list-style: none;   /* убираем маркеры */
  padding-left: 0;    /* убираем отступ списка */
  margin: 0;
}

.md-typeset .two-cols > ul > li {
  margin: 0;          /* убираем “пустые строки” от li */
}

/* Левое дерево навигации — уменьшаем шрифт */
.md-nav {
  font-size: 0.5rem;
}

/* Чуть компактнее пункты */
.md-nav__item {
  line-height: 1.3;
}

/* Картинки в контенте */
.md-content img {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.md-content img:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* Запрет выделения текста */
.md-content {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Запрет контекстного меню */
.md-content {
  pointer-events: auto;
}

.md-content pre,
.md-content code {
  user-select: text;
}

/* Горизонтальная галерея */
.image-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;

  overflow-x: auto;
  overflow-y: hidden;          /* ⬅️ запрещаем вертикальный скролл */

  padding: 8px 0 12px;

  align-items: stretch;        /* ⬅️ важно */
}


.image-scroll img {
  flex: 0 0 auto;

  height: 100%;
  max-height: 100%;            /* ⬅️ страховка */
  width: auto;

  max-width: none !important;  /* ⬅️ убираем ужимание */

  object-fit: contain;         /* ⬅️ аккуратное вписывание */

  border-radius: 24px;
  scroll-snap-align: start;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-scroll img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.image-scroll a {
  flex: 0 0 auto;
  display: block;
  max-width: none !important;
}

.left-images {
  float: left;
  margin: 0 16px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.left-images img {
  width: 200px;
  border-radius: 10px;
}

/* Кнопка "К началу" — дефолт: белая + розовый текст */
.md-top,
.md-top__link {
  background: #fff !important;
  color: rgb(90, 123, 138) !important;              /* розовый как в градиенте */
  border: 1px solid rgba(90, 123, 138, 0.35) !important;
}

/* чтобы иконка была тем же цветом */
.md-top svg {
  fill: currentColor !important;
}

/* Hover: розовый градиент + белый текст */
.md-top:hover,
.md-top__link:hover {
  background: linear-gradient(90deg, #5a7b8a 0%, #eb9baa 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* На всякий случай: актив/фокус тоже как hover */
.md-top:focus,
.md-top__link:focus,
.md-top:active,
.md-top__link:active {
  background: linear-gradient(90deg, #5a7b8a 0%, #eb9baa 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* Кнопка-ссылка */
.rbc-button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px; /* полностью овальная */
  background: linear-gradient(
    90deg,
    rgba(90, 123, 138, 0.25),
    rgba(235, 155, 170, 0.25)
  );
  color: #3a4a52 !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: 0.2s ease;
  backdrop-filter: blur(6px);
}

.rbc-button:hover {
  background: linear-gradient(
    90deg,
    rgba(90, 123, 138, 0.35),
    rgba(235, 155, 170, 0.35)
  );
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* Мелкий серый текст для примеров/подсказок */
.rbc-note {
  font-size: 0.85em;      
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.35;
}

[data-md-color-scheme="slate"] .rbc-note {
  color: rgba(255, 255, 255, 0.6);
}

.rbcn-link-preview {
  position: fixed;
  display: none;
  width: 420px;
  max-width: min(480px, calc(100vw - 20px));
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
  padding: 12px 14px;
  z-index: 9999;
  backdrop-filter: blur(8px);
}

.rbcn-link-preview__title {
  font-weight: 600;
  font-size: 0.7rem;   /* было ~0.95 */
  line-height: 1.2;
  margin-bottom: 6px;
}

.rbcn-link-preview__desc {
  font-size: 0.65rem;  /* было ~0.85 */
  line-height: 1.3;
  opacity: 0.85;
  max-height: 260px;
  overflow: hidden;
}

/* Цвет всех ссылок */
.md-content a {
  color: #5a7b8a !important;
}

/* Цвет при наведении */
.md-content a:hover {
  color: #314c58 !important; /* чуть темнее для эффекта */
}

.md-nav__link {
  color: #5a7b8a !important;
}

.md-nav__link:hover {
  color: #314c58 !important;
}

/* FIX: glightbox оборачивает картинки в <a>, и flex-раскладка с inline style width:% ломается.
   Делаем так, чтобы <a class="glightbox"> не участвовал в layout (но клик оставался). */
/* FIX: glightbox wrapper should not affect flex layout */
.md-content div[style*="display:flex"] a.glightbox {
  display: contents;
}