/* =========================================================
   CHIRPY GHOST THEME — screen.css
   Inspired by Jekyll Chirpy. Dark-first, IT portfolio ready.
   ========================================================= */

/* ---------------------------------------------------------
   0. CSS Custom Properties
   --------------------------------------------------------- */
:root {
  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-bg: #1e2330;
  --sidebar-border: #2a3144;
  --sidebar-text: #a8b2c8;
  --sidebar-text-hover: #e2e8f0;
  --sidebar-active-bg: rgba(74, 144, 226, 0.12);
  --sidebar-active-text: #4a90e2;

  /* Main content */
  --main-bg: #141824;
  --main-bg-alt: #1a1f2e;
  --content-max: 860px;

  /* Text */
  --text-primary: #cdd6f4;
  --text-secondary: #a8b2c8;
  --text-muted: #6b7280;
  --text-heading: #e2e8f0;
  --text-link: #4a90e2;
  --text-link-hover: #74aff0;

  /* Borders & Dividers */
  --border-color: #2a3144;
  --border-subtle: #1e2330;

  /* Accent */
  --accent: #4a90e2;
  --accent-hover: #74aff0;
  --accent-glow: rgba(74, 144, 226, 0.2);

  /* Tags */
  --tag-bg: rgba(74, 144, 226, 0.1);
  --tag-text: #4a90e2;
  --tag-border: rgba(74, 144, 226, 0.25);

  /* Cards */
  --card-bg: #1a1f2e;
  --card-border: #2a3144;
  --card-hover-border: #4a90e2;

  /* Code */
  --code-bg: #0d1117;
  --code-border: #30363d;
  --code-text: #e6edf3;
  --inline-code-bg: rgba(110, 118, 129, 0.15);

  /* Scrollbar */
  --scrollbar-track: #1a1f2e;
  --scrollbar-thumb: #2a3144;
  --scrollbar-thumb-hover: #3d4f6e;

  /* Font */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 300ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(74, 144, 226, 0.15);
}

/* Light Mode */
html:not(.dark) {
  --sidebar-bg: #f8f9fc;
  --sidebar-border: #e2e8f0;
  --sidebar-text: #4a5568;
  --sidebar-text-hover: #1a202c;
  --sidebar-active-bg: rgba(74, 144, 226, 0.08);

  --main-bg: #ffffff;
  --main-bg-alt: #f8f9fc;

  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #9ca3af;
  --text-heading: #1a202c;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --card-bg: #f8f9fc;
  --card-border: #e2e8f0;

  --code-bg: #f6f8fa;
  --code-border: #d0d7de;
  --code-text: #24292f;
  --inline-code-bg: rgba(175, 184, 193, 0.2);

  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-link-hover); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ---------------------------------------------------------
   2. Layout
   --------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition-slow), background-color var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-height: 100%;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--main-bg);
  transition: background-color var(--transition-slow);
}

.page-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-10) var(--space-8);
}

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------
   3. Sidebar Components
   --------------------------------------------------------- */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.sidebar-title-link:hover .sidebar-title {
  color: var(--accent);
}

.sidebar-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Nav */
.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.sidebar-nav li a svg { flex-shrink: 0; opacity: 0.8; }

.sidebar-nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: var(--space-3) 0;
}

.sidebar-nav ul + ul { margin-top: 0; }
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.sidebar-tags {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tag-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.83rem;
  transition: color var(--transition), background var(--transition);
}

.tag-link:hover { color: var(--accent); background: var(--sidebar-active-bg); }
.tag-hash { color: var(--accent); margin-right: 4px; opacity: 0.7; }
.tag-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--border-color);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Social */
.sidebar-social {
  display: flex;
  gap: var(--space-2);
}

.sidebar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  background: var(--main-bg-alt);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

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

/* Footer & theme toggle */
.sidebar-footer { margin-top: auto; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  background: var(--main-bg-alt);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Show/hide sun/moon icons */
html.dark .icon-sun { display: none; }
html.dark .icon-moon { display: block; }
html:not(.dark) .icon-sun { display: block; }
html:not(.dark) .icon-moon { display: none; }

.mobile-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-heading);
}

.sidebar-toggle {
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  padding: var(--space-2);
}

/* ---------------------------------------------------------
   4. Breadcrumb
   --------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }

/* ---------------------------------------------------------
   5. Page Header
   --------------------------------------------------------- */
.page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------
   6. Post Cards
   --------------------------------------------------------- */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
  position: relative;
}

.post-card:first-child { border-top: 1px solid var(--border-color); }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.post-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tag-text);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.post-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text-heading);
  transition: color var(--transition);
}

.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.author-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.post-reading-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------
   7. Pagination
   --------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  transition: all var(--transition);
}

.pagination-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------
   8. Post Article
   --------------------------------------------------------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--space-12);
  align-items: start;
  position: relative;
}

.post-header {
  margin-bottom: var(--space-8);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.post-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: var(--space-4);
}

.post-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-5);
  font-style: italic;
}

.post-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.post-meta-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-meta-author-info .author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.author-bio-short {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-meta-details {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.post-meta-sep { opacity: 0.4; }

.post-updated { font-style: italic; }

/* Feature image */
.post-feature-image {
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.post-feature-image img {
  width: 100%;
  object-fit: cover;
}

.post-feature-image figcaption {
  padding: var(--space-3) var(--space-4);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--card-bg);
  font-style: italic;
}

/* ---------------------------------------------------------
   9. Post Content (gh-content)
   --------------------------------------------------------- */
.gh-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 2em 0 0.75em;
  scroll-margin-top: 80px;
}

.gh-content h1 { font-size: 1.75rem; }
.gh-content h2 { font-size: 1.45rem; padding-bottom: 0.4em; border-bottom: 1px solid var(--border-color); }
.gh-content h3 { font-size: 1.2rem; }
.gh-content h4 { font-size: 1.05rem; }

.gh-content p { margin: 0 0 1.4em; }

.gh-content a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-color: var(--accent-glow);
  text-underline-offset: 3px;
  transition: all var(--transition);
}

.gh-content a:hover {
  color: var(--text-link-hover);
  text-decoration-color: var(--accent);
}

.gh-content ul,
.gh-content ol {
  margin: 0 0 1.4em 1.5rem;
  list-style: revert;
}

.gh-content li { margin-bottom: 0.4em; }

.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-6);
  margin: 1.8em 0;
  background: var(--accent-glow);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

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

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--inline-code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: #e06c75;
}

.gh-content pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  margin: 1.8em 0;
  position: relative;
}

.gh-content pre code {
  background: none;
  padding: 0;
  color: var(--code-text);
  font-size: 0.875rem;
  line-height: 1.7;
}

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

.gh-content th {
  background: var(--card-bg);
  color: var(--text-heading);
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
}

.gh-content td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.gh-content tr:hover td { background: var(--card-bg); }

.gh-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 1.8em auto;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5em 0;
}

.gh-content figure { margin: 1.8em 0; }
.gh-content figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-style: italic;
}

/* ---------------------------------------------------------
   10. Table of Contents
   --------------------------------------------------------- */
.post-toc {
  position: sticky;
  top: var(--space-8);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.toc-inner {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

#toc-content a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 3px 0 3px 12px;
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: all var(--transition);
}

#toc-content a:hover,
#toc-content a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

#toc-content .toc-h3 { padding-left: 24px; }
#toc-content .toc-h4 { padding-left: 36px; }

/* ---------------------------------------------------------
   11. Post Footer
   --------------------------------------------------------- */
.post-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.post-footer-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-tags-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: var(--space-1);
}

.post-share {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.share-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ---------------------------------------------------------
   12. Related Posts
   --------------------------------------------------------- */
.related-posts {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-color);
}

.related-posts-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-6);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.post-card--sm {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.post-card--sm:hover {
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-glow);
}

.post-card--sm .post-card-title {
  font-size: 0.95rem;
  margin: var(--space-2) 0;
}

.post-card--sm .post-card-excerpt {
  font-size: 0.82rem;
}

/* ---------------------------------------------------------
   13. Error Page
   --------------------------------------------------------- */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-content {
  text-align: center;
  max-width: 480px;
}

.error-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-4);
}

.error-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

/* ---------------------------------------------------------
   14. Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* ---------------------------------------------------------
   15. Ghost Specific Overrides
   --------------------------------------------------------- */
.kg-width-wide,
.kg-width-full { margin-left: 0; margin-right: 0; }

.kg-image-card,
.kg-gallery-card { margin: 1.8em 0; }

.kg-gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
}

.kg-gallery-image img { border-radius: var(--radius-md); }

.kg-bookmark-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.8em 0;
  background: var(--card-bg);
  display: flex;
  transition: border-color var(--transition);
}

.kg-bookmark-card:hover { border-color: var(--accent); }

.kg-bookmark-content {
  padding: var(--space-4);
  flex: 1;
}

.kg-bookmark-title { font-weight: 600; color: var(--text-heading); }
.kg-bookmark-description { font-size: 0.85rem; color: var(--text-muted); margin-top: var(--space-1); }
.kg-bookmark-metadata { font-size: 0.78rem; color: var(--text-muted); margin-top: var(--space-3); }

.kg-callout-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  margin: 1.8em 0;
}

/* ---------------------------------------------------------
   16. Responsive — Tablet
   --------------------------------------------------------- */
@media (max-width: 1100px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-toc {
    display: none;
  }
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------------------------------------------------
   17. Responsive — Mobile
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay.is-open {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }

  .page-wrapper {
    padding: var(--space-6) var(--space-5);
  }

  .post-title { font-size: 1.5rem; }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .post-meta {
    flex-direction: column;
    gap: var(--space-3);
  }

  .pagination {
    flex-direction: column;
    gap: var(--space-4);
  }
}

@media (max-width: 480px) {
  .post-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ---------------------------------------------------------
   18. Animations
   --------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-wrapper {
  animation: fadeIn 0.25s ease forwards;
}

/* ---------------------------------------------------------
   20. Private Page
   --------------------------------------------------------- */
.private-template {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--main-bg);
}

.private-container {
  max-width: 400px;
  width: 100%;
  padding: var(--space-10) var(--space-6);
  text-align: center;
}

.private-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-6);
}

.private-site-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-heading);
  margin-bottom: var(--space-6);
}

.private-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-heading);
  margin-bottom: var(--space-2);
}

.private-description {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.private-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.private-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.private-input:focus {
  outline: none;
  border-color: var(--accent);
}

.private-error {
  color: #f87171;
  font-size: 0.85rem;
}

/* ---------------------------------------------------------
   21. Print
   --------------------------------------------------------- */
.author-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}

.author-header-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  flex-shrink: 0;
}

.author-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: var(--space-2);
}

.author-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.page-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: var(--space-3);
}

/* ---------------------------------------------------------
   20. Print
   --------------------------------------------------------- */
@media print {
  .sidebar, .mobile-header, .post-toc, .post-share, .related-posts { display: none; }
  .main-content { margin-left: 0; }
  body { color: #000; background: #fff; }
}
