/* ==== n.syntog.ru — чистое чтение ==== */
:root {
    --bg: #ffffff;
    --text: #1a1f2e;
    --muted: #5b6472;
    --accent: #0f766e;
    --accent-light: #ccfbf1;
    --border: #e5e8ee;
    --code-bg: #f6f8fa;
    --serif: Georgia, "Times New Roman", "Noto Serif", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.75;
    text-rendering: optimizeLegibility;
}

/* ---------- Шапка / навигация ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--sans);
}

.site-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.site-name:hover { color: var(--accent); }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.site-nav a:hover { background: var(--accent-light); color: var(--accent); }
.site-nav a.active { background: var(--accent); color: #fff; }

/* ---------- Контент ---------- */
.content {
    max-width: 46rem;
    margin: 40px auto 80px;
    padding: 0 24px;
}

h1, h2, h3, h4 {
    font-family: var(--sans);
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-top: 2.4em;
    margin-bottom: 0.7em;
}
h1 { font-size: 2.1em; margin-top: 0.4em; }
h2 { font-size: 1.55em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1.08em; }

p, li { max-width: 100%; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

blockquote {
    margin: 1.6em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--accent);
    background: #f8fafb;
    color: var(--muted);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}
blockquote p { margin: 0.3em 0; }

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3em 0;
}

/* ---------- Мета строки ---------- */
.page-meta {
    font-family: var(--sans);
    font-size: 0.82em;
    color: var(--muted);
    margin-top: -0.8em;
    margin-bottom: 2em;
}

/* ---------- Код ---------- */
code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 0.12em 0.42em;
    border-radius: 5px;
}

pre {
    background: #0d1526;
    color: #e6edf3;
    padding: 18px 20px;
    border-radius: 10px;
    overflow-x: auto;
    line-height: 1.55;
    font-size: 0.82em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 1em;
}

/* ---------- Таблицы ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
    font-family: var(--sans);
    font-size: 0.8em;
}
th, td {
    border: 1px solid var(--border);
    padding: 10px 13px;
    text-align: left;
    vertical-align: top;
}
th {
    background: #f0fdfa;
    color: var(--text);
    font-weight: 700;
}
tr:nth-child(even) td { background: #fafbfc; }

/* ---------- Списки ---------- */
ul, ol { padding-left: 1.6em; }
li { margin: 0.35em 0; }
li::marker { color: var(--accent); }

/* ---------- Изображения ---------- */
img { max-width: 100%; height: auto; border-radius: 10px; }

/* ---------- Список статей раздела ---------- */
.post-list { margin-top: 2.5em; }
.post-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 16px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(15, 118, 110, 0.08);
}
.post-card h3 { margin: 0 0 4px; font-size: 1.15em; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card .page-meta { margin: 0 0 8px; }

/* ---------- Подвал ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 20px;
    text-align: center;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent); }

/* ---------- Якоря заголовков (insert_anchor_links) ---------- */
a.zola-anchor {
    opacity: 0;
    margin-left: 0.35em;
    text-decoration: none;
    font-weight: 400;
}
h1:hover a.zola-anchor, h2:hover a.zola-anchor,
h3:hover a.zola-anchor, h4:hover a.zola-anchor { opacity: 0.6; }

/* ---------- Тёмная тема (авто) ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1116;
        --text: #e6edf3;
        --muted: #9aa4b2;
        --accent: #2dd4bf;
        --accent-light: #123c3a;
        --border: #232a33;
        --code-bg: #161b22;
    }
    .site-header { background: rgba(14, 17, 22, 0.92); }
    blockquote { background: #141922; }
    th { background: #123c3a; }
    tr:nth-child(even) td { background: #12161c; }
    pre { background: #010409; }
}

/* ---------- Мобильные ---------- */
@media (max-width: 640px) {
    body { font-size: 17px; }
    .content { margin-top: 24px; padding: 0 16px; }
    h1 { font-size: 1.65em; }
    h2 { font-size: 1.3em; }
    .site-nav a { padding: 5px 9px; font-size: 14px; }
    table { font-size: 0.72em; }
    th, td { padding: 8px 9px; }
}

/* ── Мобильное меню (бургер) ─────────────────────────────────────── */
.menu-toggle{display:none;background:none;border:0;cursor:pointer;padding:8px;margin-right:8px}
.menu-toggle span{display:block;width:22px;height:2px;background:currentColor;margin:4px 0;border-radius:2px;transition:.25s}
.drawer-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);opacity:0;visibility:hidden;transition:.25s;z-index:1000}
.drawer-overlay.show{opacity:1;visibility:visible}
.drawer{position:fixed;top:0;left:0;height:100%;width:min(78vw,300px);background:#fff;box-shadow:2px 0 16px rgba(0,0,0,.2);
  transform:translateX(-105%);transition:transform .28s ease;z-index:1001;display:flex;flex-direction:column}
.drawer.open{transform:translateX(0)}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #e5e5e5}
.drawer-title{font-weight:700;font-size:16px}
.drawer-close{background:none;border:0;font-size:26px;line-height:1;cursor:pointer;color:#666}
.drawer-nav{display:flex;flex-direction:column;padding:8px 0}
.drawer-nav a{padding:13px 20px;text-decoration:none;color:#222;font-size:15px;border-bottom:1px solid #f0f0f0}
.drawer-nav a.active{color:#0a7c74;font-weight:600;background:#f4fbfa}
@media (max-width:760px){
  .site-nav{display:none}          /* прячем горизонтальное меню */
  .menu-toggle{display:block}      /* показываем бургер */
}
@media (prefers-color-scheme:dark){
  .drawer{background:#1b1b1f}.drawer-head{border-color:#333}.drawer-title{color:#eee}
  .drawer-nav a{color:#ddd;border-color:#2b2b30}.drawer-nav a.active{background:#12201f;color:#5ad1c9}
  .drawer-close{color:#bbb}
}
