/* =========================================================================
   SIGMA v3 — print.css
   Print-only stylesheet. Loaded by syllabus.html (and its translations) as
       <link rel="stylesheet" href="assets/print.css" media="print">
   so it NEVER affects the screen rendering. Everything here is scoped to
   paper: it strips site chrome, flattens the card UI into a document, forces
   black ink except where a colored chip genuinely carries meaning, and — most
   importantly — reveals BOTH credit tracks of the interactive grade toggle so
   the printed syllabus is complete.

   The PDFs are produced ONLY by tools/gen_syllabus_pdf.py. Never hand-edit a
   generated docs-v3/syllabus*.pdf; change this file (or the HTML) and re-run.
   ========================================================================= */

@page {
  margin: 18mm 16mm;
}

/* ---------------------------------------------------------------- base ink */
html, body {
  background: #fff !important;
  color: #000 !important;
}

body {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 10.5pt;
  line-height: 1.5;
}

/* Kill every decorative surface. Cards become document sections. */
* {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* --------------------------------------------------------- chrome removal */
/* Site header/nav (both navbar idioms), the injected drawer, the search
   control and its overlay, the sticky jump-nav, the language switcher, the
   download CTA, and the site footer. */
.nav,
.home-nav,
[data-site-nav],
.site-drawer,
.site-drawer-scrim,
.site-drawer-panel,
.sigma-search-btn,
.sigma-search-overlay,
.sigma-search-panel,
.toc,
.meta,
.syl-jump,
.syl-lang,
.syl-lang-note,
.syl-dl,
.home-footer,
[data-site-footer],
.anim-banner,
.anim-toggle,
.no-print {
  display: none !important;
}

/* Forward-compatible hook: anything the HTML marks .print-only is revealed. */
.print-only {
  display: block !important;
}

/* -------------------------------------------------- print-only page header */
/* Generated from CSS because print.css may not edit syllabus.html. Names the
   course and states the provenance of the document. Deliberately carries NO
   date/time and NO deadline text: the PDF must be byte-reproducible on re-run
   and this site never states deadlines outside Canvas. */
main.home::before {
  content: "SYSEN 5300 · Systems Engineering and Six Sigma for the Design and Operation of Reliable Systems · Cornell University";
  display: block;
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #000;
  padding-bottom: 5pt;
  border-bottom: 1.2pt solid #000;
  margin-bottom: 4pt;
}

main.home::after {
  content: "Generated from the live SIGMA syllabus page. The web version is authoritative; if the two ever disagree, the web version governs. Unofficial translations are provided for convenience — the English syllabus governs.";
  display: block;
  font-size: 8pt;
  font-style: italic;
  color: #333;
  border-top: .5pt solid #999;
  padding-top: 5pt;
  margin-top: 14pt;
  break-before: avoid;
}

:lang(zh) main.home::before {
  content: "SYSEN 5300 · 面向可靠系统设计与运行的系统工程与六西格玛 · 康奈尔大学";
}
:lang(zh) main.home::after {
  content: "本文件由 SIGMA 课程大纲网页生成。网页版本为准；如有出入，以网页版本为准。中文版为便于阅读提供的非正式译本，以英文版课程大纲为准。";
}
:lang(es) main.home::before {
  content: "SYSEN 5300 · Ingeniería de Sistemas y Six Sigma para el Diseño y la Operación de Sistemas Fiables · Cornell University";
}
:lang(es) main.home::after {
  content: "Generado a partir de la página del programa SIGMA en línea. La versión web es la autoritativa; si ambas difieren, prevalece la versión web. Esta es una traducción no oficial ofrecida por conveniencia — el programa en inglés es el que rige.";
}

/* ------------------------------------------------------------ page layout */
main.home,
.home {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* --------------------------------------------------------------- the lead */
/* .focal is a red gradient panel with white text on screen — unreadable on
   paper. Flatten it to a titled masthead. */
.focal,
.syl-lead {
  background: #fff !important;
  color: #000 !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 0 10pt !important;
  padding: 0 !important;
  break-after: avoid;
}

.focal h1, .focal h2, .focal h3, .focal h4,
.focal a, .focal small, .focal .muted {
  color: #000 !important;
}

.syl-lead-inner {
  padding: 6pt 0 0 !important;
}

.syl-lead h1 {
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 20pt;
  margin: 0 0 4pt !important;
  break-after: avoid;
}

.syl-lead .lead-line {
  font-size: 10pt;
  color: #333 !important;
  max-width: none;
}

.accent-bar {
  display: none !important;
}

.syl-note {
  font-size: 9.5pt;
  color: #333 !important;
  max-width: none;
  margin: 0 0 10pt;
}

/* ------------------------------------------------------------- sections */
.syl-section {
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  /* overflow:hidden on screen; MUST be visible or Chrome refuses to paginate
     inside the card and the section is clipped to one page. */
  overflow: visible !important;
  margin: 14pt 0 0 !important;
  break-inside: auto;
}

.syl-head {
  background: #fff !important;
  border-bottom: 1pt solid #000 !important;
  padding: 0 0 3pt !important;
  margin: 0 0 7pt !important;
  display: block !important;
  break-after: avoid;
}

.syl-head h2 {
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 13pt;
  font-weight: 800;
  margin: 0 !important;
  color: #000 !important;
}

.syl-body {
  padding: 0 !important;
  font-size: 10.5pt;
  color: #000 !important;
  line-height: 1.5;
}

.syl-body h3 {
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 10.5pt;
  font-weight: 800;
  margin: 1.2em 0 .3em !important;
  color: #000 !important;
}

.syl-body h4,
.policy-list h4 {
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 10.5pt;
  font-weight: 800;
  color: #000 !important;
}

h1, h2, h3, h4 {
  break-after: avoid;
  page-break-after: avoid;
}

p, li {
  orphans: 3;
  widows: 3;
}

li,
.policy-list li,
.check-list li {
  break-inside: avoid;
}

/* ------------------------------------------------------------ flat panels */
/* Every tinted/bordered mini-card becomes a hairline-ruled block so it still
   reads as a distinct unit without spending toner on a background wash. */
.staff-card,
.cert-card,
.pledge,
.drop-note,
.funding-note,
.callout,
.syl-card {
  background: #fff !important;
  border: .5pt solid #666 !important;
  border-left-width: 2pt !important;
  border-radius: 0 !important;
  color: #000 !important;
  padding: 6pt 9pt !important;
  break-inside: avoid;
}

.drop-note {
  border-left-width: 2pt !important;
  font-size: 9.5pt;
}

.staff-grid,
.cert-grid,
.info-grid {
  break-inside: avoid;
  gap: 8pt !important;
}

.staff-grid,
.cert-grid {
  grid-template-columns: 1fr 1fr !important;
}

.info-grid .lbl {
  color: #000 !important;
  min-width: 92pt;
}

.check-list li::before {
  color: #000 !important;
}

/* The page sets several notes inline as `color:var(--muted)` (#8a6a6a) — a
   warm mauve that prints as washed-out pink. Inline styles outrank a plain
   class rule, so this attribute selector is the only way to reach them without
   editing the HTML. It matches only the *colour* declaration, so the grade
   bar's inline `background:` segments are untouched. */
[style*="color:var(--muted)"],
[style*="color: var(--muted)"],
.muted {
  color: #333 !important;
}

/* Screen chips (semester / TBA pills) — plain bracketed text on paper. */
.syl-sem,
.syl-tba,
.chip {
  background: #fff !important;
  border: .5pt solid #666 !important;
  color: #000 !important;
  border-radius: 2pt !important;
  font-size: 8pt !important;
  padding: 0 4pt !important;
}

/* ------------------------------------------------------- the credit toggle */
/* On screen this is a tab control: .ct-btn[aria-pressed] flips which
   .grade-view[data-view] is shown, and the inactive one carries the HTML
   `hidden` attribute (set by the inline script's setCredits()). A printed
   syllabus must be COMPLETE, so print reveals both tracks and gives each its
   own heading, since the tab labels are gone. */
.credit-toggle,
.ct-btn {
  display: none !important;
}

.grade-view,
.grade-view[hidden] {
  display: block !important;
  break-inside: avoid;
  margin: 0 0 12pt;
}

.grade-view::before {
  display: block;
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 10.5pt;
  font-weight: 800;
  color: #000;
  margin: .9em 0 .4em;
}

.grade-view[data-view="3"]::before {
  content: "3-credit track — grade weights";
}

.grade-view[data-view="4"]::before {
  content: "4-credit track (+ Six Sigma Black Belt project) — grade weights";
}

/* Localized track headings. The translated pages carry <html lang="zh-Hans">
   and <html lang="es">; :lang() picks them up so the two headings this
   stylesheet injects are not stranded in English inside a translated PDF. */
:lang(zh) .grade-view[data-view="3"]::before {
  content: "3 学分方案 — 成绩权重";
}
:lang(zh) .grade-view[data-view="4"]::before {
  content: "4 学分方案（含六西格玛黑带项目）— 成绩权重";
}
:lang(es) .grade-view[data-view="3"]::before {
  content: "Modalidad de 3 créditos — ponderación de la nota";
}
:lang(es) .grade-view[data-view="4"]::before {
  content: "Modalidad de 4 créditos (con proyecto Six Sigma Black Belt) — ponderación de la nota";
}

/* The weight bar is the one place colour carries information: the segment
   widths ARE the grade breakdown, and the legend swatches key into them. */
.grade-bar {
  height: 20pt !important;
  border: .5pt solid #000 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  break-inside: avoid;
}

.grade-bar > div {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  border-right: .5pt solid #fff !important;
}

.grade-legend {
  font-size: 9pt;
  color: #000 !important;
  gap: 10pt !important;
  margin-top: 5pt !important;
}

.grade-legend .sw {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  border: .3pt solid #666;
  border-radius: 0;
}

/* --------------------------------------------------------------- tables */
/* .tbl-wrap scrolls horizontally on screen and table.tbl has min-width:640px;
   both must be released or the table runs off the right edge of the sheet. */
.tbl-wrap {
  overflow: visible !important;
  margin: 6pt 0 !important;
}

.tbl-wrap table.tbl {
  min-width: 0 !important;
}

table,
table.tbl {
  width: 100% !important;
  border-collapse: collapse !important;
  border-radius: 0 !important;
  overflow: visible !important;
  font-size: 8.6pt !important;
  margin: 6pt 0 !important;
  break-inside: auto;
}

/* Screen th is white-on-#2a2b33 — on paper that is white-on-white. */
table.tbl th,
table th {
  background: #fff !important;
  color: #000 !important;
  font-family: var(--sans, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 8.4pt !important;
  font-weight: 800;
  text-align: left;
  padding: 3pt 4pt !important;
  border-bottom: 1pt solid #000 !important;
}

table.tbl td,
table td {
  background: #fff !important;
  color: #000 !important;
  border-bottom: .4pt solid #999 !important;
  padding: 3pt 4pt !important;
  vertical-align: top;
}

table.tbl tr:nth-child(even) td {
  background: #fff !important;
}

/* Keep the short label columns from wrapping ("Homework 1" over two lines);
   the Details column is greedy and will absorb the freed width. */
table.tbl td:first-child,
table.tbl th:first-child {
  white-space: nowrap;
}

table.tbl small,
table small {
  color: #333 !important;
}

thead {
  display: table-header-group;   /* repeat the header on every page */
}

tr {
  break-inside: avoid;
}

/* ---------------------------------------------------------------- links */
a {
  color: #000 !important;
  text-decoration: underline;
}

/* Show the destination of external links, since a click is not available on
   paper. Deliberately NOT applied to button-styled links (the CTA, the nav
   pills, the language switcher, the jump nav) — those are either hidden or
   would turn into noise. */
a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-size: .85em;
  font-style: normal;
  color: #333;
  word-break: break-all;
}

.cta::after,
.navlink::after,
.syl-lang-btn::after,
.syl-jump a::after,
.track-seg::after,
.nav-home::after,
.sigma-search-btn::after,
a[href^="mailto:"]::after,
a[href^="#"]::after {
  content: "" !important;
}

/* Buttons never make sense on paper. */
button {
  display: none !important;
}

/* ------------------------------------------------------- focus rings (AX-2)
   sigma.css now paints a 2px --focus-ring on every `:focus-visible` element
   (F-06). That is purely a screen affordance. Paper has no keyboard focus, but
   whatever element held focus when the user pressed Ctrl-P still matches
   `:focus-visible` in the print rendering — which would drop a stray red box
   around, say, the search input in the middle of the syllabus PDF. Strip every
   ring on paper. This also neutralises the four pre-existing designed rings
   (#navHome, .sigma-search-btn, #tocToggle, #sideToggle) and search.css's
   input ring, all of which sit on chrome print.css already hides — belt and
   braces for anything that survives the strip. */
*,
*::before,
*::after,
:focus,
:focus-visible,
:focus-within {
  outline: none !important;
  outline-offset: 0 !important;
}
