/**
 * Learn Article Styles
 * Styles for educational content pages
 */

/* ================================
   Learn Concept Page Layout
   (used by /learn/concepts/ pages)
   ================================ */
.learn-article {
  min-height: 100vh;
  background: var(--color-surface);
}

/* Hero Section */
.learn-hero {
  padding: calc(72px + var(--space-10)) 0 var(--space-10);
  color: white;
}

.learn-hero-content {
  max-width: 800px;
}

.learn-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  opacity: 0.85;
}

.learn-breadcrumb a {
  color: white;
  text-decoration: none;
  opacity: 0.9;
}

.learn-breadcrumb a:hover {
  opacity: 1;
  text-decoration: underline;
}

.learn-breadcrumb span {
  opacity: 0.7;
}

.learn-hero h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.learn-hero-subtitle {
  font-size: var(--text-lg);
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: var(--space-6);
  max-width: 720px;
}

.learn-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.learn-meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  opacity: 0.85;
  background: rgba(255,255,255,0.12);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.learn-meta-item svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Two-Column Layout */
.learn-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-10);
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
  align-items: start;
}

@media (max-width: 960px) {
  .learn-layout {
    grid-template-columns: 1fr;
  }
}

/* Main Content Area */
.learn-content {
  min-width: 0;
  color: var(--color-text-primary);
}

.learn-content h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-top: var(--space-10);
  margin-bottom: var(--space-5);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

.learn-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.learn-content h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.learn-content h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.learn-content p {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-5);
  color: var(--color-text-secondary);
}

.learn-content strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.learn-content ul,
.learn-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

.learn-content li {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* Learn Callouts */
.learn-callout {
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  border-left: 4px solid;
}

.learn-callout-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.learn-callout p {
  margin-bottom: var(--space-3);
}

.learn-callout p:last-child {
  margin-bottom: 0;
}

.learn-callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
}

.learn-callout-info .learn-callout-title {
  color: #1e40af;
}

.learn-callout-info p {
  color: #1e3a8a;
}

.learn-callout-warning {
  background: #fffbeb;
  border-color: #f59e0b;
}

.learn-callout-warning .learn-callout-title {
  color: #b45309;
}

.learn-callout-warning p {
  color: #92400e;
}

.learn-callout-success {
  background: #f0fdf4;
  border-color: #22c55e;
}

.learn-callout-success .learn-callout-title {
  color: #166534;
}

.learn-callout-success p {
  color: #15803d;
}

.learn-callout-danger {
  background: #fef2f2;
  border-color: #ef4444;
}

.learn-callout-danger .learn-callout-title {
  color: #b91c1c;
}

.learn-callout-danger p {
  color: #991b1b;
}

/* Learn Tables */
.learn-table-wrapper {
  overflow-x: auto;
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.learn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.learn-table th {
  background: #1e293b;
  color: white;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.learn-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  line-height: 1.5;
  vertical-align: top;
}

.learn-table tr:last-child td {
  border-bottom: none;
}

.learn-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

/* Sidebar */
.learn-sidebar {
  position: sticky;
  top: calc(72px + var(--space-6));
}

@media (max-width: 960px) {
  .learn-sidebar {
    position: static;
  }
}

.learn-sidebar-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.learn-sidebar-card h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
}

/* Sidebar TOC */
.learn-sidebar-card nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.learn-sidebar-card nav a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  line-height: 1.4;
}

.learn-sidebar-card nav a:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* Sidebar Stats */
.learn-stat-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.learn-stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.learn-stat-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 2px;
}

.learn-stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Sidebar List */
.learn-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.learn-sidebar-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.learn-sidebar-list li:last-child {
  border-bottom: none;
}

.learn-sidebar-list a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.learn-sidebar-list a:hover {
  color: var(--color-accent);
}

/* Learn Checklist */
.learn-checklist {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
}

.learn-checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.learn-checklist li:last-child {
  border-bottom: none;
}

/* Learn Methodology Note */
.learn-methodology {
  margin-top: var(--space-10);
  padding: var(--space-5) var(--space-6);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

.learn-methodology h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  margin-top: 0;
}

/* ================================
   Article Page Layout (legacy)
   ================================ */
.article-page {
  padding-top: calc(72px + var(--space-8));
  padding-bottom: var(--space-16);
  min-height: 100vh;
  background: var(--color-surface);
}

.article-page .container {
  max-width: 800px;
}

/* ================================
   Article Header
   ================================ */
.article-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.article-category {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-reading-time {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.article-header h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-4);
  color: var(--color-text-primary);
}

.article-subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ================================
   Table of Contents
   ================================ */
.toc {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-10);
}

.toc h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-4);
}

.toc ol {
  list-style: decimal;
  padding-left: var(--space-5);
  margin: 0;
}

.toc li {
  margin-bottom: var(--space-2);
}

.toc a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.2s ease;
}

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

/* ================================
   Article Content
   ================================ */
.article-content {
  color: var(--color-text-primary);
}

.article-content section {
  margin-bottom: var(--space-12);
}

.article-content h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.article-content section:first-child h2 {
  border-top: none;
  padding-top: 0;
}

.article-content h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.article-content h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.article-content p {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-5);
  color: var(--color-text-secondary);
}

.article-content p.lead {
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  font-weight: 500;
}

.article-content strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

.article-content li {
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* ================================
   Blockquotes
   ================================ */
.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.article-content blockquote p {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.article-content blockquote cite {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-style: normal;
}

/* ================================
   Callouts
   ================================ */
.callout {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
}

.callout h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  margin-top: 0;
}

.callout p {
  margin-bottom: 0;
}

.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.callout-info h4 {
  color: #1e40af;
}

.callout-info p {
  color: #1e3a8a;
}

.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.callout-warning h4 {
  color: #b45309;
}

.callout-warning p {
  color: #92400e;
}

.callout-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.callout-success h4 {
  color: #166534;
}

.callout-success p {
  color: #15803d;
}

.callout-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.callout-danger h4 {
  color: #b91c1c;
}

.callout-danger p {
  color: #991b1b;
}

/* ================================
   Feature Grid
   ================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

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

.feature-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
}

.feature-card h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
  margin-top: 0;
}

.feature-card p {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ================================
   Stat Highlight
   ================================ */
.stat-highlight {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin: var(--space-8) 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  text-align: center;
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-highlight .stat-item {
  color: white;
}

.stat-highlight .stat-value {
  display: block;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: var(--space-1);
}

.stat-highlight .stat-label {
  font-size: var(--text-sm);
  opacity: 0.8;
}

/* ================================
   Article Footer
   ================================ */
.article-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.tag {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .article-nav {
    grid-template-columns: 1fr;
  }
}

.nav-link {
  display: block;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.nav-link.next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.nav-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ================================
   Images
   ================================ */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
}

.article-content figure {
  margin: var(--space-8) 0;
}

.article-content figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  text-align: center;
  margin-top: var(--space-2);
}

/* ================================
   Code Blocks
   ================================ */
.article-content code {
  background: var(--color-surface);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  font-family: 'Monaco', 'Menlo', monospace;
}

.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-6) 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: var(--text-sm);
}

/* ================================
   Timeline
   ================================ */
.timeline {
  position: relative;
  margin: var(--space-8) 0;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-6);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) - 4px);
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
}

.timeline-date {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.timeline-content h4 {
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.timeline-content p {
  margin-bottom: 0;
}

/* ================================
   Research Backlinks
   ================================ */
.research-backlink-section {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 2px solid #059669;
}

.research-backlink-section h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.research-backlink-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-5);
}

.research-backlink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.research-backlink-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.2s ease;
}

.research-backlink-card:hover {
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1);
  transform: translateY(-1px);
}

.research-backlink-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.research-backlink-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
}

.research-backlink-arrow {
  font-size: var(--text-sm);
  color: #059669;
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .research-backlink-grid {
    grid-template-columns: 1fr;
  }
}
