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

:root {
  --parchment: #f5eedc;
  --parchment-dark: #e8dfc8;
  --ink: #2c1a0e;
  --ink-light: #5c3d1e;
  --gold: #c9902a;
  --gold-light: #e8b84b;
  --crimson: #8b1a1a;
  --shadow: rgba(44, 26, 14, 0.15);
  --border: rgba(44, 26, 14, 0.2);
  --sidebar-width: 240px;
}

body {
  background: #1a0f07;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(139, 26, 26, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 144, 42, 0.06) 0%, transparent 50%);
  color: var(--ink);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
}

.site-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Header */
.site-header {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 3rem;
  position: relative;
}

.site-header::before,
.site-header::after {
  content: '✦';
  color: var(--gold);
  font-size: 1rem;
  position: absolute;
  bottom: -0.6rem;
  background: #1a0f07;
  padding: 0 0.5rem;
}
.site-header::before { left: 50%; transform: translateX(-200px); }
.site-header::after  { left: 50%; transform: translateX(180px); }

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold-light);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  flex-direction: column;
  gap: 0;
}

.title-rune {
  font-size: 1.4rem;
  display: block;
  opacity: 0.8;
}

.title-sub {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  font-weight: 400;
  margin-top: 0.2rem;
}

.site-tagline {
  margin-top: 0.75rem;
  color: var(--gold);
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1rem;
  opacity: 0.8;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 2rem;
  background: rgba(245, 238, 220, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  backdrop-filter: blur(4px);
}

.sidebar-heading {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.6rem;
  color: var(--parchment);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: 'Crimson Text', serif;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
  line-height: 1.3;
}

.nav-link:hover {
  background: rgba(201, 144, 42, 0.12);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

/* Main */
.main-content {
  min-width: 0;
}

.back-link {
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  font-family: 'Crimson Text', serif;
  transition: color 0.15s;
}
.back-link:hover { color: var(--gold-light); }

/* Index hero */
.index-hero {
  margin-bottom: 2.5rem;
}

.index-heading {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.index-intro {
  color: rgba(245, 238, 220, 0.7);
  font-family: 'IM Fell English', serif;
  font-style: italic;
}

/* Post cards */
.post-grid {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  background: linear-gradient(135deg, rgba(245,238,220,0.07) 0%, rgba(245,238,220,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.post-card-inner {
  padding: 1.5rem 1.75rem;
}

.post-meta {
  margin-bottom: 0.4rem;
}

.post-date {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

.post-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.post-card-title a {
  color: var(--parchment);
  text-decoration: none;
  transition: color 0.15s;
}
.post-card-title a:hover { color: var(--gold-light); }

.post-excerpt {
  color: rgba(245, 238, 220, 0.65);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.read-more {
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  transition: color 0.15s;
}
.read-more:hover { color: var(--gold-light); }

/* Full post */
.post-full { }

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.3;
  margin-top: 0.4rem;
}

/* Post body (rendered markdown) */
.post-body {
  color: var(--parchment);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-body h1 { font-size: 1.6rem; }
.post-body h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.post-body h3 { font-size: 1.05rem; color: var(--gold); }
.post-body h4 { font-size: 0.95rem; color: var(--gold); font-weight: 400; letter-spacing: 0.05em; }

.post-body p { margin-bottom: 1rem; }

.post-body strong { color: var(--gold-light); font-weight: 600; }

.post-body em { font-style: italic; color: rgba(245,238,220,0.9); }

.post-body a { color: var(--gold); text-underline-offset: 3px; }
.post-body a:hover { color: var(--gold-light); }

.post-body ul,
.post-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.post-body li { margin-bottom: 0.3rem; }

.post-body code {
  font-family: 'Courier New', monospace;
  font-size: 0.82em;
  background: rgba(201, 144, 42, 0.12);
  color: var(--gold-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid rgba(201, 144, 42, 0.2);
}

.post-body pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85em;
  color: var(--parchment-dark);
}

.post-body blockquote {
  border-left: 3px solid var(--crimson);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: rgba(245,238,220,0.75);
  font-style: italic;
  background: rgba(139, 26, 26, 0.08);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

.post-body th {
  background: rgba(201, 144, 42, 0.15);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--gold);
}

.post-body td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.post-body tr:last-child td { border-bottom: none; }
.post-body tr:hover td { background: rgba(201, 144, 42, 0.05); }

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(245,238,220,0.35);
  font-family: 'IM Fell English', serif;
}

.site-footer code {
  font-family: monospace;
  color: var(--gold);
  opacity: 0.7;
  font-size: 0.9em;
}

/* Responsive */
@media (max-width: 700px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .site-title {
    font-size: 1.8rem;
  }
}
