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

:root {
    --text: #1a2e26;
    --muted: #4a6b5e;
    --muted-light: #7a9d90;
    --accent: #5b89a6;
    --accent-hover: #3d6b87;
    --border: #d4dfe6;
    --bg: #ffffff;
    --bg-soft: #f0f4f6;
    --bg-code: #e8f0f4;
    --nav-bg: #2d4a3e;
    --nav-text: #9fc4b7;
    --nav-title: #e8ecee;
}

/* ── Base ─────────────────────────────────────────────────── */

body {
    font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }

/* ── Site Header / Nav ────────────────────────────────────── */

.site-header {
    background: var(--nav-bg);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nav-title);
    text-decoration: none;
}

.site-title:hover { text-decoration: none; color: #fff; }

.site-nav {
    display: flex;
    gap: 0.25rem;
}

.site-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.site-nav a.rss-link {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    color: var(--nav-text);
}
.site-nav a.rss-link:hover { color: #f26522; }

/* ── Page wrapper ─────────────────────────────────────────── */

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

/* ── Hero / Splash ────────────────────────────────────────── */

.hero {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 480px;
    background: url('/media/radio-telescope.jpg') center center / cover no-repeat;
    display: flex;
    align-items: flex-end;
    margin-bottom: 3.5rem;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(20, 35, 30, 0.88) 0%,
        rgba(20, 35, 30, 0.45) 45%,
        rgba(20, 35, 30, 0.10) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 0 0 0.75rem;
    color: #e8ecee;
    max-width: 600px;
}

.hero p {
    font-size: 1rem;
    color: #9fc4b7;
    line-height: 1.7;
    margin: 0 0 1.25rem;
    max-width: 540px;
}

.hero-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.btn-primary {
    background: #5b89a6;
    color: #fff;
}

.btn-primary:hover { background: #3d6b87; color: #fff; text-decoration: none; }

.btn-secondary {
    background: rgba(255,255,255,0.12);
    color: #e8ecee;
    border: 1px solid rgba(255,255,255,0.25);
}

.btn-secondary:hover { background: rgba(255,255,255,0.2); text-decoration: none; }

/* ── Category sections on splash ─────────────────────────── */

.splash-section {
    margin-bottom: 3.5rem;
}

.splash-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--text);
}

.splash-section-header h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
    color: var(--text);
}

.splash-section-header a {
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
}

.splash-section-header a:hover { color: var(--accent); }

.splash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.splash-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.splash-card:hover {
    border-color: #c9d0d9;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.splash-card .card-date {
    font-size: 0.73rem;
    color: var(--muted-light);
    margin-bottom: 0.4rem;
}

.splash-card h3 {
    font-size: 0.975rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.55rem;
    letter-spacing: -0.01em;
}

.splash-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.splash-card h3 a:hover { color: var(--accent); }

.splash-card .card-excerpt {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category top-border accents */
.splash-card.cat-climate  { border-top: 3px solid #059669; }
.splash-card.cat-technology { border-top: 3px solid var(--accent); }
.splash-card.cat-personal { border-top: 3px solid var(--muted-light); }

/* ── Blog listing (category pages) ───────────────────────── */

/* ── Page hero banner (non-homepage) ─────────────────────── */

.page-hero {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 280px;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.page-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(20, 35, 30, 0.82) 0%,
        rgba(20, 35, 30, 0.35) 50%,
        rgba(20, 35, 30, 0.08) 100%
    );
}

.page-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
}

.page-hero-content h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #e8ecee;
    margin: 0 0 0.35rem;
}

.page-hero-content p {
    font-size: 0.95rem;
    color: #9fc4b7;
    margin: 0;
}

/* ── Blog header (used when no hero image) ────────────────── */

.blog-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}

.blog-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem;
}

.blog-header p {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
}

.blog-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: start;
}

.blog-sidebar {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.sidebar-index {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-item {
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 5px;
    line-height: 1.35;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.sidebar-item:hover {
    color: var(--text);
    background: var(--bg-soft);
    border-left-color: var(--accent);
    text-decoration: none;
}

.sidebar-pagination {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.sidebar-page-info {
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.25rem 0.4rem;
}

.sidebar-page-link {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}

.sidebar-page-link:hover {
    background: var(--bg-soft);
    color: var(--text);
    text-decoration: none;
}


.sidebar-page-link.disabled {
    color: var(--border);
    cursor: default;
}

.blog-feed {
    min-width: 0;
}

.blog-entry {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.blog-entry:first-child { padding-top: 0; }

.blog-entry-meta {
    font-size: 0.78rem;
    color: var(--muted-light);
    margin-bottom: 0.5rem;
}

.blog-entry h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 0.65rem;
}

.blog-entry h2 a {
    color: var(--text);
    text-decoration: none;
}

.blog-entry h2 a:hover { color: var(--accent); }

.blog-entry-excerpt {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0 0 0.75rem;
}

.read-more {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
}

.blog-entry-content {
    font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
    margin-top: 1rem;
}

.blog-entry-content p { margin: 0 0 1.4em; }
.blog-entry-content h2 { font-family: "Source Sans 3", sans-serif; font-size: 1.15rem; font-weight: 700; margin: 2em 0 0.5em; }
.blog-entry-content h3 { font-family: "Source Sans 3", sans-serif; font-size: 1rem; font-weight: 600; margin: 1.75em 0 0.4em; }
.blog-entry-content img { max-width: 100%; height: auto; display: block; margin: 1.5em auto; border-radius: 6px; }
.blog-entry-content a { color: var(--accent); }
.blog-entry-content pre { background: var(--bg-code); padding: 1em 1.25em; border-radius: 6px; overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); }
.blog-entry-content code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.875em; background: var(--bg-code); padding: 0.15em 0.35em; border-radius: 3px; }
.blog-entry-content pre code { background: none; padding: 0; }
.blog-entry-content blockquote { border-left: 3px solid var(--border); margin: 1.5em 0; padding: 0.4em 1.25em; color: var(--muted); font-style: italic; }

/* ── Pagination ───────────────────────────────────────────── */

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 720px;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.pagination-link:hover { text-decoration: underline; }
.pagination-link.disabled { color: var(--muted-light); cursor: default; }

.pagination-info {
    font-size: 0.8rem;
    color: var(--muted-light);
}

/* ── Post page ────────────────────────────────────────────── */

.post-wrapper {
    padding-top: 2.5rem;
}

.post-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

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

h1.post-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
}

.post-meta {
    font-size: 0.83rem;
    color: var(--muted);
    margin-bottom: 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-content {
    font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
    margin-top: 2rem;
}

.post-content p { margin: 0 0 1.4em; }
.post-content h2 { font-family: "Source Sans 3", sans-serif; font-size: 1.25rem; font-weight: 700; margin: 2.5em 0 0.6em; letter-spacing: -0.02em; color: var(--text); }
.post-content h3 { font-family: "Source Sans 3", sans-serif; font-size: 1.05rem; font-weight: 600; margin: 2em 0 0.5em; color: var(--text); }
.post-content img { max-width: 100%; height: auto; display: block; margin: 2em auto; border-radius: 6px; }
.post-content a { color: var(--accent); }
.post-content ul, .post-content ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.post-content li { margin-bottom: 0.4em; }

pre, code {
    font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
    font-size: 0.875em;
    background: var(--bg-code);
}

code { padding: 0.15em 0.4em; border-radius: 4px; }

pre {
    padding: 1.25em 1.5em;
    overflow-x: auto;
    border-radius: 8px;
    margin: 1.75em 0;
    border: 1px solid var(--border);
}

pre code { background: none; padding: 0; font-size: 1em; }

blockquote {
    border-left: 3px solid var(--border);
    margin: 1.75em 0;
    padding: 0.4em 1.5em;
    color: var(--muted);
    font-style: italic;
}

.post-nav {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

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

/* ── Static pages ─────────────────────────────────────────── */

.page-wrapper {
    max-width: 720px;
    padding-top: 2.5rem;
}

.page-wrapper h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-content {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
}

.page-content p { margin: 0 0 1.4em; }
.page-content h2 { font-family: "Source Sans 3", sans-serif; font-size: 1.2rem; font-weight: 700; margin: 2em 0 0.5em; letter-spacing: -0.02em; color: var(--text); }
.page-content a { color: var(--accent); }
.page-content img { max-width: 180px; float: right; margin: 0 0 1em 1.5em; border-radius: 8px; }

/* ── Recipe index ────────────────────────────────────────── */

.recipe-index-wrapper {
    max-width: 860px;
    padding-top: 0;
}

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

.recipe-index-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.4rem;
}

.recipe-index-header p {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
}

.recipe-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

a.recipe-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    border-top: 3px solid var(--nav-bg);
}

a.recipe-card:hover {
    border-color: #c9d0d9;
    border-top-color: var(--nav-bg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-decoration: none;
}

.recipe-card-body h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 0.5rem;
    line-height: 1.3;
}

.recipe-card-body p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.recipe-card-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Recipe pages ────────────────────────────────────────── */

.recipe-wrapper {
    max-width: 860px;
    padding-top: 2.5rem;
}

.recipe-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.recipe-eyebrow a { color: var(--muted); text-decoration: none; }
.recipe-eyebrow a:hover { color: var(--accent); }

.recipe-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.6rem;
}

.recipe-description {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.recipe-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.recipe-tag {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.recipe-stats {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    background: var(--bg-soft);
}

.recipe-stat {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border-right: 1px solid var(--border);
}

.recipe-stat:last-child { border-right: none; }

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-light);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.recipe-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 3rem;
    align-items: start;
}

.recipe-ingredients {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 72px;
}

.recipe-ingredients h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.recipe-ingredients ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-ingredients li {
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.recipe-ingredients li:last-child { border-bottom: none; }

.recipe-content {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1f2937;
}

.recipe-content p { margin: 0 0 1.25em; }

.recipe-content h2 {
    font-family: "Source Sans 3", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 2em 0 0.75em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.recipe-content ol {
    padding-left: 1.25em;
    margin: 0 0 1.25em;
    counter-reset: none;
}

.recipe-content ol li {
    margin-bottom: 0.75em;
    padding-left: 0.25em;
    line-height: 1.65;
}

@media (max-width: 700px) {
    .recipe-body { grid-template-columns: 1fr; }
    .recipe-ingredients { position: static; }
    .recipe-stats { flex-wrap: wrap; }
    .recipe-stat { min-width: 50%; border-bottom: 1px solid var(--border); }
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 1.5rem;
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

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

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .splash-grid { grid-template-columns: 1fr; }
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { display: none; }
}

@media (max-width: 640px) {
    .site-header .inner { padding: 0 1rem; }
    .site-nav a { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
    main { padding: 0 1rem 4rem; }
    .hero { padding: 2rem 0 1.75rem; }
    .site-footer { flex-direction: column; gap: 0.4rem; padding: 1.5rem 1rem; }
}
