:root {
    --bg: #f4f4f4;
    --ink: #222;
    --ink-soft: #666;
    --rule: #ddd;
    --accent: #222;
    --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 1rem/1.7 "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover, a:focus-visible { color: #000; text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }

.site-header { padding: 1.75rem 0 0.5rem; }
.site-name {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding-top: 2rem;
    padding-bottom: 4rem;
}
@media (min-width: 60rem) {
    .layout { grid-template-columns: minmax(0, 1fr) 19rem; gap: 4rem; }
}

/* Meta lines */
.meta {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.meta a { color: inherit; text-decoration: none; }
.meta a:hover { color: var(--ink); text-decoration: underline; }

/* Listings */
h1, h2 { font-weight: 400; line-height: 1.25; }
.listing-heading { margin-bottom: 2.5rem; }
.listing-heading h1 { margin: 0; font-size: 2rem; }
.intro { margin-bottom: 2.5rem; }

.post-summary { max-width: var(--measure); padding-bottom: 2.25rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--rule); }
.post-summary h2 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.post-summary h2 a { text-decoration: none; }
.post-summary h2 a:hover { text-decoration: underline; }
.more { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }

.pagination { display: flex; gap: 1.5rem; align-items: baseline; font-size: 0.85rem; }
.pagination span { color: var(--ink-soft); }

/* Single post */
.post { max-width: var(--measure); }
.post h1 { margin: 0 0 0.5rem; font-size: 2.1rem; }
.post-body { margin-top: 1.5rem; }
.post-body h2 { font-size: 1.45rem; margin: 2.25rem 0 0.5rem; }
.post-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.post-body h4 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1rem; }
.post-body li { margin-bottom: 0.3rem; }
.post-body code { padding: 0.1em 0.35em; background: #e9e9e9; border-radius: 3px; font-size: 0.9em; }
.post-body blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 3px solid var(--ink); color: var(--ink-soft); }
.post-body hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--rule); }
.block-image { margin: 1.5rem 0; }
.block-image figure { margin: 0; }
.block-image img { display: block; border: 1px solid var(--rule); background: #fff; }
.block-table { margin: 1.5rem 0; overflow-x: auto; }
.block-table table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.block-table th, .block-table td { padding: 0.5rem 0.75rem; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.block-table th { background: #e9e9e9; }

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

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.tag-list a {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--rule);
    border-radius: 99px;
    background: #fff;
    font-size: 0.8rem;
    text-decoration: none;
}
.tag-list a:hover { border-color: var(--ink); }

/* Sidebar */
.widget { margin-bottom: 2.5rem; font-size: 0.9rem; }
.widget h2 {
    margin: 0 0 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li a { text-decoration: none; }
.widget li a:hover { text-decoration: underline; }
.widget:not(.widget-about) ul:not(.tag-list) li { padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.widget-about { text-align: left; }
.widget-about .logo { display: block; width: 8rem; height: auto; margin: 0 auto 2rem; }
.widget-about p { margin: 0; }

.search-form { display: flex; }
.search-form input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--rule);
    background: #fff;
    font: inherit;
}
.search-form button {
    padding: 0 1rem;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.search-form button:hover { background: #000; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.site-footer { padding: 1.5rem 0 3rem; border-top: 1px solid var(--rule); font-size: 0.8rem; }
.link-button { padding: 0; border: 0; background: none; font: inherit; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--ink); }

/* Cookie consent */
.cookie-banner { position: fixed; inset: auto 0 0 0; z-index: 100; padding: 1.25rem 0; background: #fff; border-top: 1px solid var(--ink); box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08); }
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.cookie-banner h2 { margin: 0 0 0.25rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.cookie-banner p { margin: 0; max-width: 42rem; font-size: 0.9rem; line-height: 1.5; }
.cookie-actions { display: flex; gap: 0.75rem; }
.cookie-actions button { padding: 0.55rem 1.4rem; border: 1px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; }
.cookie-actions button:hover { background: var(--bg); }
