@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --width: 680px;
    --font: 'Inter', sans-serif;
    --font-scale: 0.95em;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    font-size: var(--font-scale);
    font-weight: 300;
    margin: auto;
    padding: 40px 24px;
    max-width: var(--width);
    text-align: left;
    background-color: #fff;
    color: #000;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    color: #000;
    line-height: 1.2;
}

strong, b {
    color: #000;
}

a {
    color: #000;
    font-family: var(--font);
    text-decoration: underline;
    cursor: pointer;
}

a:hover {
    background-color: #000;
    color: #fff;
    text-decoration: none;
}

a:visited {
    color: #000;
}

a[href^="http"]:where(:not([href*="yellowsubmarine372.github.io"])):not(:has(img))::after {
    content: "↗";
}

.title:hover {
    text-decoration: none;
}

.title h1 {
    font-size: 1.5em;
}

header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #000;
}

nav a {
    margin-right: 12px;
    text-decoration: none;
    border-bottom: 1px solid #000;
}

nav a:hover {
    background-color: #000;
    color: #fff;
}

main {
    line-height: 1.6;
}

footer {
    margin-top: 40px;
    border-top: 1px solid #000;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85em;
    color: #666;
}

footer > span:has(a[href="https://bearblog.dev"]) {
    display: none;
}

hr {
    border: 0;
    border-top: 1px solid #000;
}

img {
    max-width: 100%;
}

blockquote {
    border-left: 3px solid #000;
    color: #333;
    padding-left: 20px;
    font-style: italic;
    margin-left: 0;
}

code {
    font-family: 'Fira Code', 'Courier New', monospace;
    padding: 1px 4px;
    background-color: #f0f0f0;
    color: #000;
    border: 1px solid #ccc;
}

.highlight,
.code {
    padding: 10px 15px;
    background-color: #f5f5f5;
    color: #000;
    border: 1px solid #ddd;
    margin-block-start: 1em;
    margin-block-end: 1em;
    overflow-x: auto;
}

table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}

th, td {
    padding: 6px 13px;
    border: 1px solid #000;
    font-size: 1em;
}

th {
    background-color: #000;
    color: #fff;
}

ul.blog-posts {
    list-style-type: none;
    padding: unset;
}

ul.blog-posts li {
    display: flex;
    margin-bottom: 8px;
}

ul.blog-posts li span {
    flex: 0 0 130px;
    color: #666;
}

ul.blog-posts li a {
    text-decoration: none;
    border-bottom: 1px solid #000;
}

ul.blog-posts li a:visited {
    color: #000;
}

i time {
    font-style: normal;
    color: #666;
}

.inline {
    width: auto !important;
}

button {
    margin: 0;
    cursor: pointer;
    font-family: var(--font);
    background: #000;
    color: #fff;
    border: none;
    padding: 6px 12px;
}

button:hover {
    background: #333;
}

input, button, textarea, select {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font: inherit;
}

input, textarea {
    margin: 0 0 10px;
    padding: 5px 10px;
    color: #000;
    background: #fff;
    border: 1px solid #000;
}

input {
    width: 55%;
}

textarea {
    width: 95%;
}

input[type=button],
input[type=submit],
input[type=reset] {
    margin: 0 0 20px;
    padding: 7px 14px;
    font-family: var(--font);
    font-weight: bold;
    color: #fff;
    background: #000;
    cursor: pointer;
}

::placeholder {
    color: #999;
}

/* ── Post layout ── */

.post-hero {
    margin: 2rem 0 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #000;
}

.post-title {
    font-size: 1.5em;
    line-height: 1.3;
    margin: 0 0 0.4em;
}

.post-date {
    display: block;
    font-size: 0.85em;
    color: #666;
}

.post-subtitle {
    margin: 0.5em 0 0;
    color: #555;
    font-style: italic;
    font-size: 0.95em;
}

.post-body {
    margin-top: 2.5rem;
}

.post-body > p {
    margin: 0 0 1.5em;
    line-height: 1.85;
}

.post-body h2 {
    font-size: 1.15em;
    margin: 2.8em 0 0.7em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #ddd;
}

.post-body h3 {
    font-size: 1.02em;
    margin: 2em 0 0.5em;
}

.post-body h4 {
    font-size: 0.95em;
    margin: 1.5em 0 0.4em;
}

.post-body ul,
.post-body ol {
    padding-left: 1.6em;
    margin: 0 0 1.4em;
}

.post-body li {
    margin-bottom: 0.4em;
    line-height: 1.75;
}

.post-body li > ul,
.post-body li > ol {
    margin-bottom: 0;
    margin-top: 0.3em;
}

.post-body blockquote {
    margin: 1.8em 0;
    padding: 0.8em 1.2em;
}

.post-body blockquote p {
    margin: 0;
}

.post-body hr {
    margin: 2.8em 0;
}

.post-body table {
    margin: 1.8em 0;
    font-size: 0.88em;
}

.post-body img {
    display: block;
    margin: 2em auto;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.post-body pre {
    margin: 1.5em 0;
}

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

.post-back {
    display: inline-block;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid #000;
    width: 100%;
    font-size: 0.9em;
    text-decoration: none;
    border-bottom: none;
}

.post-back:hover {
    background: none;
    color: inherit;
    text-decoration: underline;
}

/* ── Dark mode ── */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #000;
        color: #fff;
    }
    h1, h2, h3, h4, h5, h6, strong, b {
        color: #fff;
    }
    a {
        color: #fff;
    }
    a:hover {
        background-color: #fff;
        color: #000;
    }
    a:visited {
        color: #ccc;
    }
    nav a {
        border-bottom-color: #fff;
    }
    header {
        border-bottom-color: #fff;
    }
    footer {
        border-top-color: #fff;
        color: #999;
    }
    hr {
        border-top-color: #fff;
    }
    blockquote {
        border-left-color: #fff;
        color: #ccc;
    }
    code {
        background-color: #111;
        color: #fff;
        border-color: #333;
    }
    .highlight, .code {
        background-color: #111;
        color: #fff;
        border-color: #333;
    }
    th {
        background-color: #fff;
        color: #000;
    }
    th, td {
        border-color: #fff;
    }
    ul.blog-posts li span {
        color: #999;
    }
    ul.blog-posts li a {
        border-bottom-color: #fff;
    }
    i time {
        color: #999;
    }
    input, textarea {
        color: #fff;
        background: #000;
        border-color: #fff;
    }
    input[type=button], input[type=submit], input[type=reset] {
        color: #000;
        background: #fff;
    }
    button {
        background: #fff;
        color: #000;
    }
    .post-hero {
        border-bottom-color: #fff;
    }
    .post-date {
        color: #999;
    }
    .post-subtitle {
        color: #aaa;
    }
    .post-body h2 {
        border-bottom-color: #333;
    }
    .post-back {
        border-top-color: #fff;
    }
}
