/* ============================================
   VIBE AND SCRIBE - Modern Dark Editorial
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Colors - Matte Charcoal with Gold Accents */
  --bg-deep: #1a1a1a;
  --bg-surface: #222222;
  --bg-elevated: #2a2a2a;
  --bg-code: #151515;
  --text-primary: #e8e8e8;
  --text-cream: #e8e8e8;
  --text-muted: #707070;
  --accent-gold: #b8952a;
  --accent-gold-dim: #7a6420;
  --accent-gold-glow: rgba(184, 149, 42, 0.15);
  --shadow-deep: rgba(0, 0, 0, 0.5);

  /* Parchment card colors */
  --bg-parchment: #c9bda3;
  --bg-parchment-hover: #d4c9b0;
  --bg-parchment-code: #b8ad94;
  --text-ink: #2a2520;
  --text-ink-muted: #5c534a;
  --accent-sepia: #6e5218;
  --accent-sepia-dim: #5d4615;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-headline: 'Roboto Slab', 'Rockwell', Georgia, serif;
  --font-body: 'Spectral', 'Charter', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* Spacing */
  --content-width: 940px;
  --content-wide: 940px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-medium: 300ms ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-cream);
  background-color: var(--bg-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic scholarly background - set via JS */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 1.2s ease-out;
}

.bg-layer.loaded {
  opacity: 0.18;
}

/* Subtle grain overlay for texture cohesion - DISABLED */
/* body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 1;
  mix-blend-mode: overlay;
} */

/* Vignette + top gradient for depth and header readability */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 15%, transparent 30%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.3) 100%);
  z-index: -1;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-cream);
}

h1 {
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

small, .small {
  font-size: 0.85rem;
}

.muted {
  color: var(--text-muted);
}

.small-caps {
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

/* ---------- Selection ---------- */
::selection {
  background-color: var(--accent-gold);
  color: var(--bg-deep);
}

/* ---------- Links & Buttons ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.link-arrow::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.link-arrow:hover::after {
  transform: translateX(3px);
}

/* ---------- Horizontal Rule ---------- */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent-gold-dim) 20%,
    var(--accent-gold-dim) 80%,
    transparent
  );
  margin: var(--spacing-lg) 0;
}

/* ---------- Blockquotes ---------- */
blockquote {
  font-style: italic;
  font-size: 1.1rem;
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-left: 3px solid var(--accent-gold);
  color: var(--text-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- Lists ---------- */
ul, ol {
  margin-bottom: var(--spacing-sm);
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.3em;
}

li::marker {
  color: var(--accent-gold-dim);
}

/* ---------- Inline Code ---------- */
code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background-color: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ---------- Code Blocks ---------- */
pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  background-color: var(--bg-code);
  padding: var(--spacing-sm);
  border-radius: 4px;
  overflow-x: auto;
  margin: var(--spacing-md) 0;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-gold-dim);
  position: relative;
}

pre code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
}

/* Code block language label */
pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.7rem;
  color: var(--accent-gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Images ---------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: var(--spacing-md) 0;
}

figure img {
  border-radius: 4px;
  cursor: pointer;
  transition:
    transform var(--transition-medium),
    box-shadow var(--transition-medium);
}

figure img:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--shadow-warm);
}

figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--spacing-xs);
  font-style: italic;
}

/* ---------- Page Fade In ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* ============================================
   LAYOUT
   ============================================ */

/* ---------- Container ---------- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-wide {
  max-width: var(--content-wide);
}

/* ---------- Header ---------- */
.site-header {
  padding: var(--spacing-lg) 0 var(--spacing-md);
  position: relative;
  z-index: 10;
}

.header-link {
  display: block;
  text-decoration: none;
  transition: all var(--transition-medium);
}

.header-link:hover {
  text-decoration: none;
}

.header-link:hover .site-title {
  color: var(--accent-gold);
  text-shadow: 0 0 30px var(--accent-gold-glow);
}

.site-header .container {
  text-align: center;
}

.site-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-cream);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.6);
  transition: all var(--transition-medium);
}

/* ---------- Main Content ---------- */
main {
  padding-bottom: var(--spacing-xl);
}


/* ---------- Post Card (Homepage) - Illuminated Manuscript Style ---------- */
.post-card {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-xl);
  padding: calc(var(--spacing-md) + 8px);
  background:
    /* Paper texture grain - blurred and subtle */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeGaussianBlur stdDeviation='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.3'/%3E%3C/svg%3E"),
    /* Aged paper gradient */
    linear-gradient(168deg,
      #d4c9b0 0%,
      #c9bda3 15%,
      #c2b598 40%,
      #c9bda3 60%,
      #d1c5aa 85%,
      #c5b89c 100%
    );
  background-blend-mode: overlay, normal;
  color: var(--text-ink);
  border-radius: 3px;
  text-decoration: none;
  transition:
    transform var(--transition-medium),
    box-shadow var(--transition-medium);
  position: relative;
  z-index: 15;

  /* Layered paper depth effect */
  box-shadow:
    /* Main card shadow */
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 20px 48px rgba(0, 0, 0, 0.15),
    /* Stacked pages underneath - first page */
    3px 3px 0 -1px #bfb49a,
    4px 4px 0 -1px rgba(90, 70, 40, 0.15),
    /* Second stacked page */
    6px 6px 0 -2px #b8ad8f,
    7px 7px 0 -2px rgba(90, 70, 40, 0.12),
    /* Third stacked page */
    9px 9px 0 -3px #b0a586,
    10px 10px 0 -3px rgba(90, 70, 40, 0.1);
}

/* Deckled edge effect - rough torn paper */
.post-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: inherit;
  border-radius: 4px;
  z-index: -1;
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,2 Q2,0 4,2 T8,2 T12,2 T16,2 T20,2 T24,2 T28,2 T32,2 T36,2 T40,2 T44,2 T48,2 T52,2 T56,2 T60,2 T64,2 T68,2 T72,2 T76,2 T80,2 T84,2 T88,2 T92,2 T96,2 T100,2 L100,98 Q98,100 96,98 T92,98 T88,98 T84,98 T80,98 T76,98 T72,98 T68,98 T64,98 T60,98 T56,98 T52,98 T48,98 T44,98 T40,98 T36,98 T32,98 T28,98 T24,98 T20,98 T16,98 T12,98 T8,98 T4,98 T0,98 L0,2 Z' fill='white'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,2 Q2,0 4,2 T8,2 T12,2 T16,2 T20,2 T24,2 T28,2 T32,2 T36,2 T40,2 T44,2 T48,2 T52,2 T56,2 T60,2 T64,2 T68,2 T72,2 T76,2 T80,2 T84,2 T88,2 T92,2 T96,2 T100,2 L100,98 Q98,100 96,98 T92,98 T88,98 T84,98 T80,98 T76,98 T72,98 T68,98 T64,98 T60,98 T56,98 T52,98 T48,98 T44,98 T40,98 T36,98 T32,98 T28,98 T24,98 T20,98 T16,98 T12,98 T8,98 T4,98 T0,98 L0,2 Z' fill='white'/%3E%3C/svg%3E");
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  opacity: 0;
}

/* Decorative inner border - illuminated manuscript style */
.post-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(110, 82, 24, 0.25);
  border-radius: 2px;
  pointer-events: none;
  background:
    /* Corner ornaments */
    radial-gradient(circle at 0% 0%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 100% 0%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 0% 100%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 100% 100%, rgba(110, 82, 24, 0.4) 0%, transparent 8px);
}

.post-card:hover {
  transform: translateY(-6px) rotate(-0.3deg);
  text-decoration: none;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.18),
    0 32px 64px rgba(0, 0, 0, 0.2),
    /* Stacked pages lift effect */
    4px 4px 0 -1px #c2b69d,
    5px 5px 0 -1px rgba(90, 70, 40, 0.12),
    8px 8px 0 -2px #bbb094,
    9px 9px 0 -2px rgba(90, 70, 40, 0.1),
    12px 12px 0 -3px #b4a98b,
    13px 13px 0 -3px rgba(90, 70, 40, 0.08);
}

.post-card:hover .post-card__image img {
  transform: scale(1.03);
}

.post-card:hover .post-card__title {
  color: var(--accent-sepia);
}

.post-card__date {
  order: 4;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0;
  font-family: var(--font-mono);
  padding-top: var(--spacing-xs);
  border-top: 1px solid rgba(110, 82, 24, 0.15);
  margin-top: var(--spacing-xs);
}

.post-card__image {
  order: 2;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
  position: relative;
  /* Inset frame effect like a painting */
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.25);
  border: 3px solid rgba(90, 70, 40, 0.3);
}

.post-card__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
}

.post-card__image::after {
  content: '❦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: var(--accent-gold-dim);
  opacity: 0.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Hide ornament when image is present */
.post-card__image:has(img)::after {
  display: none;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.post-card__title {
  order: 1;
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: var(--spacing-xs);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--text-ink);
  transition: color var(--transition-fast);
}

.post-card__excerpt {
  order: 3;
  color: #1a1815;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* Post card selection highlight */
.post-card ::selection {
  background-color: var(--accent-sepia);
  color: #fff;
}

/* ---------- Post (Full Article) ---------- */
.post {
  animation: fadeIn 0.6s ease forwards;
}

/* Article page - floats above background */
.post > .container {
  background:
    /* Paper texture grain - blurred and subtle */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeGaussianBlur stdDeviation='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.3'/%3E%3C/svg%3E"),
    /* Aged paper gradient */
    linear-gradient(168deg,
      #d4c9b0 0%,
      #c9bda3 15%,
      #c2b598 40%,
      #c9bda3 60%,
      #d1c5aa 85%,
      #c5b89c 100%
    );
  background-blend-mode: overlay, normal;
  color: var(--text-ink);
  padding: var(--spacing-md);
  border-radius: 3px;
  position: relative;
  z-index: 2;

  /* Layered paper depth effect */
  box-shadow:
    /* Main card shadow */
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 20px 48px rgba(0, 0, 0, 0.15),
    /* Stacked pages underneath - first page */
    3px 3px 0 -1px #bfb49a,
    4px 4px 0 -1px rgba(90, 70, 40, 0.15),
    /* Second stacked page */
    6px 6px 0 -2px #b8ad8f,
    7px 7px 0 -2px rgba(90, 70, 40, 0.12),
    /* Third stacked page */
    9px 9px 0 -3px #b0a586,
    10px 10px 0 -3px rgba(90, 70, 40, 0.1);
}

/* Decorative inner border for article */
.post > .container::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(110, 82, 24, 0.25);
  border-radius: 2px;
  pointer-events: none;
  background:
    /* Corner ornaments */
    radial-gradient(circle at 0% 0%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 100% 0%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 0% 100%, rgba(110, 82, 24, 0.4) 0%, transparent 8px),
    radial-gradient(circle at 100% 100%, rgba(110, 82, 24, 0.4) 0%, transparent 8px);
}

.post__header {
  text-align: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--accent-sepia-dim);
}

.post__date {
  font-size: 0.8rem;
  color: var(--text-ink-muted);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-xs);
}

.post__title {
  font-size: 2.4rem;
  margin-bottom: 0;
  color: var(--text-ink);
  line-height: 1.2;
}

/* Cover image for posts */
.post__cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
  position: relative;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.25);
  border: 3px solid rgba(90, 70, 40, 0.3);
}

.post__cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
}

.post__cover::after {
  content: '❦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: var(--accent-gold-dim);
  opacity: 0.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.post__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero image for posts - matches post card image size */
.post__hero {
  margin: 0 0 var(--spacing-md) 0;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.25);
  border: 3px solid rgba(90, 70, 40, 0.3);
}

.post__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.25) 100%);
  z-index: 1;
  pointer-events: none;
}

.post__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform var(--transition-medium);
}

.post__hero-image:hover {
  transform: scale(1.01);
}

.post__content {
  font-size: 1.2rem;
  font-weight: 500;
  color: #1a1815;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.post__content > * + * {
  margin-top: var(--spacing-sm);
}

.post__content h2,
.post__content h3 {
  margin-top: var(--spacing-xs);
}


.post__footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--accent-sepia-dim);
}

.post__back {
  font-size: 0.9rem;
  color: var(--text-ink-muted);
}

.post__back:hover {
  color: var(--accent-sepia);
}

/* ---------- Parchment Container Overrides ---------- */
/* Links inside posts */
.post > .container a {
  color: var(--accent-sepia);
}

.post > .container a:hover {
  color: var(--text-ink);
}

/* Headings inside posts */
.post__content h1,
.post__content h2,
.post__content h3,
.post__content h4 {
  color: var(--text-ink);
}

/* Blockquotes */
.post > .container blockquote {
  border-left-color: var(--accent-sepia);
  color: var(--text-ink-muted);
}

/* List markers */
.post > .container li::marker {
  color: var(--accent-sepia-dim);
}

/* Horizontal rules */
.post > .container hr {
  background: linear-gradient(
    to right,
    transparent,
    var(--accent-sepia-dim) 20%,
    var(--accent-sepia-dim) 80%,
    transparent
  );
}

/* Inline code */
.post > .container code:not(pre code) {
  background-color: var(--bg-parchment-code);
  color: var(--text-ink);
}

/* Code blocks in posts - warm terminal aesthetic */
.post > .container pre {
  background: linear-gradient(
    145deg,
    #1a1814 0%,
    #151310 50%,
    #1a1814 100%
  );
  border-left-color: var(--accent-sepia);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.post > .container pre code {
  color: #e2d4bc;
  text-shadow: 0 0 20px rgba(226, 212, 188, 0.08);
}

/* Tables */
.post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-sm) 0;
  font-size: 0.95rem;
}

.post__content th,
.post__content td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid rgba(110, 82, 24, 0.2);
}

.post__content th {
  font-weight: 600;
  color: var(--text-ink);
  border-bottom: 2px solid rgba(110, 82, 24, 0.3);
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.post__content td code {
  font-size: 0.85em;
}

.post__content tbody tr:last-child td {
  border-bottom: none;
}

/* Figure captions */
.post > .container figcaption {
  color: var(--text-ink-muted);
}

/* Selection highlight */
.post > .container ::selection {
  background-color: var(--accent-sepia);
  color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--spacing-md) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .post-card {
    padding: var(--spacing-sm);
  }

  .post > .container {
    padding: var(--spacing-sm);
  }

  /* Reduce decorative inner border inset on mobile */
  .post-card::after,
  .post > .container::after {
    inset: 6px;
  }

  .site-header .container {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}
