/* Shared stylesheet for the GitLab Pipelines course.
   Tufte-inspired: readable serif body, generous margins, calm palette.
   Linked by every lesson and reference doc so the course feels like one book. */

:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e3e3e0;
  --bg: #fdfdfb;
  --accent: #b04a2f;          /* warm terracotta, GitLab-orange-ish but calmer */
  --accent-soft: #fbeee9;
  --gitlab: #fc6d26;
  --code-bg: #f4f3ef;
  --ok: #2e7d52;
  --warn: #9a6b00;
  --warn-bg: #fdf6e3;
  --note-bg: #eef4f8;
  --note-edge: #5b8aa6;
  --maxw: 44rem;
}

* { box-sizing: border-box; }

html { font-size: 19px; }

body {
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 4rem 1.6rem 6rem;
  background: var(--bg);
  color: var(--ink);
  font-family: et-book, Palatino, "Palatino Linotype", Georgia, serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- masthead ---- */
.masthead {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: .6rem;
  margin-bottom: 2.4rem;
}
.masthead .course { color: var(--gitlab); font-weight: 600; }

h1, h2, h3 { line-height: 1.18; font-weight: 600; }
h1 { font-size: 2.05rem; margin: .2rem 0 .3rem; letter-spacing: -.01em; }
.subtitle { font-style: italic; color: var(--muted); font-size: 1.12rem; margin: 0 0 2.2rem; }
h2 {
  font-size: 1.32rem; margin: 2.8rem 0 .8rem;
  padding-top: 1.1rem; border-top: 1px solid var(--rule);
}
h3 { font-size: 1.08rem; margin: 1.8rem 0 .5rem; }

p { margin: .9rem 0; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(176,74,47,.32); }
a:hover { border-bottom-color: var(--accent); }

strong { font-weight: 600; }
em.term { font-style: normal; font-weight: 600; color: var(--accent); }

/* ---- the "why this matters" mission strip ---- */
.mission {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: .82rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: .7rem 1rem;
  margin: 0 0 2rem;
  color: #5a3526;
}
.mission b { letter-spacing: .04em; text-transform: uppercase; font-size: .72rem; }

/* ---- callouts ---- */
.callout {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: .9rem;
  border-radius: 5px;
  padding: .85rem 1.1rem;
  margin: 1.4rem 0;
  line-height: 1.5;
}
.callout .label {
  display: block; font-weight: 700; font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: .25rem;
}
.note { background: var(--note-bg); border-left: 3px solid var(--note-edge); }
.note .label { color: var(--note-edge); }
.pitfall { background: var(--warn-bg); border-left: 3px solid var(--warn); }
.pitfall .label { color: var(--warn); }
.win { background: #eef7f0; border-left: 3px solid var(--ok); }
.win .label { color: var(--ok); }

/* ---- code ---- */
code, pre, .yaml {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
code { background: var(--code-bg); padding: .08em .35em; border-radius: 3px; font-size: .86em; }
pre {
  background: #1e1e2e; color: #e6e6ef; padding: 1.05rem 1.2rem;
  border-radius: 7px; overflow-x: auto; font-size: .8rem; line-height: 1.55;
  margin: 1.2rem 0;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
pre .c { color: #8b8ba7; font-style: italic; }   /* comment */
pre .k { color: #f9a8a0; }                         /* yaml key */
pre .s { color: #b5e8a8; }                         /* string/value */
pre .h { background: rgba(252,109,38,.16); display:inline-block; width:100%; }

figcaption {
  font-family: -apple-system, sans-serif; font-size: .78rem;
  color: var(--muted); text-align: center; margin-top: -.5rem;
}

/* ---- diagram: pipeline stages ---- */
.pipeline {
  display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap;
  font-family: -apple-system, sans-serif; margin: 1.4rem 0;
}
.pipeline .stage {
  flex: 1; min-width: 110px; border: 1px solid var(--rule);
  border-radius: 6px; background: #fff; padding: .55rem .5rem; text-align: center;
}
.pipeline .stage h4 {
  margin: 0 0 .45rem; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.pipeline .job {
  background: var(--code-bg); border-radius: 4px; padding: .28rem;
  font-size: .74rem; margin: .28rem 0; border: 1px solid var(--rule);
}
.pipeline .arrow { align-self: center; color: var(--muted); font-size: 1.1rem; }

/* ---- footer nav ---- */
.lesson-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule);
  font-family: -apple-system, sans-serif; font-size: .85rem;
}
.lesson-nav a { display: block; }
.lesson-nav .muted { color: var(--muted); border: none; cursor: default; }

.ask {
  font-family: -apple-system, sans-serif; font-size: .85rem;
  background: #f4f3ef; border-radius: 6px; padding: .8rem 1rem; margin: 2rem 0 0;
  color: var(--muted);
}
.ask b { color: var(--ink); }

.source {
  font-family: -apple-system, sans-serif; font-size: .85rem;
  border-left: 3px solid var(--gitlab); padding: .3rem 0 .3rem 1rem; margin: 1.6rem 0;
}
.source b { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display:block; }

/* ---- participant exercises ---- */
.exercise {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gitlab);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}
.exercise > .label {
  display: block; font-weight: 700; font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gitlab); margin-bottom: .4rem;
}
.exercise .task { font-size: .9rem; margin: .3rem 0; }
.exercise .task b { color: var(--ink); }
.exercise ol { margin: .4rem 0 .4rem 1.2rem; padding: 0; }
.exercise ol li { font-size: .9rem; margin: .3rem 0; }
.exercise details {
  margin-top: .8rem; border-top: 1px dashed var(--rule); padding-top: .7rem;
}
.exercise summary {
  cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--accent);
  list-style: none;
}
.exercise summary::-webkit-details-marker { display: none; }
.exercise summary::before { content: "▸ "; }
.exercise details[open] summary::before { content: "▾ "; }
.exercise details pre { margin: .7rem 0 .3rem; }
.exercise .hint { font-size: .82rem; color: var(--muted); font-style: italic; margin: .5rem 0 0; }

@media print {
  .exercise details { display: block; }
  .exercise details summary { display: none; }

  body { padding: 0; max-width: 100%; font-size: 11pt; }
  pre { background: #f4f3ef; color: #1a1a1a; border: 1px solid #ddd; }
  .quiz button { display: none; }
  a { color: var(--ink); }
}
