:root {
    --bg:         #181614;
    --bg-card:    #211e1b;
    --bg-hover:   #272320;
    --text:       #e8dcc8;
    --muted:      #9a8a78;
    --accent:     #c8963e;
    --accent-h:   #d4a84e;
    --border:     #312c27;
    --header-bg:  #0f0d0b;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Lora', Georgia, serif;
    font-size: 17px;
    line-height: 1.7;
}

/* ── Header ─────────────────────────────── */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-logo { text-decoration: none; }
.site-logo img { height: 48px; width: auto; display: block; }
.site-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.main-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--accent); }

/* ── Layout ──────────────────────────────── */
main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ── Archive header ──────────────────────── */
.archive-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.archive-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.archive-header p { color: var(--muted); font-size: 0.95rem; }

/* ── Card grid ───────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 960px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .card-grid { grid-template-columns: 1fr; } }

/* ── Card ────────────────────────────────── */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    background: var(--bg-hover);
}
.card-img-wrap {
    aspect-ratio: 16/9;
    overflow: hidden;
    display: block;
}
.card-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
    display: block;
}
.post-card:hover .card-img-wrap img { transform: scale(1.04); }

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.card-cats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cat-badge {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.12rem 0.45rem;
    border-radius: 2px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.cat-badge:hover { background: var(--accent); color: #111; }
.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.35;
}
.card-title a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
    font-size: 0.88rem;
    color: var(--muted);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-date { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Single post ─────────────────────────── */
.post-hero {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 2.5rem;
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-header { max-width: 760px; margin: 0 auto 2rem; }
.post-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.4rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.post-content {
    max-width: 760px;
    margin: 0 auto;
}
.post-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.65rem;
    color: var(--accent);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.post-content h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    margin: 1.75rem 0 0.75rem;
}
.post-content h4 {
    font-size: 1rem;
    color: var(--accent);
    margin: 1.25rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.post-content p { margin-bottom: 1.25rem; }
.post-content ul,
.post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content a { color: var(--accent); text-underline-offset: 3px; }
.post-content strong { color: var(--text); font-weight: 600; }
.post-content img { max-width: 100%; border-radius: 4px; margin: 1rem 0; display: block; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--muted);
    font-style: italic;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.post-content th,
.post-content td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    text-align: left;
}
.post-content th { background: var(--bg-card); color: var(--accent); }
.post-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ── Related posts ───────────────────────── */
.related { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.45rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

/* ── Footer ──────────────────────────────── */
.site-footer {
    margin-top: 5rem;
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }

/* ── Responsive tweaks ───────────────────── */
@media (max-width: 640px) {
    main { padding: 2rem 1rem; }
    .site-header { flex-direction: column; align-items: flex-start; }
    .post-header h1 { font-size: 1.8rem; }
}
