/* ==========================================================================
   The More You Wish You Didn't Know (TMYWYDK)
   Modern, Lightweight, Secure CSS Design System
   Zero external CSS frameworks required.
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1a2844;
  --bg-glass: rgba(20, 30, 51, 0.85);
  --border-color: #233554;
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #080c14;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-orange: #fb923c;

  /* Category & Provenance Accents */
  --cat-cyber: #06b6d4;
  --cat-ai: #a855f7;
  --cat-gaming: #f43f5e;
  --cat-it: #3b82f6;
  --cat-misc: #10b981;
  --cat-shitpost: #f59e0b;

  --prov-human: #10b981;
  --prov-ai: #c084fc;

  /* Typography & Layout */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1160px;
  --article-width: 820px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Reading Progress Bar (Fixed Top) */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple), var(--accent-rose));
  z-index: 1000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  contain: layout;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  background: linear-gradient(135deg, #ef4444 0%, #8b5cf6 50%, #06b6d4 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

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

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

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

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* ==========================================================================
   Hero & Filter Section (With Human / AI Toggle)
   ========================================================================== */

.hero-section {
  max-width: var(--max-width);
  margin: 3rem auto 1.75rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.hero-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #f43f5e 0%, #c084fc 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 720px;
  margin: 0 auto 1.75rem auto;
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.filter-bar {
  max-width: var(--max-width);
  margin: 0 auto 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Secondary Filter Controls Bar (Authorship Toggle + Post Count) */
.filter-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.authorship-filter-tabs {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0.25rem;
}

.author-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.author-tab:hover {
  color: var(--text-primary);
}

.author-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.categories-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.cat-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.cat-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.cat-tab.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* ==========================================================================
   Badges: Categories & Authorship Provenance
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-cyber {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cat-cyber);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-ai {
  background: rgba(168, 85, 247, 0.15);
  color: var(--cat-ai);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-gaming {
  background: rgba(244, 63, 94, 0.15);
  color: var(--cat-gaming);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-it {
  background: rgba(59, 130, 246, 0.15);
  color: var(--cat-it);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-misc {
  background: rgba(16, 185, 129, 0.15);
  color: var(--cat-misc);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-shitpost {
  background: rgba(245, 158, 11, 0.15);
  color: var(--cat-shitpost);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Provenance Badges */
.badge-provenance-human {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.badge-provenance-ai {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
  font-weight: 700;
}

/* AI Disclaimer Banner for Articles */
.ai-disclaimer-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  color: #e9d5ff;
}

.ai-disclaimer-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Post Grid & Cards
   ========================================================================== */

.posts-container {
  max-width: var(--max-width);
  margin: 0 auto 3.5rem auto;
  padding: 0 1.5rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  height: 100%;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.post-card-cover {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.post-card-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-item {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

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

/* ==========================================================================
   Article Detail Page & Sticky Table of Contents
   ========================================================================== */

.article-container {
  max-width: var(--article-width);
  margin: 2.5rem auto 4rem auto;
  padding: 0 1.5rem;
}

.article-page-container {
  max-width: var(--max-width);
  margin: 2.5rem auto 4rem auto;
  padding: 0 1.5rem;
}

.article-layout-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .article-layout-grid {
    grid-template-columns: 1fr;
  }
  .sticky-toc-wrapper {
    display: none;
  }
}

.article-main-col {
  max-width: var(--article-width);
  width: 100%;
}

.article-header {
  margin-bottom: 2rem;
}

.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.article-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0 2.5rem 0;
  border: 1px solid var(--border-color);
}

/* Sticky TOC Sidebar */
.sticky-toc-wrapper {
  position: sticky;
  top: 5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.toc-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-link {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: block;
  padding: 0.2rem 0.4rem;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--accent-cyan);
  font-weight: 600;
  border-left-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.toc-link.toc-h3 {
  padding-left: 1rem;
  font-size: 0.78rem;
}

/* Prose Typography */
.prose {
  font-size: 1.075rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  scroll-margin-top: 5.5rem;
}

.prose h1 { font-size: 1.85rem; }
.prose h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }
.prose h3 { font-size: 1.25rem; }

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose blockquote {
  border-left: 4px solid var(--accent-blue);
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.prose pre {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

/* ==========================================================================
   Code Diff Styling
   ========================================================================== */

.diff-block {
  border-left: 3px solid var(--accent-purple);
}

.diff-line {
  display: block;
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
}

.diff-add {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-weight: 500;
}

.diff-del {
  background: rgba(244, 63, 94, 0.18);
  color: #f87171;
  font-weight: 500;
}

.diff-meta {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.08);
}

.article-img {
  border-radius: var(--radius-md);
  margin: 1.75rem auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.code-copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ==========================================================================
   Reader Reactions Section
   ========================================================================== */

.reactions-section {
  margin: 3rem 0 2rem 0;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.reactions-header {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reactions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.reaction-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.reaction-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.reaction-btn.reacted {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.reaction-count {
  font-size: 0.78rem;
  background: var(--bg-card);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Admin Studio & Author Controls
   ========================================================================== */

.admin-wrapper {
  max-width: var(--max-width);
  margin: 2rem auto 4rem auto;
  padding: 0 1.5rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.admin-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
}

.form-textarea {
  min-height: 420px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.preview-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 600px;
}

.authorship-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.authorship-option {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.authorship-option.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.editor-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Upload Dropzone & Toolbar */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.dropzone-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.cover-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.cover-preview-img {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.toolbar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.toolbar-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.uploading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Post Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.data-table th, .data-table td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Modals & Alerts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.88);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  contain: paint layout;
  isolation: isolate;
  will-change: opacity;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  contain: content;
  transform: translateZ(0);
}

.notification-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

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

/* ==========================================================================
   Mobile Responsive System
   ========================================================================== */

@media (min-width: 769px) {
  .nav-label-full {
    display: inline;
  }
  .nav-label-short {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .brand-text {
    display: none;
  }

  .brand-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
  }

  .nav-links {
    gap: 0.35rem;
  }

  .nav-link {
    font-size: 0.82rem;
    padding: 0.3rem 0.45rem;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .hero-section {
    margin: 1.75rem auto 1.25rem auto;
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
  }

  .hero-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
  }

  .filter-bar {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
    gap: 0.85rem;
  }

  .search-input {
    padding: 0.7rem 0.85rem 0.7rem 2.5rem;
    font-size: 0.9rem;
  }

  .search-icon {
    left: 0.85rem;
  }

  .cat-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  .filter-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .authorship-filter-tabs {
    width: 100%;
    display: flex;
  }

  .author-tab {
    flex: 1;
    text-align: center;
    padding: 0.3rem 0.4rem;
    font-size: 0.78rem;
  }

  .posts-container {
    padding: 0 1rem;
    margin-bottom: 2.5rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .post-card-content {
    padding: 1.15rem;
  }

  .post-card-cover {
    height: 170px;
  }

  .article-container,
  .article-page-container {
    padding: 0 1rem;
    margin: 1.5rem auto 3rem auto;
  }

  .article-title {
    font-size: 1.85rem;
    line-height: 1.25;
  }

  .article-cover {
    max-height: 260px;
    margin: 1rem 0 1.5rem 0;
  }

  .prose {
    font-size: 1rem;
    line-height: 1.7;
  }

  .prose h1 { font-size: 1.5rem; }
  .prose h2 { font-size: 1.3rem; }
  .prose h3 { font-size: 1.15rem; }

  .reactions-section {
    padding: 1.25rem 1rem;
  }

  .reaction-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-links {
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .admin-wrapper {
    padding: 0 1rem;
    margin: 1.25rem auto 3rem auto;
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .admin-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
  }

  .admin-tab-btn {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .modal-dialog {
    padding: 1.5rem;
    width: calc(100vw - 2rem);
    max-width: 380px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .hero-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
  }

  .article-title {
    font-size: 1.55rem;
  }

  .site-header .header-container {
    padding: 0.5rem 0.75rem;
  }

  .nav-links {
    gap: 0.2rem;
  }

  .nav-link {
    font-size: 0.76rem;
    padding: 0.25rem 0.35rem;
  }
}
