/*
=================================================================
Daniel's Blog — Clean Redesign
=================================================================
*/

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

:root {
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --bg: #0c0f14;
  --bg-card: #151920;
  --bg-card-hover: #1a1f2a;
  --bg-elevated: #1e2430;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(99,179,237,0.2);

  --text: #e2e8f0;
  --text-secondary: #8892a4;
  --text-muted: #5a6478;

  --accent: #63b3ed;
  --accent-hover: #90cdf4;
  --accent-glow: rgba(99,179,237,0.15);
  --accent-warm: #f6ad55;

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --border: rgba(0,0,0,0.08);
  --border-accent: rgba(37,99,235,0.2);
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37,99,235,0.1);
  --accent-warm: #ea580c;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

::selection { background: var(--accent); color: var(--bg); }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 15, 20, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
}

.header .logo h1 a {
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header .logo p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Hamburger Menu ───────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 200;
}

.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--text);
  left: 0;
  transition: all 0.3s ease;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle { position: relative; }
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline; }

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

.header-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.header-nav a:hover {
  color: var(--text);
  background: var(--accent-glow);
}

.icon-button {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-button:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  align-items: start;
}

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

/* ── Sidebar ──────────────────────────────────────────────── */
.blog-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-avatar { text-align: center; }

.sidebar-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--border-accent);
  object-fit: cover;
  transition: transform var(--transition), border-color var(--transition);
}

.sidebar-avatar img:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.sidebar-bio {
  text-align: center;
}

.sidebar-bio h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.sidebar-bio p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sidebar-search {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.sidebar-search:focus-within {
  border-color: var(--accent);
}

.search-input {
  flex: 1;
  padding: 0.6rem 0.875rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
}

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

.search-button {
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition);
}

.search-button:hover { background: var(--accent-hover); }

.sidebar-section h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-list li a {
  display: block;
  padding: 0.35rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.sidebar-list li a:hover {
  color: var(--accent);
  padding-left: 0.5rem;
}

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

.sidebar-tags a {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 100px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.sidebar-tags a:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ── Post Cards ───────────────────────────────────────────── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeUp 0.4s ease forwards;
  opacity: 0;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 0 1px var(--border-accent);
}

.post-image img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.post-header h2 {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.post-header h2 a {
  color: var(--text);
  transition: color var(--transition);
}

.post-header h2 a:hover { color: var(--accent); }

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-separator { color: var(--text-muted); opacity: 0.4; }

.post-tags a {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.post-tags a:hover { opacity: 1; }

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.65;
  margin-top: 0.25rem;
}

/* ── Single Post ──────────────────────────────────────────── */
.post, .page {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  max-width: 800px;
  margin: 3rem auto;
}

.post-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.post-content {
  margin-top: 2rem;
  font-size: 1.05rem;
  line-height: 1.85;
}

.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin-left: 1.5rem; margin-bottom: 1.25rem; }

.post-content code:not(pre > code) {
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: var(--font-mono);
  color: var(--accent-warm);
}

pre {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

pre code {
  background: transparent !important;
  padding: 0 !important;
  font-family: var(--font-mono);
}

.code-toolbar {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
}

.code-toolbar:hover .copy-button { opacity: 1; }
.copy-button:hover { background: rgba(255,255,255,0.15); color: var(--text); }

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

.social-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-share span {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.copy-link-button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-link-text {
  font-size: 0.85rem;
  font-weight: 500;
}

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

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: transparent;
}

/* ── Splash Screen ────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0c0f14;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] #splash-screen {
  background: #f8fafc;
}

[data-theme="light"] .splash-content h1 {
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
}

[data-theme="light"] .splash-content p { color: #475569; }

[data-theme="light"] .header {
  background: rgba(248, 250, 252, 0.85);
}

#splash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.splash-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem;
}

.splash-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent-warm) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  background-size: 200% 200%;
}

.splash-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
}

.splash-button {
  padding: 0.75rem 2.25rem;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid rgba(99,179,237,0.4);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.splash-button:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Back to Top ──────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  z-index: 50;
  transition: all var(--transition);
}

#back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ── Progress Bar ─────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  width: 0%;
  z-index: 10000;
  transition: width 0.1s linear;
}

/* ── Command Palette ──────────────────────────────────────── */
#command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: flex;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

#command-palette-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

#command-palette {
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
  max-height: 480px;
}

#command-palette-overlay:not(.hidden) #command-palette { transform: scale(1); }

.command-palette-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

#command-palette-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text);
  font-family: var(--font-body);
}

#command-palette-results {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

#command-palette-results li {
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

#command-palette-results li:hover,
#command-palette-results li.active {
  background: var(--bg-elevated);
  color: var(--text);
}

#command-palette-results li .result-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 100px;
}

.command-palette-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.command-palette-footer kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ── Error Pages ──────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 4rem 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-content h1 {
  font-size: 6rem;
  color: var(--accent);
  margin: 0;
  line-height: 1;
  opacity: 0.6;
}

.error-content h2 { font-size: 1.5rem; margin: 1rem 0; }
.error-content p { color: var(--text-secondary); margin-bottom: 2rem; }

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* ── Archive ──────────────────────────────────────────────── */
.archive-page { max-width: 700px; margin: 0 auto; padding: 3rem 0; }

.archive-year { margin-bottom: 3rem; }

.archive-year h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.archive-month h3 {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0 0.75rem;
}

.archive-posts { margin-left: 1rem; }

.archive-post {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-post:last-child { border-bottom: none; }
.archive-post a { color: var(--text-secondary); font-size: 0.925rem; flex: 1; }
.archive-post a:hover { color: var(--accent); }

.archive-post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  margin-left: 1rem;
  font-family: var(--font-mono);
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.page-header p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Related Posts ─────────────────────────────────────────── */
.related-posts {
  max-width: 800px;
  margin: 0 auto 3rem;
}

.related-posts h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
}

.related-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.related-card h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Tag Cloud ────────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1rem 0;
}

.tag-cloud-item {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.tag-cloud-item:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ── Post Tags Row (article header) ───────────────────────── */
.post-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag-pill {
  background: var(--bg-elevated);
  color: var(--accent);
  border-radius: 100px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.tag-pill:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.post-category-link {
  color: var(--accent);
  font-weight: 500;
}

.more-tags {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ── Better Post Content ──────────────────────────────────── */
.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content blockquote p { margin-bottom: 0; }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.post-content th,
.post-content td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--text);
}

.post-content td {
  color: var(--text-secondary);
}

.post-content tr:hover td {
  background: rgba(99,179,237,0.04);
}

.post-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="light"] .post-content img {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.25rem;
  }

  .blog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    order: -1;
  }

  .sidebar-avatar, .sidebar-bio { grid-column: 1 / -1; }

  .post, .page { padding: 2rem 1.5rem; margin: 2rem 1rem; }
  .post-header h1 { font-size: 1.75rem; }

  .nav-toggle { display: block; }

  .header-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    transition: right 0.3s ease;
    z-index: 150;
    gap: 0.5rem;
  }

  .header-nav.open { right: 0; }

  .header-nav a {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-overlay.visible {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 600px) {
  .blog-layout { padding: 1.5rem 1rem; }
  .blog-sidebar { grid-template-columns: 1fr; }
  .post-card { padding: 1.25rem 1.5rem; }
  .post-header h2 { font-size: 1.15rem; }
  .header .container { padding: 0.75rem 1rem; }
  .container { padding: 0 1rem; }
  .post, .page { padding: 1.5rem 1.25rem; margin: 1.5rem 0.5rem; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .header, .footer, #back-to-top, .blog-sidebar, .social-share,
  #splash-screen, #command-palette-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .post, .page { border: none; box-shadow: none; max-width: 100%; }
  a { color: #000; text-decoration: underline; }
}

/* ── Accessibility ────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  z-index: 1000;
}
.skip-link:focus { top: 6px; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
