/* Course-specific editorial layout for the CHO course. Core controls, practice
   and print styles come from ../bioreactor-course/course.css and ../course-kit/practice.css.
   Palette: the site teal stays the primary accent, a warm amber carries operating
   numbers, and a soft violet marks PRODUCT QUALITY callouts, which are the thing
   that separates this course from a fermentation one. Three colours, three meanings:
   teal explains, amber is something you set, violet is something you might break. */
.brc-page {
  --ch-ink: #0b1f27;
  --ch-rule: #27424a;
  --ch-mint: #7fdcc9;
  --ch-amber: #edc077;
  --ch-warn: #e59b6b;
  --ch-quality: #b9a2e0;
}
.brc-page [id] {
  scroll-margin-top: 18px;
}

/* ---------- Hub hero ---------- */
.ch-hero .brc-hero-copy {
  max-width: 650px;
}
.ch-hero h1 {
  font-size: clamp(2.55rem, 4.2vw, 4.75rem);
  line-height: 1.01;
  letter-spacing: -0.055em;
}
.ch-hero h1 span {
  color: var(--ch-mint);
  display: block;
}
.ch-hero .brc-hero-copy > p {
  max-width: 48ch;
}
.ch-keep {
  white-space: nowrap;
  font: inherit;
}
.ch-meta {
  margin-top: 1.35rem;
  color: #bfd3d6;
  font-size: 0.91rem;
}
.ch-audience {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 5rem);
  padding: 2rem 0;
  border-bottom: 1px solid var(--ch-rule);
}
.ch-audience h2 {
  font-size: 1.25rem;
}
.ch-audience p,
.ch-faq p {
  margin-top: 0.5rem;
}
.ch-outline,
.ch-faq,
.ch-next {
  margin: 2.1rem 0;
}

/* ---------- Module cards on the hub ---------- */
.ch-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.brc-page .ch-card {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  background: #08161f;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.ch-card:hover {
  border-color: var(--ch-mint);
}
.ch-thumbnail {
  height: 105px;
  background-color: #0c2229;
  background-image:
    linear-gradient(#17313a 1px, transparent 1px),
    linear-gradient(90deg, #17313a 1px, transparent 1px);
  background-size: 21px 21px;
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.ch-module-art {
  height: 100%;
  color: var(--ch-mint);
  max-width: 100%;
}
.ch-card:nth-child(3n + 2) .ch-module-art {
  color: var(--ch-amber);
}
.ch-card .brc-cardbody {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 19px;
}
.ch-card .ck-ring-row {
  margin-top: auto;
  padding-top: 10px;
}
.ch-card-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}
.ch-badge {
  display: inline-block;
  color: #c3e0e8;
  font-size: 0.78rem;
  padding: 0.18rem 0.58rem;
  border: 1px solid #3a5663;
  border-radius: 4px;
  vertical-align: middle;
}

/* ---------- Module page frame ---------- */
.brc-page .ch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.ch-head-art {
  height: 100px;
  min-width: 90px;
  flex: none;
}
.ch-head > div:first-child {
  max-width: 850px;
}
.ch-layout {
  display: grid;
  grid-template-columns: minmax(145px, 0.21fr) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 38px);
  align-items: start;
}
.ch-rail {
  position: sticky;
  top: 16px;
  border-left: 2px solid var(--ch-rule);
  padding-left: 1rem;
}
.ch-rail h2 {
  font-size: 1rem;
}
.ch-rail a {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.92rem;
  text-decoration: none;
}
.ch-rail a:hover,
.ch-faq summary:hover {
  text-decoration: underline;
}
.ch-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.3rem;
  min-width: 0;
}
.ch-panel {
  position: relative;
  min-width: 0;
  padding: clamp(16px, 2.4vw, 36px);
}
.ch-panel > p {
  max-width: 82ch;
  margin: 0.75rem 0 1.2rem;
}
.ch-panel > [data-lab],
.ch-panel > [data-calc] {
  margin: 16px 0;
  min-width: 0;
}
.ch-panel :is(input, select, canvas, svg) {
  max-width: 100%;
}
.ch-panel :is(button, label, summary, td, th) {
  overflow-wrap: break-word;
}
.ch-panel h3 {
  line-height: 1.25;
}
.ch-panel .ck-visit {
  position: absolute;
  top: 0;
  left: 0;
}
.ch-station > h2 {
  margin-block: 0 0.65rem;
}
.ck-opening,
.ck-end,
.ck-hub {
  min-width: 0;
}
.ck-end details {
  margin: 1rem 0;
}

/* Any table a module carries must be able to scroll rather than push the page wide:
   one element past the right edge makes Chrome zoom the whole page out on a phone. */
.ch-panel .ch-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}
.ch-panel .ch-scroll table {
  border-collapse: collapse;
  min-width: 30rem;
}
.ch-panel .ch-scroll :is(th, td) {
  border-top: 1px solid var(--ch-rule);
  padding: 0.5rem 0.9rem 0.5rem 0;
  text-align: left;
  vertical-align: top;
  font-size: 0.93rem;
}
.ch-panel .ch-scroll th {
  color: #e6f3f2;
}

/* ---------- Key relations block beside each exercise ---------- */
.brc-page .ch-relations {
  margin: 1.1rem 0 1.45rem;
  padding: clamp(0.85rem, 2vw, 1.2rem);
  border: 1px solid var(--ch-rule);
  border-inline-start: 3px solid var(--ch-mint);
  border-radius: 0.42rem;
  background: #0f2630;
  color: #d4e2e4;
  overflow-wrap: anywhere;
}
.brc-page .ch-relations h3 {
  margin: 0 0 0.7rem;
  color: #9eebd8;
  font-size: 1.05rem;
  line-height: 1.35;
}
.ch-relations dl {
  margin: 0;
}
.ch-relations dl > div {
  display: grid;
  grid-template-columns: minmax(7.4rem, 0.27fr) minmax(0, 1fr);
  gap: 0.4rem 1.25rem;
  padding: 0.5rem 0;
  border-top: 1px solid #304650;
  line-height: 1.5;
}
.ch-relations dt {
  color: #ecf6f5;
  font-weight: 650;
}
.ch-relations dd {
  margin: 0;
}
.brc-page .ch-relations-source {
  margin: 0.55rem 0 0;
  max-width: none;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #b2c7ce;
}
.ch-relations-source strong {
  margin-inline-end: 0.35em;
}

/* An operating number the learner can actually dial in. Amber, so it reads as
   "set this" rather than "know this". */
.brc-page .ch-setpoint {
  margin: 1.1rem 0;
  padding: clamp(0.8rem, 2vw, 1.15rem);
  border: 1px solid #5a4830;
  border-inline-start: 3px solid var(--ch-amber);
  border-radius: 0.42rem;
  background: #221a0f;
  color: #f0e2cd;
}
.brc-page .ch-setpoint h3 {
  margin: 0 0 0.5rem;
  color: var(--ch-amber);
  font-size: 1rem;
}
.ch-setpoint p {
  margin: 0.4rem 0;
}
.ch-setpoint code {
  background: #2e2416;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* ---------- Station index, reading list, footer ---------- */
.ch-station-index {
  padding: 0.6rem 0 1.35rem;
}
.ch-station-index ul {
  margin: 0.65rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.ch-station-index li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.6rem;
  border-top: 1px solid #334f5a;
}
.ch-station-index a {
  color: #a1dfcc;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  padding: 0.55rem 0;
}
.ch-station-index li span {
  color: #b9d0d8;
  font-size: 0.87rem;
}
.ch-reading h3 {
  font-size: 1rem;
  margin: 1.4rem 0 0.5rem;
}
.ch-reading li {
  margin: 0.45rem 0;
}
.ch-reading ul {
  padding-left: 1.2rem;
}
.ch-next {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ch-next [data-complete]:disabled {
  opacity: 1;
}
.ch-deck {
  margin: 1.15rem 0;
  background: #0c1f2b;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.ch-deck h3 {
  font-size: 1rem;
}
.ck-end .ch-deck details {
  margin: 0.5rem 0 0;
}
.ch-faq details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.ch-faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--heading);
}

/* ---------- Pricing ---------- */
.ch-pricing {
  margin: 2.4rem 0;
}
.ch-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.ch-plan {
  padding: clamp(1rem, 1.8vw, 1.7rem);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #091a26;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}
.ch-plan:nth-child(2) {
  border-color: #4f8a84;
}
.ch-plan strong {
  font-size: 2rem;
  color: #e7f5ee;
}
.ch-plan p {
  flex: 1;
}

/* ---------- Hub drawing ---------- */
.ch-drawing {
  align-self: center;
  margin: clamp(18px, 2vw, 34px);
  background: #0b222d;
  border: 1px solid #395663;
  border-radius: 9px;
  overflow: hidden;
  color: #c9dcdf;
}
.ch-drawing figcaption {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.25rem 0.5rem;
}
.ch-drawing figcaption span {
  color: #99e1d1;
  font: 600 0.83rem var(--mono);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.ch-drawing figcaption strong {
  font-size: clamp(1.15rem, 1.65vw, 1.75rem);
  color: #edf6f4;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.ch-drawing svg {
  display: block;
  width: 100%;
  height: auto;
}
.ch-drawing-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  border-top: 1px solid #354f5c;
  font-size: 0.9rem;
}
.ch-drawing-foot b {
  color: #9de7d1;
}
.ch-mini {
  color: #9de2c9;
  height: 100%;
  max-width: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .ch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .ch-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ch-rail {
    position: static;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 18px;
  }
  .ch-rail h2 {
    width: 100%;
  }
  .ch-rail a {
    padding: 0.2rem 0;
  }
}
@media (max-width: 720px) {
  .brc-page .ch-hero,
  .ch-audience {
    grid-template-columns: minmax(0, 1fr);
  }
  .ch-head-art {
    display: none;
  }
  .ch-drawing {
    margin: 0 18px 18px;
  }
  .ch-plans {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 650px) {
  .ch-relations dl > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}
@media (max-width: 520px) {
  .ch-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ch-thumbnail {
    height: 78px;
  }
  .ch-hero .brc-hero-copy {
    padding: 22px 18px;
  }
  .ch-hero h1 {
    font-size: 2.35rem;
  }
  .ch-hero .brc-actions {
    gap: 12px;
  }
  .ch-audience {
    gap: 1.3rem;
  }
  .ch-rail a {
    width: 100%;
  }
  .ch-panel {
    padding: 14px;
  }
  .ch-next {
    justify-content: flex-start;
  }
  .ch-drawing figcaption {
    padding: 0.8rem;
  }
  .ch-drawing-foot {
    padding: 0.55rem 0.8rem;
  }
}
@media print {
  .ch-next {
    display: none !important;
  }
  .brc-page .ch-relations,
  .brc-page .ch-setpoint {
    background: white;
    border: 1px solid #888;
  }
  .brc-page .ch-relations,
  .brc-page .ch-relations h3,
  .brc-page .ch-relations dt,
  .brc-page .ch-relations-source,
  .brc-page .ch-setpoint,
  .brc-page .ch-setpoint h3 {
    color: black;
  }
  html.ck-print-module body :has(main.brc-page) > :not(main.brc-page):not(:has(main.brc-page)) {
    display: none !important;
  }
}


/* Site integration: global.css gives every heading Instrument Serif (400 only).
   Keep that for the page title so the course matches the rest of the site, and
   use DM Sans for the compact panel headings, where a light serif reads poorly. */
.brc-page h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
}
.brc-page :where(h2, h3, h4) {
  font-family: 'DM Sans', Arial, sans-serif;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Product-quality callout. Violet, because it marks an attribute a process choice
   can damage rather than a number the learner sets. */
.brc-page .ch-quality {
  margin: 1.1rem 0;
  padding: clamp(0.8rem, 2vw, 1.15rem);
  border: 1px solid #4b4166;
  border-inline-start: 3px solid var(--ch-quality, #b9a2e0);
  border-radius: 0.42rem;
  background: #1c1830;
  color: #e6dff5;
}
.brc-page .ch-quality h3 {
  margin: 0 0 0.5rem;
  color: var(--ch-quality, #b9a2e0);
  font-size: 1rem;
}
.ch-quality p {
  margin: 0.4rem 0;
}
.ch-quality code {
  background: #2a2342;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
@media print {
  .brc-page .ch-quality {
    background: white;
    border: 1px solid #888;
  }
  .brc-page .ch-quality,
  .brc-page .ch-quality h3 {
    color: black;
  }
}
