/*
Theme Name: CheatFlow
Theme URI: https://cheatflow.com
Author: CheatFlow
Author URI: https://cheatflow.com
Description: A modern blog theme for productivity and automation content
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cheatflow
*/

/* ============================================
   CSS RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent: #F06A08;
  --accent-hover: #d95e07;
  --accent-light: rgba(240, 106, 8, 0.1);
  --accent-lighter: rgba(240, 106, 8, 0.05);
  --bg: #ffffff;
  --grey900: #191f28;
  --grey800: #333d4b;
  --grey700: #4e5968;
  --grey600: #6b7684;
  --grey500: #8b95a1;
  --grey100: #f2f4f6;
  --border: rgba(0, 27, 55, 0.06);
  --divider: rgba(0, 27, 55, 0.1);
  --card-shadow: 0 0 4px 0 rgba(2, 32, 71, 0.05), 0 4px 16px 0 rgba(2, 32, 71, 0.05);
  --card-shadow-hover: 0 0 8px 0 rgba(2, 32, 71, 0.08), 0 8px 24px 0 rgba(2, 32, 71, 0.1);
  --nav-height: 60px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #17171c;
  --grey900: #f0f0f5;
  --grey800: #d4d4de;
  --grey700: #b0b0c0;
  --grey600: #8888a0;
  --grey500: #6b6b80;
  --grey100: #242438;
  --border: rgba(255, 255, 255, 0.06);
  --divider: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.2), 0 4px 16px 0 rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 0 8px 0 rgba(0, 0, 0, 0.3), 0 8px 24px 0 rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--grey900);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  border-bottom-color: var(--divider);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.nav-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-logo a {
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo img,
.nav-logo .custom-logo {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links .menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links .menu li {
  list-style: none;
}

.nav-link,
.nav-links .menu li a {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--grey700);
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.nav-link:hover,
.nav-links .menu li a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-link.active,
.nav-links .menu li.current-menu-item a,
.nav-links .menu li.current-cat a {
  color: var(--accent);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey600);
  transition: background var(--transition), color var(--transition);
}

.nav-icon-btn:hover {
  background: var(--grey100);
  color: var(--grey900);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Hamburger menu button (mobile) */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: var(--grey600);
  transition: background var(--transition), color var(--transition);
}

.nav-hamburger:hover {
  background: var(--grey100);
  color: var(--grey900);
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: var(--bg);
  z-index: 999;
  padding: 20px;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu-overlay .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-overlay .menu li a {
  display: block;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--grey800);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.mobile-menu-overlay .menu li a:hover {
  color: var(--accent);
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.progress-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 999;
  transition: width 0.1s linear;
  display: none;
}

.progress-bar.visible {
  display: block;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  backdrop-filter: blur(4px);
}

.search-overlay.active {
  display: flex;
}

.search-box {
  width: 580px;
  background: var(--bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}

.search-input-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--grey500);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  font-family: inherit;
  background: transparent;
  color: var(--grey900);
}

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

.search-hint {
  padding-top: 16px;
  font-size: 13px;
  color: var(--grey500);
  text-align: center;
}

.search-hint kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--grey100);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  color: var(--grey600);
}

/* ============================================
   MAIN CONTENT WRAPPER
   ============================================ */
.main-content {
  padding-top: var(--nav-height);
}

/* ============================================
   HOMEPAGE: HERO SECTION
   ============================================ */
.hero {
  position: relative;
  padding: 60px 40px;
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
  align-items: center;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--grey900);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  cursor: pointer;
  transition: color var(--transition);
}

.hero-title a {
  color: inherit;
  text-decoration: none;
}

.hero-title:hover,
.hero-title a:hover {
  color: var(--accent);
}

.hero-excerpt {
  font-size: 17px;
  color: var(--grey600);
  line-height: 1.7;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--grey500);
}

.hero-meta-divider {
  width: 3px;
  height: 3px;
  background: var(--grey500);
  border-radius: 50%;
}

.hero-image {
  width: 440px;
  height: 280px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hero-image .gradient-thumb {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.hero-image:hover img,
.hero-image:hover .gradient-thumb {
  transform: scale(1.05);
}

/* ============================================
   HOMEPAGE: TWO COLUMN LAYOUT
   ============================================ */
.home-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
  display: flex;
  gap: 40px;
}

.home-main {
  flex: 1;
  min-width: 0;
}

.home-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--grey900);
}

/* ============================================
   CARD GRID
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.card-thumb {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-thumb .gradient-thumb {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.card:hover .card-thumb img,
.card:hover .card-thumb .gradient-thumb {
  transform: scale(1.05);
}

.card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  z-index: 1;
}

.card-body {
  padding: 18px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--grey900);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-excerpt {
  font-size: 14px;
  color: var(--grey600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey500);
}

.card-meta-dot {
  width: 3px;
  height: 3px;
  background: var(--grey500);
  border-radius: 50%;
}

/* ============================================
   SIDEBAR: POPULAR POSTS
   ============================================ */
.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--grey900);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--grey900);
}

[data-theme="dark"] .sidebar-title {
  border-bottom-color: var(--grey700);
}

.popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

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

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

.popular-rank {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  min-width: 24px;
  line-height: 1.3;
}

.popular-info {
  flex: 1;
  min-width: 0;
}

.popular-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--grey800);
  line-height: 1.5;
  transition: color var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-title a {
  color: inherit;
  text-decoration: none;
}

.popular-meta {
  font-size: 12px;
  color: var(--grey500);
  margin-top: 4px;
}

/* ============================================
   SIDEBAR: TAGS
   ============================================ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  padding: 6px 14px;
  background: var(--grey100);
  color: var(--grey700);
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

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

/* ============================================
   LOADING SPINNER (Infinite Scroll)
   ============================================ */
.load-more-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  gap: 10px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--grey100);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.load-text {
  font-size: 14px;
  color: var(--grey500);
}

.load-more-sentinel.done {
  display: none;
}

/* ============================================
   CATEGORY PAGE
   ============================================ */
.category-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px 32px;
  text-align: left;
}

.category-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--grey500);
  margin-bottom: 24px;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
}

.category-back:hover {
  color: var(--accent);
}

.category-back svg {
  width: 16px;
  height: 16px;
}

.category-name {
  font-size: 32px;
  font-weight: 800;
  color: var(--grey900);
  margin-bottom: 8px;
}

.category-desc {
  font-size: 16px;
  color: var(--grey600);
  line-height: 1.6;
}

.category-count {
  font-size: 14px;
  color: var(--grey500);
  margin-top: 8px;
}

/* Category List Layout */
.category-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--transition);
}

.list-card:first-child {
  border-top: 1px solid var(--divider);
}

.list-card-content {
  flex: 1;
  min-width: 0;
}

.list-card-category {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.list-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--grey900);
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color var(--transition);
}

.list-card-title a {
  color: inherit;
  text-decoration: none;
}

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

.list-card-excerpt {
  font-size: 15px;
  color: var(--grey600);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.list-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey500);
}

.list-card-thumb {
  width: 275px;
  height: 190px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.list-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.list-card-thumb .gradient-thumb {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.list-card:hover .list-card-thumb img,
.list-card:hover .list-card-thumb .gradient-thumb {
  transform: scale(1.05);
}

/* ============================================
   SINGLE POST: POST HERO
   ============================================ */
.post-hero {
  position: relative;
  height: calc(100vh - var(--nav-height));
  max-height: 560px;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.post-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.post-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-hero-bg .gradient-thumb {
  width: 100%;
  height: 100%;
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.75) 100%);
  z-index: 1;
}

.post-hero-content {
  position: relative;
  z-index: 2;
  padding: 60px;
  max-width: 800px;
}

.post-hero-category {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  margin-bottom: 20px;
  text-decoration: none;
}

.post-hero-category:hover {
  background: var(--accent-hover);
}

.post-hero-title {
  font-size: 44px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.post-hero-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 24px;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.post-hero-meta-dot {
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.post-hero-scroll-btn {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
  animation: bounceDown 2s ease-in-out infinite;
  background: none;
}

.post-hero-scroll-btn:hover {
  border-color: #fff;
  color: #fff;
}

.post-hero-scroll-btn svg {
  width: 24px;
  height: 24px;
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   SINGLE POST: THREE-COLUMN LAYOUT
   ============================================ */
.post-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  display: flex;
  gap: 40px;
  position: relative;
}

/* Left sidebar: actions */
.post-actions {
  width: 65px;
  flex-shrink: 0;
  position: relative;
}

.post-actions-sticky {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.action-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--grey600);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  gap: 2px;
  background: var(--bg);
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lighter);
}

.action-btn.liked {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

.action-btn-count {
  font-size: 11px;
  font-weight: 600;
}

/* Center: article body */
.post-body {
  flex: 1;
  min-width: 0;
  max-width: 700px;
}

.post-body h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--grey900);
  margin: 48px 0 20px;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.post-body h2:first-child {
  margin-top: 0;
}

.post-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--grey900);
  margin: 36px 0 16px;
  line-height: 1.4;
}

.post-body p {
  font-size: 17px;
  color: var(--grey800);
  line-height: 1.8;
  margin-bottom: 20px;
}

.post-body ul, .post-body ol {
  margin: 16px 0 20px 0;
  padding-left: 0;
}

.post-body li {
  font-size: 17px;
  color: var(--grey800);
  line-height: 1.8;
  margin-bottom: 8px;
  position: relative;
  padding-left: 24px;
  list-style: none;
}

.post-body li::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 12px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.post-body .callout {
  background: var(--grey100);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 28px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.callout-content {
  flex: 1;
}

.callout-content p {
  font-size: 15px;
  color: var(--grey700);
  margin-bottom: 0;
  line-height: 1.7;
}

.callout-content p + p {
  margin-top: 10px;
}

.post-body strong {
  font-weight: 600;
  color: var(--grey900);
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--accent-lighter);
  border-radius: 0 8px 8px 0;
}

.post-body blockquote p {
  color: var(--grey700);
  margin-bottom: 0;
}

.post-body pre {
  background: var(--grey100);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

.post-body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  background: var(--grey100);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.post-body th,
.post-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
  font-size: 15px;
}

.post-body th {
  font-weight: 600;
  color: var(--grey900);
  background: var(--grey100);
}

/* Right sidebar: TOC */
.post-toc {
  width: 220px;
  flex-shrink: 0;
  position: relative;
}

.post-toc-sticky {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.toc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 0;
  margin: 0;
}

.toc-item {
  position: relative;
}

.toc-link {
  display: block;
  padding: 8px 0 8px 16px;
  font-size: 13px;
  color: var(--grey500);
  transition: color var(--transition);
  cursor: pointer;
  line-height: 1.5;
  text-decoration: none;
}

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

.toc-link.active {
  color: var(--accent);
  font-weight: 600;
}

.toc-item.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.toc-link.h3-link {
  padding-left: 28px;
  font-size: 12px;
}

/* ============================================
   POST TAGS
   ============================================ */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
}

.post-tag {
  padding: 6px 14px;
  border: 1px solid var(--divider);
  color: var(--grey700);
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.post-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lighter);
}

/* ============================================
   RELATED POSTS
   ============================================ */
.related-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--divider);
}

.related-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--grey900);
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--divider);
}

.comments-header {
  font-size: 20px;
  font-weight: 700;
  color: var(--grey900);
  margin-bottom: 24px;
}

.comment-form-wrapper {
  margin-bottom: 36px;
}

.comment-form {
  margin-bottom: 36px;
}

.comment-form .comment-form-comment {
  margin-bottom: 0;
}

.comment-form .comment-form-comment label {
  display: none;
}

.comment-textarea,
.comment-form textarea {
  width: 100%;
  height: 100px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--grey900);
  background: var(--bg);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.comment-textarea:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
}

.comment-textarea::placeholder,
.comment-form textarea::placeholder {
  color: var(--grey500);
}

.comment-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.comment-submit,
.comment-form .form-submit .submit {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.comment-submit:hover,
.comment-form .form-submit .submit:hover {
  background: var(--accent-hover);
}

.comment-form .form-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* WordPress comment form fields */
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url {
  margin-bottom: 12px;
}

.comment-form .comment-form-author label,
.comment-form .comment-form-email label,
.comment-form .comment-form-url label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--grey700);
  margin-bottom: 4px;
}

.comment-form .comment-form-author input,
.comment-form .comment-form-email input,
.comment-form .comment-form-url input {
  width: 100%;
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--grey900);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}

.comment-form .comment-form-author input:focus,
.comment-form .comment-form-email input:focus,
.comment-form .comment-form-url input:focus {
  border-color: var(--accent);
}

.comment-form .comment-form-cookies-consent {
  margin: 12px 0;
  font-size: 13px;
  color: var(--grey500);
}

/* Comment list items */
.comment-item,
.comment-list .comment {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  list-style: none;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list .children {
  list-style: none;
  padding-left: 54px;
  margin: 0;
}

.comment-avatar,
.comment .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar .gradient-thumb {
  width: 100%;
  height: 100%;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-author,
.comment .comment-author .fn {
  font-size: 14px;
  font-weight: 600;
  color: var(--grey900);
}

.comment-author a {
  color: var(--grey900);
  text-decoration: none;
}

.comment-date,
.comment .comment-metadata {
  font-size: 13px;
  color: var(--grey500);
  margin-left: 8px;
}

.comment .comment-metadata a {
  color: var(--grey500);
  text-decoration: none;
}

.comment-text,
.comment .comment-content p {
  font-size: 15px;
  color: var(--grey800);
  line-height: 1.6;
  margin-top: 6px;
}

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--grey500);
  transition: color var(--transition);
  cursor: pointer;
}

.comment-like-btn:hover {
  color: var(--accent);
}

.comment-like-btn svg {
  width: 14px;
  height: 14px;
}

.comment .reply a {
  font-size: 13px;
  color: var(--grey500);
  text-decoration: none;
  transition: color var(--transition);
}

.comment .reply a:hover {
  color: var(--accent);
}

/* Below-post wrapper (contains related, comments centered) */
.post-below {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ============================================
   GRADIENT THUMBNAILS
   ============================================ */
.gradient-thumb {
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--grey100);
  border-top: 1px solid var(--border);
  padding: 48px 40px;
  transition: background var(--transition);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.footer-copy {
  font-size: 13px;
  color: var(--grey500);
}

/* ============================================
   SKIP TO CONTENT
   ============================================ */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-to-content:focus {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px 80px;
}

.page-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--grey900);
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

.page-body {
  font-size: 17px;
  color: var(--grey800);
  line-height: 1.8;
}

.page-body p {
  margin-bottom: 20px;
}

.page-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 16px;
}

.page-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px 24px;
}

.search-results-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--grey900);
}

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

.search-results-count {
  font-size: 14px;
  color: var(--grey500);
  margin-top: 8px;
}

.search-results-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ============================================
   404 PAGE
   ============================================ */
.error-404 {
  max-width: 600px;
  margin: 0 auto;
  padding: 120px 40px 80px;
  text-align: center;
}

.error-404-code {
  font-size: 120px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--grey900);
  margin-bottom: 16px;
}

.error-404-desc {
  font-size: 16px;
  color: var(--grey600);
  margin-bottom: 32px;
  line-height: 1.6;
}

.error-404-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: background var(--transition);
}

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

/* ============================================
   WORDPRESS-SPECIFIC CLASSES
   ============================================ */
.alignwide {
  margin-left: -60px;
  margin-right: -60px;
  max-width: calc(100% + 120px);
}

.alignfull {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 24px;
  margin-bottom: 12px;
}

.alignright {
  float: right;
  margin-left: 24px;
  margin-bottom: 12px;
}

.wp-caption {
  max-width: 100%;
  margin: 24px 0;
}

.wp-caption img {
  border-radius: 8px;
}

.wp-caption-text {
  font-size: 13px;
  color: var(--grey500);
  margin-top: 8px;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.wp-block-image {
  margin: 24px 0;
}

.wp-block-image img {
  border-radius: 8px;
}

.wp-block-image figcaption {
  font-size: 13px;
  color: var(--grey500);
  margin-top: 8px;
  text-align: center;
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--grey100);
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: var(--grey900);
  display: block;
  font-size: 14px;
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ============================================
   VIEW TRANSITIONS
   ============================================ */
.view-fade-in {
  animation: fadeIn 0.35s ease;
}

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

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1024px) {
  .home-sidebar {
    display: none;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .post-toc, .post-actions {
    display: none;
  }
  .post-layout {
    justify-content: center;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .alignwide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 0 20px;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .hero {
    padding: 40px 20px;
  }
  .hero-inner {
    flex-direction: column;
  }
  .hero-image {
    width: 100%;
    height: 200px;
  }
  .hero-title {
    font-size: 28px;
  }
  .home-body {
    padding: 0 20px 60px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .category-header, .category-list {
    padding-left: 20px;
    padding-right: 20px;
  }
  .list-card {
    flex-direction: column-reverse;
    gap: 16px;
  }
  .list-card-thumb {
    width: 100%;
    height: 200px;
  }
  .post-hero-title {
    font-size: 30px;
  }
  .post-hero-content {
    padding: 30px;
  }
  .post-layout {
    padding: 24px 20px 60px;
  }
  .post-below {
    padding: 0 20px 60px;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .page-content {
    padding: 40px 20px 60px;
  }
  .page-title {
    font-size: 28px;
  }
  .search-results-header {
    padding-left: 20px;
    padding-right: 20px;
  }
  .search-results-list {
    padding-left: 20px;
    padding-right: 20px;
  }
  .search-box {
    width: calc(100% - 40px);
    margin: 0 20px;
  }
  .site-footer {
    padding: 32px 20px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .error-404 {
    padding: 80px 20px 60px;
  }
  .error-404-code {
    font-size: 80px;
  }
}
