/* Council Arcana -- Public Pages Stylesheet
   Replicates the MUI-based React landing page design.
   No frameworks, no dependencies. Pure CSS. */

/* --- 1. Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem; line-height: 1.6; color: #1a1a2e; background-color: #fff;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #4a90e2; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; line-height: 1.25; }
h1 { font-size: 3rem;   font-weight: 800; }
h2 { font-size: 2.5rem; font-weight: 700; }
h3 { font-size: 2rem;   font-weight: 700; }
p  { margin: 0 0 1em; }

/* --- 2. Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--md { max-width: 900px; }
.section     { padding: 64px 0; }
.section-alt { padding: 64px 0; background-color: #f5f5f5; }

/* --- 3. Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background-color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nav-container { display: flex; align-items: center; height: 56px; }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: #1a1a2e;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo img  { width: 28px; height: 28px; border-radius: 4px; }
.nav-logo span { font-size: 1.25rem; font-weight: 700; }
.nav-links {
  display: flex; align-items: center; gap: 16px; margin-left: auto;
  list-style: none; padding: 0; margin-top: 0; margin-bottom: 0;
}
.nav-links a {
  color: #1a1a2e; font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: #4a90e2; text-decoration: none; }

/* --- 4. Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; font-family: inherit; font-size: 0.9375rem;
  font-weight: 600; line-height: 1.5; border: 2px solid transparent;
  border-radius: 6px; cursor: pointer; text-decoration: none; text-transform: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background-color: #4a90e2; color: #fff; border-color: #4a90e2; }
.btn-primary:hover { background-color: #357abd; border-color: #357abd; }
.btn-outline { background-color: transparent; color: #4a90e2; border-color: #4a90e2; }
.btn-outline:hover { background-color: rgba(74,144,226,0.08); }
.btn-sm { padding: 6px 16px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* --- 5. Hero --- */
.hero {
  padding: 96px 0 80px; text-align: center;
  background: linear-gradient(180deg, rgba(74,144,226,0.08) 0%, transparent 100%);
}
.hero img {
  width: 200px; max-width: 260px; margin: 0 auto 32px; border-radius: 12px;
}
.hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 0.3em; }
.hero .hero-subtitle { font-size: 1.5rem; color: #666; margin-bottom: 16px; }
.hero .hero-description {
  font-size: 1rem; color: #666; max-width: 600px;
  margin: 0 auto 40px; line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 16px; justify-content: center;
  align-items: center; flex-wrap: wrap;
}

/* --- 6. Steps / How-It-Works --- */
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; text-align: center;
}
.step-card { display: flex; flex-direction: column; align-items: center; }
.step-number {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background-color: #4a90e2; color: #fff;
  font-size: 1.25rem; font-weight: 700; margin-bottom: 12px;
}
.step-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 6px; }
.step-desc  { font-size: 0.875rem; color: #666; max-width: 280px; margin: 0 auto; }

/* --- 7. Features Grid --- */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature-card {
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.feature-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background-color: rgba(74,144,226,0.08); color: #4a90e2;
  font-size: 1.25rem; margin-bottom: 12px;
}
.feature-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p  { font-size: 0.875rem; color: #666; margin-bottom: 0; }

/* --- 8. Use Cases Grid --- */
.use-cases-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.use-case-card {
  display: flex; align-items: flex-start; gap: 16px;
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px;
}
.use-case-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; min-width: 48px; border-radius: 50%;
  background-color: #4a90e2; color: #fff; font-size: 1.25rem;
}
.use-case-card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.use-case-card p  { font-size: 0.875rem; color: #666; margin-bottom: 0; }

/* --- 9. Concilia Cards (Public Deliberation Grid) --- */
.concilia-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.concilia-card {
  display: flex; flex-direction: column;
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px;
  transition: box-shadow 0.2s; background-color: #fff;
}
.concilia-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-meta   { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-author { font-size: 0.875rem; font-weight: 500; color: #1a1a2e; }
.card-title  { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: #1a1a2e; }
.card-title a       { color: inherit; text-decoration: none; }
.card-title a:hover { color: #4a90e2; }
.card-excerpt {
  font-size: 0.875rem; color: #666; line-height: 1.5;
  margin-bottom: 16px; flex-grow: 1;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8125rem; color: #666;
}

/* --- 10. Pagination --- */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; margin-top: 32px;
}
.pagination a,
.pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px; border-radius: 6px;
  font-size: 0.875rem; font-weight: 500; color: #1a1a2e;
  text-decoration: none; transition: background-color 0.2s, color 0.2s;
}
.pagination a:hover  { background-color: rgba(74,144,226,0.08); text-decoration: none; }
.pagination .active  { background-color: #4a90e2; color: #fff; }
.pagination .disabled { color: #ccc; pointer-events: none; }

/* --- 11. Dialog / Concilium Detail --- */
.dialog-content { max-width: 900px; margin: 32px auto; padding: 0 24px; }
.dialog-content .stage-section { margin-bottom: 32px; }
.dialog-content .stage-section h2 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid #e0e0e0;
}
/* Markdown content within dialog */
.dialog-content .markdown-content { padding: 12px; }
.dialog-content .markdown-content p { margin: 0 0 12px; }
.dialog-content .markdown-content p:last-child { margin-bottom: 0; }
.dialog-content .markdown-content ul,
.dialog-content .markdown-content ol { margin: 0 0 12px; padding-inline-start: 24px; }
.dialog-content .markdown-content li { margin: 4px 0; }
.dialog-content .markdown-content pre {
  background: #f5f5f5; padding: 12px; border-radius: 4px;
  overflow-x: auto; margin: 0 0 12px;
}
.dialog-content .markdown-content code {
  background: #f5f5f5; padding: 2px 6px; border-radius: 3px;
  font-family: monospace; font-size: 0.9em;
}
.dialog-content .markdown-content pre code { background: none; padding: 0; }
.dialog-content .markdown-content blockquote {
  margin: 0 0 12px; padding-inline-start: 16px;
  border-inline-start: 4px solid #ddd; color: #666;
}
.dialog-content .markdown-content h1,
.dialog-content .markdown-content h2,
.dialog-content .markdown-content h3,
.dialog-content .markdown-content h4 { margin: 16px 0 8px; }
.dialog-content .markdown-content h1:first-child,
.dialog-content .markdown-content h2:first-child,
.dialog-content .markdown-content h3:first-child,
.dialog-content .markdown-content h4:first-child { margin-top: 0; }

/* --- 12. Vote Buttons --- */
.vote-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border: 1px solid #e0e0e0; border-radius: 4px;
  background: transparent; color: #666; font-size: 0.8125rem;
  font-family: inherit; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.vote-btn:hover          { border-color: #bbb; }
.vote-btn.active-like    { color: #4a90e2; border-color: #4a90e2; }
.vote-btn.active-dislike { color: #f44336; border-color: #f44336; }
.vote-btn .vote-count    { font-weight: 600; }

/* --- 13. Chip --- */
.chip {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border: 1px solid #e0e0e0; border-radius: 999px;
  font-size: 0.75rem; color: #666; line-height: 1.5; white-space: nowrap;
}

/* --- 14. Avatar --- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background-color: rgba(74,144,226,0.08); color: #4a90e2;
  font-size: 14px; font-weight: 600; text-transform: uppercase; flex-shrink: 0;
}

/* --- 15. Footer --- */
.site-footer {
  border-top: 1px solid #e0e0e0; padding: 32px 0; background-color: #f5f5f5;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; margin-bottom: 24px;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.footer-brand img  { width: 24px; height: 24px; border-radius: 4px; }
.footer-brand span { font-size: 1.25rem; font-weight: 700; }
.footer-tagline    { font-size: 0.875rem; color: #666; }
.footer-heading {
  font-size: 0.875rem; font-weight: 600; margin-bottom: 12px; color: #1a1a2e;
}
.footer-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.footer-links a {
  font-size: 0.875rem; color: #666; text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: #4a90e2; text-decoration: underline; }
.footer-divider   { border: none; border-top: 1px solid #e0e0e0; margin: 0 0 16px; }
.footer-copyright { text-align: center; font-size: 0.75rem; color: #666; }

/* --- 16. Status / Alert Colors --- */
.text-success { color: #4caf50; }
.text-warning { color: #ff9800; }
.text-error   { color: #f44336; }
.text-primary { color: #4a90e2; }

/* --- 17. Utilities --- */
.text-center    { text-align: center; }
.text-secondary { color: #666; }
.mb-1 { margin-bottom:  8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top:  8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.flex-grow { flex-grow: 1; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- 18. Breadcrumbs --- */
.breadcrumbs { margin-bottom: 24px; }
.breadcrumbs ol {
  display: flex; align-items: center; gap: 0;
  list-style: none; padding: 0; margin: 0;
  font-size: 0.8125rem; color: #666; flex-wrap: wrap;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/'; padding: 0 8px; color: #ccc;
}
.breadcrumb-item a { color: #4a90e2; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #1a1a2e; font-weight: 500; }

/* --- 19. FAQ --- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid #e0e0e0; border-radius: 8px;
  margin-bottom: 12px; overflow: hidden;
}
.faq-question {
  padding: 16px 20px; cursor: pointer;
  font-weight: 600; font-size: 1rem; color: #1a1a2e;
  list-style: none; display: flex; align-items: center;
  justify-content: space-between;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: 1.25rem; color: #4a90e2; flex-shrink: 0; margin-left: 16px; }
.faq-item[open] .faq-question::after { content: '\2212'; }
.faq-item[open] .faq-question { border-bottom: 1px solid #e0e0e0; }
.faq-answer {
  padding: 16px 20px; margin: 0;
  font-size: 0.9375rem; color: #444; line-height: 1.7;
}

/* --- Responsive ---
   < 600px  = mobile  (1 column)
   600-959px = tablet  (2 columns)
   >= 960px  = desktop (3 columns) */

/* --- Dialog page specific --- */
.dialog-header { margin-bottom: 32px; }
.dialog-header h1 { margin-bottom: 12px; }
.dialog-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; font-size: 0.875rem;
}
.dialog-votes {
  display: flex; gap: 12px; font-size: 0.875rem; color: #666;
}
.dialog-message { margin-bottom: 24px; }
.dialog-user { background: rgba(74,144,226,0.04); border-radius: 8px; padding: 16px; }
.dialog-stage { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; }
.message-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  color: #4a90e2; letter-spacing: 0.05em; margin-bottom: 8px;
}
.model-response {
  border-bottom: 1px solid #f0f0f0; padding-bottom: 16px; margin-bottom: 16px;
}
.model-response:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.model-name {
  font-size: 0.75rem; font-weight: 600; color: #666;
  margin-bottom: 8px; font-family: monospace;
}
.synthesis-response {
  background: #f0fff0; border-radius: 8px; padding: 16px;
}
.dialog-cta {
  margin-top: 48px; padding: 32px; background: #f5f5f5;
  border-radius: 8px;
}
.vote-count { font-size: 0.875rem; color: #666; }
.vote-count-group { display: flex; gap: 12px; }
.hero-logo { border-radius: 12px; }
a.concilia-card { color: inherit; text-decoration: none; }
a.concilia-card:hover { text-decoration: none; }

/* --- 18. Responsive --- */
@media (max-width: 599px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: 2rem; }
  .hero .hero-subtitle { font-size: 1.1rem; }
  .hero img { width: 160px; }
  .hero-actions { flex-direction: column; }
  .section, .section-alt { padding: 40px 0; }
  .steps-grid, .features-grid,
  .concilia-grid, .use-cases-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .nav-links { gap: 8px; }
}

@media (min-width: 600px) and (max-width: 959px) {
  .hero h1  { font-size: 2.75rem; }
  .hero img { width: 200px; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid, .use-cases-grid,
  .concilia-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .hero h1 { font-size: 3.5rem; }
  .hero .hero-subtitle { font-size: 1.5rem; }
  .hero img { width: 260px; }
}
