/* Midterm guide components, layered over the dedicated week-08-base.css shell. */
.week-eight-document,
body.course-contents-programming.week-eight-page {
  overflow-x: clip;
}

body.course-contents-programming.week-eight-page .week-eight-hero-visual img {
  object-fit: contain;
  background: #fdfdf8;
}

body.course-contents-programming.week-eight-page .toc {
  min-width: 0;
}

body.course-contents-programming.week-eight-page .article .proposal-required-label {
  margin: 18px 0 8px;
  font-size: var(--week-five-size-secondary);
  font-weight: 600;
}

body.course-contents-programming.week-eight-page .proposal-note {
  margin: 16px 0 24px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--line-strong);
}

body.course-contents-programming.week-eight-page .proposal-note p {
  margin: 0;
  color: var(--muted);
  font-size: var(--week-five-size-secondary);
  line-height: 1.7;
}

body.course-contents-programming.week-eight-page .proposal-note .proposal-note-label {
  margin: 0 0 6px;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: var(--week-five-size-label);
  font-weight: 600;
  letter-spacing: 0.03em;
}

body.course-contents-programming.week-eight-page .midterm-rubric .rubric-name,
body.course-contents-programming.week-eight-page .midterm-rubric .rubric-description {
  display: block;
}

body.course-contents-programming.week-eight-page .midterm-rubric .rubric-description {
  margin-top: 8px;
  font-weight: 400;
}

body.course-contents-programming.week-eight-page .midterm-rubric .rubric-weight {
  width: 76px;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  font-size: var(--week-five-size-subhead);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 980px) {
  body.course-contents-programming.week-eight-page .article :is(h2, h3) {
    scroll-margin-top: 132px;
  }
}

/* Two sections share the course shell; their nested headings stay distinct. */
body.course-contents-programming.week-eight-page .midterm-section-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 36px 0 48px;
}

body.course-contents-programming.week-eight-page .midterm-section-links a {
  padding: 18px 0;
  border-block: 1px solid var(--line-strong);
  color: var(--ink-strong);
  font-weight: 600;
  text-decoration: none;
}

body.course-contents-programming.week-eight-page .midterm-section-links span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
}

body.course-contents-programming.week-eight-page .midterm-section {
  min-width: 0;
  margin: 64px 0 0;
}

body.course-contents-programming.week-eight-page .midterm-section-heading {
  margin-bottom: 34px;
  padding-top: 24px;
  border-top: 3px solid var(--accent);
}

body.course-contents-programming.week-eight-page .midterm-section-heading .section-kicker {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

body.course-contents-programming.week-eight-page .midterm-section-heading h2 {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  font-family: var(--week-five-display);
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.035em;
}

body.course-contents-programming.week-eight-page .midterm-section-heading > p:last-child {
  margin: 0;
  color: var(--muted);
}

body.course-contents-programming.week-eight-page .midterm-section > h3 {
  margin: 56px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-strong);
  font-family: var(--week-five-text);
  font-size: 23px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.025em;
  word-break: keep-all;
}

body.course-contents-programming.week-eight-page .midterm-section-heading + h3 {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

body.course-contents-programming.week-eight-page .midterm-section h4 {
  margin: 36px 0 14px;
  color: var(--ink-strong);
  font-family: var(--week-five-text);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

body.course-contents-programming.week-eight-page .midterm-section :is(p, li, dd, td, th) {
  overflow-wrap: anywhere;
}

body.course-contents-programming.week-eight-page .midterm-section > :is(ul, ol) {
  padding-left: 1.5em;
}

body.course-contents-programming.week-eight-page .midterm-section > :is(ul, ol) > li {
  margin-block: 10px;
  line-height: 1.8;
}

body.course-contents-programming.week-eight-page .writing-prompt {
  margin: 24px 0;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--paper));
}

body.course-contents-programming.week-eight-page .writing-prompt p {
  margin: 8px 0 0;
}

body.course-contents-programming.week-eight-page .article .writing-label,
body.course-contents-programming.week-eight-page .article .example-kicker {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-family: var(--week-five-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

body.course-contents-programming.week-eight-page .blank {
  padding: 0 2px 2px;
  border-bottom: 1px solid var(--accent-ink);
  background: #ffe34a;
  color: #0d110e;
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

body.course-contents-programming.week-eight-page .midterm-section :is(td, dd, figcaption) strong {
  background: #ffe34a;
  color: #0d110e;
  padding: 0.05em 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

body.course-contents-programming.week-eight-page .expanded-example {
  margin: 24px 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--line-strong);
}

body.course-contents-programming.week-eight-page .expanded-example p:last-child {
  margin-bottom: 0;
}

body.course-contents-programming.week-eight-page .proposal-figure {
  margin: 28px 0;
}

body.course-contents-programming.week-eight-page .proposal-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

body.course-contents-programming.week-eight-page .proposal-figure figcaption,
body.course-contents-programming.week-eight-page .source-reference,
body.course-contents-programming.week-eight-page .example-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

body.course-contents-programming.week-eight-page .source-keyword {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

body.course-contents-programming.week-eight-page .data-source-table th:first-child {
  width: 24%;
}

body.course-contents-programming.week-eight-page .template-download {
  margin-block: 24px;
}

body.course-contents-programming.week-eight-page .template-download a {
  display: inline-block;
  padding: 12px 16px;
  border: 1px solid var(--accent-ink);
  border-radius: 4px;
  color: var(--accent-ink);
  font-weight: 600;
}

body.course-contents-programming.week-eight-page .one-page-example {
  margin: 34px 0;
  padding: 28px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

body.course-contents-programming.week-eight-page .one-page-example header {
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink-strong);
}

body.course-contents-programming.week-eight-page .one-page-example h4 {
  margin: 0;
  font-size: 26px;
}

body.course-contents-programming.week-eight-page .proposal-sheet {
  margin: 0;
}

body.course-contents-programming.week-eight-page .proposal-sheet > div {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

body.course-contents-programming.week-eight-page .proposal-sheet dt {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 600;
}

body.course-contents-programming.week-eight-page .proposal-sheet dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}

body.course-contents-programming.week-eight-page .toc .toc-level-2 + .toc-level-3 {
  margin-top: 5px;
}

body.course-contents-programming.week-eight-page .toc .toc-level-2:not(:first-child) {
  margin-top: 18px;
}

body.course-contents-programming.week-eight-page .expression-route {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 20px 0 32px;
  font-size: 14px;
  font-weight: 600;
}

body.course-contents-programming.week-eight-page .article h4:is(#art-methods, #chart-choice, #mapping-sketch) {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--accent);
  font-size: 22px;
}

body.course-contents-programming.week-eight-page .midterm-section h5 {
  margin: 28px 0 12px;
  color: var(--ink-strong);
  font-family: var(--week-five-text);
  font-size: 17px;
  line-height: 1.6;
}

body.course-contents-programming.week-eight-page .art-reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 30px;
  margin: 26px 0;
}

body.course-contents-programming.week-eight-page .art-reference-list > section {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

body.course-contents-programming.week-eight-page .art-reference-list h5 {
  margin-top: 0;
}

body.course-contents-programming.week-eight-page .art-reference-list p {
  font-size: 15px;
  line-height: 1.85;
}

body.course-contents-programming.week-eight-page .chart-comparison-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

body.course-contents-programming.week-eight-page .chart-comparison-gallery figure {
  min-width: 0;
  margin: 0;
}

body.course-contents-programming.week-eight-page .chart-comparison-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
}

body.course-contents-programming.week-eight-page .chart-comparison-gallery figcaption {
  padding: 14px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
}

body.course-contents-programming.week-eight-page .toc .toc-detail a {
  padding-left: 25px;
  font-size: 12px;
}

@media (min-width: 981px) {
  body.course-contents-programming.week-eight-page .toc {
    max-height: calc(100svh - 110px);
    overflow-y: auto;
  }
}

@media (max-width: 700px) {
  body.course-contents-programming.week-eight-page .art-reference-list,
  body.course-contents-programming.week-eight-page .chart-comparison-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body.course-contents-programming.week-eight-page .article :is(h2, h3, h4) {
    scroll-margin-top: 132px;
  }

  body.course-contents-programming.week-eight-page .toc .toc-level-2:not(:first-child) {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  body.course-contents-programming.week-eight-page .midterm-section-links {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body.course-contents-programming.week-eight-page .midterm-section-links a + a {
    border-top: 0;
  }

  body.course-contents-programming.week-eight-page .midterm-section > h3 {
    font-size: 21px;
  }

  body.course-contents-programming.week-eight-page .writing-prompt,
  body.course-contents-programming.week-eight-page .one-page-example {
    padding: 18px;
  }

  body.course-contents-programming.week-eight-page .proposal-sheet > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.course-contents-programming.week-eight-page .midterm-section table {
    min-width: 580px;
  }

  body.course-contents-programming.week-eight-page .midterm-section :is(.midterm-rubric, .one-page-outline) {
    min-width: 0;
  }

  body.course-contents-programming.week-eight-page .one-page-outline th[scope="row"] {
    width: 30%;
  }

  body.course-contents-programming.week-eight-page .one-page-outline :is(th, td) {
    padding: 12px 10px;
    font-size: 14px;
  }
}
