/* ============================================================
   Blog Site — Design System & Styles
   Premium dark-mode with glassmorphism, gradients, micro-animations
   ============================================================ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Surfaces */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --bg-toolbar: rgba(20, 20, 30, 0.92);
  --bg-input: rgba(255, 255, 255, 0.05);

  /* Text */
  --text-primary: #e8e8ef;
  --text-secondary: #8b8b9e;
  --text-muted: #55556a;
  --text-link: #7c8aff;

  /* Accents */
  --accent-1: #7c5cfc;          /* violet */
  --accent-2: #00d4ff;          /* cyan */
  --accent-3: #ff6bcb;          /* magenta */
  --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-warm: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  --gradient-text: linear-gradient(135deg, #a78bfa, #67e8f9, #f0abfc);

  /* Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(124, 92, 252, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(124, 92, 252, 0.15);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.18s var(--ease-out);
  --transition-medium: 0.35s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(124, 92, 252, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

a:hover {
  color: var(--accent-2);
}

img, video, iframe {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

/* ── Utility Classes ── */
.hidden { display: none !important; }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 92, 252, 0.45);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(10px);
}

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

.btn-danger {
  background: rgba(255, 70, 70, 0.12);
  color: #ff6b6b;
  border: 1px solid rgba(255, 70, 70, 0.15);
}

.btn-danger:hover {
  background: rgba(255, 70, 70, 0.2);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* ── Auth Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s var(--ease-out);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s var(--ease-out);
}

.modal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 24px;
}

.modal-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: all var(--transition-fast);
}

.modal-tab.active {
  background: var(--accent-1);
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
}

.form-error {
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-top: 8px;
  min-height: 1.2em;
}

/* ── Home View: Post Grid ── */
.view-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px;
}

.home-header {
  text-align: center;
  margin-bottom: 48px;
}

.home-header h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  line-height: 1.15;
}

.home-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

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

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-medium);
  position: relative;
}

.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.post-card-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}

.post-card-cover-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.15), rgba(0, 212, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.6;
}

.post-card-body {
  padding: 24px;
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Editor View ── */
.editor-container {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px;
}

.editor-title-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 8px;
  padding: 8px 0;
}

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

.cover-image-section {
  margin-bottom: 24px;
}

.cover-image-preview {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.cover-image-actions {
  display: flex;
  gap: 8px;
}

/* ── Toolbar ── */
.toolbar {
  position: sticky;
  top: 60px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-toolbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
  margin: 0 6px;
}

.toolbar-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.toolbar-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-1);
}

.toolbar-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  color: var(--text-secondary);
}

.toolbar-btn:hover[title]::after {
  opacity: 1;
}

.toolbar-select {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.toolbar-color-input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 0;
}

/* ── Content Editable Area ── */
.editor-content {
  min-height: 400px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.editor-content:focus {
  border-color: var(--border-accent);
}

/* Content styling inside editor */
.editor-content h1 { font-size: 2rem; font-weight: 800; margin: 24px 0 12px; letter-spacing: -0.5px; }
.editor-content h2 { font-size: 1.5rem; font-weight: 700; margin: 20px 0 10px; letter-spacing: -0.3px; }
.editor-content h3 { font-size: 1.2rem; font-weight: 600; margin: 16px 0 8px; }
.editor-content p { margin-bottom: 12px; }
.editor-content blockquote {
  border-left: 3px solid var(--accent-1);
  padding: 12px 20px;
  margin: 16px 0;
  background: rgba(124, 92, 252, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.editor-content pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 16px 0;
}
.editor-content code {
  background: rgba(124, 92, 252, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
}
.editor-content ul, .editor-content ol {
  margin: 12px 0;
  padding-left: 28px;
}
.editor-content li { margin-bottom: 6px; }
.editor-content a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.editor-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.editor-content .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.editor-content .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ── Post Detail View ── */
.post-detail {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 32px;
}

.post-detail-header {
  margin-bottom: 32px;
}

.post-detail-title {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-detail-cover {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 36px;
}

.post-detail-content {
  font-size: 1.05rem;
  line-height: 1.9;
}

/* Re-use editor content styles for rendered post */
.post-detail-content h1 { font-size: 2rem; font-weight: 800; margin: 28px 0 14px; }
.post-detail-content h2 { font-size: 1.5rem; font-weight: 700; margin: 24px 0 12px; }
.post-detail-content h3 { font-size: 1.2rem; font-weight: 600; margin: 20px 0 10px; }
.post-detail-content blockquote {
  border-left: 3px solid var(--accent-1);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(124, 92, 252, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.post-detail-content pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.88rem;
  margin: 20px 0;
}
.post-detail-content code {
  background: rgba(124, 92, 252, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.post-detail-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}
.post-detail-content .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}
.post-detail-content .video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.post-detail-content a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-detail-content ul, .post-detail-content ol {
  margin: 16px 0;
  padding-left: 28px;
}

.post-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Search & Filter Styles ── */
.search-filter-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.12);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.tag-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.tag-pill.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.2);
}

/* ── Reactions & Views Styles ── */
.post-reactions-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.views-count-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.emojis-reaction-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emoji-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.emoji-reaction-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-accent);
  transform: scale(1.08);
}

.emoji-reaction-btn:active {
  transform: scale(0.95);
}

.emoji-reaction-btn.active {
  background: rgba(124, 92, 252, 0.15);
  color: var(--text-primary);
  border-color: var(--accent-1);
  box-shadow: 0 0 10px rgba(124, 92, 252, 0.2);
}

.emoji-reaction-btn .emoji-icon {
  font-size: 1.1rem;
}

.emoji-reaction-btn .emoji-count {
  font-size: 0.8rem;
  font-weight: 600;
}

.post-card-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.post-card-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  animation: slideInRight 0.35s var(--ease-out);
  min-width: 280px;
}

.toast.success { border-left: 3px solid #34d399; }
.toast.error { border-left: 3px solid #ff6b6b; }
.toast.info { border-left: 3px solid var(--accent-2); }

/* ── Loading Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.fade-in {
  animation: fadeIn 0.4s var(--ease-out);
}

.slide-up {
  animation: slideUp 0.45s var(--ease-out);
}

/* ── Editor Placeholder ── */
.editor-content[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  position: absolute;
  font-style: italic;
}

.editor-content {
  position: relative;
}

/* ── Button States ── */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar {
    padding: 14px 18px;
  }

  .view-container, .editor-container, .post-detail {
    padding: 24px 16px;
  }

  .home-header h1 {
    font-size: 2rem;
  }

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

  .editor-title-input {
    font-size: 1.8rem;
  }

  .post-detail-title {
    font-size: 2rem;
  }

  .toolbar {
    gap: 2px;
    padding: 8px 10px;
  }

  .toolbar-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .modal {
    padding: 28px 24px;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .home-header h1 {
    font-size: 1.6rem;
  }

  .posts-grid {
    gap: 16px;
  }

  .post-card-body {
    padding: 18px;
  }
}
