/*
  Lemma Site Stylesheet
  Shared layout, typography, and component styling extracted from inline rules.
  Page-specific sections appear later in this file to preserve intentional differences.
*/

/* Base Tokens */
:root {
  --color-background: #F5F3F0;
  --color-ink: #444444;
  --color-muted: #777777;
  --color-border: #e0ddd8;
  --color-brand: #03379B;
  --color-badge: #03379B;
  --color-announcement-bg: #FFFFFF;
  --color-announcement-text: #222222;
  --font-body: Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Base Elements */
html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0 24px 80px 24px;
  background-color: var(--color-background);
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a {
  color: black;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
}

header img {
  margin: 0;
}

header {
  max-width: 900px;
  margin: 40px auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .brand {
  letter-spacing: 0.04em;
  font-size: 14px;
  color: #666666;
  text-transform: uppercase;
}

header .brand img {
  display: block;
  width: auto;
  height: 30px;
}

nav a {
  color: black;
  text-decoration: none;
  margin-left: 16px;
}

main {
  max-width: 900px;
  margin: 40px auto;
}

footer {
  max-width: 900px;
  margin: 40px auto 0 auto;
  color: var(--color-muted);
  font-size: 14px;
}

footer a {
  color: black;
  text-decoration: none;
}

footer a:hover,
nav a:hover,
.announcement a:hover,
.cmp-sources a:hover,
.contact a:hover {
  text-decoration: underline;
}

/* Utility Links */
.link-accent {
  color: var(--color-brand);
  text-decoration: underline;
}

.link-accent:hover {
  text-decoration: underline;
}

.link-muted {
  color: black;
  text-decoration: none;
}

.link-muted:hover {
  text-decoration: underline;
}

/* Home Page */
body.page-home header .brand img {
  height: 48px;
}

body.page-home #maincontent {
  max-width: 42em;
  margin: 15px auto 0 auto;
}

body.page-home .tagline {
  font-size: 19px;
  font-weight: bold;
  color: black;
  margin-bottom: 20px;
}

body.page-home .announcement {
  position: relative;
  background: var(--color-announcement-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  color: var(--color-announcement-text);
}

body.page-home .announcement a {
  color: black;
  text-decoration: underline;
  font-weight: normal;
}

body.page-home .announcement .badge {
  display: inline-block;
  background: var(--color-badge);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  margin-right: 8px;
}

body.page-home .divider {
  height: 1px;
  background: var(--color-border);
  margin: 16px 0 24px 0;
}

body.page-home .nav-item-blog {
  position: relative;
  display: inline-block;
}

body.page-home .nav-new-badge {
  position: absolute;
  top: -10px;
  right: 0;
  background: var(--color-badge);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  line-height: 1;
  pointer-events: none;
}

/* Blog Landing Page */
body.page-blog-index .subtitle {
  color: #666666;
  margin-bottom: 32px;
}

body.page-blog-index .post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.page-blog-index .post-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  column-gap: 24px;
  padding: 12px 0;
}

body.page-blog-index .post-item:last-child {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 24px;
}

body.page-blog-index .post-item .subtitle {
  margin-bottom: 0;
}

body.page-blog-index .date {
  color: var(--color-muted);
}

body.page-blog-index .post-item a {
  color: black;
  text-decoration: none;
  font-weight: 600;
}

body.page-blog-index .post-item a:hover {
  text-decoration: underline;
}

body.page-blog-index footer {
  margin: 20px auto 0 auto;
}

body.page-blog-index h1 {
  font-weight: 600;
  margin: 0 0 10px 0;
}

/* Article Pages */
body.page-article {
  line-height: 1.6;
}

body.page-article h1 {
  font-weight: 600;
  margin: 0 0 6px 0;
}

body.page-article h2 {
  font-family: inherit;
  font-weight: 600;
  font-size: 24px;
  margin: 32px 0 16px 0;
  line-height: 1.3;
  color: inherit;
}

body.page-article .meta {
  color: var(--color-muted);
  margin-bottom: 28px;
}

body.page-article ul,
body.page-article ol {
  padding-left: 20px;
}

body.page-article figure {
  margin: 28px 0;
}

body.page-article figcaption {
  color: var(--color-muted);
  font-size: 14px;
  margin-top: 8px;
}

body.page-article .contact {
  margin-top: 28px;
}

body.page-article .contact a {
  color: black;
  text-decoration: none;
}

body.page-article .contact a.link-accent {
  color: var(--color-brand);
  text-decoration: underline;
}

body.page-article .page-break {
  height: 1px;
  background: var(--color-border);
  margin: 24px 0;
}

@media print {
  body.page-article .page-break {
    page-break-after: always;
    break-after: page;
  }
}

/* Article Accent Helpers */
body.page-article .hl {
  background: #f1e7c7;
  padding: 0 3px;
  border-radius: 3px;
}

/* Article Comparison Blocks (Lemma 2) */
body.page-article .cmp {
  margin: 22px 0;
  font-family: var(--font-ui);
  font-size: 14px;
}

body.page-article .cmp.cmp-single {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.08);
}

body.page-article .cmp-single .cmp-container {
  margin-top: 16px;
}

body.page-article .cmp-container {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

body.page-article .cmp-card {
  flex: 1;
  min-width: 300px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

body.page-article .cmp-user-prompt {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: #f7f4ef;
  border-bottom: 1px solid var(--color-border);
}

body.page-article .cmp-user-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #666666;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  flex-shrink: 0;
}

body.page-article .cmp-prompt-text {
  flex: 1;
}

body.page-article .cmp-prompt-title {
  font-weight: 600;
  margin-bottom: 4px;
}

body.page-article .cmp-prompt-note {
  color: #3a3a3a;
  font-size: 14px;
}

body.page-article .cmp-response {
  padding: 20px;
}

body.page-article .cmp-response-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

body.page-article .cmp-ai-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

body.page-article .cmp-ai-icon img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  margin: 0;
}

body.page-article .cmp-model-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  padding-top: 2px;
}

body.page-article .cmp-model-note {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: normal;
}

body.page-article .cmp-response-content {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid;
  line-height: 1.6;
}

body.page-article .cmp-response-content p {
  margin: 0 0 12px 0;
}

body.page-article .cmp-response-content p:last-child {
  margin-bottom: 0;
}

body.page-article .cmp-card.correct .cmp-response-content {
  background: #f0fdf4;
  border-color: #86efac;
}

body.page-article .cmp-card.incorrect .cmp-response-content {
  background: #fef2f2;
  border-color: #fca5a5;
}

body.page-article .cmp-sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

body.page-article .cmp-single .cmp-shared-prompt {
  display: flex;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #f7f4ef;
  margin-bottom: 18px;
}

body.page-article .cmp-single .cmp-shared-prompt .cmp-user-icon {
  background: #666666;
}

body.page-article .cmp-single .cmp-shared-prompt blockquote {
  margin: 12px 0 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--color-border);
  font-style: italic;
  color: var(--color-ink);
}

body.page-article .cmp-ai-icon.cmp-ai-icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #166534;
  color: #ffffff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 18px;
}

body.page-article .rubric-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--font-ui);
  font-size: 14px;
}

body.page-article .rubric-table td {
  border: 1px solid var(--color-border);
  padding: 12px 16px;
  vertical-align: top;
}

body.page-article .rubric-table tr:nth-child(even) {
  background: #f7f4ef;
}

body.page-article .score-list {
  margin: 16px 0 24px 0;
  padding-left: 20px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
}

body.page-article .score-list li {
  margin-bottom: 6px;
}

body.page-article .score-list span {
  font-weight: 600;
}

body.page-article .cmp-sources b {
  font-weight: 600;
}

body.page-article .cmp-sources ol {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

body.page-article .cmp-sources a {
  color: var(--color-brand);
  text-decoration: underline;
}

/* Inline Charts (Lemma 2) */
body.page-article #chart {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1200 / 700;
}

body.page-article .x .tick text,
body.page-article .y .tick text {
  fill: #333333;
  font-size: 18px;
  font-weight: 400;
}

body.page-article .x .domain,
body.page-article .y .domain {
  stroke: #000000;
  stroke-width: 2;
}

body.page-article .x .tick line,
body.page-article .y .tick line {
  stroke: #cccccc;
}

body.page-article .axis-label {
  fill: #333333;
  font-size: 18px;
  font-weight: 400;
}

body.page-article .bar {
  transition: opacity 0.2s ease;
}

body.page-article .bar:hover {
  opacity: 0.85;
}

body.page-article .score-label {
  font-size: 18px;
  fill: #111111;
  font-weight: 700;
}


