/* Blog Template Styles */
:root {
  --primary-color: #1173d4;
  --primary-color-muted: #3e96ee;
  --secondary-color: #7209b7;
  --background-light: #f8fafc;
  --background-dark: #0f172a;
  --text-light: #1e293b;
  --text-dark: #f1f5f9;
  --border-light: rgba(226, 232, 240, 0.8);
  --border-dark: rgba(51, 65, 85, 0.8);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --gradient-light: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-smooth-long: cubic-bezier(0.22, 1, 0.36, 1);
  --color-muted: #64748b;
}

/* Floating Theme Toggle Button */
.theme-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid #ffe066;
  background: #4563EC;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px var(--shadow-light);
  cursor: pointer;
  transition: transform 240ms var(--animation-smooth), box-shadow 240ms var(--animation-smooth), background 240ms var(--animation-smooth), color 240ms var(--animation-smooth);
  z-index: 1000;
}

.theme-toggle:hover {
  transform: translateY(-4px) scale(1.2);
  box-shadow: 0 8px 16px var(--shadow-dark) scale(1.2);
}

.theme-toggle i {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .theme-toggle {
    width: 48px;
    height: 48px;
    left: 10px;
    bottom: 10px;
  }
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gradient-light);
  color: var(--text-light);
  line-height: 1.7;
  transition: all 0.5s var(--animation-smooth-long);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-light: var(--background-dark);
    --text-light: var(--text-dark);
    --border-light: var(--border-dark);
    --shadow-light: var(--shadow-dark);
    --gradient-light: var(--gradient-dark);
  }
  body:not(.article-dark) {
    background: var(--gradient-dark);
    color: var(--text-dark);
  }
  .article-top-section,
  .article-main-container {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-dark);
  }
  .article-title,
  .article-content,
  .article-content h1,
  .article-content h2,
  .article-content h3,
  .article-content h4,
  .article-content h5,
  .article-content h6,
  .sharing-label,
  .toc-title,
  .author-name,
  .publish-date,
  .comments-title,
  .comment-author,
  .comment-text {
    color: var(--text-dark);
  }
  .article-category { background: rgba(56, 189, 248, 0.12); }
  .article-tags .tag { background: rgba(56, 189, 248, 0.12); color: var(--text-dark); }
  .social-sharing-sidebar,
  .table-of-contents-sidebar,
  .comments-section,
  .reactions-section,
  .comment,
  .comment-form {
    background: rgba(17, 24, 39, 0.7);
    border-color: var(--border-dark);
  }
  /* FAQ section */
  .faq-section .faq-title { color: var(--text-dark); }
  .faq-section .faq-subtitle { color: var(--text-dark); opacity: 0.8; }
  .faq-section,
  .tools-faq { background: linear-gradient(to bottom, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.88)); }
  .faq-section .faq-list .faq-item {
    background: rgba(31, 41, 55, 0.6);
    border-color: #2B3443;
    box-shadow: none;
  }
  .faq-section .faq-question {
    background: rgba(31, 41, 55, 0.85);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
  }
  .faq-section .faq-question:hover { background: rgba(55, 65, 81, 0.88); }
  .faq-section .faq-question h3 { color: var(--text-dark); }
  .faq-section .faq-question i { color: #60A5FA; }
  .faq-section .faq-item.active .faq-question i { color: #38BDF8; }
  .faq-section .faq-answer {
    background: rgba(17, 24, 39, 0.85);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
  }
  /* Override faq.css tokens for dark */
  .article-content .faq-section {
    --bg-primary: rgba(17, 24, 39, 0.92);
    --bg-secondary: rgba(17, 24, 39, 0.88);
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --border-light: #2B3443;
  }
  .share-btn,
  .reaction-btn { background: rgba(31, 41, 55, 0.8); color: var(--text-dark); }
  .toc-link { color: var(--text-dark); }
}

/* Apply same dark palette when manual toggle is active */
body.article-dark .article-top-section,
body.article-dark .article-main-container {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border-dark);
}
body.article-dark .article-title,
body.article-dark .article-content,
body.article-dark .article-content h1,
body.article-dark .article-content h2,
body.article-dark .article-content h3,
body.article-dark .article-content h4,
body.article-dark .article-content h5,
body.article-dark .article-content h6,
body.article-dark .sharing-label,
body.article-dark .toc-title,
body.article-dark .author-name,
body.article-dark .publish-date,
body.article-dark .comments-title,
body.article-dark .comment-author,
body.article-dark .comment-text { color: var(--text-dark); }
body.article-dark .article-category { background: rgba(56, 189, 248, 0.12); }
body.article-dark .article-tags .tag { background: rgba(56, 189, 248, 0.12); color: var(--text-dark); }
body.article-dark .social-sharing-sidebar,
body.article-dark .table-of-contents-sidebar,
body.article-dark .comments-section,
body.article-dark .reactions-section,
body.article-dark .comment,
body.article-dark .comment-form {
  background: rgba(17, 24, 39, 0.7);
  border-color: var(--border-dark);
}
body.article-dark .share-btn,
body.article-dark .reaction-btn { background: rgba(31, 41, 55, 0.8); color: var(--text-dark); }
body.article-dark .toc-link { color: var(--text-dark); }
/* FAQ dark for manual toggle */
body.article-dark .faq-section .faq-title { color: var(--text-dark); }
body.article-dark .faq-section .faq-subtitle { color: var(--text-dark); opacity: 0.8; }
body.article-dark .faq-section,
body.article-dark .tools-faq { background: linear-gradient(to bottom, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.88)); }
body.article-dark .faq-section .faq-list .faq-item {
  background: rgba(31, 41, 55, 0.6);
  border-color: #2B3443;
  box-shadow: none;
}
body.article-dark .faq-section .faq-question {
  background: rgba(31, 41, 55, 0.85);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
}
body.article-dark .faq-section .faq-question:hover { background: rgba(55, 65, 81, 0.88); }
body.article-dark .faq-section .faq-question h3 { color: var(--text-dark); }
body.article-dark .faq-section .faq-question i { color: #60A5FA; }
body.article-dark .faq-section .faq-item.active .faq-question i { color: #38BDF8; }
body.article-dark .faq-section .faq-answer {
  background: rgba(17, 24, 39, 0.85);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
}
/* Override faq.css tokens when manual dark is on */
body.article-dark .article-content .faq-section {
  --bg-primary: rgba(17, 24, 39, 0.92);
  --bg-secondary: rgba(17, 24, 39, 0.88);
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --border-light: #2B3443;
}

/* Dark theme: remap light tokens to dark equivalents */
body.article-dark {
  --primary-color: #1173d4;
  --secondary-color: #7209b7;
  --background-light: var(--background-dark);
  --text-light: var(--text-dark);
  --border-light: var(--border-dark);
  --shadow-light: var(--shadow-dark);
  --gradient-light: var(--gradient-dark);
}

body.article-dark {
  background: var(--gradient-dark);
  color: var(--text-dark);
}

/* Layout */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main Content */
.main {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  transition: padding 0.45s var(--animation-smooth);
}

@media (min-width: 640px) {
  .main {
    padding: 3rem 1.5rem;
    transition: padding 0.45s var(--animation-smooth);
  }
}

@media (min-width: 1024px) {
  .main {
    padding: 4rem 2rem;
    transition: padding 0.45s var(--animation-smooth);
  }
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
  animation: fadeInUpSmooth 0.7s var(--animation-smooth-long) both;
}

@media (min-width: 768px) {
  .content-wrapper {
    padding: 2rem 1.5rem;
    transition: padding 0.4s var(--animation-smooth);
  }
}

@media (min-width: 1024px) {
  .content-wrapper {
    padding: 2rem;
    transition: padding 0.4s var(--animation-smooth);
  }
}

/* Article Top Section: Title/Meta + Featured Image */
.article-top-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUpSmooth 0.7s var(--animation-smooth-long) both;
  transition: box-shadow 0.5s var(--animation-smooth), padding 0.5s var(--animation-smooth);
}

@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .article-top-section {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

@media (min-width: 768px) {
  .article-top-section {
    grid-template-columns: 1fr 1fr;
    padding: 2.5rem;
    transition: padding 0.4s var(--animation-smooth);
  }
}

.article-header-container {
  display: flex;
  flex-direction: column;
}

.article-category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(17, 115, 212, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  width: fit-content;
  transition: background 0.4s var(--animation-smooth), color 0.4s var(--animation-smooth);
}

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-light);
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .article-title {
    font-size: 2.25rem;
    transition: font-size 0.4s var(--animation-smooth);
  }
}

@media (min-width: 1024px) {
  .article-title {
    font-size: 2.5rem;
    transition: font-size 0.4s var(--animation-smooth);
  }
}

.featured-image-container {
  display: flex;
  align-items: flex-start;
  align-self: center;
  margin-top: 2rem;
  transition: margin 0.45s var(--animation-smooth);
}

@media (min-width: 768px) {
  .featured-image-container {
    align-self: start;
    margin-top: 3rem;
    transition: margin 0.45s var(--animation-smooth);
  }
}

@media (max-width: 767px) {
  .featured-image {
    margin-bottom: 0;
    transition: margin 0.4s var(--animation-smooth);
  }
  
  .featured-image-container {
    order: -1;
    margin-top: 0;
    transition: margin 0.4s var(--animation-smooth);
  }
}

/* Article Main Section: Sidebar + Content */
.article-main-section {
  margin-bottom: 3rem;
  transition: margin 0.4s var(--animation-smooth);
}

.article-main-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUpSmooth 0.7s var(--animation-smooth-long) both;
  transition: box-shadow 0.5s var(--animation-smooth), padding 0.5s var(--animation-smooth);
}

@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .article-main-container {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

@media (min-width: 1024px) {
  .article-main-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2.5rem;
    transition: gap 0.4s var(--animation-smooth), padding 0.4s var(--animation-smooth);
  }
}

/* Article Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-container {
  padding: 0;
}

/* Sticky/floating sidebar behavior on larger screens */
@media (min-width: 1024px) {
  /* Make the sidebar stick while scrolling */
  .article-sidebar {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 96px; /* below header */
    align-self: start;
    width: 280px;
    z-index: 3;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  /* Remove internal sidebar column so content fills the card */
  .article-main-container {
    grid-template-columns: 1fr;
  }
  /* Overlap sidebar and content in the same grid cell to avoid reserving vertical space */
  .article-content-wrapper {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
  }
  .article-sidebar {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
  }
  /* Provide visual gap between floating sidebar and content card */
  .article-sidebar {
    margin-left: -320px; /* 280 + ~40px spacing */
  }
}

/* On wide desktops, visually pull the sidebar out of the article card to the left */
@media (min-width: 1280px) {
  .article-main-section { position: relative; }
  /* Make content span full width of the card (fill removed column) */
  .article-main-container {
    grid-template-columns: 1fr;
  }
  /* Float the sidebar left of the card with a comfortable separation */
  .article-sidebar {
    margin-left: -340px; /* 280px width + 60px gap from card */
  }
}

.social-sharing-sidebar {
  margin-bottom: 0;
  padding: 1.25rem;
  background: rgba(248, 250, 252, 0.5);
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  border-top: 2px solid var(--primary-color);
  transition: background 0.4s var(--animation-smooth), border-color 0.4s var(--animation-smooth);
}

.sharing-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1rem;
  transition: color 0.4s var(--animation-smooth);
}

.sharing-label i {
  color: var(--primary-color);
  transition: color 0.3s var(--animation-smooth);
}

.sharing-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  transition: gap 0.3s var(--animation-smooth);
}

.share-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary-color);
  border: 1px solid rgba(17, 115, 212, 0.2);
  cursor: pointer;
  transition: 
    background 0.35s var(--animation-smooth),
    color 0.3s var(--animation-smooth),
    box-shadow 0.45s var(--animation-smooth),
    transform 0.45s var(--animation-smooth);
  font-size: 1.125rem;
}

.share-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(17, 115, 212, 0.3);
}

/* ... No change needed for other static (non-animated) sidebar items ... */

.table-of-contents-sidebar {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(248, 250, 252, 0.5);
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  border-top: 2px solid var(--primary-color);
  transition: background 0.4s var(--animation-smooth), border-color 0.4s var(--animation-smooth);
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1rem;
  transition: color 0.4s var(--animation-smooth);
}

.toc-title i {
  color: var(--primary-color);
  transition: color 0.3s var(--animation-smooth);
}

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

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: 
    background 0.32s var(--animation-smooth),
    color 0.32s var(--animation-smooth),
    transform 0.4s var(--animation-smooth);
  font-weight: 500;
  position: relative;
}

.toc-link::after {
  content: '→';
  opacity: 0;
  transform: translateX(-4px);
  transition: 
    opacity 0.4s var(--animation-smooth), 
    transform 0.4s var(--animation-smooth), 
    color 0.4s var(--animation-smooth);
  color: var(--primary-color);
  font-size: 1.125rem;
}

.toc-link:hover {
  background: rgba(17, 115, 212, 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.toc-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Article Content */
.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-light);
  padding: 0;
  transition: color 0.45s var(--animation-smooth);
}

@media (min-width: 1024px) {
  .article-content {
    padding-left: 0;
  }
}

/* ... for brevity, applying 'transition' and smoother animation timing to prominent elements below ... */

/* Article Meta */
.article-meta {
  margin-bottom: 1.5rem;
}

.article-meta .author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: gap 0.4s var(--animation-smooth);
}

/* Word Count Badge */
.article-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  transition: gap 0.3s var(--animation-smooth);
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(17, 115, 212, 0.08);
  border: 1px solid rgba(17, 115, 212, 0.15);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  transition: 
    background 0.35s var(--animation-smooth),
    border-color 0.35s var(--animation-smooth),
    transform 0.3s var(--animation-smooth);
}

.stat-badge i {
  font-size: 0.875rem;
  color: var(--primary-color);
  transition: color 0.3s var(--animation-smooth);
}

.stat-badge:hover {
  background: rgba(17, 115, 212, 0.12);
  border-color: rgba(17, 115, 212, 0.25);
  transform: translateY(-1px);
}

.stat-value {
  font-weight: 600;
  color: var(--primary-color);
  transition: color 0.3s var(--animation-smooth);
}

/* Dark mode stat badge */
@media (prefers-color-scheme: dark) {
  .stat-badge {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
    color: var(--text-dark);
  }
  .stat-badge:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
  }
}

body.article-dark .stat-badge {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--text-dark);
}

body.article-dark .stat-badge:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

@media (max-width: 768px) {
  .article-stats {
    gap: 0.75rem;
  }
  
  .stat-badge {
    font-size: 0.8125rem;
    padding: 0.4rem 0.875rem;
  }
}

.author-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  flex-shrink: 0;
  transition: border-color 0.4s var(--animation-smooth), width 0.4s var(--animation-smooth), height 0.4s var(--animation-smooth);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: box-shadow 0.4s var(--animation-smooth);
}

.author-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: gap 0.4s var(--animation-smooth);
}

.author-name {
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.4s var(--animation-smooth);
}

.author-name strong {
  color: var(--primary-color);
  transition: color 0.35s var(--animation-smooth);
}

/* Author link: no underline, custom colors */
.author-name a {
  text-decoration: none;
  color: var(--primary-color);
  border-bottom: none;
  transition: color 0.3s var(--animation-smooth);
}

.author-name a:hover {
  color: var(--secondary-color);
}

.publish-date {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.publish-date time {
  color: inherit;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  transition: gap 0.3s var(--animation-smooth);
}

.tag {
  background: rgba(17, 115, 212, 0.1);
  color: var(--primary-color);
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: 
    background 0.35s var(--animation-smooth),
    color 0.35s var(--animation-smooth);
}

.tag:hover {
  background: var(--primary-color);
  color: white;
}

.featured-image {
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: transform 0.45s var(--animation-smooth), box-shadow 0.5s var(--animation-smooth);
}

.featured-image:hover {
  transform: scale(1.01);
}

.featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.75rem;
  transition: border-radius 0.4s var(--animation-smooth);
}

/* Background image container (old method) */
.image-container {
  aspect-ratio: 16/9;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.45s var(--animation-smooth);
}

.featured-image:hover .image-container {
  transform: scale(1.03);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.3;
  transition: 
    color 0.4s var(--animation-smooth),
    margin 0.4s var(--animation-smooth);
}

.article-content h2 {
  font-size: 2rem;
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  transition: font-size 0.4s var(--animation-smooth), border-bottom 0.4s var(--animation-smooth);
}

.article-content h3 {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: color 0.4s var(--animation-smooth);
}

.article-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
  transition: margin 0.4s var(--animation-smooth);
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  transition: margin 0.35s var(--animation-smooth);
}

.article-content li {
  margin-bottom: 0.75rem;
  position: relative;
  transition: margin 0.3s var(--animation-smooth);
}

.article-content ul li::marker {
  color: var(--primary-color);
}

.article-content ol li::marker {
  color: var(--primary-color);
  font-weight: 600;
}

.article-content strong {
  font-weight: 700;
  color: var(--text-light);
  transition: color 0.4s var(--animation-smooth);
}

.article-content a {
  color: var(--primary-color-muted);
  text-decoration: none !important;
  font-weight: 500;
  display: inline-block;
  transition: 
    color 0.33s var(--animation-smooth),
    transform 0.33s var(--animation-smooth);
}

.article-content a:hover {
  color: var(--primary-color);
  text-decoration: none !important;
  transform: scale(1.02);
}

/* Code blocks */
.article-content code {
  background: rgba(17, 115, 212, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875em;
  transition: background 0.4s var(--animation-smooth), color 0.4s var(--animation-smooth);
}

.article-content pre {
  background: #1e293b;
  color: #f1f5f9;
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: background 0.4s var(--animation-smooth), color 0.4s var(--animation-smooth);
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* Blockquotes */
.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #64748b;
  background: rgba(17, 115, 212, 0.05);
  padding: 1.5rem;
  border-radius: 0.5rem;
  transition: background 0.4s var(--animation-smooth), border-color 0.4s var(--animation-smooth), color 0.4s var(--animation-smooth);
}

/* Reactions and Share Section */
.reactions-section {
  margin: 3rem 0;
  padding: 2rem;
  background: rgba(17, 115, 212, 0.05);
  border-radius: 1rem;
  border: 1px solid rgba(17, 115, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  transition: background 0.4s var(--animation-smooth), border-color 0.4s var(--animation-smooth), gap 0.4s var(--animation-smooth);
}

.reactions-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: gap 0.4s var(--animation-smooth);
}

.reactions-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.4s var(--animation-smooth);
}

.reactions-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  transition: gap 0.3s var(--animation-smooth);
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--primary-color);
  border: 1px solid rgba(17, 115, 212, 0.2);
  cursor: pointer;
  transition: 
    background 0.35s var(--animation-smooth),
    color 0.35s var(--animation-smooth), 
    box-shadow 0.45s var(--animation-smooth),
    transform 0.45s var(--animation-smooth);
  font-weight: 500;
}

.reaction-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(17, 115, 212, 0.3);
}

.reaction-icon {
  font-size: 1.125rem;
  transition: color 0.4s var(--animation-smooth);
}

.share-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: gap 0.4s var(--animation-smooth);
}

.share-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.4s var(--animation-smooth);
}

.share-btn {
  display: flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary-color);
  border: 1px solid rgba(17, 115, 212, 0.2);
  cursor: pointer;
  transition: 
    background 0.35s var(--animation-smooth),
    color 0.35s var(--animation-smooth),
    box-shadow 0.45s var(--animation-smooth),
    transform 0.45s var(--animation-smooth);
}

.share-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(17, 115, 212, 0.3);
}

.share-icon {
  font-size: 1.25rem;
  transition: color 0.4s var(--animation-smooth);
}

/* Comments Section */
.comments-section {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  transition: background 0.4s var(--animation-smooth), border-color 0.4s var(--animation-smooth);
}

.comments-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  transition: color 0.4s var(--animation-smooth), font-size 0.4s var(--animation-smooth);
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-light);
  animation: fadeInSmooth 0.6s var(--animation-smooth-long) both;
  transition: box-shadow 0.4s var(--animation-smooth), background 0.4s var(--animation-smooth);
}

.comment-avatar {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--primary-color);
  transition: border-color 0.4s var(--animation-smooth), width 0.3s var(--animation-smooth), height 0.3s var(--animation-smooth);
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  transition: gap 0.3s var(--animation-smooth);
}

.comment-author {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  transition: color 0.4s var(--animation-smooth);
}

.comment-date {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.comment-text {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.6;
  transition: color 0.4s var(--animation-smooth);
}

/* Comment Form */
.comment-form {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.4s var(--animation-smooth), background 0.4s var(--animation-smooth);
}

.comment-form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1rem;
  transition: color 0.4s var(--animation-smooth);
}

.comment-textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 2px solid var(--border-light);
  background: #f8fafc;
  padding: 1rem;
  font-size: 1rem;
  color: var(--text-light);
  resize: vertical;
  transition: 
    background 0.4s var(--animation-smooth), 
    border-color 0.4s var(--animation-smooth),
    box-shadow 0.4s var(--animation-smooth),
    color 0.4s var(--animation-smooth);
  font-family: inherit;
}

.comment-textarea::placeholder {
  color: #94a3b8;
  transition: color 0.3s var(--animation-smooth);
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(17, 115, 212, 0.1);
}

.comment-submit {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.submit-btn {
  border-radius: 0.5rem;
  background: var(--gradient-primary);
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: 
    background 0.4s var(--animation-smooth),
    box-shadow 0.45s var(--animation-smooth),
    color 0.4s var(--animation-smooth),
    transform 0.45s var(--animation-smooth);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(17, 115, 212, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Footer Container */
#footer-placeholder {
  margin-top: auto;
}

/* Back Button */
.back-button-container {
  margin-bottom: 1rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.625rem 1rem;
  border-radius: 50px;
  background: rgba(17, 115, 212, 0.05);
  border: 1.5px solid rgba(17, 115, 212, 0.15);
  /* Smoother, longer, and more natural transitions */
  transition:
    background 0.45s var(--animation-smooth-long),
    color 0.45s var(--animation-smooth-long),
    border-radius 0.6s var(--animation-smooth-long),
    border-color 0.35s var(--animation-smooth),
    transform 0.4s var(--animation-smooth),
    box-shadow 0.6s var(--animation-smooth-long);
  will-change: transform, background, color, box-shadow, border-radius;
}

.back-button:hover {
  border-radius: 12px;
  background: var(--primary-color);
  color: white;
  transform: translateX(-4px);
  box-shadow: 0 2px 16px 0 rgba(17,115,212,0.18), 0 0 20px 6px rgba(17,115,212,0.10);
  /* Smooth color transition for inner icon */
}

.back-button i {
  font-size: 0.875rem;
  transition: color 0.35s var(--animation-smooth), transform 0.45s var(--animation-smooth-long);
}

.back-button:hover i {
  color: #fff;
  transform: scale(1.08) translateX(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .content-wrapper {
    padding: 1rem 0.5rem;
    transition: padding 0.4s var(--animation-smooth);
  }
  
  .article-top-section {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
    transition: padding 0.4s var(--animation-smooth), gap 0.4s var(--animation-smooth);
  }
  
  .featured-image-container {
    order: -1;
  }
  
  .article-main-container {
    padding: 1.5rem;
    gap: 1.5rem;
    transition: padding 0.4s var(--animation-smooth), gap 0.4s var(--animation-smooth);
  }
  
  .article-title {
    font-size: 1.75rem;
    transition: font-size 0.4s var(--animation-smooth);
  }
  
  .sharing-buttons {
    justify-content: center;
    transition: justify-content 0.4s var(--animation-smooth);
  }
}

@media (max-width: 480px) {
  .main {
    padding: 0.5rem;
    transition: padding 0.4s var(--animation-smooth);
  }
  
  .content-wrapper {
    padding: 0.5rem;
    transition: padding 0.4s var(--animation-smooth);
  }
  
  .article-top-section {
    padding: 1rem;
    transition: padding 0.4s var(--animation-smooth);
  }
  
  .article-main-container {
    padding: 1rem;
    transition: padding 0.4s var(--animation-smooth);
  }
  
  .article-title {
    font-size: 1.5rem;
    transition: font-size 0.4s var(--animation-smooth);
  }
  
  .author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    transition: width 0.3s var(--animation-smooth), height 0.3s var(--animation-smooth);
  }
  
  .sharing-buttons {
    flex-direction: column;
    width: 100%;
    transition: flex-direction 0.4s var(--animation-smooth), width 0.4s var(--animation-smooth);
  }
  
  .share-btn {
    width: 100%;
    border-radius: 0.5rem;
    transition: width 0.4s var(--animation-smooth), border-radius 0.4s var(--animation-smooth);
  }
}

/* Animations */
@keyframes fadeInUpSmooth {
  0% {
    opacity: 0;
    transform: translateY(36px);
  }
  60% {
    opacity: 0.7;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInSmooth {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.content-wrapper {
  animation: fadeInUpSmooth 0.7s var(--animation-smooth-long) both;
}

.article-top-section,
.article-main-container {
  animation: fadeInUpSmooth 0.7s var(--animation-smooth-long) both;
}

.comment {
  animation: fadeInSmooth 0.6s var(--animation-smooth-long) both;
}

/* Focus styles for accessibility */
.reaction-btn:focus,
.share-btn:focus,
.submit-btn:focus,
.comment-textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  transition: outline 0.45s var(--animation-smooth);
}

/* Print styles */
@media print {
  .reactions-section,
  .comments-section,
  #footer-placeholder {
    display: none;
  }
  
  body {
    background: white !important;
    color: black !important;
    transition: none !important;
  }
  
  .content-wrapper {
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    animation: none !important;
  }
  
  .article-content {
    color: black !important;
    transition: none !important;
  }
  
  .article-title {
    -webkit-text-fill-color: black !important;
    color: black !important;
    transition: none !important;
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.45s var(--animation-smooth);
}

/* Smooth transitions for dynamic content */
.fade-in {
  animation: fadeInSmooth 0.45s var(--animation-smooth-long) both;
}

/* Enhanced hover effects */
.interactive:hover {
  transform: translateY(-2px);
  transition: transform 0.35s var(--animation-smooth);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  transition: width 0.35s var(--animation-smooth);
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  transition: background 0.35s var(--animation-smooth);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
  transition: background 0.35s var(--animation-smooth);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
