/* ---------- CSS Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

/* ---------- Page Layout ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: lightgrey;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

nav {
    background-color: #333;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
}

nav a {
    color: #fff;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

nav a:hover {
    background-color: #555;
}

/* Hide the raw "|" separators between links */
nav {
    font-size: 0;
}

nav a {
    font-size: 1rem;
}

hr {
    border: none;
    border-top: 1px solid #bbb;
    margin: 0;
}

main,
body > h1,
body > p,
body > img {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

main {
    margin-bottom: 3rem;
}

body > h1:last-of-type,
body > p:last-of-type,
body > img:last-of-type {
    margin-bottom: 3rem;
}

.hero-image {
    margin-top: 1.5rem;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

h1 {
    margin-top: 2rem;
    font-size: 2rem;
    color: #222;
}

p {
    margin-top: 1rem;
}

footer {
    margin-top: auto;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 1rem 2rem;
}

footer p {
    margin: 0;
}

/* ---------- Post list ---------- */
.post-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #bbb;
}

.post-item:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
}

.post-title:hover {
    text-decoration: underline;
}

.post-meta {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #555;
    display: flex;
    gap: 1rem;
}

.post-slug {
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

.post-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-tag {
    background-color: #ddd;
    color: #333;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* ---------- Code blocks ---------- */
.codehilite {
    background-color: #272822;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    overflow-x: auto;
    font-size: 0.9rem;
}

.codehilite pre {
    margin: 0;
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

/* Inline code only — exclude code inside <pre> (which is handled by .codehilite) */
:not(pre) > code {
    background-color: #eee;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}
