/* ===== Trumpet Course — Shared Stylesheet ===== */
/* Tufte-inspired: clean serif, generous margins, restrained color */

:root {
  --bg: #fdfcf9;
  --text: #1a1a1a;
  --text-soft: #444;
  --text-mute: #777;
  --accent: #b8442f;
  --accent-soft: #f4ebe7;
  --accent-dark: #8f3322;
  --rule: #d9d4c9;
  --callout-bg: #f7f4ed;
  --callout-border: #c9b873;
  --tip-bg: #eef5ee;
  --tip-border: #5a8a5a;
  --warn-bg: #fff4e6;
  --warn-border: #c4742f;
  --code-bg: #f0ede5;
  --max-width: 680px;
}

* { box-sizing: border-box; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 1.2rem 6rem;
  background: var(--bg);
  color: var(--text);
  font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua',
    Palatino, Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  body { padding: 0 1rem 4rem; }
}

/* --- Header / Masthead --- */

.masthead {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .course-tag {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.masthead h1 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.masthead .subtitle {
  font-size: 0.95rem;
  color: var(--text-mute);
  margin: 0;
  font-style: italic;
}

/* --- Main content --- */

.lesson {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 1.8rem;
}

.lesson h2 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2.2rem 0 0.5rem;
  line-height: 1.35;
}

.lesson h3 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.6rem 0 0.4rem;
  color: var(--text-soft);
}

.lesson p {
  margin: 0 0 1rem;
}

.lesson ul, .lesson ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
}

.lesson li {
  margin-bottom: 0.4rem;
}

/* --- Steps (numbered sequence) --- */

.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
  margin: 1.5rem 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Callouts --- */

.callout {
  background: var(--callout-bg);
  border-left: 3px solid var(--callout-border);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.95rem;
}

.callout-title {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
}

.callout.tip {
  background: var(--tip-bg);
  border-color: var(--tip-border);
}

.callout.tip .callout-title { color: #3a6a3a; }

.callout.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.callout.warn .callout-title { color: #9a5200; }

/* --- Inline code --- */

.lesson code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

/* --- Tables --- */

.lesson table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.88rem;
}

.lesson th, .lesson td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.7rem;
  text-align: left;
}

.lesson th {
  background: var(--callout-bg);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
}

/* --- Quiz --- */

.quiz {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 1.8rem;
  margin: 2rem 0;
  border: 1px solid #e8d3ce;
}

.quiz h3 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  margin-top: 0;
  color: var(--accent-dark);
}

.quiz .question {
  margin-bottom: 1.2rem;
}

.quiz .question p {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quiz .options { list-style: none; padding-left: 0; margin: 0; }
.quiz .options li {
  margin-bottom: 0.3rem;
}

.quiz button {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0.1rem 0.3rem 0.1rem 0;
  color: var(--text);
  transition: all 0.15s;
}

.quiz button:hover { border-color: var(--accent); }

.quiz button.correct {
  background: #d6ecd6;
  border-color: #5a8a5a;
  color: #2a5a2a;
  font-weight: 700;
}

.quiz button.wrong {
  background: #f4d4d0;
  border-color: #b8442f;
  color: #8f3322;
}

.quiz .feedback {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--text-soft);
  min-height: 1.2rem;
}

.quiz .feedback.correct { color: #3a6a3a; }
.quiz .feedback.wrong { color: #8f3322; }

/* --- Footer / Navigation --- */

.lesson-footer {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.lesson-footer .primary-source {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.lesson-footer .primary-source h3 {
  margin-top: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
}

.lesson-footer .ask-agent {
  text-align: center;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-mute);
}

.lesson-footer .nav {
  display: flex;
  justify-content: space-between;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
}

.lesson-footer .nav a {
  color: var(--accent);
  text-decoration: none;
}

.lesson-footer .nav a:hover { text-decoration: underline; }

/* --- Links --- */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* --- Response tracking (practice exc) --- */

.practice-check {
  list-style: none;
  padding-left: 0;
}

.practice-check li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.practice-check li::before {
  content: '☐';
  position: absolute;
  left: 0;
  font-size: 1.2rem;
}

.practice-check li.done::before { content: '☑'; color: var(--tip-border); }
.practice-check li.done { text-decoration: line-through; color: var(--text-mute); }

/* --- Responsive tables --- */

@media (max-width: 500px) {
  .lesson table { font-size: 0.8rem; }
  .lesson th, .lesson td { padding: 0.35rem 0.4rem; }
}
