/* ==========================================================================
   Объединённые кастомные стили для документации
   ========================================================================== */

/* --- 1. Базовые настройки темы --- */

/* Скрываем кнопку переключения темы */
.theme-toggle-container {
    display: none !important;
}

/* Принудительно светлый color-scheme */
:root {
    color-scheme: light !important;
}

/* Скрытие футера и анонсов */
footer,
.announcement {
    display: none !important;
}

/* --- 2. Убираем желтую подсветку якорей --- */

:target {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

section:target > h1,
section:target > h2,
section:target > h3,
section:target > h4,
section:target > h5,
section:target > h6,
div.section:target > h1,
div.section:target > h2,
div.section:target > h3 {
    background-color: transparent !important;
}

/* --- 3. Заголовок оглавления --- */

.toc-title {
    font-size: 0 !important;
}

.toc-title::before {
    content: "Оглавление" !important;
    font-size: 0.875rem !important;
    visibility: visible !important;
    font-weight: 600 !important;
}

/* --- 4. Стили иконок Material Design --- */

/* Покрасить все иконки Material в синий цвет */
.sd-material-regular {
    color: #007bff !important;
}


svg {
  width: 30px;
  height: 30px;
}


/* Серый цвет для иконок (без кружка) */
svg.sd-material-icon.btn-gray {
    fill: #9aa0a6 !important;
    color: #9aa0a6 !important;
}

/* --- 5. СТИЛЬ КРУЖКА (База) --- */
/* Применяется к блочным контейнерам и инлайновым иконкам с классом btn-inline */

.btn-circle svg.sd-material-icon,
svg.sd-material-icon.btn-inline {
    display: inline-flex !important;
    box-sizing: content-box !important;
    padding: 5px !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) !important;
    fill: #5f6368 !important;
    vertical-align: middle !important;
    margin: 0 4px !important;
    border: 1px solid #eee !important;
    cursor: pointer !important;
}

/* --- 5. СТИЛЬ КРУЖКА (База) --- */
/* Применяется к блочным контейнерам и инлайновым иконкам с классом btn-inline */

.btn-circle.btn-dark svg.sd-material-icon,
svg.sd-material-icon.btn-inline.btn-dark {
    display: inline-flex !important;
    box-sizing: content-box !important;
    padding: 5px !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background-color: #607d8b !important; /* Светло-серый фон */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) !important;
    fill: #ffffff !important;
    vertical-align: middle !important;
    margin: 0 4px !important;
    border: 1px solid #eee !important;
    cursor: default !important;
}

/* Отключаем эффект наведения для тёмных кнопок */
.btn-circle.btn-dark svg.sd-material-icon:hover,
svg.sd-material-icon.btn-inline.btn-dark:hover {
    background-color: #607d8b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) !important;
}

/* --- 6. ЦВЕТОВЫЕ МОДИФИКАТОРЫ --- */

/* Красим иконку в красный, если добавлен класс btn-red */
/* Используем более специфичный селектор для перекрытия базового стиля btn-inline */
svg.sd-material-icon.btn-inline.btn-red,
svg.sd-material-icon.btn-plain.btn-red,
svg.sd-material-icon.btn-red {
    fill: #d32f2f !important;
}

/* --- 6.1 Иконки БЕЗ КРУЖКА (простой вариант) --- */
/* Используйте класс btn-plain для иконок без фона и кружка */

svg.sd-material-icon.btn-plain {
    display: inline-flex !important;
    box-sizing: content-box !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    fill: #5f6368 !important;
    vertical-align: middle !important;
    margin: 0 2px !important;
    border: none !important;
    cursor: pointer !important;
}

/* Серый цвет для иконок Material (sd-material-regular) */
.sd-material-regular.btn-gray {
    color: #9aa0a6 !important;
    font-family: 'Material Icons' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 1.2em !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
    vertical-align: middle !important;
}

/* Синевато-серый цвет для иконок без кружка */
svg.sd-material-icon.btn-plain.btn-gray {
    color: #607d8b !important;
}

/* Прямое окрашивание path элементов внутри серых иконок */
svg.sd-material-icon.btn-plain.btn-gray path:not([fill="none"]) {
    fill: #607d8b !important;
}

/* Эффект наведения только для иконок-кнопок */
.btn-circle svg.sd-material-icon:hover,
svg.sd-material-icon.btn-inline:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16) !important;
    background-color: #f8f9fa !important;
}

/* ==========================================================================
   Стили из _static/custom.css (шрифты и поиск)
   ========================================================================== */

/* --- 7. Стили текста и шрифты --- */

/* Для основного текста */
body {
    font-family: 'Times New Roman', Arial, sans-serif !important;
}

/* Для заголовков */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Times New Roman', Arial, sans-serif !important;
}

/* Для блоков кода */
code, pre {
    font-family: 'Roboto', monospace !important;
}

/* --- 8. Кастомизация поиска (DocSearch) --- */

/* Находим контейнер с клавишами и заменяем его содержимое */
.DocSearch-Button-Keys {
    display: flex !important;
    align-items: center;
    gap: 2px;
}

/* Прячем ПЕРВУЮ клавишу (обычно это Ctrl или Cmd) */
.DocSearch-Button-Keys kbd.DocSearch-Button-Key:first-child {
    display: none !important;
}

/* Изменяем ВТОРУЮ клавишу (где была K) */
.DocSearch-Button-Keys kbd.DocSearch-Button-Key:last-child {
    font-size: 0 !important; /* Убираем букву K */
    width: auto !important;
    min-width: 20px;
    padding: 0 4px !important;
}

/* Рисуем слэш вместо K */
.DocSearch-Button-Keys kbd.DocSearch-Button-Key:last-child::before {
    content: "/" !important;
    font-size: 14px !important;
    color: inherit;
    display: inline-block;
    vertical-align: middle;
}
