/* =========================
   БАЗА / ПЕРЕМЕННЫЕ (СВЕТЛАЯ)
========================= */
:root {
    --text: #222;
    --muted: #666;
    --bg: #fff;
    --header-bg: #f0f0f0;

    --card-bg: #f6f6f6;
    --card-border: #e2e2e2;

    --btn-active: #007bff;
    --btn-border: #bdbdbd;
    --btn-bg: #fff;

    --radius: 10px;
}

/* =========================
   ТЁМНАЯ ТЕМА
   (включается: html[data-theme="dark"])
========================= */
html[data-theme="dark"] {
    --text: #eaeaea;
    --muted: #b6b6b6;
    --bg: #0f1115;
    --header-bg: #151822;

    --card-bg: #151822;
    --card-border: #2a2f3a;

    --btn-active: #4c8dff;
    --btn-border: #2a2f3a;
    --btn-bg: #0f1115;
}

* { box-sizing: border-box; }

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--bg);
}

/* =========================
   HEADER / NAV (НОУТБУК-ФРЕНДЛИ)
========================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--header-bg);
    padding: 10px 16px;
    z-index: 10;
    border-bottom: 1px solid var(--card-border);
}

/* nav контейнер: меню + кнопка темы */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-nav li { margin: 0; }

.site-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 8px;
    display: inline-block;
}

.site-nav a:hover {
    color: var(--btn-active);
    background: rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .site-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* =========================
   КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ
========================= */
.theme-toggle {
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    min-height: 36px;
}

.theme-toggle:hover {
    border-color: var(--btn-active);
}

/* =========================
   ОСНОВНОЙ КОНТЕНТ
========================= */
main {
    padding: 16px;
    margin-top: 68px;
}

.manual {
    max-width: 1100px;
    margin: 0 auto;
}

/* =========================
   ТИПОГРАФИКА
========================= */
.content {
    margin-top: 16px;
    font-size: 18px;
}

h1 {
    font-size: 32px;
    margin: 10px 0 14px;
}

h2 {
    font-size: 22px;
    margin: 0 0 12px;
}

.content p {
    margin: 0 0 14px;
    line-height: 1.75;
}

.lead {
    font-size: 18px;
    margin-bottom: 16px;
}

.content ul {
    margin: 8px 0 16px 22px;
}

.content li {
    margin-bottom: 8px;
}

/* =========================
   КНОПКИ-ВКЛАДКИ (ЦЕНТР + НЕ СЪЕЗЖАЮТ)
========================= */
.page-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 14px auto 18px;
    max-width: 1100px;
    padding: 10px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="dark"] .page-buttons {
    background: rgba(255, 255, 255, 0.04);
}

.page-buttons button {
    padding: 9px 14px;
    border: 2px solid var(--btn-border);
    cursor: pointer;
    background: var(--btn-bg);
    color: var(--text);
    font-weight: 800;
    border-radius: 10px;
    line-height: 1;
    min-height: 38px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.page-buttons button:hover {
    border-color: var(--btn-active);
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .page-buttons button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.page-buttons button.active {
    background: var(--btn-active);
    color: #fff;
    border-color: var(--btn-active);
}

/* =========================
   ВКЛАДКИ
========================= */
.tab { display: none; }
.tab.active { display: block; }

/* =========================
   КАРТОЧКИ / БЛОКИ
========================= */
.note-block {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 14px 0;
}

.note-block p { margin: 0; }

.note-block.narrow {
    max-width: 760px;
}

/* =========================
   ЛОГО
========================= */
.site-logo.wide {
    display: flex;
    justify-content: center;
    margin: 14px 0 20px;
}

.site-logo.wide img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* =========================
   КАРТИНКИ / СКРИНЫ
========================= */
.image-box {
    margin: 16px 0 18px;
}

.image-box img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    display: block;
    border-radius: 10px;
}

.image-caption {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
}

/* =========================
   FOOTER
========================= */
footer {
    font-size: 16px;
    width: 100%;
    background-color: var(--header-bg);
    padding: 14px 16px;
    text-align: center;
    border-top: 1px solid var(--card-border);
}

/* =========================
   АДАПТИВ
========================= */
@media (max-width: 900px) {
    main { margin-top: 78px; }
    .content { font-size: 17px; }
    h1 { font-size: 28px; }
    .site-nav a { font-size: 15px; }
}

@media (max-width: 600px) {
    header { padding: 10px 12px; }
    main { padding: 12px; margin-top: 86px; }
    .page-buttons { padding: 10px; }
    .page-buttons button { width: 100%; }
}
/* === ФИКС ОТОБРАЖЕНИЯ ЛОГО === */

/* логотип в контенте */
.site-logo {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.site-logo img {
    display: block;
    width: auto;
    max-width: 260px;   /* можно менять */
    height: auto;
    max-height: 120px;  /* гарант, что не схлопнется */
    image-rendering: pixelated; /* для пиксельного лого */
}

/* если где-то был hidden / opacity */
.site-logo,
.site-logo img {
    visibility: visible;
    opacity: 1;
}
/* =========================
   ЛОГО — НОРМАЛЬНЫЙ РАЗМЕР
========================= */

.site-logo.wide {
    display: flex;
    justify-content: center;
    margin: 24px 0 32px;
}

/* ДЕЛАЕМ ЛОГО КРУПНЫМ */
.site-logo.wide img {
    width: 100%;              /* занимает всю доступную ширину */
    max-width: 1000px;        /* ключевой момент — было мало */
    min-height: 460px;        /* чтобы не выглядел мелким */
    height: auto;
    object-fit: contain;      /* PNG ведёт себя корректно */
    display: block;
}

/* ===== ФУТЕР ВСЕГДА ВНИЗУ ЭКРАНА ===== */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}
/* ===== ФУТЕР К НИЗУ СТРАНИЦЫ (FIX) ===== */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* main НЕ растягиваем бесконечно */
main {
    flex: 0 0 auto;
}

/* футер всегда внизу, но не перекрывает контент */
footer {
    margin-top: auto;
}
