/*
Theme Name: LEWICKI Dark Blog
Theme URI: https://lewickiy.ru
Author: Lewickiy
Description: Минималистичная тёмная тема WordPress для блога разработчика
Version: 2.1
Text Domain: lewicki
*/

:root {
    --bg: #0b0d10;
    --surface: #11151a;
    --surface-raised: #171c22;
    --text: #f1f3f5;
    --muted: #8b949e;
    --subtle: #626b75;
    --accent: #7ee787;
    --accent-strong: #56d364;
    --border: #252c35;
    --code-bg: #0a0c0f;
    --max-width: 1080px;
    --reading-width: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
a { color: inherit; text-decoration: none; transition: color .2s ease, border-color .2s ease, background .2s ease; }
a:hover { color: var(--accent); }

header, footer { background: rgba(11,13,16,.88); border-color: var(--border); }
header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
footer { border-top: 1px solid var(--border); margin-top: 48px; }
.header-inner, .footer-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 20px 28px;
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.logo, .footer-logo { font-family: "SF Mono", Monaco, Consolas, monospace; font-size: .9rem; font-weight: 600; letter-spacing: .08em; }
.header-status { margin-left: auto; color: var(--accent); font: .72rem "SF Mono", Monaco, monospace; }
.header-status::before { content: "●"; margin-right: 6px; font-size: .65rem; }
.logo::before { content: "~/"; color: var(--accent); margin-right: 5px; }
.footer-logo { color: var(--muted); }
.socials { display: flex; gap: 8px; }
.socials a { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; border-radius: 8px; }
.socials a:hover { color: var(--accent); background: var(--surface); border-color: var(--border); transform: none; }

main { max-width: var(--reading-width); margin: 0 auto; padding: 76px 24px 32px; min-height: 60vh; }
main::before { content: "// notes from the engineering desk"; display: block; margin-bottom: 36px; color: var(--subtle); font: .78rem/1.4 "SF Mono", Monaco, monospace; letter-spacing: .04em; }
article { padding: 0 0 38px; margin-bottom: 42px; border-bottom: 1px solid var(--border); animation: fadeIn .45s ease-out both; }
article:hover { background: transparent; border-color: var(--border); box-shadow: none; }
article h1, article h2 { margin: 0 0 12px; font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
article h2 a:hover { color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--muted); font: .78rem "SF Mono", Monaco, monospace; }
.meta::before { content: "published"; color: var(--subtle); }
.meta a { color: var(--accent); }
.entry-content { font-size: 1.06rem; line-height: 1.85; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { line-height: 1.3; letter-spacing: -.025em; }
.entry-content h1 { margin: 2.4em 0 .7em; font-size: 2rem; }
.entry-content h2 { margin: 2.2em 0 .7em; padding-bottom: .45em; font-size: 1.6rem; border-bottom: 1px solid var(--border); }
.entry-content h3 { margin: 1.8em 0 .6em; font-size: 1.3rem; }
.entry-content h4 { margin: 1.5em 0 .5em; color: var(--muted); }
.entry-content ul, .entry-content ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.entry-content li { margin: .4em 0; }
.entry-content strong { color: #fff; font-weight: 650; }
.entry-content img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; }
.entry-content a { color: var(--accent); border-bottom: 1px solid rgba(126,231,135,.35); }
.entry-content a:hover { border-bottom-color: var(--accent); }
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }

pre, code { font-family: "SF Mono", Monaco, Consolas, monospace; }
pre { position: relative; margin: 1.7em 0; padding: 22px; overflow-x: auto; color: #e6edf3; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; font-size: .88rem; line-height: 1.7; }
pre code { padding: 0; background: none; border: 0; white-space: pre; }
code { padding: .16em .4em; color: #c9d1d9; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 5px; font-size: .86em; }
.copy-btn { position: absolute; top: 10px; right: 10px; padding: 5px 9px; color: var(--muted); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px; font: .7rem "SF Mono", monospace; cursor: pointer; opacity: .8; }
.copy-btn:hover, .copy-btn.copied { color: var(--bg); background: var(--accent); border-color: var(--accent); opacity: 1; }
.entry-content blockquote { margin: 1.8em 0; padding: 16px 20px; color: #c9d1d9; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.entry-content blockquote p { margin: 0; }
.entry-content table { width: 100%; margin: 1.8em 0; border-collapse: collapse; border: 1px solid var(--border); font-size: .94rem; }
.entry-content th, .entry-content td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.entry-content th { color: var(--muted); background: var(--surface); font: .75rem "SF Mono", monospace; text-transform: uppercase; }

.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.post-tags a { padding: 4px 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font: .75rem "SF Mono", monospace; }
.post-tags a:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-raised); }
.pagination { margin: 48px 0 20px; text-align: center; }
.pagination .nav-links { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 7px; font: .8rem "SF Mono", monospace; }
.pagination a:hover, .pagination .current { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.error-404 { padding: 72px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.error-404 h1 { margin: 0 0 10px; color: var(--accent); font: 4.5rem "SF Mono", monospace; }
.error-404 p { color: var(--muted); margin: 0 auto 28px; max-width: 480px; }
.button-link { display: inline-block; padding: 10px 16px; color: var(--bg); background: var(--accent); border: 1px solid var(--accent); border-radius: 7px; font: .8rem "SF Mono", monospace; }
.button-link:hover { color: var(--bg); background: var(--accent-strong); border-color: var(--accent-strong); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media (max-width: 640px) {
    .header-inner, .footer-inner { padding: 16px 18px; }
    .header-status { display: none; }
    main { padding: 48px 18px 24px; }
    main::before { margin-bottom: 28px; }
    .entry-content { font-size: 1rem; }
    article { padding-bottom: 30px; margin-bottom: 34px; }
    pre { margin-left: -4px; margin-right: -4px; padding: 17px; font-size: .8rem; }
    .error-404 { padding: 56px 18px; }
    .error-404 h1 { font-size: 3.5rem; }
}
@media print {
    body { background: #fff; color: #000; }
    body::before, header, footer, .socials, .copy-btn, .pagination, .post-tags { display: none !important; }
    main { max-width: none; padding: 0; }
    main::before { display: none; }
    article { border: 0; }
    pre, code { color: #000; background: #f5f5f5; }
}
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
