/*
 * Edge CMS — Shared Stylesheet
 *
 * Single stylesheet for reader and admin pages.
 * Extracted from HTML mockups: reader, reader-post,
 * admin-dashboard, admin-editor.
 */

/* === Variables === */
:root {
  --bg: #f5f0e8;
  --bg-card: #fffdf9;
  --bg-admin: #f0ede8;
  --text: #2a2520;
  --text-muted: #7a7068;
  --text-light: #a89e94;
  --accent: #1b6b52;
  --accent-hover: #14503e;
  --accent-light: #e8f3ef;
  --terracotta: #c4593a;
  --terracotta-light: #fdf0ec;
  --gold: #b8a47e;
  --gold-light: #f5f0e5;
  --border: #e5ddd3;
  --border-light: #ede7de;
  --shadow: rgba(42, 37, 32, 0.06);
  --shadow-md: rgba(42, 37, 32, 0.1);
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1180px;
  --header-height: 72px;
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* === Typography === */
/* Base body typography is in Reset above.
   Post body typography is in "Post Body" section below.
   Preview pane typography is in "Admin: Split Pane Editor" section. */

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(245, 240, 232, 0.92);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 36;
}

.site-title span {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

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

.header-nav .nav-rss {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-nav .nav-rss svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* === Main Layout === */
.main-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3.5rem;
  align-items: start;
}

/* Article container (single post) */
.article-container {
  min-width: 0; /* prevent grid overflow past sidebar */
  animation: fadeUp 0.5s ease 0.1s both;
}

/* Featured image (single post) */
.article-featured-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.article-featured-image img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

/* Post header (single post) */
.article-header {
  margin-bottom: 2.5rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 36;
  color: var(--text);
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 1rem;
}

.article-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-light);
  flex-shrink: 0;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* === Post Cards === */
.posts-feed { display: flex; flex-direction: column; gap: 2rem; min-width: 0; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeUp 0.5s ease both;
}

.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.16s; }
.post-card:nth-child(4) { animation-delay: 0.24s; }

.post-card:hover {
  box-shadow: 0 8px 30px var(--shadow), 0 2px 8px var(--shadow);
  transform: translateY(-2px);
}

.post-card-featured {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.post-card-featured img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

.post-card-body {
  padding: 1.75rem 2rem 2rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.post-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-light);
  flex-shrink: 0;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 28;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s;
  flex-shrink: 0;
}

.read-more:hover { gap: 0.6rem; }

.read-more svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Sidebar === */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  animation: fadeUp 0.5s ease 0.1s both;
}

.sidebar-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
}

.sidebar-heading {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  font-variation-settings: 'opsz' 14;
}

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

.sidebar-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

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

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

.sidebar-links li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-links li:last-child { border-bottom: none; }

.sidebar-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.sidebar-links a:hover { color: var(--accent); }

.sidebar-links svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.5;
}

/* === Edge Badge === */
.edge-badge {
  background: linear-gradient(135deg, var(--accent), #247a63);
  color: white;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  font-size: 0.78rem;
  line-height: 1.5;
  border: none;
}

.edge-badge-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edge-badge-title svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.edge-badge p {
  opacity: 0.85;
}

.edge-badge-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.edge-stat {
  display: flex;
  flex-direction: column;
}

.edge-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.edge-stat-label {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.footer-edge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

.footer-edge .pop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pagination a, .pagination span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: white;
}

.pagination .prev, .pagination .next {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

/* === Tags === */
.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.2s;
}

.tag-accent {
  background: var(--accent-light);
  color: var(--accent);
}

.tag-accent:hover {
  background: var(--accent);
  color: white;
}

.tag-terracotta {
  background: var(--terracotta-light);
  color: var(--terracotta);
}

.tag-terracotta:hover {
  background: var(--terracotta);
  color: white;
}

.tag-gold {
  background: var(--gold-light);
  color: #8a7650;
}

.tag-gold:hover {
  background: var(--gold);
  color: white;
}

/* === Post Body (single post) === */
.article-body {
  max-width: 680px;
  font-size: 1.075rem;
  line-height: 1.8;
  color: var(--text);
}

.article-body > * + * {
  margin-top: 1.5rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 28;
  color: var(--text);
  margin-top: 2.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 22;
  color: var(--text);
  margin-top: 2.25rem;
}

.article-body p {
  color: var(--text);
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-body a:hover {
  border-bottom-color: var(--accent);
}

.article-body strong {
  font-weight: 700;
  color: var(--text);
}

.article-body em {
  font-style: italic;
}

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin-left: 0;
  margin-right: 0;
  background: var(--accent-light);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body blockquote p {
  color: var(--text-muted);
  margin-top: 0;
}

/* Lists */
.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
}

.article-body ul {
  list-style: none;
  padding-left: 1.25rem;
}

.article-body ul li {
  position: relative;
  padding-left: 0.75rem;
  margin-bottom: 0.4rem;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: -0.25rem;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.article-body ol {
  padding-left: 1.5rem;
}

.article-body ol li {
  margin-bottom: 0.4rem;
  padding-left: 0.35rem;
}

.article-body ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

/* Images in body */
.article-body figure {
  margin: 2rem 0;
}

.article-body figure img,
.article-body picture img,
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.article-body picture {
  display: block;
  max-width: 100%;
}

.article-body figure img {
  width: 100%;
}

.article-body figcaption {
  font-size: 0.82rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.6rem;
  font-style: italic;
}

/* Horizontal rule */
.article-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

/* === Code Blocks === */
.article-body pre {
  background: #2a2520;
  color: #e8e0d6;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-top: 1.5rem;
  border: 1px solid #3a352f;
}

.article-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* Syntax highlighting tokens */
.token-keyword { color: #c4593a; }
.token-string { color: #b8a47e; }
.token-comment { color: #7a7068; font-style: italic; }
.token-function { color: #6bb89c; }
.token-type { color: #d4a56a; }
.token-macro { color: #9b8ec4; }
.token-punct { color: #a89e94; }
.token-lifetime { color: #c4593a; }
.token-attr { color: #6bb89c; }
.token-number { color: #d4a56a; }

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gold-light);
  color: var(--text);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* === Share Buttons === */
.article-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-share-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

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

.share-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.share-btn .copied-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.share-btn .copied-tooltip.visible {
  opacity: 1;
}

.share-btn .copied-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
}

/* === Post Navigation (prev/next) === */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  text-decoration: none;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--shadow);
}

.post-nav-item--next {
  text-align: right;
}

.post-nav-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.post-nav-item--next .post-nav-label {
  justify-content: flex-end;
}

.post-nav-label svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.post-nav-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  font-variation-settings: 'opsz' 20;
  transition: color 0.2s;
}

.post-nav-item:hover .post-nav-title {
  color: var(--accent);
}

/* === Error Pages === */
/* Reserved for 404/500 error page styling */

/* === Login Page === */
/* Reserved for admin login page styling */

/* === Admin: Top Bar === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2a2520;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  animation: fadeDown 0.4s ease both;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 36;
}

.topbar-logo span { color: var(--accent); }

.topbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
}

.topbar-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-link:hover { color: #fff; }

.topbar-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-logout {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Editor-specific top bar overrides */
.topbar-label--editor {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(184, 164, 126, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.btn-logout {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #e5ddd3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* === Admin: Stats Cards === */
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  animation: fadeUp 0.5s ease both;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  animation: fadeUp 0.5s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 36;
}

.stat-card-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.stat-card-icon {
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-icon-total { background: var(--accent-light); }
.stat-icon-total svg { stroke: var(--accent); }

.stat-icon-published { background: #e8f3ef; }
.stat-icon-published svg { stroke: #1b6b52; }

.stat-icon-drafts { background: var(--gold-light); }
.stat-icon-drafts svg { stroke: #8a7650; }

.stat-icon-images { background: var(--terracotta-light); }
.stat-icon-images svg { stroke: var(--terracotta); }

/* === Admin: Action Bar === */
.action-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  animation: fadeUp 0.5s ease 0.2s both;
}

.btn-new-post {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(27, 107, 82, 0.25);
}

.btn-new-post:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(27, 107, 82, 0.35);
  transform: translateY(-1px);
}

.btn-new-post svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a89e94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 82, 0.08);
}

.filter-select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a89e94' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.7rem) center;
  transition: border-color 0.2s;
}

.filter-select:focus {
  border-color: var(--accent);
}

/* Shared button system (editor action bar) */
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27, 107, 82, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(27, 107, 82, 0.35);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: #ddd6cc;
}

.btn-danger {
  background: transparent;
  color: var(--terracotta);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: var(--terracotta-light);
  border-color: rgba(196, 89, 58, 0.15);
}

/* Editor-specific action bar layout */
.action-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-bar-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-bar-meta .save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

/* === Admin: Posts Table === */
.posts-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  animation: fadeUp 0.5s ease 0.25s both;
}

.posts-table-scroll {
  overflow-x: auto;
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.posts-table thead {
  background: rgba(42, 37, 32, 0.03);
}

.posts-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.85rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.posts-table th.sortable {
  cursor: pointer;
  transition: color 0.2s;
}

.posts-table th.sortable:hover {
  color: var(--accent);
}

.posts-table th .sort-icon {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.4;
  font-size: 0.65rem;
  vertical-align: middle;
  transition: opacity 0.2s;
}

.posts-table th.sort-active .sort-icon {
  opacity: 1;
  color: var(--accent);
}

.posts-table td {
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.posts-table tbody tr {
  transition: background 0.15s;
}

.posts-table tbody tr:nth-child(even) {
  background: rgba(42, 37, 32, 0.015);
}

.posts-table tbody tr:hover {
  background: rgba(27, 107, 82, 0.04);
}

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

/* Post title in table */
.post-title-cell {
  font-weight: 600;
  color: var(--text);
}

.post-title-cell a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-published {
  background: var(--accent);
  color: #fff;
}

.status-draft {
  background: var(--gold);
  color: var(--text);
}

/* Date column */
.date-cell {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Tags in table */
.table-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.table-tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  background: var(--border-light);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Action icons */
.action-icons {
  display: flex;
  gap: 0.25rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
}

.action-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-btn-edit:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.action-btn-delete:hover {
  background: var(--terracotta-light);
  color: var(--terracotta);
}

/* Table footer */
.table-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Empty state */
.empty-state {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-variation-settings: 'opsz' 24;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
}

/* === Admin: Editor Metadata === */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  animation: fadeUp 0.4s ease 0.2s both;
}

.metadata {
  background: #faf8f5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(42, 37, 32, 0.06);
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.75rem;
}

.field { display: flex; flex-direction: column; }

.field-full { grid-column: 1 / -1; }

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  color-scheme: light;
  background-color: #ffffff;
  border: 1px solid #ddd6cc;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 82, 0.1);
}

.field-title input {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 36;
  padding: 0.5rem 0.85rem;
  border-color: transparent;
  background: transparent;
}

.field-title input:focus {
  border-color: var(--accent);
  background: #ffffff;
}

.field-title input::placeholder {
  color: var(--text-light);
}

.slug-input-group {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #ddd6cc;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.slug-input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 82, 0.1);
}

.slug-prefix {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 0.6rem 0 0.6rem 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.field-slug .slug-input-group input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0.6rem 0.85rem 0.6rem 0;
  flex: 1;
  min-width: 0;
  outline: none;
}

.field-slug .slug-input-group input:focus {
  box-shadow: none;
}

.field textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.6;
}

.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7068' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Tags input (editor) */
.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #ddd6cc;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 42px;
  align-items: center;
}

.tags-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 82, 0.1);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent);
  animation: fadeIn 0.15s ease;
  user-select: none;
}

.tag-pill:nth-child(3n+2) {
  background: var(--terracotta-light);
  color: var(--terracotta);
}

.tag-pill:nth-child(3n) {
  background: var(--gold-light);
  color: #8a7650;
}

.tag-pill-remove {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 1;
  transition: all 0.15s;
  opacity: 0.6;
}

.tag-pill-remove:hover {
  opacity: 1;
  background: rgba(0,0,0,0.08);
}

.tags-input {
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: transparent;
  color: var(--text);
  flex: 1;
  min-width: 80px;
  padding: 0.2rem 0;
}

.tags-input::placeholder { color: var(--text-light); }

/* === Admin: Split Pane Editor === */
.editor-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  background: #faf8f5;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.editor-tab {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.editor-tab.active {
  color: var(--text);
}

.editor-tab svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-tab-spacer { flex: 1; }

.editor-tab-info {
  font-size: 0.72rem;
  color: var(--text-light);
  padding-right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-tab-info .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.editor-panes {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  min-height: 520px;
  box-shadow: 0 4px 12px rgba(42, 37, 32, 0.08);
}

/* Markdown editor pane */
.editor-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #1e1c19;
}

.editor-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-pane-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a89e94;
}

.editor-pane-lang {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: rgba(168, 158, 148, 0.5);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.editor-textarea-wrapper {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.editor-line-numbers {
  width: 44px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: #3a3630;
  user-select: none;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.editor-line-numbers div {
  padding-right: 0.75rem;
}

.editor-textarea {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #e0dcd5;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 1rem 1.25rem;
  tab-size: 2;
  white-space: pre;
  overflow-y: auto;
  overflow-x: auto;
}

.editor-textarea::placeholder {
  color: rgba(168, 158, 148, 0.3);
}

/* Custom scrollbar for editor */
.editor-textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.editor-textarea::-webkit-scrollbar-track {
  background: transparent;
}
.editor-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.editor-textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Pane divider */
.pane-divider {
  background: var(--border);
  cursor: col-resize;
  position: relative;
  transition: background 0.2s;
}

.pane-divider:hover,
.pane-divider.active {
  background: var(--accent);
}

.pane-divider::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 9px;
  margin-left: -4px;
  cursor: col-resize;
}

/* Preview pane */
.preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.preview-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #faf8f5;
  border-bottom: 1px solid var(--border);
}

.preview-pane-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

.preview-pane-badge {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.25rem;
}

/* Preview content typography (mirrors reader) */
.preview-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
  font-variation-settings: 'opsz' 36;
}

.preview-content h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-variation-settings: 'opsz' 28;
}

.preview-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.preview-content p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.preview-content strong {
  color: var(--text);
  font-weight: 600;
}

.preview-content em {
  font-style: italic;
}

.preview-content code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(27, 107, 82, 0.08);
  color: var(--accent);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.preview-content pre {
  background: #1e1c19;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-content pre code {
  background: none;
  color: #e0dcd5;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.7;
}

.preview-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.preview-content ul li {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.preview-content ul li::marker {
  color: var(--accent);
}

.preview-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--border);
}

/* Custom scrollbar for preview */
.preview-content::-webkit-scrollbar {
  width: 8px;
}
.preview-content::-webkit-scrollbar-track {
  background: transparent;
}
.preview-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* === Admin: Image Upload === */
.image-upload-zone {
  border: 2px dashed #ddd6cc;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
  min-height: 100px;
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.image-upload-zone.dragover {
  transform: scale(1.01);
}

.image-upload-icon {
  width: 36px;
  height: 36px;
  color: var(--text-light);
  transition: color 0.2s;
}

.image-upload-zone:hover .image-upload-icon,
.image-upload-zone.dragover .image-upload-icon {
  color: var(--accent);
}

.image-upload-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.image-upload-text strong {
  color: var(--accent);
}

.image-upload-hint {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* === Admin: Sidebar Editor === */
.bottom-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  animation: fadeUp 0.5s ease 0.3s both;
}

.sidebar-manager {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
}

.sidebar-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.sidebar-manager-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variation-settings: 'opsz' 20;
}

.btn-manage-sidebar {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-manage-sidebar svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-manage-sidebar:hover {
  background: var(--accent);
  color: #fff;
}

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

.sidebar-preview-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sidebar-preview-item:last-child { border-bottom: none; }

.sidebar-preview-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-preview-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-preview-icon-cat {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-preview-icon-link {
  background: var(--gold-light);
  color: #8a7650;
}

.sidebar-preview-label {
  font-weight: 500;
  color: var(--text);
}

.sidebar-preview-detail {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: auto;
  white-space: nowrap;
}

/* Edge info card (dashboard) */
.edge-info-card {
  background: linear-gradient(135deg, #2a2520 0%, #3a342e 100%);
  border-radius: 8px;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.edge-info-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-variation-settings: 'opsz' 20;
}

.edge-info-card-title svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.edge-info-card p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
}

.edge-info-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.edge-info-stat {
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.65rem 0.5rem;
}

.edge-info-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.edge-info-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.1rem;
}

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

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Responsive === */

/* Reader responsive */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 1.5rem 1.25rem 3rem;
  }

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

  .edge-badge { grid-column: 1 / -1; }

  .post-card-title { font-size: 1.35rem; }
  .post-card-body { padding: 1.25rem 1.5rem 1.5rem; }

  /* Single post responsive */
  .article-title { font-size: 1.8rem; }
  .article-featured-image img { height: 260px; }
  .post-nav { grid-template-columns: 1fr; }
}

/* Admin dashboard responsive */
@media (max-width: 900px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom-section {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 1.5rem 1.25rem 3rem;
  }
}

/* Admin editor responsive */
@media (max-width: 900px) {
  .page-content {
    padding: 1rem;
  }

  .metadata {
    padding: 1.25rem 1.25rem;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .editor-panes {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .pane-divider {
    height: 1px;
    cursor: row-resize;
  }

  .pane-divider::after {
    width: 100%;
    height: 9px;
    margin-left: 0;
    margin-top: -4px;
  }

  .editor-pane { min-height: 350px; }
  .preview-pane { min-height: 350px; }

  .editor-line-numbers { width: 36px; }

  .field-title input {
    font-size: 1.2rem;
  }
}

@media (max-width: 640px) {
  .stats-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem 1.25rem;
  }

  .stat-card-value {
    font-size: 1.6rem;
  }

  .stat-card-icon {
    width: 30px;
    height: 30px;
  }

  .stat-card-icon svg {
    width: 14px;
    height: 14px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-new-post {
    justify-content: center;
  }

  .search-input {
    min-width: unset;
  }

  .topbar {
    padding: 0 1rem;
  }

  .topbar-label { display: none; }
  .topbar-divider { display: none; }
}

@media (max-width: 600px) {
  .header-nav { gap: 1rem; }
  .sidebar { grid-template-columns: 1fr; }
  .post-card-featured img { height: 180px; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }

  /* Single post responsive */
  .article-featured-image img { height: 200px; }
  .article-title { font-size: 1.55rem; }
  .article-share { flex-wrap: wrap; }

  /* Editor responsive */
  .topbar-label { display: none; }
  .editor-tab-info { display: none; }

  .preview-content {
    padding: 1.25rem;
  }

  /* Editor action bar responsive */
  .action-bar-left,
  .action-bar-right {
    justify-content: center;
  }
}
