/* Antibody Engineering Curriculum: course styles (Bootstrap 5 overrides) */
:root {
  --ink: #16212c;
  --ink-soft: #4a5866;
  --paper: #f4f6f7;
  --surface: #ffffff;
  --rule: #d9dfe4;
  --phenol: #c8385a;           /* phenol-red: current position markers */
  --course: #0e7064;           /* MICR 240 culture-flask teal */
  --course-deep: #0a4f47;
  --course-tint: #e3f1ee;
  --font-ui: "Source Sans 3", system-ui, sans-serif;
  --font-head: "Manrope", system-ui, sans-serif;
  --font-read: "Source Serif 4", Georgia, serif;
  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-link-color-rgb: 14, 112, 100;
  --bs-link-hover-color-rgb: 10, 79, 71;
}
[data-course="micro230"] {
  --course: #3b47a8;           /* MICR 230 indigo */
  --course-deep: #28317a;
  --course-tint: #e8eaf7;
  --bs-link-color-rgb: 59, 71, 168;
  --bs-link-hover-color-rgb: 40, 49, 122;
}

body { background: var(--paper); color: var(--ink); font-size: 1.0625rem; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; padding-bottom: 4rem; }
h1, h2, h3, h4, .navbar-brand { font-family: var(--font-head); letter-spacing: -0.01em; }
a { text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--phenol) !important; outline-offset: 2px; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--surface); padding: .5rem 1rem; }

/* ---------- navigation */
.site-nav { background: var(--ink); padding: .6rem 0; }
.site-nav .navbar-brand { color: #fff; font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: .6rem; }
.site-nav .nav-link { color: #c7d0d8; font-weight: 600; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: #fff; }
.site-nav .nav-link.active { box-shadow: inset 0 -3px 0 var(--course); }
.site-nav .navbar-toggler { border-color: #56636f; }
.site-nav .navbar-toggler-icon { filter: invert(1); }
.brand-mark { width: 18px; height: 22px; display: inline-block; background:
  linear-gradient(#fff,#fff) 8px 10px / 2px 12px no-repeat,
  linear-gradient(45deg, transparent 45%, #fff 45%, #fff 60%, transparent 60%) 0 0 / 10px 12px no-repeat,
  linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 60%, transparent 60%) 8px 0 / 10px 12px no-repeat; }

.site-footer { background: var(--surface); border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .9rem; padding: 1.25rem 0; }

/* ---------- headings & breadcrumb */
.page-head { padding-top: 1.75rem; padding-bottom: 1.25rem; }
.breadcrumb { font-size: .9rem; margin-bottom: .75rem; }
.breadcrumb a { color: var(--ink-soft); }
.lec-heading, .doc-heading { font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); line-height: 1.15; margin: 0; max-width: 28ch; }
.lec-heading { max-width: none; }
.lec-heading-num { display: block; font-size: .95rem; font-weight: 700; color: var(--course); margin-bottom: .3rem; letter-spacing: 0; }
.doc-kicker { color: var(--ink-soft); margin: .5rem 0 0; }
.section-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }

/* ---------- course hero */
.course-hero { background: var(--course-deep); color: #fff; padding: 1.75rem 0 2.75rem; margin-bottom: 2.5rem; }
.course-hero .breadcrumb a, .course-hero .breadcrumb-item.active, .course-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.75); }
.course-code { font-weight: 600; color: rgba(255,255,255,.8); margin: 1.25rem 0 .25rem; }
.course-title { font-weight: 800; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.8rem); line-height: 1.02; margin: 0 0 1rem; letter-spacing: -0.025em; }
.course-summary { max-width: 62ch; font-size: 1.1rem; color: rgba(255,255,255,.92); }
.course-summary a { color: #fff; }
.small-note { font-size: 1rem; color: rgba(255,255,255,.78); }
.hero-actions { display: flex; flex-direction: column; gap: .6rem; }
.btn-course { background: #fff; color: var(--course-deep); font-weight: 700; padding: .75rem 1.1rem; border-radius: 6px; }
.btn-course:hover { background: var(--course-tint); color: var(--course-deep); }
.btn-outline-course { border: 2px solid rgba(255,255,255,.7); color: #fff; font-weight: 700; padding: .65rem 1.1rem; border-radius: 6px; }
.btn-outline-course:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }

/* ---------- module rows */
.module-row { padding: 1.5rem 0 1.75rem; border-bottom: 1px solid var(--rule); }
.module-row-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.module-row h3 { font-size: 1.3rem; font-weight: 800; margin: .1rem 0 .25rem; }
.module-row h3 a { color: var(--ink); text-decoration: none; }
.module-row h3 a:hover { color: var(--course); text-decoration: underline; }
.module-num { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--course); color: #fff; font-family: var(--font-head); font-weight: 800; display: grid; place-items: center; font-size: 1.1rem; }
.module-row.extra .module-num { background: var(--surface); color: var(--ink-soft); border: 2px dashed var(--rule); }
.module-facts { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--ink-soft); font-size: .95rem; margin: 0; }
.module-facts i { color: var(--course); }
.course-hero .module-facts, .module-head .module-facts { margin-top: .6rem; }
.module-head { display: flex; gap: 1.5rem; align-items: flex-start; }
.module-big { font-family: var(--font-head); font-weight: 800; font-size: clamp(4rem, 3rem + 4vw, 7rem); line-height: .8; color: var(--course); }

/* ---------- lecture & document links */
.lec-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.lec-list.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lec-link { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .75rem; align-items: center; padding: .7rem 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.lec-list .lec-link:last-child { border-bottom: 0; }
.lec-link:hover { background: var(--course-tint); }
.lec-num { font-family: var(--font-head); font-weight: 800; color: var(--course); font-size: 1.15rem; text-align: right; }
.lec-title { font-weight: 600; line-height: 1.3; }
.lec-count { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.doc-list { display: flex; flex-direction: column; gap: .15rem; }
.doc-link { display: flex; align-items: center; gap: .65rem; padding: .45rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.doc-link i { color: var(--course); font-size: 1.1rem; }
.doc-link:hover { background: var(--course-tint); }
.doc-link.current { background: var(--course-tint); font-weight: 700; }
.doc-list.roomy .doc-link { padding: .75rem .9rem; background: var(--surface); border: 1px solid var(--rule); margin-bottom: .4rem; }

/* ---------- side blocks */
.side-block { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 1.1rem 1.1rem 1rem; margin-bottom: 1.25rem; }
.side-title { font-size: 1rem; font-weight: 800; margin: 0 0 .75rem; line-height: 1.35; }
.side-title a { color: var(--ink); }
.side-sub { font-size: .9rem; font-weight: 700; color: var(--ink-soft); margin: 1rem 0 .4rem; font-family: var(--font-ui); }
.mini-lec { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.mini-lec li a { display: block; padding: .3rem .5rem; border-left: 3px solid transparent; color: var(--ink); text-decoration: none; line-height: 1.3; }
.mini-lec li a:hover { background: var(--course-tint); }
.mini-lec li.current a { border-left-color: var(--phenol); font-weight: 700; background: var(--paper); }
.mini-lec.all { max-height: 60vh; overflow-y: auto; }

/* ---------- slide viewer */
.viewer { background: var(--ink); border-radius: 8px; overflow: hidden; outline: none; }
.viewer-stage { position: relative; background: #fff; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.viewer-img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.viewer-hit { position: absolute; top: 0; bottom: 0; width: 22%; background: transparent; border: 0; cursor: pointer; }
.viewer-hit.prev { left: 0; cursor: w-resize; }
.viewer-hit.next { right: 0; cursor: e-resize; }
.viewer-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; color: #dbe2e8; flex-wrap: wrap; }
.btn-viewer { color: #fff; border: 1px solid #4b5866; background: transparent; font-weight: 600; }
.btn-viewer:hover, .btn-viewer:focus { background: #2b3947; color: #fff; }
.btn-viewer:disabled { opacity: .35; color: #fff; border-color: #4b5866; }
.viewer-count { font-size: .95rem; white-space: nowrap; }
.viewer-count input { width: 3.6rem; background: #24313e; color: #fff; border: 1px solid #4b5866; border-radius: 4px; text-align: center; padding: .1rem .25rem; }
.viewer-progress { height: 4px; background: #2b3947; }
.viewer-progress span { display: block; height: 100%; width: 0; background: var(--phenol); transition: width .2s ease; }
.viewer-hint { color: var(--ink-soft); font-size: .9rem; margin: .6rem 0 0; }
.viewer:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.viewer:fullscreen .viewer-stage { flex: 1; aspect-ratio: auto; background: #000; }
.slide-grid-panel { --bs-offcanvas-width: min(560px, 100vw); }
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.slide-thumb { border: 2px solid var(--rule); border-radius: 6px; padding: 0; background: #fff; overflow: hidden; text-align: left; }
.slide-thumb img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: contain; }
.slide-thumb span { display: block; font-size: .8rem; padding: .2rem .4rem; color: var(--ink-soft); }
.slide-thumb.current { border-color: var(--phenol); }
.slide-thumb:hover { border-color: var(--course); }

/* ---------- prev / next steps */
.lec-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.lec-step { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.3; }
.lec-step small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.lec-step.next { justify-content: flex-end; text-align: right; grid-column: 2; }
.lec-step i { color: var(--course); font-size: 1.3rem; }
.lec-step:hover { border-color: var(--course); }

/* ---------- reading documents */
.doc-body { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: clamp(1.25rem, 1rem + 2vw, 2.75rem); font-family: var(--font-read); font-size: 1.08rem; line-height: 1.7; }
.doc-body > * { max-width: 70ch; }
.doc-body.doc-wide > *, .doc-body .table-responsive { max-width: none; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { font-family: var(--font-head); line-height: 1.25; margin: 2rem 0 .75rem; scroll-margin-top: 1rem; }
.doc-body h1 { font-size: 1.6rem; font-weight: 800; }
.doc-body h2 { font-size: 1.3rem; font-weight: 800; color: var(--course-deep); }
.doc-body h3 { font-size: 1.1rem; font-weight: 700; }
.doc-body > :first-child { margin-top: 0; }
.doc-body table { font-family: var(--font-ui); font-size: .95rem; line-height: 1.4; margin: 0; }
.doc-body .table-responsive { margin: 1rem 0 1.5rem; border: 1px solid var(--rule); border-radius: 6px; }
.doc-body thead th, .matrix thead th { background: var(--course-tint); font-weight: 700; }
.doc-body td, .doc-body th { padding: .5rem .65rem; }
.doc-body .table > :not(caption) > * > * { border-bottom-color: var(--rule); }
.callout { border-left: 4px solid var(--course); background: var(--course-tint); padding: .75rem 1rem; margin: 1rem 0; }
.matrix th[scope="row"] { font-weight: 700; white-space: nowrap; }
.doc-toc { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.toc-title { font-size: .95rem; font-weight: 800; margin: 0 0 .5rem; }
.doc-toc ul { list-style: none; padding: 0; margin: 0; columns: 2 16rem; column-gap: 2rem; font-size: .93rem; }
.doc-toc li { break-inside: avoid; padding: .15rem 0; }
.doc-toc .toc-l2 { padding-left: 1rem; }

@media (max-width: 575.98px) {
  .lec-steps { grid-template-columns: 1fr; }
  .lec-step.next { grid-column: 1; }
  .lec-link { grid-template-columns: 2rem 1fr; }
  .lec-count { display: none; }
  .module-head { flex-direction: column; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-nav, .site-footer, .viewer, .lec-steps, aside { display: none !important; } }
