:root {
  --bg: #fafafa;
  --text-main: #292929;
  --text-muted: #6b6b6b;
  --accent: #1a8917;
  --border: #e6e6e6;
  --surface: #ffffff;
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-mono: 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --text-main: #e8e8e8;
  --text-muted: #a3a3a3;
  --accent: #D97706;
  --border: #333333;
  --surface: #121212;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --text-main: #e8e8e8;
    --text-muted: #a3a3a3;
    --accent: #D97706;
    --border: #333333;
    --surface: #121212;
  }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 4px;
}

.skeleton-title { height: 28px; width: 70%; margin-bottom: 12px; }
.skeleton-text { height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton-meta { height: 14px; width: 40%; margin-bottom: 16px; }

.skeleton-post {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 2rem;
}

html.init-edit-mode header,
html.init-edit-mode .layout {
  opacity: 0 !important;
  pointer-events: none !important;
}

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

body {
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 1.5rem;
  transition: color 0.2s;
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--text-main);
}

/* Layout */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 20px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  align-items: start;
}

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

  .sidebar {
    position: static !important;
  }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.search-box {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

.search-box:focus {
  border-color: var(--accent);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.pill:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

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

/* Main Feed */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.goals-section {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 650px;
}

.goals-section strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Featured Post */
.featured-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s;
  display: none;
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
}
.featured-content {
  flex: 1;
  padding: 2.5rem;
}
@media (max-width: 600px) {
  .featured-content {
    padding: 1.5rem;
  }
}

.featured-post:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.featured-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.featured-post .post-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Post Feed */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.feed-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.post-preview {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
  cursor: pointer;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  overflow: hidden;
}

.post-preview-content {
  flex: 1;
  padding: 1.5rem;
}

.post-preview:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-4px);
}

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

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

.meta-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.1);
  color: var(--text-main);
}

.meta-tag.difficulty-Beginner {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.meta-tag.difficulty-Intermediate {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.meta-tag.difficulty-Advanced {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.meta-tag.draft {
  color: #f59e0b;
  border: 1px dashed #f59e0b;
  background: transparent;
}

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  transition: color 0.2s;
}

.post-excerpt {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Editor Modal (Hidden by default) */
.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn:hover {
  border-color: var(--text-muted);
}

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

.btn-primary:hover {
  background: #146c12;
  border-color: #146c12;
  color: #fff;
}

.btn-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

#confirmModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#confirmModal.active {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  text-align: center;
  border-radius: 12px;
  padding: 2rem;
}

#editorModal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

#editorModal.active {
  display: block;
}

.editor-topbar {
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.editor-tools {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.word-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.post-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 20px 8rem;
}

@media (min-width: 1024px) {
  .post-layout::after {
    content: '';
    width: 220px;
    flex-shrink: 0;
    display: block;
  }
}

.sidebar-toc {
  position: sticky;
  top: 100px;
  width: 220px;
  flex-shrink: 0;
  display: none;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 1rem;
}

/* Custom minimal scrollbar for TOC */
.sidebar-toc::-webkit-scrollbar {
  width: 3px;
}
.sidebar-toc::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 3px;
}

@media (min-width: 1024px) {
  .sidebar-toc {
    display: block;
  }
}

.toc-header {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0 0 0 10px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 1px solid var(--border);
}

.toc-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: block;
  line-height: 1.4;
  position: relative;
  padding-left: 10px;
}

.toc-list a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.toc-list a::before {
  content: '';
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background-color: var(--accent);
  transition: height 0.2s;
}

.toc-list a:hover::before {
  height: 12px;
}

.editor-body {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  width: 100%;
}

.meta-accordion {
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
}

.meta-accordion summary {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.meta-accordion summary::-webkit-details-marker {
  display: none;
}

.meta-accordion summary::after {
  content: "▼";
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.meta-accordion[open] summary::after {
  transform: rotate(180deg);
}

.meta-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: end;
}

.meta-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.meta-group select,
.meta-group input[type="text"] {
  padding: 4px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 0;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.meta-group select:focus,
.meta-group input[type="text"]:focus {
  border-bottom-color: var(--accent);
}

.title-input,
.excerpt-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  outline: none;
}

.title-input {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-serif);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.title-input::placeholder {
  color: var(--border);
}

.excerpt-input {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  resize: none;
  overflow: hidden;
}

.excerpt-input::placeholder {
  color: #ffffff;
  opacity: 0.7;
}

.title-input::placeholder {
  color: #ffffff;
  opacity: 0.7;
}

.ProseMirror {
  padding: 0;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 50vh;
  outline: none;
}

.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #ffffff;
  opacity: 0.7;
  pointer-events: none;
  height: 0;
}

.ProseMirror h2 {
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-size: 1.75rem;
}

.ProseMirror h3 {
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-size: 1.35rem;
}

.ProseMirror p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.ProseMirror p code,
.ProseMirror li code,
.ProseMirror h1 code,
.ProseMirror h2 code,
.ProseMirror h3 code {
  font-family: var(--font-mono);
  background: var(--surface);
  color: var(--accent);
  padding: 0.1em 0.2em;
  margin: 0 0.15em;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

.ProseMirror ul,
.ProseMirror ol {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.ProseMirror li {
  margin-bottom: 0.25rem;
}

.ProseMirror li p {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.ProseMirror blockquote {
  border-left: 4px solid var(--text-muted);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  margin: 2rem 0;
}

.ProseMirror img.ProseMirror-selectednode {
  outline: none;
}

.ProseMirror hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem auto;
  width: 50%;
  clear: both;
}

/* Tables */
.tableWrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.ProseMirror table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.ProseMirror td,
.ProseMirror th {
  min-width: 1em;
  border: 1px solid var(--border);
  padding: 8px 12px;
  vertical-align: top;
  box-sizing: border-box;
  position: relative;
}

.ProseMirror th {
  font-weight: bold;
  text-align: left;
  background-color: var(--surface);
  color: var(--text-main);
}

.ProseMirror .column-resize-handle {
  background-color: var(--accent);
  bottom: -2px;
  position: absolute;
  right: -2px;
  pointer-events: none;
  top: 0;
  width: 4px;
}

.ProseMirror table p {
  margin: 0;
}

.block-menu-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s, border-color 0.2s;
  font-size: 1.2rem;
}

.block-menu-btn:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.block-menu-btn.active {
  transform: rotate(45deg);
}

.ProseMirror pre {
  background-color: #282c34;
  color: #abb2bf;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ProseMirror pre code {
  color: inherit;
  padding: 0;
  background: none;
  font-size: inherit;
}

/* Code Group Tabs */
.code-group {
  position: relative;
  border-radius: 8px;
  background: #282c34;
  margin: 1.5rem 0;
  overflow: hidden;
}

.floating-add-tab-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #abb2bf;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 10;
  display: none;
}

.code-group:hover .floating-add-tab-btn {
  display: block;
}

.floating-add-tab-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.code-group-tabs {
  display: flex;
  background: #21252b;
  padding: 0 8px;
  overflow-x: auto;
}

.code-tab-wrap {
  display: flex;
  align-items: center;
  color: #abb2bf;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  opacity: 0.7;
}

.code-tab-wrap:hover {
  background: rgba(255, 255, 255, 0.05);
  opacity: 1;
}

.code-tab-wrap.active {
  color: #61afef;
  border-bottom-color: #61afef;
  opacity: 1;
}

.code-tab-name {
  outline: none;
  cursor: text;
}

.code-tab-del {
  margin-left: 8px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
}

.code-tab-del:hover {
  color: #e06c75;
}

.code-tab-add-btn {
  background: transparent;
  border: none;
  color: #abb2bf;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
}
.code-tab-add-btn:hover { color: #fff; }

.code-group-content {
  padding: 0;
  position: relative;
}

.code-group .ProseMirror pre,
.code-group pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.code-group[data-active-index="0"] > .code-group-content > *:not(:nth-child(1)),
.code-group[data-active-index="1"] > .code-group-content > *:not(:nth-child(2)),
.code-group[data-active-index="2"] > .code-group-content > *:not(:nth-child(3)),
.code-group[data-active-index="3"] > .code-group-content > *:not(:nth-child(4)),
.code-group[data-active-index="4"] > .code-group-content > *:not(:nth-child(5)),
.code-group[data-active-index="5"] > .code-group-content > *:not(:nth-child(6)),
.code-group[data-active-index="6"] > .code-group-content > *:not(:nth-child(7)),
.code-group[data-active-index="7"] > .code-group-content > *:not(:nth-child(8)) {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

.tiptap-bubble-menu {
  display: flex;
  background: #1a1a1a;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bubble-btn {
  background: transparent;
  border: none;
  color: #e5e5e5;
  padding: 6px 10px;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  box-sizing: border-box;
}

.icon-btn {
  padding: 0 8px;
}

.bubble-btn.is-active {
  background: #333;
  color: #fff;
}

.bubble-btn:hover {
  background: #2a2a2a;
}

#tooltipInlineInput {
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 4px 8px;
  min-width: 180px;
}

#tooltipInlineInput::placeholder {
  color: var(--text-muted);
}

#floatingMenu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-40px);
}

.block-options {
  display: none;
  gap: 0.5rem;
}

#floatingMenu.is-expanded .block-options {
  display: flex;
}

.block-opt {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.block-opt:hover {
  background: var(--accent);
  color: #fff;
}

.loading {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  padding-bottom: 5rem;
}

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

.article-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 0;
  margin: 2rem 0;
}

.post-cover-img {
  width: 240px;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  border-radius: 0;
  flex-shrink: 0;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .post-preview, .featured-post {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1rem;
  }
  .post-cover-img {
    width: 100%;
    height: 180px;
  }
}

.featured-cover-img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  border-radius: 0;
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem 0;
  letter-spacing: -1px;
}

.article-meta {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(128, 128, 128, 0.1);
  color: var(--text-main);
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 1.5rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
}

.ProseMirror a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}

.ProseMirror a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.text-tooltip {
  border-bottom: 1px dashed var(--text-muted);
  cursor: help;
  position: relative;
  display: inline-block;
}

.text-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.ProseMirror pre.hljs-loaded {
  opacity: 1;
}
    /* Image Alignments */
    .ProseMirror img.align-left {
      float: left;
      margin-right: 2rem;
      max-width: 50%;
    }
    
    .ProseMirror img.align-center {
      display: block;
      margin-left: auto;
      margin-right: auto;
    }
    
    .ProseMirror img.align-full {
      width: 100vw;
      max-width: 100vw;
      margin-left: 50%;
      transform: translateX(-50%);
      border-radius: 0;
    }

    /* YouTube Embeds */
    .youtube-embed {
      border: none;
      border-radius: 8px;
      margin: 2rem 0;
      box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    /* Title Placeholder */
    .ProseMirror h1.is-empty::before,
    .ProseMirror p.is-empty:first-of-type::before,
    .ProseMirror h2.is-empty::before {
      content: attr(data-placeholder);
      float: left;
      color: var(--text-muted);
      pointer-events: none;
      height: 0;
    }

/* Footer Container */
.footer-container {
  max-width: 1000px;
  margin: 4rem auto 2rem auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: end;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer-section h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.newsletter-form, .contact-form {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.newsletter-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.newsletter-btn {
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.newsletter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.newsletter-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-btn {
    width: 100%;
  }
}

/* Recommended Section */
.recommended-wrapper {
  max-width: 720px;
  margin: 4rem auto 0 auto;
  padding: 0 20px;
}

.recommended-header {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

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

.recommended-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.share-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
}

.share-btn {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  font-family: var(--font-sans);
  text-decoration: none;
}

.share-btn:hover {
  background: var(--border);
}
.recommended-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--text-muted);
}

.recommended-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 1rem 0;
  font-family: var(--font-sans);
  color: var(--text-main);
}

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

.like-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  font-family: var(--font-sans);
  padding: 6px 12px;
}

.like-btn:hover {
  background: var(--surface);
  color: var(--danger, #ff4d4d);
  border-color: var(--danger, #ff4d4d);
}

.like-btn.liked {
  color: var(--danger, #ff4d4d);
  border-color: var(--danger, #ff4d4d);
  background: rgba(255, 77, 77, 0.1);
}

.like-btn .heart-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
