/* ==========================================
   ВИКИ-СТИЛЬ + БАННЕР + ЛОГОТИП
   ========================================== */

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.7;
  color: #202122;
  background: #ffffff;
}

.wy-nav-content {
  max-width: 1100px !important;
  background: #ffffff !important;
  padding: 2.5rem 3.5rem !important;
  margin: 0 auto;
  border-left: 1px solid #eaecf0;
  border-right: 1px solid #eaecf0;
}

/* ===== БОКОВАЯ ПАНЕЛЬ — БЕЛЫЙ ФОН ===== */
.wy-nav-side {
  background: #ffffff !important;
}

.wy-side-nav-search {
  padding-top: 0 !important;
  background: #ffffff !important;
}

.wy-side-nav-search .wy-dropdown,
.wy-side-nav-search input[type="text"] {
  background: #ffffff;
  color: #202122;
  border: 1px solid #eaecf0;
}

/* ===== ЛОГОТИП ===== */
.wy-side-nav-search .icon-home {
  position: relative;
  z-index: 10;
}

.wy-side-nav-search .icon-home img {
  max-height: 60px !important;
  width: auto;
  display: block;
  margin: 10px auto 5px auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.wy-side-nav-search a.icon-home {
  font-size: 0 !important;
}
.wy-side-nav-search a.icon-home::before {
  display: none !important;
}

/* Меню в боковой панели — светлая тема */
.wy-menu-vertical a {
  color: #202122 !important;
  background: #ffffff !important;
}
.wy-menu-vertical a:hover {
  background: #eaecf0 !important;
  color: #0645ad !important;
}

/* ===== ЗАГОЛОВКИ ===== */
h1 {
  font-weight: normal;
  font-size: 2.6rem;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 0.3rem;
  color: #000000;
}

h2 {
  font-weight: normal;
  font-size: 2rem;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 0.2rem;
  margin-top: 2rem;
  color: #000000;
}

/* ===== ССЫЛКИ ===== */
a {
  color: #0645ad !important;
  text-decoration: none;
}
a:hover {
  color: #0b0080 !important;
  text-decoration: underline;
}

/* ===== ТАБЛИЦЫ ===== */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  width: 100%;
  border: 1px solid #a2a9b1;
}
table th {
  background: #eaecf0;
  font-weight: bold;
  padding: 0.6rem 0.8rem;
  border: 1px solid #a2a9b1;
}
table td {
  padding: 0.5rem 0.8rem;
  border: 1px solid #a2a9b1;
}
table tr:nth-child(even) {
  background: #f8f9fa;
}

/* ===== ИНФОБОКСЫ ===== */
.infobox {
  float: right;
  clear: right;
  background: #f8f9fa;
  border: 1px solid #a2a9b1;
  padding: 0.8rem 1.2rem;
  margin: 0 0 1rem 1.5rem;
  width: 280px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.infobox h3 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #a2a9b1;
  padding-bottom: 0.3rem;
}
.infobox hr {
  border: none;
  border-top: 1px solid #a2a9b1;
  margin: 0.5rem 0;
}
.infobox p {
  margin: 0.3rem 0;
}

blockquote {
  background: #f8f9fa;
  border-left: 4px solid #a2a9b1;
  padding: 0.8rem 1.5rem;
  font-style: italic;
  color: #404244;
}

.rst-footer-buttons { display: none !important; }
.footer { display: none !important; }

/* ==========================================
   ТЁМНАЯ ТЕМА (ГАРАНТИРОВАННО РАБОТАЕТ)
   ========================================== */

:root {
  --bg-color: #ffffff;
  --text-color: #202122;
  --border-color: #eaecf0;
  --link-color: #0645ad;
  --block-bg: #f8f9fa;
  --sidebar-bg: #ffffff;
  --menu-text: #202122;
  --menu-hover-bg: #eaecf0;
}

/* Тёмная тема — применяется к элементу <html data-theme="dark"> */
[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --border-color: #3a3a5a;
  --link-color: #7fadff;
  --block-bg: #2a2a4a;
  --sidebar-bg: #0d0d1a;
  --menu-text: #e0e0e0;
  --menu-hover-bg: #2a2a4a;
}

/* Тёмная тема — основной контент */
[data-theme="dark"] body {
  background: var(--bg-color) !important;
  color: var(--text-color) !important;
}

[data-theme="dark"] .wy-nav-content {
  background: var(--bg-color) !important;
  color: var(--text-color) !important;
}

/* Тёмная тема — боковая панель */
[data-theme="dark"] .wy-nav-side {
  background: var(--sidebar-bg) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .wy-side-nav-search {
  background: var(--sidebar-bg) !important;
}

[data-theme="dark"] .wy-side-nav-search .wy-dropdown,
[data-theme="dark"] .wy-side-nav-search input[type="text"] {
  background: #2a2a4a !important;
  color: #e0e0e0 !important;
  border-color: #3a3a5a !important;
}

/* Тёмная тема — меню */
[data-theme="dark"] .wy-menu-vertical a {
  color: var(--menu-text) !important;
  background: var(--sidebar-bg) !important;
}

[data-theme="dark"] .wy-menu-vertical a:hover {
  background: var(--menu-hover-bg) !important;
  color: #7fadff !important;
}

/* Тёмная тема — ссылки */
[data-theme="dark"] a {
  color: var(--link-color) !important;
}
[data-theme="dark"] a:hover {
  color: #9fcbff !important;
}

/* Тёмная тема — инфобоксы, цитаты */
[data-theme="dark"] .infobox,
[data-theme="dark"] blockquote,
[data-theme="dark"] #quoteOfTheDay {
  background: var(--block-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

/* Тёмная тема — таблицы */
[data-theme="dark"] table {
  background: var(--bg-color) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}
[data-theme="dark"] table th {
  background: var(--block-bg) !important;
  color: var(--text-color) !important;
}
[data-theme="dark"] table td {
  background: var(--bg-color) !important;
  color: var(--text-color) !important;
}
[data-theme="dark"] table tr:nth-child(even) {
  background: var(--block-bg) !important;
}

/* Тёмная тема — заголовки */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: #e0e0e0 !important;
}

/* Тёмная тема — поля ввода */
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  background: #2a2a4a !important;
  color: #e0e0e0 !important;
  border-color: #3a3a5a !important;
}

/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ ===== */
button#themeToggle {
  background: #0645ad;
  color: white;
  border: none;
  padding: 8px 20px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

[data-theme="dark"] button#themeToggle {
  background: #2a4a7f;
  color: white;
}
[data-theme="dark"] button#themeToggle:hover {
  background: #3a5a9f;
}

/* ===== СТИКЕРЫ ===== */
.sticker {
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: 48px;
  margin: 0 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  transition: transform 0.2s;
}

.sticker:hover {
  transform: scale(1.1);
}

/* Маленькие стикеры (в тексте) */
.sticker-sm {
  width: 32px;
  height: 32px;
}

/* Большие стикеры (для галереи) */
.sticker-lg {
  width: 80px;
  height: 80px;
}

/* Тёмная тема для стикеров */
[data-theme="dark"] .sticker {
  background: rgba(255, 255, 255, 0.08);
}
