/* ============================================
   TechFixHub — Complete CSS Design System
   Modern Tech Blog | Dark/Light Theme
   ============================================ */

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

/* ============ CSS Variables ============ */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --gradient-1: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-2: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-3: linear-gradient(135deg, #8b5cf6, #ec4899);
  --border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 70px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(241, 245, 249, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-border: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-dark: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

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

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

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

ul,
ol {
  list-style: none;
}

/* ============ Utility Classes ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============ Animated Background ============ */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

[data-theme="light"] .bg-pattern {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

/* ============ Header & Navigation ============ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-glass-border);
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
}

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

.nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

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

/* Search Bar */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 200px;
  padding: 8px 16px 8px 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-bar input:focus {
  width: 260px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  transform: rotate(15deg);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
}

/* ============ Hero Section ============ */
.hero {
  position: relative;
  padding: calc(var(--header-height) + 60px) 0 60px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
  z-index: 1;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

[data-theme="light"] .hero-bg {
  opacity: 0.08;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-search {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-search input {
  flex: 1;
  padding: 16px 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

.hero-search button {
  padding: 16px 28px;
  background: var(--gradient-1);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.hero-search button:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-light);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============ Category Pills ============ */
.categories-section {
  padding: 20px 0;
}

.categories-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
}

.category-pill .icon {
  font-size: 1rem;
}

/* ============ Section Headers ============ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

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

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  gap: 8px;
}

/* ============ Article Cards ============ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding: 40px 0;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  animation: fadeInUp 0.5s ease both;
  backdrop-filter: blur(10px);
}

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

.article-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.article-card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: var(--accent);
  color: white;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-card-body {
  padding: 20px;
}

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

.article-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-primary);
  transition: var(--transition);
}

.article-card:hover h3 {
  color: var(--accent-light);
}

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

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  transition: var(--transition);
}

.read-more:hover {
  gap: 10px;
}

/* Featured Article */
.featured-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  transition: var(--transition);
}

.featured-article:hover {
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.featured-article .article-card-image {
  height: 100%;
  min-height: 300px;
}

.featured-article .article-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--gradient-3);
  color: white;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
  margin-bottom: 16px;
}

.featured-article h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.featured-article p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ============ Sidebar ============ */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 40px 0;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  height: fit-content;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Popular Posts */
.popular-post {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.popular-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-post-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.4;
  min-width: 30px;
}

.popular-post-content h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: var(--transition);
}

.popular-post-content h4:hover {
  color: var(--accent-light);
}

.popular-post-content span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Newsletter Widget */
.newsletter-widget {
  background: var(--gradient-1);
  border: none;
  color: white;
}

.newsletter-widget h3 {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.newsletter-widget p {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 16px;
}

.newsletter-form input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  margin-bottom: 10px;
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.newsletter-form button {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: white;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tags Widget */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

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

/* ============ Blog Post Page ============ */
.post-page {
  padding-top: calc(var(--header-height) + 40px);
}

.post-page .content-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.post-main-content {
  min-width: 0;
}

.post-header {
  max-width: 800px;
  margin: 0 auto 32px;
  padding: 0 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-light);
}

.breadcrumb .sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.post-category {
  display: inline-flex;
  padding: 4px 14px;
  background: var(--accent-glow);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.post-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

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

.post-meta .author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-meta .author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.post-featured-image {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.post-featured-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Table of Contents */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.toc h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.toc ol {
  list-style: decimal;
  padding-left: 20px;
}

.toc li {
  padding: 6px 0;
  font-size: 0.88rem;
}

.toc a {
  color: var(--text-secondary);
}

.toc a:hover {
  color: var(--accent-light);
}

/* Post Content */
.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-layout .post-content {
  max-width: none;
  margin: 0;
  padding: 0;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--text-primary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.post-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.post-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 24px 0;
  box-shadow: var(--shadow-md);
}

.post-content ul,
.post-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 4px 0;
  line-height: 1.7;
}

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-glass);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content code {
  background: var(--bg-glass);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--accent-light);
  border: 1px solid var(--border);
}

.post-content pre {
  background: #1e293b;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.85rem;
}

/* Pro Tip Box */
.pro-tip {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.pro-tip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.pro-tip p {
  font-size: 0.9rem !important;
  margin-bottom: 0 !important;
}

/* Warning Box */
.warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.warning-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #f87171;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* Step Box */
.step-box {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  padding: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.step-number {
  background: var(--gradient-1);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.9rem !important;
}

/* Social Share */
.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  margin: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.post-share span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.share-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Related Posts */
.related-posts {
  padding: 40px 0;
}

.related-posts h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text-primary);
}

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

/* Author Box */
.author-box {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 32px 0;
}

.author-box-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  flex-shrink: 0;
}

.author-box-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.author-box-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============ Static Pages ============ */
.page-hero {
  padding: calc(var(--header-height) + 60px) 0 40px;
  text-align: center;
  position: relative;
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 12px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.page-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 36px 0 14px;
  color: var(--text-primary);
}

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.page-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.page-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.page-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

/* Contact Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 24px;
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-submit {
  padding: 14px 32px;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============ Footer ============ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col ul li {
  padding: 4px 0;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--accent-light);
  padding-left: 4px;
}

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--accent-light);
}

/* ============ Back to Top ============ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-1);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============ Cookie Consent ============ */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 20px;
  z-index: 9999;
  display: none;
  backdrop-filter: blur(20px);
}

.cookie-consent.show {
  display: block;
  animation: slideUp 0.3s ease;
}

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

.cookie-inner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cookie-inner a {
  color: var(--accent-light);
}

.cookie-buttons {
  display: flex;
  gap: 10px;
}

.cookie-accept {
  padding: 10px 24px;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-decline {
  padding: 10px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
}

.pagination a,
.pagination span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.pagination a {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.pagination a:hover,
.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============ Animations ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Stagger animation for cards */
.article-card:nth-child(1) {
  animation-delay: 0.05s;
}

.article-card:nth-child(2) {
  animation-delay: 0.1s;
}

.article-card:nth-child(3) {
  animation-delay: 0.15s;
}

.article-card:nth-child(4) {
  animation-delay: 0.2s;
}

.article-card:nth-child(5) {
  animation-delay: 0.25s;
}

.article-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 768px) {
  /* ── Nav dropdown ── */
  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .nav.active {
    display: flex;
  }

  /* ── Mobile menu button ── */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* ── Header layout: prevent overflow ── */
  .header-inner {
    gap: 8px;
    padding: 0 12px;
  }

  .logo {
    flex-shrink: 0;
    font-size: 1.1rem;
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* ── Search bar: collapse to icon-only on mobile ── */
  .search-bar input {
    width: 0;
    padding: 8px 0 8px 32px;
    border-color: transparent;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
  }

  .search-bar.expanded input {
    width: 150px;
    padding: 8px 16px 8px 36px;
    border-color: var(--border);
    background: var(--bg-glass);
    pointer-events: auto;
    opacity: 1;
  }

  .search-bar .search-icon {
    cursor: pointer;
    font-size: 1rem;
    z-index: 2;
    left: 10px;
  }

  /* ── Hero ── */
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-stats {
    gap: 20px;
  }

  /* ── Grids ── */
  .featured-article {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col ul {
    padding: 0;
  }

  .footer-col ul li {
    justify-content: center;
  }

  .footer-col a {
    justify-content: center;
  }

  .footer-brand {
    text-align: center;
  }

  .footer-brand .logo {
    justify-content: center;
  }

  .article-card-body {
    text-align: center;
  }

  .article-card-meta {
    justify-content: center;
  }

  .read-more {
    display: block;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* ── Category pills: exactly 2 per line ── */
  .categories-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: 8px;
  }

  .category-pill {
    white-space: nowrap;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .category-pill .icon {
    font-size: 0.9rem;
  }

  /* ── Post page ── */
  .post-page .content-layout {
    padding: 0 16px 40px;
  }

  .post-header {
    padding: 0 16px;
    text-align: center;
  }

  .breadcrumb {
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.75rem;
  }

  .post-meta {
    justify-content: center;
    gap: 10px;
    font-size: 0.78rem;
  }

  .post-featured-image {
    padding: 0 16px;
    margin-bottom: 24px;
  }

  /* Images inside post never overflow */
  .post-content img {
    width: 100%;
    height: auto;
  }

  /* Step boxes stack on small screens */
  .step-box {
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  /* Tighter blockquote / code */
  .post-content blockquote {
    padding: 12px 16px;
    margin: 16px 0;
  }

  .post-content pre {
    padding: 14px;
    font-size: 0.78rem;
    overflow-x: auto;
  }

  .toc {
    padding: 16px;
  }

  /* Related posts: always 1 column on mobile */
  .related-grid {
    grid-template-columns: 1fr;
  }

  /* Share buttons: center on mobile */
  .post-share {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  /* Author box already handled above */
    flex-direction: column;
    text-align: center;
  }

  .post-share {
    flex-wrap: wrap;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 10px;
  }

  .logo span:last-child {
    font-size: 1rem;
  }

  .theme-toggle,
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .hero-search button {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
}

/* ============ Loading Skeleton ============ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-card-hover) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ============ Print Styles ============ */
@media print {

  .header,
  .footer,
  .sidebar,
  .back-to-top,
  .cookie-consent,
  .post-share,
  .related-posts {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .post-content {
    max-width: 100%;
  }
}