/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Reset only specific elements, not content elements */
body, h1, h2, h3, h4, h5, h6, nav, header, footer, section, article, aside {
  margin: 0;
  padding: 0;
}

/* Allow natural spacing for content elements */
.page-content *,
.post-content * {
  margin: revert;
  padding: revert;
}

/* Constrain images in post/page content */
.page-content img,
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-content img:hover,
.post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Remove clickable behavior from sidebar images */
.sidebar-post-image img {
  cursor: default !important;
  transition: none !important;
}

.sidebar-post-image img:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Specific constraints for very large images */
.page-content img[width],
.post-content img[width] {
  max-width: min(600px, 100%);
  width: auto !important;
  height: auto !important;
}

/* Exception for side-by-side layouts - allow full width */
.page-content .side-by-side img[width],
.post-content .side-by-side img[width] {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

/* Video embeds (YouTube, etc.) - Ghost specific */
.kg-embed-card {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 2rem 0;
  border-radius: var(--radius-md);
}

.kg-embed-card iframe[src*="youtube"],
.kg-embed-card iframe[src*="vimeo"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

.kg-embed-card iframe[src*="youtube"] iframe,
.kg-embed-card iframe[src*="vimeo"] iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Fallback for regular iframes */
.page-content iframe,
.post-content iframe {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

/* Ensure all YouTube/Vimeo iframes maintain aspect ratio */
iframe[src*="youtube"],
iframe[src*="vimeo"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  border-radius: var(--radius-md);
}

/* Alternative responsive container for direct iframe embeds */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

/* But keep our custom spacing for specific elements */
.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

:root {
  /* Colors */
  --primary-color: #68d391;
  --primary-dark: #48bb78;
  --secondary-color: #a6f0fc;
  --accent-color: #9ae6b4;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --background: #ffffff;
  --background-alt: #f7fafc;
  --border-color: #e2e8f0;
  --code-bg: #1a202c;
  --code-text: #e2e8f0;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  
  /* Spacing */
  --container-max-width: 1200px;
  --section-padding: 4rem 0;
  --grid-gap: 2rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

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

* {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* ===== LAYOUT ===== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  margin: 0;
  padding: 0;
}

/* ===== NAVIGATION ===== */
.site-header {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: fixed;
}

.site-nav {
  padding: 1.5rem 0;
}

.nav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand .site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand .site-title::before {
  content: "⭐";
  font-size: 1.5rem;
}

.site-logo {
  height: 4.5rem;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
}

.nav-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.5rem 0;
  opacity: 0.9;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--text-primary);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-menu a:hover {
  opacity: 1;
}

.nav-search {
  color: var(--text-primary);
  transition: color 0.2s ease;
  opacity: 0.9;
}

.nav-search:hover {
  opacity: 1;
}

/* ===== COMPACT HERO FOR PAGES ===== */
.hero-compact {
  padding: 3rem 0;
  min-height: auto;
}

.hero-compact .hero-content {
  display: block;
  text-align: center;
}

.hero-text-compact {
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-text-compact h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-description-compact {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.5;
  opacity: 0.9;
  margin: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, 
    #ffaff3 0%, 
    #ffd93d 25%, 
    #a6f0fc 50%, 
    #68d391 75%, 
    #ff79e6 100%);
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 200" fill="none"><path d="M0,100 Q250,50 500,100 T1000,100 Q1250,50 1500,100 T2000,100 L2000,0 L0,0 Z" fill="rgba(255,255,255,0.08)"/><path d="M0,120 Q300,80 600,120 T1200,120 Q1500,80 1800,120 T2400,120 L2400,0 L0,0 Z" fill="rgba(255,255,255,0.05)"/></svg>') repeat-x;
  background-size: 2000px 200px;
  animation: wave 30s linear infinite;
  opacity: 0.6;
}

@keyframes wave {
  0% { background-position-x: 0; }
  100% { background-position-x: 2000px; }
}

.hero-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-text {
  color: var(--text-primary);
}

.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.6;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-code {
  background: #2d3748;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.hero-code::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.hero-code pre {
  margin: 0;
  overflow-x: auto;
}

.hero-code code {
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== BUTTONS ===== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.button:hover::before {
  left: 100%;
}

.button.primary {
  background: rgba(45, 55, 72, 0.9);
  color: white;
  backdrop-filter: blur(10px);
}

.button.primary:hover {
  background: rgba(45, 55, 72, 1);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(45, 55, 72, 0.4);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.button.large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* ===== LATEST POSTS SECTION ===== */
.latest-posts {
  padding: 4rem 0;
  background: var(--background);
  border-top: none;
  border-bottom: 1px solid var(--border-color);
  margin-top: 0;
}

.latest-posts h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

/* ===== SECTIONS ===== */
.features {
  padding: 4rem 0;
  margin: 0;
  background: var(--background-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.features h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--grid-gap);
}

.feature-item {
  text-align: center;
  padding: 2rem;
  background: var(--background);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.feature-item > * {
  position: relative;
  z-index: 1;
}

.feature-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.feature-item:hover::before {
  opacity: 0.1;
}

.feature-item:hover .feature-icon {
  animation: pulse 1s ease-in-out;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-item h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.feature-item p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== POSTS GRID ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--grid-gap);
  margin-bottom: 3rem;
}

.post-card {
  background: var(--background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.post-card:hover::before {
  opacity: 0.05;
}

.post-card .post-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card .post-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-post-image img {
  display: block; /* Ensures image behaves predictably */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top; /* Align the image content to the top of its box */
}

.post-card h3 {
  margin-bottom: 0.5rem;
}

.post-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.post-card h3 a:hover {
  color: var(--primary-color);
}

.post-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

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

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

.tag {
  background: var(--background-alt);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-decoration: none;
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 6rem 0;
  text-align: center;
  color: var(--text-primary);
  margin: 0;
}

.cta-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== MAIN CONTENT SPACING ===== */
.main-content {
  padding: 0;
  margin: 0;
}

.main-content section {
  margin-bottom: 0;
}

.main-content section:last-child {
  margin-bottom: 0;
}

/* ===== CONTENT STYLING ===== */
.page-content h1,
.post-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 3rem 0 1.5rem 0;
  color: var(--text-primary);
}

.page-content h2,
.post-content h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2.5rem 0 1rem 0;
  color: var(--text-primary);
}

.page-content h3,
.post-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2rem 0 1rem 0;
  color: var(--text-primary);
}

.page-content h4,
.post-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--text-primary);
}

.page-content p,
.post-content p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.page-content ul,
.page-content ol,
.post-content ul,
.post-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.page-content li,
.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.page-content a,
.post-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.page-content a:hover,
.post-content a:hover {
  border-bottom-color: var(--primary-color);
}

/* Add extra spacing between major sections */
.page-content h3 + p,
.post-content h3 + p {
  margin-top: 1rem;
}

.page-content h3 + ul,
.page-content h3 + ol,
.post-content h3 + ul,
.post-content h3 + ol {
  margin-top: 1rem;
}

/* ===== PAGE CONTENT ===== */
.page-header {
  padding: 4rem 0 2rem;
  text-align: center;
  background: var(--background);
}

.page-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.page-excerpt {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.page-image {
  margin-bottom: 3rem;
}

.page-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.page-content {
  padding: 2rem 0 4rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* ===== POST CONTENT ===== */
.post-header {
  padding: 4rem 0 2rem;
  text-align: center;
}

.post-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-content {
  padding: 2rem 0;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--background-alt);
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  text-align: left;
}

.footer-section {
  text-align: left;
}

.footer-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: left;
}

.footer-section ul {
  list-style: none;
  text-align: left;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.75rem;
  text-align: left;
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  text-align: left;
  display: block;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-bottom p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  /* Ensure footer sections stay left-aligned on mobile */
  .footer-section,
  .footer-section h4,
  .footer-section ul,
  .footer-section li,
  .footer-section a,
  .latest-posts-footer,
  .latest-posts-footer li,
  .latest-posts-footer a {
    text-align: left !important;
  }
  
  .hero {
    padding: 6rem 0 4rem;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .nav-menu ul {
    display: none;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .button {
    width: 100%;
    max-width: 300px;
  }
  
  /* Better video sizing on mobile */
  .page-content iframe,
  .post-content iframe {
    min-height: 250px;
    margin: 1.5rem 0 2rem 0;
  }
  
  .kg-width-wide,
  .kg-width-full {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  
  .kg-bookmark-container {
    flex-direction: column;
  }
  
  .kg-bookmark-thumbnail {
    width: 100%;
    height: 200px;
  }
  
  .kg-gallery-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .post-container,
  .page-container {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar,
  .page-sidebar {
    display: none;
  }
  
  .post-container,
  .page-container {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar,
  .page-sidebar {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .hero {
    padding: 6rem 0 3rem;
  }
  
  .hero-text h1 {
    font-size: 2rem;
  }
  
  .features {
    padding: 3rem 0;
  }
  
  .feature-item {
    padding: 1.5rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

/* ===== SIDE-BY-SIDE LAYOUTS ===== */
.page-content .side-by-side,
.post-content .side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 2rem;
  margin: 2rem 0;
  width: 100%;
  align-items: flex-start;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.page-content .side-by-side > *,
.post-content .side-by-side > * {
  margin: 0 !important;
}

.page-content .side-by-side iframe,
.post-content .side-by-side iframe {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  min-height: 280px !important;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 0 !important;
}

.page-content .side-by-side .kg-embed-card,
.post-content .side-by-side .kg-embed-card {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 0 !important;
  border-radius: var(--radius-md);
}

.page-content .side-by-side .kg-embed-card iframe,
.post-content .side-by-side .kg-embed-card iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.page-content .side-by-side img,
.post-content .side-by-side img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 0 !important;
}

@media (max-width: 850px) {
  .page-content .side-by-side,
  .post-content .side-by-side {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    grid-template-columns: none !important;
  }
  
  .page-content .side-by-side > *,
  .post-content .side-by-side > * {
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
  }
  
  .page-content .side-by-side .kg-embed-card,
  .post-content .side-by-side .kg-embed-card {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    margin: 0 0 1.5rem 0 !important;
    border-radius: var(--radius-sm) !important;
    display: block !important;
  }
  
  .page-content .side-by-side .kg-embed-card iframe,
  .post-content .side-by-side .kg-embed-card iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
  }
  
  .page-content .side-by-side img,
  .post-content .side-by-side img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 0 1.5rem 0 !important;
    position: relative !important;
    display: block !important;
  }
  
  .page-content .side-by-side > *:last-child,
  .post-content .side-by-side > *:last-child {
    margin-bottom: 0 !important;
  }
}

/* ===== GAME SHOWCASE ===== */
.game-showcase {
  padding: 4rem 0;
  background: var(--background);
  text-align: center;
  position: relative;
  overflow: visible;
}

.game-showcase h2 {
  margin-bottom: 1rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.game-showcase h3 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.game-showcase p {
  margin-bottom: 2rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.game-showcase .side-by-side {
  display: flex !important;
  gap: 2rem !important;
  margin: 2rem 0 3rem 0 !important; /* Add more bottom margin to prevent overlap */
  width: 100% !important;
  max-width: 1000px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-items: stretch !important;
  position: relative !important;
  z-index: 1 !important;
  grid-template-columns: none !important; /* Override any grid styles */
  grid-gap: 0 !important; /* Override any grid styles */
  column-gap: 2rem !important; /* Ensure column gap is set */
  row-gap: 2rem !important; /* Ensure row gap is set */
}

.game-showcase .side-by-side > * {
  flex: 1 !important;
  margin: 0 !important;
  min-height: 0 !important; /* Allow flex items to shrink */
  position: relative !important;
  z-index: 2 !important;
}

.game-showcase .side-by-side > *:first-child {
  margin-right: 1rem !important; /* Add right margin to first element */
}

.game-showcase .side-by-side > *:last-child {
  margin-left: 1rem !important; /* Add left margin to last element */
}

.game-showcase iframe {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 280px !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}

.game-showcase .kg-embed-card {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 16 / 9 !important; /* Use aspect-ratio instead of padding-bottom */
  margin: 0 !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  padding-bottom: 0 !important; /* Override any padding-bottom from general styles */
  height: auto !important; /* Override any height: 0 from general styles */
}

.game-showcase .kg-embed-card iframe[src*="youtube"],
.game-showcase .kg-embed-card iframe[src*="vimeo"] {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}

.game-showcase .kg-image-card {
  display: flex !important;
  align-items: stretch !important;
  aspect-ratio: 16 / 9 !important; /* Match the video aspect ratio */
  overflow: hidden !important;
  border-radius: var(--radius-md) !important;
}

.game-showcase img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  margin: 0 !important;
  display: block !important;
}

.game-actions {
  margin-top: 2rem;
  clear: both;
  position: relative;
  z-index: 1;
}

/* Ensure the game showcase section has proper clearfix */
.game-showcase {
  padding: 4rem 0;
  background: var(--background);
  text-align: center;
  overflow: hidden; /* Prevent any floating issues */
}

.game-showcase::after {
  content: "";
  display: table;
  clear: both;
}

/* iPad Pro specific styles - between tablet and desktop */
@media (min-width: 769px) and (max-width: 1024px) {
  .game-showcase .side-by-side {
    display: flex !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
    grid-gap: 0 !important;
    margin: 2rem 0 3rem 0 !important;
  }
  
  .game-showcase .side-by-side > * {
    flex: 1 !important;
    margin: 0 !important;
    min-height: 0 !important;
  }
  
  .game-showcase .side-by-side > *:first-child {
    margin-right: 1rem !important; /* Add right margin to first element */
  }

  .game-showcase .side-by-side > *:last-child {
    margin-left: 1rem !important; /* Add left margin to last element */
  }
  
  .game-showcase .kg-embed-card {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0 !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
    height: auto !important;
  }
  
  .game-showcase .kg-embed-card iframe[src*="youtube"],
  .game-showcase .kg-embed-card iframe[src*="vimeo"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
  }
  
  .game-showcase .kg-image-card {
    display: flex !important;
    align-items: stretch !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: var(--radius-md) !important;
  }
  
  .game-showcase img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    margin: 0 !important;
    display: block !important;
  }
}

@media (max-width: 768px) {
  .game-showcase .side-by-side {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .game-showcase .side-by-side > * {
    flex: none;
  }
  
  /* Remove horizontal margins on mobile since layout is vertical */
  .game-showcase .side-by-side > *:first-child {
    margin-right: 0 !important;
  }

  .game-showcase .side-by-side > *:last-child {
    margin-left: 0 !important;
  }
  
  .game-showcase .kg-embed-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 1rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  
  .game-showcase .kg-embed-card iframe[src*="youtube"],
  .game-showcase .kg-embed-card iframe[src*="vimeo"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-sm);
  }
  
  .game-showcase .kg-image-card {
    display: flex;
    align-items: stretch;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-sm);
  }
  
  .game-showcase img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin: 0;
    display: block;
  }
  
  .game-showcase iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    min-height: 200px !important;
    border: none;
    border-radius: var(--radius-sm);
  }
  
  .game-showcase .side-by-side > * {
    position: relative;
    z-index: 1;
    margin: 0 0 1rem 0 !important;
  }
  
  .game-showcase .side-by-side > *:last-child {
    margin-bottom: 0 !important;
  }
}

/* ===== VIEW ALL CARD ===== */
.view-all-card {
  background: linear-gradient(135deg, #68d391, #4fd1c5);
  border: none;
  color: #1a4731;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.view-all-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.view-all-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.view-all-card:hover::before {
  opacity: 1;
}

.view-all-card-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.view-all-card .post-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  height: 100%;
  min-height: 250px;
  padding: 2rem;
  box-sizing: border-box;
}

.view-all-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
}

.tutorial-icon {
  color: #1a4731;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.view-all-card h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a4731;
}

.view-all-card p {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: #2d3748;
  max-width: 90%;
}

.view-all-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
}

.tutorial-count {
  font-weight: 600;
  color: #1a4731;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
}

.view-all-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.view-all-icon {
  color: #1a4731;
  transition: transform 0.3s ease;
}

.view-all-card:hover .view-all-icon-container {
  background: rgba(255, 255, 255, 0.5);
}

.view-all-card:hover .view-all-icon {
  transform: translateX(3px);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.view-all-icon-container {
  animation: pulse 2s infinite;
}

.view-all-card:hover .view-all-icon,
.view-all-icon:hover {
  opacity: 1;
  transform: translateX(5px);
}

.view-all-icon svg {
  color: var(--text-primary);
}

/* Post Footer Spacing */
.post-footer-spacing {
  height: 3rem;
  width: 100%;
  clear: both;
}

/* Tag Page Spacing */
.tag-content {
  margin-top: 2rem;
}

/* Ghost Search Styling */
.nav-search {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ghost Search Modal Styling */
.gh-search-container {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.9);
}

.gh-search-inner {
  background: var(--background);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 700px;
  width: 90%;
  animation: fadeInUp 0.5s ease forwards;
}

.gh-search-input {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--background);
  font-size: 1.25rem;
  padding: 1rem 1.5rem;
  transition: border-color 0.3s ease;
}

.gh-search-input:focus {
  border-color: var(--primary-color);
}

.gh-search-close {
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.gh-search-close:hover {
  color: var(--text-primary);
}

.search-form-container {
  margin: 1rem 0 2rem;
  text-align: center;
}

.search-form {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  outline: none;
  transition: border-color 0.3s ease;
  background: var(--background);
  color: var(--text-primary);
}

.search-form input[type="search"]:focus {
  border-color: var(--primary-color);
}

.search-button {
  padding: 1rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 1.1rem;
  font-weight: 500;
}

.search-button:hover {
  background: var(--primary-color-dark);
}

/* Ghost search results styling */
.gh-search-item {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--background-alt);
  border-radius: var(--radius-md);
  transition: transform 0.3s ease;
}

.gh-search-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gh-search-item-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.gh-search-item-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.gh-search-item-title a:hover {
  color: var(--primary-color);
}

.gh-search-item-excerpt {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Hide dates in search results */
.gh-search-item-meta {
  display: none;
}

/* Search page styling (for fallback) */
.search-content {
  margin-top: 2rem;
}

.no-results {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem;
  background: var(--background-alt);
  border-radius: var(--radius-md);
}

.latest-heading {
  margin: 3rem 0 1.5rem;
  text-align: center;
}

/* ===== NAVIGATION STYLES ===== */
/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
}

.desktop-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.5rem 0;
  opacity: 0.9;
}

.desktop-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--text-primary);
  transition: width 0.3s ease;
}

.desktop-nav a:hover::after {
  width: 100%;
}

.desktop-nav a:hover {
  opacity: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
  position: relative;
}

.mobile-menu-toggle .bar {
  display: block;
  width: 28px;
  height: 3px;
  margin: 6px 0;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 3px;
}

.mobile-menu-toggle.active .bar {
  background-color: white;
}

.mobile-menu-toggle.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 2rem;
}

.mobile-nav-content .nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 0 0 2rem 0;
  padding: 0;
  width: 100%;
  text-align: center;
  list-style: none;
}

.mobile-nav-content .nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
  width: 100%;
  list-style: none;
}

.mobile-nav-content .nav li {
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-nav-content .nav a {
  color: white;
  font-size: 1.75rem;
  padding: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 1;
  display: inline-block;
  text-decoration: none;
}

.mobile-nav-content .nav a:hover,
.mobile-nav-content .nav a:focus {
  color: white;
  text-decoration: underline;
}

/* Search button within navigation */
.mobile-nav-content .nav .nav-search-item {
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
}

.mobile-nav-content .nav .nav-search {
  color: white;
  font-size: 1.75rem;
  padding: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 1;
  background: none;
  border: none;
  display: inline-block;
}

.mobile-nav-content .nav .nav-search:hover {
  color: white;
  text-decoration: underline;
}

/* Responsive Navigation */
@media (max-width: 768px) {
  .site-nav {
    padding: 1rem 0;
  }
  
  .mobile-menu-toggle {
    display: block;
    margin-right: 0.5rem;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav-overlay {
    display: block;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  .button {
    width: 100%;
    max-width: 300px;
  }
  
  .kg-width-wide,
  .kg-width-full {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  
  .kg-bookmark-container {
    flex-direction: column;
  }
  
  .kg-bookmark-thumbnail {
    width: 100%;
    height: 200px;
  }
  
  .kg-gallery-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .post-container,
  .page-container {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar,
  .page-sidebar {
    display: none;
  }
  
  /* Mobile video embed fixes */
  .kg-embed-card {
    margin: 1.5rem 0 2rem 0;
  }
  
  /* Override for side-by-side layouts on mobile */
  .page-content .side-by-side .kg-embed-card,
  .post-content .side-by-side .kg-embed-card {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
    margin: 0 0 1.5rem 0 !important;
    border-radius: var(--radius-sm) !important;
    display: block !important;
  }
  
  .kg-embed-card iframe[src*="youtube"],
  .kg-embed-card iframe[src*="vimeo"] {
    border-radius: var(--radius-sm);
    min-height: 200px; /* Minimum height for mobile */
  }
  
  /* Override for side-by-side layouts on mobile */
  .page-content .side-by-side .kg-embed-card iframe[src*="youtube"],
  .page-content .side-by-side .kg-embed-card iframe[src*="vimeo"],
  .post-content .side-by-side .kg-embed-card iframe[src*="youtube"],
  .post-content .side-by-side .kg-embed-card iframe[src*="vimeo"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: var(--radius-sm) !important;
    min-height: auto !important;
  }
}

/* ===== SIDEBAR STYLES (SHARED) ===== */
.post-container,
.page-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
}

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

.post-sidebar,
.page-sidebar {
  align-self: start;
}

/* Ensure content takes full width on mobile */
@media (max-width: 768px) {
  .post-container,
  .page-container {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar,
  .page-sidebar {
    display: none;
  }
}

.page-content,
.post-content {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Mobile video embed fixes */

/* ===== TUTORIAL SECTIONS ===== */
.tutorial-section {
  margin-bottom: 3rem;
}

.tutorial-section h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.tutorial-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

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



.tutorial-list li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
}

.tutorial-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.tutorial-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.tutorial-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-intro {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

/* ===== SIDEBAR STYLES ===== */
.sidebar-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--background-alt);
  border-radius: var(--radius-md);
}

.sidebar-section h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}

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

.sidebar-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--background);
  border-radius: var(--radius-sm);
  color: #3e8e41;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-tag:hover {
  background: #3e8e41;
  color: white;
}

.tag-count {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.sidebar-recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-post {
  display: flex;
  align-items: flex-start; /* Align tops of icon/image and text content */
  gap: 0.75rem;
}

.sidebar-post-image {
  flex: 0 0 56px; /* Don't grow, don't shrink, basis 56px */
  width: 56px;
  height: 56px; /* Restore fixed height */
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-start; /* Align image to top of container */
}

.sidebar-post-image img {
  display: block; /* Ensures image behaves predictably */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* Crop from bottom, keep top aligned */
  margin: 0;
  padding: 0;
}

.sidebar-post-icon {
  flex: 0 0 24px; /* Fixed width for the icon column */
  display: flex;
  align-items: flex-start;   /* Align SVG to the top of this container */
  /* justify-content: center; removed as align-items handles vertical for single child */
  color: var(--text-secondary);
  /* Height will be determined by SVG content + border */
}

.sidebar-post-icon svg {
  width: 18px;
  height: 18px;
  display: block; /* Recommended for SVGs in flex containers */
}

.sidebar-post-content h5 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 400;
}

.sidebar-post-content a {
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-post-content a:hover {
  color: #3e8e41;
}

.social-links-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
}

.social-links-vertical a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  text-align: left;
}

.social-links-vertical a:hover {
  color: var(--primary-color);
}

.latest-posts-footer {
  text-align: left;
}

.latest-posts-footer li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.latest-posts-footer li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.latest-posts-footer a {
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}

.latest-posts-footer time {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: left;
}

/* ===== MEMBERSHIP NAVIGATION ===== */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-membership {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-signin,
.nav-account {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
  opacity: 0.9;
}

.nav-signin:hover,
.nav-account:hover {
  opacity: 1;
}

.nav-subscribe {
  background: white !important;
  color: var(--text-primary) !important;
  text-decoration: none;
  font-weight: 800 !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  font-size: 0.95rem;
}

.nav-subscribe:hover {
  background: var(--background-alt) !important;
  color: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg) !important;
}

/* ===== COMMENTS SECTION ===== */
.post-comments {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.post-comments .container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}


