/* Energy Markets Teaching — Shared Stylesheet */
/* Designed for readability, printability, and consistent cross-lesson appearance */

:root {
  --text: #1a1a2e;
  --text-secondary: #4a4a6a;
  --bg: #fefefe;
  --bg-aside: #f4f6fa;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --accent-dark: #1d4ed8;
  --border: #e2e8f0;
  --green: #059669;
  --green-light: #d1fae5;
  --orange: #d97706;
  --orange-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --radius: 6px;
  --max-width: 780px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }
body {
  font-family: 'Charter', 'Georgia', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Typography */
h1 { font-size: 1.8rem; margin-bottom: 0.3rem; line-height: 1.2; }
h2 { font-size: 1.35rem; margin-top: 2.5rem; margin-bottom: 0.8rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.8rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
p { margin-bottom: 1rem; }
strong { font-weight: 600; }

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

/* Lists */
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }
li::marker { color: var(--accent); }

/* Lesson metadata */
.lesson-meta {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.lesson-meta .tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

/* Aside / callout boxes */
.callout {
  background: var(--bg-aside);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
}
.callout.warn {
  border-left-color: var(--orange);
  background: var(--orange-light);
}
.callout.success {
  border-left-color: var(--green);
  background: var(--green-light);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}
th, td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg-aside);
}
tr:hover { background: var(--bg-aside); }

/* Quiz widget styles */
.quiz {
  background: var(--bg-aside);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.quiz h4 {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.quiz-question { font-weight: 500; margin-bottom: 1rem; }
.quiz-options { list-style: none; margin: 0; padding: 0; }
.quiz-options li {
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.92rem;
}
.quiz-options li:hover { border-color: var(--accent); background: var(--accent-light); }
.quiz-options li.correct { border-color: var(--green); background: var(--green-light); }
.quiz-options li.incorrect { border-color: var(--red); background: var(--red-light); }
.quiz-options li.disabled { pointer-events: none; opacity: 0.7; }
.quiz-feedback {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: var(--green-light); color: var(--green); }
.quiz-feedback.incorrect { background: var(--red-light); color: var(--red); }

/* Diagram / figure */
figure {
  margin: 1.5rem 0;
  text-align: center;
}
figcaption {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Navigation links */
.nav-links {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}

/* Footer reminder */
.teacher-reminder {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--accent-light);
  border-radius: var(--radius);
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.82rem;
  color: var(--accent-dark);
  text-align: center;
}

/* Print styles */
@media print {
  body { padding: 0; font-size: 11pt; }
  .quiz-options li { border: 1px solid #ccc; }
  .teacher-reminder { display: none; }
  a { color: var(--text); text-decoration: none; }
  a::after { content: " (" attr(href) ")"; font-size: 0.7em; color: #666; }
}
