/* Lightweight, dependency-free stylesheet for course webpage submissions.
   No external fonts/CDNs — keeps the folder self-contained and under the size cap. */

/* Palette lifted from a dusk shot of the Tetons: pale sky-blue ground, a
   near-black indigo ridge for text, slate-blue for muted/links, the warm
   gap of sunlight through cloud as a small accent, and the dark sagebrush
   flat at the photo's base as a trace green — used only at the header's
   horizon rule and the footer, not washed across every neutral. */
:root {
  --max-width: 900px;
  --text: #1c2431;
  --muted: #5b6b80;
  --bg: #f6f8fb;
  --panel: #e9edf3;
  --border: #d7dee6;
  --accent: #3b5b82;
  --accent-warm: #a3761f;
  --ground: #5f7a5a;
  --code-bg: #eef1f6;
  --gap: 1.25rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2.5rem 1.25rem 5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

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

header.page-header {
  max-width: var(--max-width);
  margin: 0 auto 2.5rem;
  text-align: center;
}

header.page-header::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 1.25rem auto 0;
  background: var(--ground);
  border-radius: 2px;
}

header.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
}

header.page-header p {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

nav#TOC {
  max-width: var(--max-width);
  margin: 0 auto 2.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
}

nav#TOC::before {
  content: "Contents";
  font-weight: 600;
}

nav#TOC ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

nav#TOC ul ul { margin-top: 0.2rem; }
nav#TOC a { color: var(--accent); text-decoration: none; }
nav#TOC a:hover { text-decoration: underline; }

/* pandoc --section-divs wraps each heading level in <section class="levelN">;
   our questions are level-2 (##) headings. */
section.level2 {
  margin-bottom: 3rem;
  padding-top: 0.5rem;
  scroll-margin-top: 1rem;
}

section.level2 > h2 {
  font-size: 1.3rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.6rem;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  margin: 1rem 0;
}

.figure-grid.cols-1 { grid-template-columns: 1fr; }
.figure-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.figure-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.figure-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.figure-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

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

figure img,
figure video {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.note {
  background: var(--panel);
  border-left: 3px solid var(--accent-warm);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.92rem;
  margin: 1rem 0;
}

.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

pre, code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

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

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

th {
  background: var(--panel);
}

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

footer.page-footer {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 1rem;
  border-top: 2px solid var(--ground);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Same photo, night side: near-black indigo ground, pale sky text,
       brighter steel-blue and gold to hold contrast, sagebrush green
       kept as the same trace accent. */
    --text: #e4e9f1;
    --muted: #93a1b5;
    --bg: #131822;
    --panel: #1e2530;
    --border: #2d3645;
    --accent: #7fa4d1;
    --accent-warm: #d9a94a;
    --ground: #7fa07a;
    --code-bg: #1a212c;
  }
}
