/* Sober academic/journalistic style — research.agenticrelations.ch */

:root {
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-light: #888;
  --color-border: #e5e5e5;
  --color-accent: #1a4a85;
  --color-bg: #fafaf8;
  --color-card: #ffffff;
  --max-width: 760px;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Charter', 'Iowan Old Style', 'Georgia', serif;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-card);
  margin: 0;
  padding: 0;
}

main, article {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  background: var(--color-card);
}

h1, h2, h3, h4, h5 {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  margin-top: 2.2em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 0.3em;
  line-height: 1.15;
}

/* Title block (HTML only — Typst handles its own title page) */
.title-block {
  text-align: center;
  padding: 3rem 0 3.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.title-block h1 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: 2.3rem;
  letter-spacing: -0.02em;
}

.title-block .subtitle {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--color-muted);
  margin: 0 0 2em;
  text-align: center;
}

.title-block .author {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  color: var(--color-text);
  margin: 0;
  text-align: center;
}

.title-block .affiliation {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9em;
  color: var(--color-muted);
  margin: 0.2em 0 1.5em;
  text-align: center;
}

.title-block .venue {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85em;
  color: var(--color-light);
  margin: 0;
  text-align: center;
}

h2 {
  font-size: 1.45rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  color: var(--color-muted);
}

h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

p {
  margin: 0.9em 0;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-align: justify;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--color-accent);
}

strong { font-weight: 600; }
em { font-style: italic; }

blockquote {
  margin: 1.5em 0;
  padding: 0.8em 1.5em;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg);
  color: var(--color-muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

blockquote p { margin: 0.5em 0; }

table {
  border-collapse: collapse;
  margin: 1.6em 0;
  width: 100%;
  font-size: 0.92em;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

th, td {
  text-align: left;
  padding: 0.55em 0.9em;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

th {
  font-weight: 600;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-text);
}

tr:last-child td { border-bottom: 2px solid var(--color-text); }

figure {
  margin: 2em 0;
  text-align: center;
}

img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

figcaption {
  font-size: 0.85em;
  color: var(--color-muted);
  margin-top: 0.6em;
  text-align: left;
  font-style: italic;
  line-height: 1.5;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

code {
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.88em;
  background: var(--color-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

ul, ol { margin: 0.8em 0; padding-left: 1.5em; }
li { margin: 0.35em 0; }

/* Citation block */
.citation {
  margin: 3em 0 0;
  padding: 1.5em;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.88em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.citation h4 {
  margin-top: 0;
  margin-bottom: 0.4em;
}

.citation pre {
  background: white;
  padding: 0.8em;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.4;
}

/* Header / meta */
.meta {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.88em;
  color: var(--color-muted);
  margin: 1.2em 0 2.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.6;
}

.meta strong { color: var(--color-text); }

/* Hinweis-Kasten (Pre-Vote-Note) */
.notice {
  margin: 2em 0;
  padding: 1.2em 1.5em;
  background: #fff5d9;
  border: 1px solid #d4a300;
  border-left: 4px solid #d4a300;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.92em;
  line-height: 1.5;
  color: #4a3a00;
}

.notice strong { color: #1a1a1a; }

/* Footer */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2em 1.5em 4em;
  border-top: 1px solid var(--color-border);
  font-size: 0.85em;
  color: var(--color-muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Tabellen müssen auf Mobile horizontal scrollbar sein */
table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 700px) {
  table {
    display: table;
    overflow-x: visible;
  }
}

/* Mobile / kleine Bildschirme */
@media (max-width: 700px) {
  html { font-size: 16px; }
  main, article { padding: 1.5rem 1rem 3rem; }

  h1 { font-size: 1.55rem; line-height: 1.2; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.05rem; }

  .title-block { padding: 2rem 0 2rem; }
  .title-block h1 { font-size: 1.7rem; }
  .title-block .subtitle { font-size: 0.95rem; }

  p, li { text-align: left; hyphens: auto; -webkit-hyphens: auto; }
  blockquote { padding: 0.6em 1em; font-size: 0.95em; }

  table { font-size: 0.82em; }
  th, td { padding: 0.35em 0.5em; }

  figure { margin: 1.5em 0; }
  figcaption { font-size: 0.8em; }

  footer { padding: 1.5em 1rem 3rem; font-size: 0.8em; }
}

/* Sehr schmale Bildschirme (Smartphones im Portrait, < 420px) */
@media (max-width: 420px) {
  html { font-size: 15px; }
  h1 { font-size: 1.4rem; }
  .title-block h1 { font-size: 1.45rem; }
  table { font-size: 0.78em; }
  th, td { padding: 0.3em 0.4em; }
}

/* Print */
@media print {
  body { background: white; }
  main, article { max-width: none; padding: 0; }
  h2 { page-break-after: avoid; }
  figure, table { page-break-inside: avoid; }
}

/* ============================================================
   Callout-Komponenten (synchron mit Typst-Preamble)
   ============================================================ */

.key-takeaways {
  margin: 1.5em 0;
  padding: 1em 1.2em;
  background: #f3f6fb;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 3px 3px 0;
}
.key-takeaways h4 {
  font-size: 0.78em;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  text-transform: uppercase;
  margin: 0 0 0.5em 0;
  font-weight: 700;
}
.key-takeaways ul { margin: 0; padding-left: 1.2em; }
.key-takeaways li { margin: 0.45em 0; }

.research-questions {
  margin: 1.5em 0;
  padding: 1em 1.2em;
  background: #fafaf5;
  border-top: 1px solid var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
}
.research-questions p {
  margin: 0.6em 0;
  text-align: left;
  display: flex;
  gap: 0.7em;
  align-items: baseline;
}
.ff-tag {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  font-weight: 700;
  font-size: 0.78em;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: -apple-system, sans-serif;
  flex-shrink: 0;
}

.callout {
  margin: 1.2em 0;
  padding: 0.8em 1.1em;
  border-radius: 0 3px 3px 0;
  font-size: 0.95em;
}
.callout strong:first-child {
  display: block;
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3em;
  font-weight: 700;
}
.callout.befund {
  background: #fafaf5;
  border-left: 3px solid var(--color-accent);
}
.callout.befund strong:first-child { color: var(--color-accent); }
.callout.hinweis {
  background: #fdf6e3;
  border-left: 3px solid #b8860b;
}
.callout.hinweis strong:first-child { color: #b8860b; }
.callout.puncher {
  background: #f3f6fb;
  border-left: 3px solid var(--color-accent);
  padding: 1.1em 1.3em;
}
.callout.puncher h4 {
  font-size: 0.78em;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  text-transform: uppercase;
  margin: 0 0 0.5em 0;
  font-weight: 700;
}
.callout.puncher p { margin: 0; }
