/* Course layout for long notes (assets/site/course.js): boxes above the text, grouped and coloured
   by chapter, one page at a time, previous and next page at the end. Without JavaScript nothing
   of this appears and the note is one long page with headings. */
.article-body { --c: var(--ink); --c-soft: #fffdf4; }
[data-chapter="1"] { --c: #b95a28; --c-soft: #f7e6da; }
[data-chapter="2"] { --c: #173fbe; --c-soft: #e1e6f7; }
[data-chapter="3"] { --c: #426f6b; --c-soft: #deebe8; }
[data-chapter="4"] { --c: #685d94; --c-soft: #e8e4f2; }
[data-chapter="5"] { --c: #8a5979; --c-soft: #f2e2ec; }
[data-chapter="6"] { --c: #7a6420; --c-soft: #f1ead5; }

/* both are <nav> elements: undo the flex row and the [brackets] of the site navigation */
.course-nav { display: block; margin: 4px 0 6px; }
.course-nav a[aria-current="page"]::before { content: none; }
.course-label { margin: 0 0 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c); font-weight: 700; }
.course-chapters { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.course-nav ol { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 0; }
.course-nav li { margin: 0; }
.course-nav a, .course-nav a:visited { position: relative; display: grid; place-items: center; width: 38px; height: 34px;
  border: 2px solid var(--c); background: var(--c-soft); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none;
  box-shadow: 3px 3px 0 #e6e3db; }
.course-nav a:hover { background: #fffdf4; color: var(--ink); }
/* pages not yet written: dashed and pale */
.course-nav a.is-empty { border-style: dashed; background: transparent; color: var(--muted); box-shadow: none; font-weight: 400; }
/* a small pixel in the corner marks pages already read */
.course-nav a.is-visited::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; background: var(--c); }
.course-nav a[aria-current="page"] { background: var(--c); border-style: solid; color: #fffdf4; box-shadow: 3px 3px 0 var(--ink); }
.course-nav a[aria-current="page"]::after { background: #fffdf4; }

/* the number in front of the page heading, in the colour of the chapter */
.course-page > h3 { font-size: 1.5em; border-bottom: 1px dotted var(--line); padding-bottom: 7px; margin-top: 1.1em; }
.course-number { display: inline-block; margin-right: .2em; padding: 0 .35em; background: var(--c); color: #fffdf4; font-size: .8em; vertical-align: .08em; }
.course-empty { margin: 26px 0; padding: 18px 20px; border: 2px dashed var(--c); color: var(--muted); font-size: 14px;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, var(--c-soft) 14px 28px); }

.course-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin: 42px 0 8px; padding-top: 20px; border-top: 1px dotted var(--line); }
.course-pager a, .course-pager a:visited { max-width: 48%; padding: 9px 14px 10px; border: 2px solid var(--ink); border-left: 8px solid var(--c); background: #fffdf4; color: var(--ink);
  font-size: 14px; line-height: 1.4; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); }
.course-pager a:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: #fffdf4; color: var(--ink); }
.course-pager a:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.course-pager .course-next { margin-left: auto; text-align: right; }
.course-pager small { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 560px) {
  .course-chapters { gap: 8px 12px; }
  .course-nav ol { gap: 5px; }
  .course-nav a { width: 34px; height: 30px; font-size: 12px; }
  .course-pager a { max-width: 100%; }
  .course-page > h3 { font-size: 1.3em; }
}
@media (prefers-reduced-motion: reduce) {
  .course-pager a:hover, .course-pager a:active { transform: none; }
}
@media print {
  .course-page[hidden] { display: block !important; }
  .course-nav, .course-pager, .course-empty { display: none; }
}
