
:root {
  --case-blue: #1F4E79;
  --case-light-blue: #EAF2F8;
  --case-green: #2E6B4F;
  --case-light-green: #EDF7F1;
  --case-orange: #B55D12;
  --case-light-orange: #FFF3E8;
  --case-red: #9C2F2F;
  --case-light-red: #FCEEEE;
  --case-gray: #555555;
  --case-light-gray: #F4F5F6;
}

/* Match the TeX chapter / section color hierarchy. */
.quarto-title-block h1.title,
#quarto-document-content h1,
#quarto-document-content h2 {
  color: var(--case-blue);
}

#quarto-document-content h3 {
  color: var(--case-green);
}

#quarto-document-content h1 .chapter-number,
#quarto-document-content h1 .chapter-title,
#quarto-document-content h2 .header-section-number {
  color: inherit;
}

/* Custom teaching boxes converted from tcolorbox. */
.studybox,
.conceptbox,
.pitfall,
.methodbox,
.exercisebox {
  border: 1px solid;
  border-radius: 6px;
  margin: 1rem 0;
  padding: 0.9rem 1rem 0.8rem;
  overflow: hidden;
  box-shadow: none;
}

.studybox::before,
.conceptbox::before,
.pitfall::before,
.methodbox::before,
.exercisebox::before {
  content: attr(data-title);
  display: block;
  margin: -0.9rem -1rem 0.8rem;
  padding: 0.38rem 0.78rem;
  font-weight: 700;
  color: white;
}

.studybox { background: var(--case-light-blue); border-color: var(--case-blue); }
.studybox::before { background: var(--case-blue); }

.conceptbox { background: var(--case-light-green); border-color: var(--case-green); }
.conceptbox::before { background: var(--case-green); }

.pitfall { background: var(--case-light-red); border-color: var(--case-red); }
.pitfall::before { background: var(--case-red); }

.methodbox { background: var(--case-light-orange); border-color: var(--case-orange); }
.methodbox::before { background: var(--case-orange); }

.exercisebox { background: var(--case-light-gray); border-color: var(--case-gray); }
.exercisebox::before { background: var(--case-gray); }

.studybox > :last-child,
.conceptbox > :last-child,
.pitfall > :last-child,
.methodbox > :last-child,
.exercisebox > :last-child {
  margin-bottom: 0;
}

/* VideoResource: white body, CaseBlue frame/title. */
.callout.callout-note {
  border: 1px solid var(--case-blue) !important;
  background: white !important;
  border-radius: 6px;
  overflow: hidden;
}
.callout.callout-note .callout-header {
  background: var(--case-blue) !important;
  color: white !important;
  margin: 0 !important;
  padding: 0.42rem 0.8rem !important;
}
.callout.callout-note .callout-title-container {
  color: white !important;
  font-weight: 700;
}
.callout.callout-note .callout-icon-container {
  display: none !important;
}
.callout.callout-note .callout-body-container {
  background: white !important;
}

/* Booktabs-like tables, with responsive horizontal scrolling supplied by Quarto. */
#quarto-document-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.35rem;
  font-size: 0.96em;
}
#quarto-document-content table thead tr {
  border-top: 2px solid #333;
  border-bottom: 1px solid #666;
}
#quarto-document-content table tbody tr:last-child {
  border-bottom: 2px solid #333;
}
#quarto-document-content table th,
#quarto-document-content table td {
  padding: 0.42rem 0.6rem;
  vertical-align: top;
  border-left: none;
  border-right: none;
}
#quarto-document-content table th {
  font-weight: 600;
  background: transparent;
}

/* Vector figures generated from the original TikZ/PGFPlots. */
#quarto-document-content figure {
  margin: 1.25rem auto 1.5rem;
  text-align: center;
}
#quarto-document-content figure img,
#quarto-document-content p > img {
  display: block;
  max-width: min(100%, 900px);
  height: auto;
  margin: 0 auto;
}
#quarto-document-content figcaption,
#quarto-document-content .figure-caption {
  color: var(--case-gray);
  margin-top: 0.55rem;
}

/* Keep long tables usable on narrow screens. */
@media (max-width: 768px) {
  #quarto-document-content table {
    font-size: 0.9em;
  }
  #quarto-document-content table th,
  #quarto-document-content table td {
    padding: 0.35rem 0.45rem;
  }
}

/* ---------- Digital textbook cover ---------- */
.cover-heading {
  display: none !important;
}

.cover-page {
  max-width: 980px;
  min-height: 84vh;
  margin: 0 auto;
  padding: 2.8rem 1.2rem 3.5rem;
  text-align: center;
}

.cover-school {
  color: var(--case-blue);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.cover-college {
  color: var(--case-blue);
  font-size: clamp(1.15rem, 2.1vw, 1.45rem);
  font-weight: 700;
  margin-bottom: 2.4rem;
}

.cover-title {
  color: var(--case-blue);
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cover-edition {
  font-size: 1.35rem;
  margin-top: 1rem;
  color: #333;
}

.cover-tagline {
  font-size: 1.18rem;
  margin: 1rem 0 2.2rem;
  color: #333;
}

.cover-project-box {
  max-width: 860px;
  margin: 0 auto 2.2rem;
  border: 1.4px solid var(--case-blue);
  border-radius: 8px;
  padding: 1.2rem 1.45rem 1.35rem;
  text-align: left;
  background: #fff;
}

.cover-project-label,
.cover-project-name {
  font-weight: 700;
  line-height: 1.65;
}

.cover-project-name {
  margin: 0.25rem 0 1rem;
}

.cover-meta-grid {
  display: grid;
  grid-template-columns: 8.2rem 1fr;
  gap: 0.28rem 1rem;
  line-height: 1.65;
}

.cover-meta-label {
  font-weight: 600;
  color: #333;
}

.cover-compiler {
  margin-top: 2.2rem;
  font-size: 1.05rem;
}

.cover-date {
  margin-top: 0.35rem;
  color: var(--case-gray);
}

.cover-enter {
  display: inline-block;
  margin-top: 1.8rem;
  padding: 0.72rem 1.45rem;
  border-radius: 999px;
  background: var(--case-blue);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
}

.cover-enter:hover {
  background: #173b5c;
}

.preface-signoff {
  margin-top: 2rem;
  text-align: right;
  line-height: 1.8;
}

@media (max-width: 650px) {
  .cover-page {
    padding: 1.8rem 0.3rem 2.5rem;
  }
  .cover-project-box {
    padding: 1rem;
  }
  .cover-meta-grid {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .cover-meta-label {
    margin-top: 0.55rem;
  }
}
