/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background-color: #fff;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Layout */
main {
  margin: 0 auto;
  max-width: 800px;
  padding: 2rem;
}

/* Article Header and Metadata */
.site-title {
    background-color: #20232a;
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: .1rem;
}

.subtitle {
  color: #495057;
  font-size: 1.25rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
}

/* Article Meta */
.article-meta {
  color: #6c757d;
  display: flex;
  font-size: 0.95rem;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.article-meta span {
  display: inline-block;
}

/* Article Content Container */

.article-container {
  margin: 0 auto;
  max-width: 800px;
  padding: 2rem;
}

/* Article Header */
.article-header {
  margin-bottom: 1rem;
}

/* Header Container */
#header {
  background-color: #20232a;
  padding: .5rem 0;
  width: 100%;
}

/* Table of Contents */
.table-of-contents {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin: 2rem 0;
  padding: 1.5rem;
}

.table-of-contents h2 {
  border-bottom: 2px solid #61dafb;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  margin-top: 0;
  padding-bottom: 0.5rem;
}

.table-of-contents ol {
  list-style-type: none;
  margin: 0;
  padding-left: 0;
}

.table-of-contents li {
  margin: 0.5rem 0;
  padding: 0.25rem 0;
}

.table-of-contents a {
  color: #228be6;
  display: block;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.table-of-contents a:hover {
  background-color: #f1f3f5;
  border-radius: 3px;
  color: #1971c2;
  padding-left: 0.5rem;
  text-decoration: none;
}

/* Main Content */
.main-content {
  margin: 2rem 0;
}

/* Content Block */
.content-block {
  margin: 1.5rem 0;
}

.article-content {
  margin: 2rem 0;
  max-width: 100%;
}

.article-content section {
  margin-bottom: 2.5rem;
}

.article-content h2 {
  border-bottom: 2px solid #e9ecef;
  color: #1a1a1a;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
}

.article-content h3 {
  color: #343a40;
  margin: 1.5rem 0 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
  align-items: center;
  display: flex;
  font-size: 0.95rem;
  gap: 0.5rem;
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.breadcrumb li:not(:last-child)::after {
  color: #666;
  content: "›";
  margin-left: 0.5rem;
}

.breadcrumb a {
  color: #06c;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: #666;
}

/* Content Sections */
.key-concepts, .technical-concepts {
  background-color: #f8f9fa;
  border-radius: 5px;
  margin: 1.5rem 0;
  padding: 1.5rem;
}

.key-concepts h3, .technical-concepts h3 {
  color: #343a40;
  margin-bottom: 1rem;
}

.key-concepts ul, .technical-concepts ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

/* AI Processing Elements */
[data-ai-process] {
  position: relative;
}

/* AI Interaction Zone */
.ai-interaction-zone {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin: 1rem 0;
  padding: 1.5rem;
}

.ai-challenge {
  background-color: #e7f5ff;
  border-radius: 4px;
  margin-top: 1rem;
  padding: 1rem;
}

/* AI Processing Metadata */
.ai-processing-metadata {
  display: none;
}

.key-concepts li, .technical-concepts li {
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
}

.key-concepts li:last-child, .technical-concepts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Article Grid Layout */
.article-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin: 2rem 0;
}

.article-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.article-card h3 {
  font-size: 1.25rem;
  margin-top: 0;
}

.article-card a {
  color: inherit;
  text-decoration: none;
}

.article-card a:hover {
  color: #228be6;
}

.article-card p {
  color: #495057;
  margin: 1rem 0;
}

.article-card .article-meta {
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 0;
  margin-top: 1rem;
}

/* AI Recursive Blocks */
.ai-recursive-block {
  background-color: #f1f3f5;
  border-left: 4px solid #228be6;
  border-radius: 0 5px 5px 0;
  margin: 2rem 0;
  padding: 1.5rem;
}

.ai-recursive-block h2, .ai-recursive-block h3 {
  color: #1864ab;
  margin-top: 0;
}

.ai-recursive-block[data-recursion-type="insight-generation"] {
  background-color: #e7f5ff;
  border-left-color: #1c7ed6;
}

.ai-recursive-block[data-recursion-type="question-expansion"] {
  background-color: #e3fafc;
  border-left-color: #0c8599;
}


.ai-recursive-block[data-recursion-type="engagement-prompt"] {
  background-color: #e7f5ff;
  border-left-color: #1c7ed6;
}

/* Navigation */
nav {
  background-color: #20232a;
  border-bottom: 2px solid #228be6;
  margin-bottom: 0;
  padding: .5rem;
  text-align: center;
}

.nav-menu {
  display: flex;
  gap: 6px;
  justify-content: center;
  list-style: none;
  padding: 0;
}

.nav-menu li {
  display: inline;
}

.nav-menu a {
  color: #61dafb;
  font-weight: bold;
  padding: 4px 8px;
  text-decoration: none;
  transition: 0.3s;
}

.nav-menu a:hover {
  background-color: #228be6;
  border-radius: 5px;
  color: #fff;
}

/* Typography */
h1 {
  color: #212529;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

h2 {
  color: #343a40;
  font-size: 2rem;
  margin: 2rem 0 1rem;
}

h3 {
  color: #495057;
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
}

p {
  margin-bottom: 1rem;
}

/* Lists */
ul {
  margin: 1rem 0 1.5rem 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Horizontal Rules */
hr {
  background-color: #dee2e6;
  border: 0;
  height: 1px;
  margin: 3rem 0;
}

/* Links & Related Content */
.related-content {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin: 3rem 0;
  padding: 1.5rem;
}

.related-content h3 {
  border-bottom: 2px solid #61dafb;
  color: #343a40;
  font-size: 1.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
}

.related-content nav {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
}

.related-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-content li {
  border-bottom: 1px solid #dee2e6;
  margin: 0.75rem 0;
  padding: 0.5rem 0;
}

.related-content li:last-child {
  border-bottom: none;
}

.related-content a {
  color: #228be6;
  display: block;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.related-content a:hover {
  background-color: #f1f3f5;
  border-radius: 3px;
  color: #1971c2;
  padding-left: 0.5rem;
  text-decoration: none;
}

.related-content a::before {
  color: #61dafb;
  content: "→";
  margin-right: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.related-content a:hover::before {
  opacity: 1;
}

/* Example Blocks */
.example-block {
  background-color: #f8f9fa;
  border-left: 3px solid #228be6;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0;
  padding: 1rem;
}

/* Section Navigation */
.section-nav {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 3rem 0;
  padding: 1.5rem;
}

.section-nav h2 {
  border-bottom: 2px solid #61dafb;
  color: #343a40;
  font-size: 1.25rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
}

.section-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-nav li {
  margin: 0.5rem 0;
  padding: 0.5rem 0;
}

.section-nav a {
  color: #228be6;
  display: block;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.section-nav a:hover {
  background-color: #f1f3f5;
  border-radius: 3px;
  color: #1971c2;
  padding-left: 0.5rem;
  text-decoration: none;
}

/* Recursive Prompt */
.recursive-prompt {
  color: #1864ab;
  font-style: italic;
  margin-bottom: 1rem;
}

/* Citation Section */
.cite-this {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 3rem 0;
  max-width: 100%;
  padding: 1.5rem;
}

.cite-this h4 {
  border-bottom: 2px solid #61dafb;
  color: #343a40;
  font-size: 1.25rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
}

.citation-formats {
  margin-top: 0.75rem;
  max-width: 100%;
}

.citation-formats pre {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-sizing: border-box;
  color: #495057;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: normal;
}

.citation-formats pre:hover {
  background-color: #f8f9fa;
  border-color: #228be6;
}

/* Footer */
footer, #footer {
  background-color: #20232a;
  border-top: 2px solid #228be6;
  color: #fff;
  margin-top: 3rem;
  padding: 1rem;
  text-align: center;
}

.footer-menu {
  display: flex;
  gap: 20px;
  justify-content: center;
  list-style: none;
  padding: 0;
}

.footer-menu li {
  display: inline;
}

.footer-menu a {
  color: #61dafb;
  font-weight: bold;
  text-decoration: none;
}

.footer-menu a:hover {
  color: #fff;
}

/* Footer Container */
#footer {
  background-color: #20232a;
  margin-top: 3rem;
  padding: 1rem 0;
  width: 100%;
}

/* Copyright */

.copyright {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  opacity: 0.8;
}

/* Responsive Design */
@media (width <= 768px) {
  .article-grid {
      gap: 1.5rem;
      grid-template-columns: 1fr;
      margin: 1.5rem 0;
  }
  
  .article-card {
      padding: 1rem;
  }

    .article-container {
      padding: 1rem;
  }

  .table-of-contents {
      padding: 1rem;
  }

  .ai-interaction-zone {
      padding: 1rem;
  }

  main {
      padding: 1rem;
  }

  h1 {
      font-size: 2rem;
  }

  h2 {
      font-size: 1.75rem;
  }

  h3 {
      font-size: 1.25rem;
  }

  .article-meta {
      flex-direction: column;
      gap: 0.5rem;
  }

  .breadcrumb {
      margin-bottom: 1.5rem;
  }

  .ai-recursive-block {
      margin: 1.5rem 0;
      padding: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
}

.article-content h3 {
    font-size: 1.25rem;
}

  .key-concepts, .technical-concepts {
    padding: 1rem;
}

  .cite-this {
      margin: 2rem 0;
      padding: 1rem;
  }

  .citation-formats pre {
      font-size: 0.8rem;
      padding: 0.75rem;
  }
  
  .cite-this h4 {
      font-size: 1.1rem;
  }
}

/* Error Fallback */
#error-fallback {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  color: #856404;
  margin: 1rem 0;
  padding: 1rem;
}

/* FAQ Section */
.faq-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  margin: 2rem 0;
  padding: 1.5rem;
}

.faq-section h2 {
  border-bottom: 2px solid #61dafb;
  color: #343a40;
  font-size: 1.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h3 {
  color: #495057;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: #333;
  margin: 0;
}