/* Teal chapter fields, cool light reading space, and a quiet brick accent. */
:root {
  color-scheme: light;
  --paper: #f3f7f9;
  --white: #ffffff;
  --teal: #287a7b;
  --teal-deep: #205b61;
  --teal-light: #dcebed;
  --brick: #95422f;
  --clay: #f2e3dd;
  --clay-ink: #784b3c;
  --ink: #243c40;
}

html,
body {
  color: var(--ink);
  background: var(--paper);
}

a {
  color: var(--brick);
  text-decoration-line: underline;
}

a:hover {
  text-decoration-thickness: .14em;
}

a:focus-visible,
main:focus-visible {
  outline: 3px solid var(--brick);
  outline-offset: 4px;
}

::selection {
  color: var(--ink);
  background: var(--clay);
}

.guide-header {
  color: var(--white);
  background: var(--teal);
}

.guide-name {
  color: inherit;
  text-decoration: none;
}

/* An open primer, drawn with two pages and a central fold. */
.guide-name::before,
.chapter:first-of-type .chapter-main > h2::before,
.chapter-notes > h2::before {
  border: 2px solid currentColor;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(90deg, transparent 46%, currentColor 46%, currentColor 53%, transparent 53%);
  transform: rotate(-5deg);
}

.chapter:first-of-type .chapter-main > h2::before,
.chapter-notes > h2::before {
  content: "";
  display: block;
  width: 1.75rem;
  height: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--brick);
}

.skip-reading {
  color: var(--white);
  background: var(--brick);
  border-radius: var(--corner);
}

.skip-reading:focus-visible {
  outline-color: var(--white);
}

.reading-progress {
  color: var(--brick);
  background: var(--teal-light);
  accent-color: var(--brick);
}

.reading-progress::-webkit-progress-bar {
  background: var(--teal-light);
}

.reading-progress::-webkit-progress-value {
  background: var(--brick);
}

.reading-progress::-moz-progress-bar {
  background: var(--brick);
}

h1,
h2,
h3 {
  color: var(--teal-deep);
}

.journal-lead,
.missing-page {
  color: var(--white);
  background: var(--teal);
}

.journal-lead h1,
.missing-page h1 {
  color: inherit;
}

.fact-date {
  color: var(--clay-ink);
}

.journal-lead .fact-date {
  color: inherit;
}

.topic-index {
  color: var(--ink);
  background: var(--white);
}

.topic-title {
  color: var(--teal-deep);
}

.topic-label {
  color: var(--clay-ink);
}

.topic-cluster a:hover {
  background: var(--clay);
}

.topic-cluster a[aria-current="page"] {
  color: var(--white);
  background: var(--brick);
}

.topic-cluster a[aria-current="page"]::before {
  background: currentColor;
}

.chapter:nth-of-type(even) {
  color: var(--white);
  background: var(--teal);
}

.chapter:nth-of-type(even) h2,
.chapter:nth-of-type(even) h3,
.chapter:nth-of-type(even) .chapter-main > .fact-date {
  color: inherit;
}

.term-notes {
  color: var(--ink);
  background: var(--teal-light);
}

.term-title,
.term-notes dt {
  color: var(--teal-deep);
}

.chapter:nth-of-type(even) .term-notes {
  background: var(--white);
}

.source-link {
  color: var(--brick);
  background: var(--white);
}

.source-link:hover {
  background: var(--clay);
}

.cost-lines > div {
  border-top: 2px solid var(--teal-light);
}

.cost-lines > div:last-child {
  border-bottom: 2px solid var(--teal-light);
}

.cost-lines dt {
  color: var(--teal-deep);
}

.chapter:nth-of-type(even) .cost-lines dt {
  color: inherit;
}

.question-list li::marker {
  color: var(--brick);
}

.chapter:nth-of-type(even) .question-list li::marker {
  color: inherit;
}

.urgent-answer {
  color: var(--ink);
  background: var(--clay);
  border-top: 6px solid var(--brick);
}

.urgent-answer h2 {
  color: var(--brick);
}

.urgent-action {
  border-top: 2px solid var(--brick);
}

.journal-entries {
  background: var(--teal-light);
}

.journal-entry {
  color: var(--ink);
  background: var(--white);
}

.journal-entry h3,
.journal-entry time {
  color: var(--brick);
}

.journal-entry:hover {
  background: var(--clay);
}

.chapter-notes {
  background: var(--white);
}

.chapter-next {
  background: var(--clay);
}

.reading-link {
  color: var(--white);
  background: var(--brick);
}

.reading-link:hover {
  background: var(--clay-ink);
}

.guide-footer {
  color: var(--white);
  background: var(--teal);
}

.footer-link,
.missing-page a {
  color: var(--brick);
  background: var(--white);
}

.guide-header a:focus-visible,
.guide-footer a:focus-visible,
.journal-lead a:focus-visible,
.missing-page a:focus-visible,
.chapter:nth-of-type(even) a:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--brick);
}

@media print {
  html,
  body,
  .guide-header,
  .guide-footer,
  .journal-lead,
  .chapter:nth-of-type(even),
  .term-notes,
  .urgent-answer,
  .chapter-notes,
  .journal-entries,
  .journal-entry,
  .chapter-next,
  .missing-page {
    color: #243c40;
    background: #ffffff;
  }

  .journal-lead h1,
  .chapter:nth-of-type(even) h2,
  .chapter:nth-of-type(even) h3 {
    color: #243c40;
  }
}
