* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream: #faf5ee;
    --paper: #fffdfa;
    --ink: #241f19;
    --ink-soft: #6b6459;
    --line: #e9e0d2;
    --rust: #bd5b34;
    --rust-dark: #8f3f22;
    --rust-tint: #f5e6dc;
    --shadow: 220 25% 20%;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--cream);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(189,91,52,0.06), transparent 45%),
        radial-gradient(circle at 100% 20%, rgba(189,91,52,0.05), transparent 40%);
    background-attachment: fixed;
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 28px; }

/* Site header */
.site-header {
    padding: 56px 0 30px;
    text-align: center;
}

.site-header .kicker {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rust);
    margin-bottom: 10px;
}

.site-header .brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(34px, 6vw, 52px);
    font-weight: 600;
    letter-spacing: -0.015em;
    text-decoration: none;
    color: var(--ink);
    display: inline-block;
}

.site-header .tagline {
    color: var(--ink-soft);
    font-size: 15.5px;
    margin-top: 8px;
}

.site-nav {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 26px;
    font-size: 13.5px;
    font-weight: 600;
}

.site-nav a {
    text-decoration: none;
    color: var(--ink-soft);
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 12.5px;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--rust-dark);
    border-color: var(--rust);
}

.header-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
    margin: 32px 0 44px;
}

/* Tag pills / filters */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.tag-pill:hover { border-color: var(--rust); color: var(--rust-dark); transform: translateY(-1px); }
.tag-pill.active { background: var(--rust); color: #fff; border-color: var(--rust); }
.tag-pill .count { opacity: 0.65; font-weight: 500; }

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Magazine hero for the latest post */
.hero {
    position: relative;
    display: block;
    text-decoration: none;
    color: #fff;
    border-radius: 28px;
    overflow: hidden;
    margin-bottom: 56px;
    min-height: clamp(360px, 56vw, 560px);
    box-shadow: 0 20px 50px -20px hsl(var(--shadow) / 0.35);
}

.hero-media { position: absolute; inset: 0; background: var(--line); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.hero:hover .hero-media img { transform: scale(1.04); }

.hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,14,10,0.05) 0%, rgba(20,14,10,0.15) 45%, rgba(16,11,8,0.88) 100%);
}

.hero.no-media {
    background: linear-gradient(135deg, #26221d 0%, #3a2c22 55%, var(--rust-dark) 130%);
}

.hero-copy {
    position: relative;
    z-index: 2;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(28px, 4vw, 56px);
}

.hero .eyebrow {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.hero h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(28px, 4.2vw, 46px);
    font-weight: 600;
    line-height: 1.12;
    margin-bottom: 14px;
    max-width: 22ch;
}

.hero p.excerpt {
    color: rgba(255,255,255,0.82);
    font-size: 16.5px;
    max-width: 56ch;
    margin-bottom: 20px;
}

.hero .meta-row { color: rgba(255,255,255,0.75); }
.hero .post-tags .tag-pill { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.28); color: #fff; }

.meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-soft);
}

.meta-row .dot::before { content: '·'; margin-right: 14px; opacity: 0.6; }

/* Section label above the grid */
.section-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

/* Post grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    margin-bottom: 52px;
}

.post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--paper);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 40px -22px hsl(var(--shadow) / 0.3);
}

.post-card .cover-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--line); }
.post-card .cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2,.8,.2,1); }
.post-card:hover .cover { transform: scale(1.06); }

.post-card .cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 15px;
    color: var(--ink-soft);
    background: linear-gradient(135deg, var(--rust-tint), var(--line));
}

.card-eyebrow {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rust-dark);
    background: rgba(255,253,250,0.92);
    padding: 5px 10px;
    border-radius: 999px;
}

.post-card .body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }

.post-card h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 19.5px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.post-card p.excerpt {
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 16px;
    flex: 1;
}

.post-card .meta-row { font-size: 12.5px; margin-top: auto; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--ink-soft);
}

.empty-state a { color: var(--rust-dark); font-weight: 600; }

/* Feed page: full posts, one after another */
.feed-post {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 44px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(36,31,25,0.05);
}

.feed-post .cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 30px;
}

.feed-post h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.feed-post h2 a { text-decoration: none; }
.feed-post h2 a:hover { color: var(--rust-dark); }

.feed-post .meta-row { margin-bottom: 26px; }

hr.divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 8px 0 32px;
}

/* Single post */
.post-header { text-align: center; margin-bottom: 32px; }

.post-header .eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--rust);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.post-header h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 18px;
}

.post-header .meta-row { justify-content: center; margin-bottom: 18px; }
.post-header .post-tags { justify-content: center; }

.post-cover {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 44px;
    box-shadow: 0 24px 48px -24px hsl(var(--shadow) / 0.35);
}

/* Rich post content typography — shared by post.php and feed.php */
.post-content {
    font-size: 18.5px;
    line-height: 1.78;
    color: var(--ink);
}

.post-content h1, .post-content h2, .post-content h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin: 38px 0 14px;
}

.post-content h1 { font-size: 30px; }
.post-content h2 { font-size: 25px; }
.post-content h3 { font-size: 21px; }

.post-content p { margin-bottom: 22px; }

.post-content img {
    width: 100%;
    border-radius: 14px;
    margin: 30px 0;
    box-shadow: 0 20px 40px -22px hsl(var(--shadow) / 0.3);
}

.post-content a { color: var(--rust-dark); text-decoration-color: var(--rust); }

.post-content blockquote {
    border-left: 3px solid var(--rust);
    padding: 4px 0 4px 22px;
    margin: 28px 0;
    color: var(--ink-soft);
    font-style: italic;
    font-size: 19.5px;
}

.post-content ul, .post-content ol { margin: 0 0 22px 24px; }
.post-content li { margin-bottom: 6px; }

.post-content code {
    background: var(--rust-tint);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
}

.back-link:hover { color: var(--rust-dark); }

.site-footer {
    text-align: center;
    padding: 50px 20px 70px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}

.site-footer .brand-mini {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.site-footer .fine-print {
    color: var(--ink-soft);
    font-size: 12.5px;
}

.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--rust-dark); }

.load-more-wrap { text-align: center; margin-bottom: 48px; }

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.15s, transform 0.1s;
}

.btn-load-more:hover { background: var(--rust-dark); transform: translateY(-1px); }

@media (max-width: 920px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .post-grid { grid-template-columns: 1fr; }
    .site-header { padding: 40px 0 24px; }
    .hero-copy { padding: 24px; }
    .feed-post { padding: 28px 24px; }
}
