/*
 * k4text.ru — стиль сайта
 * Минималистичный, читабельный, адаптивный
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
    font-size: 18px;
    line-height: 1.75;
    color: #222;
    background: #fafafa;
    -webkit-font-smoothing: antialiased;
}

/* === Навигация === */
.page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
}

article + .page-nav {
    border-bottom: none;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

.page-nav a {
    color: #5b7ea1;
    text-decoration: none;
    transition: color 0.2s;
}

.page-nav a:hover {
    color: #2c5282;
}

.nav-prev { margin-right: auto; }
.nav-next { margin-left: auto; }

.nav-en {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border: 1.5px solid #5b7ea1;
    border-radius: 4px;
    color: #5b7ea1 !important;
    background: rgba(91, 126, 161, 0.06);
}

.nav-en:hover {
    background: #5b7ea1;
    color: #fff !important;
}

/* === Контент === */
.content {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}

.content h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    color: #111;
    text-align: center;
}

.content h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #111;
    text-align: center;
}

.content h3 {
    font-size: 19px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #222;
}

.content p {
    margin-bottom: 14px;
    text-align: justify;
}

.content sup {
    font-size: 0.7em;
    color: #999;
    vertical-align: super;
    line-height: 0;
}

.content i { font-style: italic; }

.content a {
    color: #5b7ea1;
    text-decoration: none;
}

.content a:hover {
    color: #2c5282;
    text-decoration: underline;
}

.content .center, .content .center1 {
    text-align: center;
    margin: 16px 0;
}

/* === Оглавление === */
.toc-page .sgc-toc-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    color: #111;
}

.toc-page .sgc-toc-level-1 {
    margin: 0;
    padding: 0;
}

.toc-page .sgc-toc-level-1 > a {
    display: block;
    padding: 10px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: color 0.2s;
}

.toc-page .sgc-toc-level-1 > a:hover {
    color: #5b7ea1;
}

.toc-page .sgc-toc-level-2 {
    margin-left: 24px;
    padding: 0;
}

.toc-page .sgc-toc-level-2 > a {
    display: block;
    padding: 4px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 400;
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

.toc-page .sgc-toc-level-2 > a:hover {
    color: #5b7ea1;
}

/* === EN epub классы (Calibre formatting) === */

.content p {
    display: block;
    margin-bottom: 16px;
    text-align: justify;
    line-height: 1.7;
}

.content .calibre9,
.content .noind1,
.content .noind {
    display: block;
    margin-top: 12px;
    margin-bottom: 16px;
    text-indent: 0;
}

.content .calibre3 {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-top: 32px;
    margin-bottom: 16px;
}

.content .calibre2 {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 24px 0;
}

.content .center {
    text-align: center;
    margin: 16px 0;
}

.content .calibre4 {
    font-weight: bold;
}

.content .calibre6,
.content .calibre12 {
    font-style: italic;
}

.content .calibre10 {
    margin: 20px 24px;
    font-style: italic;
}

.content .numbers {
    color: #999;
    font-size: 0.85em;
}

.content blockquote {
    margin: 20px 24px;
    font-style: italic;
}

/* Задел под поиск */
.search-highlight {
    background: rgba(255, 235, 59, 0.4);
    border-radius: 2px;
    padding: 1px 2px;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    body { font-size: 17px; line-height: 1.65; }
    .content { padding: 24px 16px 32px; }
    .content h1 { font-size: 22px; }
    .content h2 { font-size: 19px; }
    .page-nav { padding: 12px 16px; font-size: 13px; gap: 16px; }
    .toc-page .sgc-toc-title { font-size: 24px; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .content { padding: 20px 12px 28px; }
    .page-nav { gap: 12px; }
    .nav-en { font-size: 11px; }
}
