/* Introduction to Programming · course site · warm light theme, shared with the class decks */
:root {
  --bg: #FFFCF7;
  --card: #F4EDE0;
  --line: #E6DCCC;
  --text: #2E3A41;
  --muted: #6E7D85;
  --accent: #D2552C;
  --teal: #12897A;     /* Block 1 · theory */
  --shadow: 0 1px 2px rgba(46, 58, 65, .04), 0 6px 18px rgba(46, 58, 65, .05);
  --yellow: #A9750B;   /* Block 2 */
  --orange: #D2552C;   /* Block 3 */
  --purple: #6B5CA5;   /* practical */
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* system-ui first: without it Linux/Chrome falls through to a monospace default */
  font: 17px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", "Noto Sans", Arial, sans-serif;
}

/* ---- header / footer ---- */
header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; }
.brand span { color: var(--muted); font-weight: 400; margin-left: .5rem; font-size: .9rem; }
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: .95rem;
}
header.site nav a:first-child { margin-left: 0; }
header.site nav a:hover { color: var(--accent); }

footer.site {
  max-width: 760px;
  margin: 3rem auto 0;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

/* ---- content column ---- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 0;
}
h1 { font-size: 2.2rem; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 + p { color: var(--muted); font-size: 1.15rem; margin-top: 0; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 .75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: .3rem; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-color: rgba(210, 85, 44, .35); }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
blockquote {
  margin: 1.25rem 0;
  padding: .75rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  color: var(--text);
}

/* ---- code ---- */
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}
code { background: var(--card); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; }
pre {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; }
/* these blocks hold prose-like rules and long commands: wrap rather than clip */
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: .95rem;
  box-shadow: var(--shadow);
}
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }

/* ---- weeks index (home) and materials (week pages) ---- */
.weeks ul, .materials ul { list-style: none; padding: 0; margin: 0; }
.weeks li, .materials li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1.05rem;
  margin-bottom: .5rem;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.weeks li:hover, .materials li:hover { border-color: var(--accent); transform: translateY(-1px); }
.weeks li a { text-decoration: none; color: var(--text); font-weight: 600; }
.weeks li a:hover { color: var(--accent); }
.weeks .meta { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; }
.badge {
  display: inline-block;
  padding: .1rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--bg);
  background: var(--muted);
}
.badge.theory { background: var(--teal); }
.badge.practical { background: var(--purple); }

.materials li.deck { border-left: 3px solid var(--accent); }
.materials li.deck span { font-weight: 600; }
.materials li.deck a { font-weight: 600; text-decoration: none; }
.materials li.page a { color: var(--text); text-decoration: none; }
.materials li.page a:hover, .materials li.file a:hover { color: var(--accent); }
.materials li.file a { color: var(--text); text-decoration: none; }
.materials .size { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* ---- small screens ---- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.8rem; }
  header.site { flex-direction: column; align-items: flex-start; }
  table { display: block; overflow-x: auto; }
}
