/* Triangle — plain-Spanish readability, auto dark mode */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #1a4d3e;
  --border: #e0e0e0;
  --blockquote-bg: #f4f1e8;
  --warning: #8b2525;
  --table-header-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a1a;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --accent: #7fb894;
    --border: #333;
    --blockquote-bg: #232323;
    --warning: #d15a5a;
    --table-header-bg: #252525;
  }
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  line-height: 1.65;
  margin: 0;
  padding: 0;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

nav { margin-bottom: 1.5rem; }
nav a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
nav a:hover { text-decoration: underline; }

header h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

header .subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-style: italic;
}

header .tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

header .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }

a { color: var(--accent); }

blockquote {
  background: var(--blockquote-bg);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}
blockquote p { margin-bottom: 0.5rem; }
blockquote footer {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

.friend-answer {
  background: var(--blockquote-bg);
  border-left: 4px solid var(--warning);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}
.friend-answer h2 {
  border: none;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 1.25rem;
  color: var(--warning);
}
.friend-answer p { margin-bottom: 0.75rem; }
.friend-answer p:last-child { margin-bottom: 0; }

.thesis-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: var(--surface);
}
.thesis-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}
.thesis-card h3 a {
  text-decoration: none;
  color: var(--accent);
}
.thesis-card h3 a:hover { text-decoration: underline; }
.thesis-card .summary { color: var(--text); }
.thesis-card .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--table-header-bg);
  font-weight: 600;
}

.claim-by-claim table td:last-child {
  font-weight: 600;
  min-width: 140px;
}

section.intro, section.how, section.sources {
  margin: 2rem 0;
}

section.sources ul {
  font-size: 0.9rem;
}

.rule {
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
}

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}
footer p { margin-bottom: 0.75rem; }
footer a { color: var(--accent); }

.disclaimer {
  font-style: italic;
}

.audio-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.audio-player h2 {
  border: none;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 1.1rem;
}
.audio-player .audio-label {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.audio-player .meta {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}
.audio-top {
  margin-top: 0;
  margin-bottom: 1.75rem;
}

.updated {
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 16px; }
  main { padding: 1.5rem 1rem 3rem; }
  header h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.5rem; }
}
