/* ==========================================================================
   low-latency.it — minimal base stylesheet
   ========================================================================== */

:root {
    --text: #1a1a1a;
    --muted: #666;
    --bg: #fdfdfd;
    --surface: #ffffff;
    --accent: #2b5fd9;
    --border: #e5e5e5;
    --code-bg: #f6f6f6;
    --max-width: 860px;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    font-size: 17px;
}

.wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

a { color: var(--accent); }

/* ---------- header / nav ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}

.site-header .wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.site-nav a {
    margin-left: 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.site-nav a:hover { color: var(--accent); }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.85rem;
}

main.wrapper { padding: 2.5rem 1.25rem; }

/* ---------- post list (index page) ---------- */

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-list li {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.post-date {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.post-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.post-list a:hover { color: var(--accent); }

.post-excerpt {
    color: var(--muted);
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
}

/* ---------- post page ---------- */

.post {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

@media (max-width: 640px) {
    .post {
        padding: 2rem 1.25rem 3rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.6rem;
}

.post-meta {
    color: var(--muted);
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    display: inline-block;
    background: #eef1fb;
    color: var(--accent);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    margin-right: 0.35rem;
}

/* ---------- post content (prose) ---------- */

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
}

.post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 0.85rem;
}

.post-content p { margin: 0 0 1.25rem; }

.post-content ul,
.post-content ol {
    margin: 0 0 1.25rem;
    padding-left: 1.4rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 3px solid var(--accent);
    background: #f3f6fd;
    color: var(--muted);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.75rem auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}

.post-content th,
.post-content td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th { background: var(--code-bg); }

/* ---------- code ---------- */

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.87em;
}

.post-content :not(pre) > code {
    background: var(--code-bg);
    color: #c7254e;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.post-content pre {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.55;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Rouge / IntelliJ Light syntax colors */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #808080; font-style: italic; }
.highlight .cp { color: #808000; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kp, .highlight .ow { color: #000080; font-weight: bold; }
.highlight .kt, .highlight .kc { color: #000080; font-weight: bold; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc,
.highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx,
.highlight .sr, .highlight .ss { color: #008000; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #0000ff; }
.highlight .nc, .highlight .vc { color: #000000; font-weight: bold; }
.highlight .nf { color: #000000; font-weight: bold; }
.highlight .nd { color: #808000; }
.highlight .na { color: #808000; }
.highlight .nb, .highlight .bp { color: #000080; }
.highlight .no { color: #000080; font-weight: bold; }
.highlight .ne { color: #000080; font-weight: bold; }
.highlight .n, .highlight .nx, .highlight .py { color: #000000; }
.highlight .o, .highlight .p { color: #000000; }
.highlight .err { color: #ff0000; background: #ffe0e0; }

/* ---------- post footer ---------- */

.post-footer {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.post-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- post list (index page) ---------- */

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 2rem;
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.post-card {
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.post-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-card-image {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.post-card-content h2 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-card-content h2 a {
    color: var(--text);
    text-decoration: none;
}

.post-card-content h2 a:hover {
    color: var(--accent);
}

.post-description {
    color: var(--muted);
    margin: 0 0 0.85rem;
    font-size: 0.97rem;
    line-height: 1.5;
}

.post-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: var(--text);
}

.meta-separator {
    color: #bbb;
}