/* Shared stylesheet for the Italian teaching workspace. Tufte-ish: quiet, readable, print-friendly. */

:root {
  --ink: #262220;
  --ink-soft: #57504a;
  --paper: #faf6ef;
  --paper-raised: #f1ead9;
  --rule: #ddd2bd;
  --accent: #7a2e2e;      /* muted terracotta-red */
  --accent-soft: #c9a3a3;
  --good: #33613f;         /* muted green */
  --good-bg: #e9f0e5;
  --bad: #9c3b2e;
  --bad-bg: #f7e8e2;
  --code-bg: #efe6d3;
  --max-width: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece6db;
    --ink-soft: #b8ada0;
    --paper: #1c1a17;
    --paper-raised: #262320;
    --rule: #40392f;
    --accent: #d98b7a;
    --accent-soft: #8a5a52;
    --good: #8fbf9a;
    --good-bg: #21301f;
    --bad: #e0897a;
    --bad-bg: #3a2420;
    --code-bg: #2a2620;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 3rem 1.5rem 6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
}

header.lesson-header {
  max-width: var(--max-width);
  margin: 0 auto 2.5rem;
}

.eyebrow {
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

h1 {
  font-size: 2rem;
  margin: 0.3rem 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin-top: 2.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.subtitle {
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-style: italic;
  margin: 0;
}

.it {
  font-style: italic;
  color: var(--ink);
}

.gloss {
  color: var(--ink-soft);
}

code, .term {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 0.25em;
  font-size: 0.92em;
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.1rem 1.25rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
  font-style: italic;
}

ul, ol {
  padding-left: 1.4rem;
}

li { margin-bottom: 0.4rem; }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* --- Callouts --- */

.callout {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout .callout-label {
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}

.callout.source { border-left: 4px solid var(--accent); }
.callout.ask    { border-left: 4px solid var(--ink-soft); }

/* --- Vocab table --- */

table.vocab {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 1rem;
}

table.vocab th {
  text-align: left;
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0.6rem 0.4rem 0;
}

table.vocab td {
  padding: 0.55rem 0.6rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.vocab td.it-word { font-weight: 600; white-space: nowrap; }

/* --- Quiz widget --- */

.quiz {
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  border-radius: 0.5rem;
  padding: 1.25rem 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.quiz .quiz-prompt { font-weight: 600; margin-bottom: 0.75rem; }

.quiz input[type="text"] {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
  width: 100%;
  max-width: 20rem;
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  background: var(--paper);
  color: var(--ink);
}

.quiz .quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.quiz label.choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  cursor: pointer;
  background: var(--paper);
}

.quiz label.choice:hover { border-color: var(--accent-soft); }

.quiz button {
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 0.35rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.quiz button:hover { opacity: 0.9; }

.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.35rem;
  font-size: 0.95rem;
  display: none;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: var(--good-bg); color: var(--good); }
.quiz-feedback.incorrect { background: var(--bad-bg); color: var(--bad); }

/* --- Lesson nav footer --- */

nav.lesson-nav {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

@media print {
  body { padding: 0; background: white; color: black; }
  .quiz button { display: none; }
}
