/**
 * Blog System Styles - AutoNateAI
 * Block-based component library for rich, interactive blog posts
 *
 * Philosophy: Each blog is a story. These blocks are the building blocks
 * of that story — modular, animated, and distinctly AutoNateAI.
 */

/* ===== CSS Variables (extends marketing.css) ===== */
:root {
  /* Blog-specific spacing */
  --blog-max-width: 800px;
  --blog-wide-width: 1000px;
  --blog-full-width: 100%;

  /* Block spacing */
  --block-gap: 3rem;
  --block-padding: 2rem;

  /* Animation timing */
  --entrance-duration: 0.6s;
  --entrance-easing: cubic-bezier(0.16, 1, 0.3, 1);
  --hover-duration: 0.2s;

  /* Blog colors (dark theme) */
  --blog-bg: #0a0a0f;
  --blog-surface: #12121a;
  --blog-card: #16162a;
  --blog-border: rgba(121, 134, 203, 0.2);
  --blog-glow: rgba(121, 134, 203, 0.1);
}

/* ===== Article Container ===== */
.article-container {
  max-width: var(--blog-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-container.wide {
  max-width: var(--blog-wide-width);
}

.article-container.full {
  max-width: var(--blog-full-width);
  padding: 0;
}

/* ===== Base Block Styles ===== */
.blog-block {
  margin-bottom: var(--block-gap);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--entrance-duration) var(--entrance-easing),
              transform var(--entrance-duration) var(--entrance-easing);
}

.blog-block.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sequential blocks */
.blog-block:nth-child(1) { transition-delay: 0s; }
.blog-block:nth-child(2) { transition-delay: 0.1s; }
.blog-block:nth-child(3) { transition-delay: 0.2s; }
.blog-block:nth-child(4) { transition-delay: 0.3s; }
.blog-block:nth-child(5) { transition-delay: 0.4s; }

/* ===== HERO BLOCK ===== */
/* Hero overrides blog-block opacity — visible immediately, animated by JS */
.blog-block.hero-block {
  opacity: 1;
  transform: none;
}

.hero-block {
  position: relative;
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  align-items: center;
  align-content: center;
  text-align: left;
  padding: 4rem 2rem;
  padding-left: max(2rem, calc((100vw - 1000px) / 2));
  padding-right: max(2rem, calc((100vw - 1000px) / 2));
  gap: 0 3rem;
  margin-bottom: 4rem;
  overflow: hidden;
  background: linear-gradient(180deg, var(--blog-surface) 0%, var(--blog-bg) 100%);
}

/* Grid placement: text content on left, image spanning right */
.hero-block .category-badge {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.hero-block .article-title {
  grid-column: 1;
  grid-row: 2;
}

.hero-block .article-meta {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

.hero-block .hero-image {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  position: relative;
  z-index: 1;
}

.hero-block .hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Animated gradient mesh background */
.hero-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(121, 134, 203, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(77, 182, 172, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(206, 147, 216, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 213, 79, 0.08) 0%, transparent 40%);
  pointer-events: none;
  animation: blogGradientMesh 14s ease-in-out infinite alternate;
}

/* Subtle drifting grid overlay */
.hero-block::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background-image:
    linear-gradient(rgba(121, 134, 203, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 134, 203, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  animation: blogGridDrift 25s linear infinite;
}

/* Category badge: glass-pill with pulsing dot */
.hero-block .category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(121, 134, 203, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(121, 134, 203, 0.25);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.hero-block .category-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: blogBadgePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Article title: multi-stop gradient */
.hero-block .article-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 900px;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

/* Article meta: pill-style spans */
.hero-block .article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.hero-block .article-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Legacy hero-visual (absolute-positioned background) */
.hero-block .hero-visual {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

/* Hero with no image: fall back to centered single-column */
.hero-block:not(:has(.hero-image)) {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}

.hero-block:not(:has(.hero-image)) .article-meta {
  justify-content: center;
}

/* ===== TEXT BLOCK ===== */
.text-block {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.text-block.lead {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.9;
}

.text-block p {
  margin-bottom: 1.5rem;
}

.text-block p:last-child {
  margin-bottom: 0;
}

/* Enhanced strong with gradient underline on hover */
.text-block strong {
  color: var(--text-primary);
  font-weight: 600;
  position: relative;
}

.text-block strong::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.text-block strong:hover::after {
  transform: scaleX(1);
}

/* Enhanced inline code: glass-pill */
.text-block code {
  padding: 0.2rem 0.55rem;
  background: rgba(121, 134, 203, 0.1);
  border: 1px solid rgba(121, 134, 203, 0.2);
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 0.88em;
  color: var(--accent-primary);
  transition: all var(--hover-duration);
}

.text-block code:hover {
  background: rgba(121, 134, 203, 0.15);
  box-shadow: 0 0 8px rgba(121, 134, 203, 0.15);
}

.text-block a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--hover-duration);
}

.text-block a:hover {
  color: var(--accent-secondary);
}

/* ===== QUOTE BLOCK ===== */
.quote-block {
  position: relative;
  padding: 2.5rem 2.5rem 2.5rem 3rem;
  margin: 2rem 0;
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary)) 1;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: box-shadow 0.3s ease;
}

.quote-block:hover {
  box-shadow: -4px 0 20px rgba(121, 134, 203, 0.15), 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Large decorative opening quote */
.quote-block::before {
  content: '\201C';
  position: absolute;
  top: -10px;
  left: 1rem;
  font-size: 5rem;
  font-family: Georgia, serif;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.4;
  line-height: 1;
}

/* Decorative closing quote */
.quote-block::after {
  content: '\201D';
  position: absolute;
  bottom: -10px;
  right: 1.5rem;
  font-size: 4rem;
  font-family: Georgia, serif;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.2;
  line-height: 1;
}

.quote-block blockquote {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
}

/* Citation: accent color with dash */
.quote-block cite {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-style: normal;
  color: var(--accent-primary);
}

/* ===== CALLOUT BLOCK ===== */
.callout-block {
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--hover-duration), box-shadow var(--hover-duration);
  overflow: hidden;
}

/* Left accent stripe */
.callout-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.callout-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Callout icon: gradient background circle */
.callout-block .callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.callout-block .callout-content {
  flex: 1;
}

.callout-block .callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.callout-block .callout-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Callout variants — glass treatment */
.callout-block.info {
  background: rgba(121, 134, 203, 0.08);
  border: 1px solid rgba(121, 134, 203, 0.2);
}
.callout-block.info::before { background: linear-gradient(180deg, #7986CB, #5C6BC0); }
.callout-block.info .callout-icon { background: rgba(121, 134, 203, 0.2); }
.callout-block.info .callout-title { color: var(--accent-primary); }

.callout-block.success {
  background: rgba(102, 187, 106, 0.08);
  border: 1px solid rgba(102, 187, 106, 0.2);
}
.callout-block.success::before { background: linear-gradient(180deg, #81C784, #66BB6A); }
.callout-block.success .callout-icon { background: rgba(102, 187, 106, 0.2); }
.callout-block.success .callout-title { color: var(--accent-success); }

.callout-block.warning {
  background: rgba(255, 213, 79, 0.08);
  border: 1px solid rgba(255, 213, 79, 0.2);
}
.callout-block.warning::before { background: linear-gradient(180deg, #FFD54F, #FFC107); }
.callout-block.warning .callout-icon { background: rgba(255, 213, 79, 0.2); }
.callout-block.warning .callout-title { color: var(--accent-warning); }

.callout-block.danger {
  background: rgba(239, 83, 80, 0.08);
  border: 1px solid rgba(239, 83, 80, 0.2);
}
.callout-block.danger::before { background: linear-gradient(180deg, #EF5350, #E53935); }
.callout-block.danger .callout-icon { background: rgba(239, 83, 80, 0.2); }
.callout-block.danger .callout-title { color: var(--accent-error); }

/* ===== IMAGE BLOCK ===== */
.image-block {
  margin: 2.5rem 0;
}

.image-block img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(121, 134, 203, 0.1);
  cursor: zoom-in;
  transition: transform var(--hover-duration), box-shadow var(--hover-duration);
}

.image-block img:hover {
  transform: scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(121, 134, 203, 0.08);
}

.image-block .image-caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 1rem;
  border-left: 3px solid rgba(121, 134, 203, 0.3);
  text-align: left;
}

/* Wide image variant */
.image-block.wide {
  margin-left: -10%;
  margin-right: -10%;
  max-width: 120%;
}

/* ===== GALLERY BLOCK ===== */
.gallery-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}

.gallery-block .gallery-item {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.gallery-block .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-block .gallery-item:hover img {
  transform: scale(1.1);
}

/* ===== VIDEO BLOCK ===== */
.video-block {
  margin: 2.5rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.video-block .video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}

.video-block .video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-block .video-caption {
  padding: 1rem;
  background: var(--blog-surface);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== MERMAID BLOCK ===== */
.mermaid-block {
  margin: 2.5rem 0;
  padding: 2rem;
  background: var(--blog-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-border);
  overflow-x: auto;
}

.mermaid-block .mermaid {
  display: flex;
  justify-content: center;
}

.mermaid-block .mermaid svg {
  max-width: 100%;
  height: auto;
}

.mermaid-block .diagram-caption {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--blog-border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== CODE BLOCK ===== */
.code-block {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1a1a2e;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Code header: gradient left accent stripe */
.code-block .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.code-block .code-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

/* Language badge: pill-style with gradient */
.code-block .code-language {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50px;
}

/* Copy button: glass treatment */
.code-block .code-copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--hover-duration);
}

.code-block .code-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(121, 134, 203, 0.15);
}

.code-block .code-copy.copied {
  color: var(--accent-success);
  border-color: var(--accent-success);
}

/* Code area: subtle left border gradient hint */
.code-block pre {
  margin: 0;
  padding: 1.5rem;
  padding-left: 1.75rem;
  overflow-x: auto;
  font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border-left: 2px solid rgba(121, 134, 203, 0.1);
}

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

/* ===== COMPARISON BLOCK ===== */
.comparison-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2.5rem 0;
}

@media (max-width: 768px) {
  .comparison-block {
    grid-template-columns: 1fr;
  }
}

.comparison-block .comparison-side {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.comparison-block .comparison-header {
  padding: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-block .comparison-side.bad .comparison-header {
  background: rgba(239, 83, 80, 0.2);
  color: var(--accent-error);
}

.comparison-block .comparison-side.good .comparison-header {
  background: rgba(102, 187, 106, 0.2);
  color: var(--accent-success);
}

.comparison-block .comparison-content {
  background: var(--blog-surface);
  padding: 1.5rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  min-height: 150px;
}

/* ===== TERMINAL BLOCK ===== */
.terminal-block {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0d0d0d;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.terminal-block .terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
}

.terminal-block .terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-block .terminal-dot.red { background: #ff5f56; }
.terminal-block .terminal-dot.yellow { background: #ffbd2e; }
.terminal-block .terminal-dot.green { background: #27c93f; }

.terminal-block .terminal-title {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-block pre {
  margin: 0;
  padding: 1.5rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #4af626;
  overflow-x: auto;
}

.terminal-block .prompt {
  color: var(--accent-primary);
}

.terminal-block .output {
  color: var(--text-secondary);
}

/* ===== POLL BLOCK ===== */
.poll-block {
  margin: 2.5rem 0;
  padding: 2rem;
  background: var(--blog-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-border);
}

.poll-block .poll-question {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.poll-block .poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.poll-block .poll-option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--blog-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--hover-duration);
  overflow: hidden;
}

.poll-block .poll-option:hover {
  border-color: var(--accent-primary);
  background: rgba(121, 134, 203, 0.05);
}

.poll-block .poll-option.selected {
  border-color: var(--accent-primary);
  background: rgba(121, 134, 203, 0.1);
}

.poll-block .poll-option input {
  display: none;
}

.poll-block .poll-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: all var(--hover-duration);
}

.poll-block .poll-option.selected .poll-radio {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.poll-block .poll-option.selected .poll-radio::after {
  content: '\2713';
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.poll-block .poll-label {
  flex: 1;
  font-size: 1rem;
}

.poll-block .poll-percentage {
  font-weight: 600;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity var(--hover-duration);
}

.poll-block.voted .poll-percentage {
  opacity: 1;
}

.poll-block .poll-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(121, 134, 203, 0.15);
  width: 0;
  transition: width 0.5s ease;
}

.poll-block.voted .poll-bar {
  width: var(--percentage, 0%);
}

.poll-block .poll-total {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--blog-border);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== QUIZ BLOCK ===== */
.quiz-block {
  margin: 2.5rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--blog-surface), var(--blog-card));
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-border);
}

.quiz-block .quiz-question {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.quiz-block .quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quiz-block .quiz-option {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--blog-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--hover-duration);
}

.quiz-block .quiz-option:hover:not(.disabled) {
  border-color: var(--accent-primary);
}

.quiz-block .quiz-option.correct {
  border-color: var(--accent-success);
  background: rgba(102, 187, 106, 0.1);
}

.quiz-block .quiz-option.incorrect {
  border-color: var(--accent-error);
  background: rgba(239, 83, 80, 0.1);
}

.quiz-block .quiz-option.disabled {
  cursor: default;
  opacity: 0.6;
}

.quiz-block .quiz-feedback {
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  display: none;
}

.quiz-block .quiz-feedback.visible {
  display: block;
}

.quiz-block .quiz-feedback.correct {
  background: rgba(102, 187, 106, 0.1);
  border: 1px solid rgba(102, 187, 106, 0.3);
  color: var(--accent-success);
}

.quiz-block .quiz-feedback.incorrect {
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.3);
  color: var(--accent-error);
}

/* ===== REVEAL BLOCK ===== */
.reveal-block {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--blog-border);
}

.reveal-block .reveal-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: var(--blog-surface);
  cursor: pointer;
  transition: background var(--hover-duration);
}

.reveal-block .reveal-trigger:hover {
  background: var(--blog-card);
}

.reveal-block .reveal-title {
  font-weight: 600;
  color: var(--text-primary);
}

.reveal-block .reveal-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.reveal-block.open .reveal-icon {
  transform: rotate(180deg);
}

.reveal-block .reveal-content {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: var(--blog-card);
}

.reveal-block.open .reveal-content {
  padding: 1.25rem;
  max-height: 1000px;
}

/* ===== STATS BLOCK ===== */
.stats-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
  padding: 2rem;
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-border);
}

.stats-block .stat-item {
  text-align: center;
  position: relative;
}

/* Subtle dividers between stat items */
.stats-block .stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--blog-border), transparent);
}

/* Per-stat color cycling */
.stats-block .stat-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-block .stat-item:nth-child(1) .stat-value {
  background-image: linear-gradient(135deg, #7986CB, #5C6BC0);
}
.stats-block .stat-item:nth-child(2) .stat-value {
  background-image: linear-gradient(135deg, #4DB6AC, #26A69A);
}
.stats-block .stat-item:nth-child(3) .stat-value {
  background-image: linear-gradient(135deg, #FFD54F, #FFC107);
}
.stats-block .stat-item:nth-child(4) .stat-value {
  background-image: linear-gradient(135deg, #FF8A65, #FF7043);
}
.stats-block .stat-item:nth-child(5) .stat-value {
  background-image: linear-gradient(135deg, #81C784, #66BB6A);
}
.stats-block .stat-item:nth-child(6) .stat-value {
  background-image: linear-gradient(135deg, #CE93D8, #AB47BC);
}

.stats-block .stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== TIMELINE BLOCK ===== */
.timeline-block {
  margin: 2.5rem 0;
  position: relative;
  padding-left: 2rem;
}

.timeline-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

.timeline-block .timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 2rem;
}

.timeline-block .timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-block .timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 0 4px var(--blog-bg);
}

.timeline-block .timeline-date {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.timeline-block .timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline-block .timeline-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== CTA BLOCK ===== */
.cta-block {
  position: relative;
  margin: 3rem 0;
  padding: 3rem;
  border-radius: var(--radius-xl);
  text-align: center;
  overflow: hidden;
  /* Animated gradient border via double background */
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, var(--blog-card), var(--blog-surface)) padding-box,
    linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary)) border-box;
  background-size: 100% 100%, 200% 200%;
  animation: blogCtaBorderRotate 4s ease infinite;
}

/* Glass interior overlay */
.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* Floating decorative circle top-right */
.cta-block::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(121, 134, 203, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* CTA title: gradient text */
.cta-block .cta-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.cta-block .cta-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* CTA button: pulsing glow */
.cta-block .cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: transform var(--hover-duration), box-shadow var(--hover-duration);
  animation: blogCtaGlow 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.cta-block .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(121, 134, 203, 0.4), 0 0 40px rgba(121, 134, 203, 0.2);
}

/* ===== AUTHOR BLOCK ===== */
.author-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem 0;
  padding: 2rem;
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-border);
  position: relative;
  overflow: hidden;
  transition: transform var(--hover-duration), box-shadow var(--hover-duration);
}

/* Subtle left gradient stripe */
.author-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

.author-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Avatar: gradient ring border */
.author-block .author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background-image: linear-gradient(var(--blog-surface), var(--blog-surface)), linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.author-block .author-info {
  flex: 1;
}

/* Author name: gradient text */
.author-block .author-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Role: glass pill badge */
.author-block .author-role {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.75rem;
  background: rgba(121, 134, 203, 0.1);
  border: 1px solid rgba(121, 134, 203, 0.2);
  border-radius: 50px;
}

.author-block .author-bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== RELATED BLOCK ===== */
.related-block {
  margin: 4rem 0 2rem;
  padding-top: 3rem;
  border-top: 1px solid var(--blog-border);
}

.related-block .related-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.related-block .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-block .related-card {
  background: var(--blog-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  transition: transform var(--hover-duration), box-shadow var(--hover-duration);
  border: 1px solid var(--blog-border);
}

.related-block .related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-primary);
}

.related-block .related-category {
  font-size: 0.8rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.related-block .related-card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-block .related-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== DIVIDER BLOCK ===== */
.divider-block {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
  gap: 1.5rem;
}

.divider-block::before,
.divider-block::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(121, 134, 203, 0.3), transparent);
}

/* Gradient icon with glow */
.divider-block .divider-icon {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(121, 134, 203, 0.3));
}

/* ===== SECTION BLOCK ===== */
.section-block {
  margin: 4rem 0;
}

/* Enhanced section numbers: 44px with hover scale */
.section-block .section-number {
  display: inline-block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
  text-align: center;
  line-height: 44px;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.section-block .section-number:hover {
  transform: scale(1.15);
}

/* Per-section color cycling via nth-of-type (6-color cycle) */
.section-block:nth-of-type(6n+1) .section-number {
  background: linear-gradient(135deg, #7986CB, #5C6BC0);
  box-shadow: 0 4px 15px rgba(121, 134, 203, 0.35);
}

.section-block:nth-of-type(6n+2) .section-number {
  background: linear-gradient(135deg, #4DB6AC, #26A69A);
  box-shadow: 0 4px 15px rgba(77, 182, 172, 0.35);
}

.section-block:nth-of-type(6n+3) .section-number {
  background: linear-gradient(135deg, #FFD54F, #FFC107);
  box-shadow: 0 4px 15px rgba(255, 213, 79, 0.35);
  color: #1a1a2e;
}

.section-block:nth-of-type(6n+4) .section-number {
  background: linear-gradient(135deg, #FF8A65, #FF7043);
  box-shadow: 0 4px 15px rgba(255, 138, 101, 0.35);
}

.section-block:nth-of-type(6n+5) .section-number {
  background: linear-gradient(135deg, #81C784, #66BB6A);
  box-shadow: 0 4px 15px rgba(129, 199, 132, 0.35);
}

.section-block:nth-of-type(6n+6) .section-number {
  background: linear-gradient(135deg, #CE93D8, #AB47BC);
  box-shadow: 0 4px 15px rgba(206, 147, 216, 0.35);
}

.section-block .section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-block .section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ===== Lightbox (for images) ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius-md);
  cursor: zoom-out;
}

.lightbox .lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--hover-duration);
}

.lightbox .lightbox-close:hover {
  opacity: 1;
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow:
    0 0 8px rgba(121, 134, 203, 0.4),
    0 0 20px rgba(77, 182, 172, 0.2);
}

/* Pulse on leading edge */
.reading-progress::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 12px rgba(77, 182, 172, 0.6);
  animation: blogProgressGlow 1.5s ease-in-out infinite;
}

/* ===== Keyframe Animations ===== */
@keyframes blogGradientMesh {
  0% {
    background-position: 0% 0%;
    opacity: 1;
  }
  33% {
    opacity: 0.8;
  }
  66% {
    opacity: 1;
  }
  100% {
    background-position: 100% 100%;
    opacity: 0.9;
  }
}

@keyframes blogGridDrift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(60px, 60px);
  }
}

@keyframes blogCtaGlow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(121, 134, 203, 0.3);
  }
  50% {
    box-shadow: 0 4px 25px rgba(121, 134, 203, 0.5), 0 0 40px rgba(77, 182, 172, 0.2);
  }
}

@keyframes blogCtaBorderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes blogBadgePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

@keyframes blogProgressGlow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

/* ===== Mobile Responsiveness ===== */
@media (max-width: 768px) {
  .article-container {
    padding: 0 1rem;
  }

  .hero-block {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: auto;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 1rem;
  }

  .hero-block .category-badge,
  .hero-block .article-title,
  .hero-block .article-meta,
  .hero-block .hero-image {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }

  .hero-block .article-meta {
    justify-content: center;
  }

  .hero-block .article-title {
    font-size: 2rem;
  }

  .hero-block .article-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hero-block .article-meta span {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
  }

  /* Reduce hero blur for performance */
  .hero-block::before {
    animation-duration: 20s;
  }

  .hero-block::after {
    animation-duration: 35s;
  }

  /* Section numbers: slightly smaller on mobile */
  .section-block .section-number {
    width: 38px;
    height: 38px;
    line-height: 38px;
    font-size: 1rem;
  }

  .stats-block {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-block .stat-value {
    font-size: 2rem;
  }

  /* Stat dividers: hide on mobile (items stack differently) */
  .stats-block .stat-item + .stat-item::before {
    display: none;
  }

  /* Callout blocks: stack icon above on narrow screens */
  .callout-block {
    flex-direction: column;
    gap: 0.75rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .callout-block .callout-icon {
    width: 28px;
    height: 28px;
  }

  /* Quote block: reduce sizes on mobile */
  .quote-block::before {
    font-size: 3.5rem;
  }

  .quote-block::after {
    font-size: 2.5rem;
  }

  .quote-block {
    padding: 2rem 1.5rem 2rem 2rem;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  /* CTA block: reduce padding, full-width feel */
  .cta-block {
    padding-bottom: 2rem;
  }

  .cta-block .cta-title {
    font-size: 1.5rem;
  }

  .cta-block .cta-button {
    width: calc(100% - 3rem);
    justify-content: center;
  }

  .author-block {
    flex-direction: column;
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .author-block::before {
    left: 0;
    top: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  }

  .image-block.wide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  /* Reduce glass effects on mobile for performance */
  .author-block,
  .stats-block {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

/* ===== Print Styles ===== */
@media print {
  .hero-block {
    min-height: auto;
    background: white;
    color: black;
  }

  .blog-block {
    opacity: 1;
    transform: none;
  }

  .reading-progress,
  .lightbox {
    display: none;
  }

  .hero-block::before,
  .hero-block::after,
  .cta-block::before,
  .cta-block::after {
    display: none;
  }
}
