/* ── Recap Design System ──────────────────────────────── */
:root {
  /* Light Theme Colors */
  --bg-primary:   #f8fafc; /* Softer light gray */
  --bg-card:      #ffffff;
  --bg-secondary: #f1f5f9;
  --border:       #e2e8f0;
  --border-hover: #cbd5e1;

  --accent-1: #6366f1; /* Indigo */
  --accent-2: #3b82f6; /* Blue */
  --accent-soft: rgba(99, 102, 241, 0.1);

  --text-primary:   #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted:     #94a3b8; /* Slate 400 */

  --code-bg: #f1f5f9;
  
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark Theme Overrides ─────────────────────────────── */
[data-theme="dark"] {
  --bg-primary:   #020617; /* Deepest Navy */
  --bg-card:      #111a2e; /* Slightly lighter Navy for cards */
  --bg-secondary: #1e293b; /* Slate 800 */
  --border:       #2d3a4f; /* Clearly visible borders */
  --border-hover: #818cf8; /* Accent border on hover */

  --text-primary:   #f8fafc; 
  --text-secondary: #cbd5e1; 
  --text-muted:     #64748b; 

  --accent-1: #818cf8; 
  --accent-2: #60a5fa; 
  --accent-soft: rgba(129, 140, 248, 0.15);
  
  --code-bg: #1e293b;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
}

/* Typography Upgrade: Outfit for Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Theme Toggle ─────────────────────────────────────── */
.theme-toggle-container {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
}

/* ── Icon Buttons (Language + Theme Toggle) ────────────── */
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all var(--transition);
}

.icon-btn:hover {
  color: var(--accent-1) !important;
  border-color: var(--accent-1);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

#theme-toggle {
  font-size: 0;
  padding: 0;
}

[data-theme="light"] .moon { display: none; }
[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .icon-btn { background: var(--bg-card); border-color: var(--border); }

/* ── Page Header (Hero) ────────────────────────────────── */
.hero {
  padding: 3rem 0;
  text-align: center;
}

.hero-logo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 2rem;
  border: 4px solid var(--bg-card);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  background: var(--bg-card);
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.hero h1 span {
  color: var(--text-muted);
  font-weight: 400;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* ── Filter Bar ──────────────────────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
  color: var(--text-primary);
}

.clear-filter {
  color: var(--accent-1);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  background: var(--accent-soft);
  transition: all var(--transition);
}

.clear-filter:hover {
  background: var(--accent-1);
  color: white;
}

/* ── Recap-Style Cards ─────────────────────────────────── */
.feed-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: transform var(--transition);
}

.feed-post:hover {
  border-color: var(--border-hover);
}

.feed-post-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid var(--border);
}

.author-info {
  line-height: 1.2;
}

.author-name {
  font-weight: 700;
  font-size: 1rem;
  display: block;
}

.author-slug {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-meta-top {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Article Content ──────────────────────────────────── */
.article-body {
  padding: 1.5rem 1.75rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-body h1, .article-body h2, .article-body h3 {
  margin: 1.5rem 0 0.75rem;
  line-height: 1.3;
}

.article-body h2 { font-size: 1.5rem; border-bottom: 2px solid #6366f1; width: fit-content; padding-bottom: 2px; margin-bottom: 1rem; }

.article-body p { margin-bottom: 1rem; }

.article-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  display: block;
}

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

/* ── Tags (Recap Pills) ───────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent-1);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.tag:hover { 
  background: var(--accent-1); 
  color: white; 
}
.tag::before { content: '#'; opacity: 0.6; margin-right: 1px; }

/* ── Footer / Share ───────────────────────────────────── */
.feed-post-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-btn-mastodon {
  background: #6366f1;
  color: white !important;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity var(--transition);
}

.share-btn-mastodon:hover { opacity: 0.9; }
.share-btn-mastodon svg { fill: currentColor; }

/* ── Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }
.page-btn.active { background: var(--accent-1); color: white !important; border-color: var(--accent-1); }

/* ── Single View Tweaks ──────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-weight: 600;
  color: var(--accent-1);
  text-decoration: none;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
}

.post-nav-link {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.post-nav-link:hover { border-color: var(--accent-1); }

/* ── Code ─────────────────────────────────────────────── */
pre {
  background: #020617;
  color: #f3f4f6;
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

code {
  font-family: 'JetBrains Mono', monospace;
}

:not(pre) > code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-1);
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  padding: 0 0 4rem;
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}


.footer-mastodon {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}


.footer-mastodon:hover {
  color: var(--accent-1);
}

