/* Lab pages. Loaded with unit.css. Does not restyle hubs or unit lecture grids.
   unit.css widens .hp-shell to 1180px; restore the shared homepage/hub cap. */
.hp-shell {
  max-width: var(--hp-max);
  margin: 0 auto;
}
.lab-page { color: #243044; }
.lab-crumbs { margin: 0 0 .85rem; }
.lab-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 280px);
  gap: .85rem 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
  min-width: 0;
}
.lab-intro--single {
  grid-template-columns: minmax(0, 1fr);
}
.lab-soon-note {
  margin: .8rem 0 0;
  max-width: 40rem;
}
.lab-soon-note p { margin: 0 0 .45rem; }
.lab-soon-back {
  display: inline-block;
  margin-top: .9rem;
  color: #1a5c36;
  font-weight: 800;
}
.lab-intro-copy {
  min-width: 0;
  max-width: 100%;
}
.lab-intro-copy h1 {
  margin: 0 0 .4rem;
  color: #1a5c36;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  overflow-wrap: break-word;
}
.lab-lede {
  margin: 0;
  color: #3a4a58;
  line-height: 1.45;
  max-width: 40rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.lab-intro-cards { align-content: stretch; min-width: 0; }

.lab-media {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr);
  gap: .9rem 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
  min-width: 0;
}
.lab-media--text {
  grid-template-columns: minmax(0, 1fr);
}
.lab-page,
.lab-media,
.lab-video,
.lab-lec {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.lab-video {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.lab-lec-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}
.lab-lec-credit {
  margin: .35rem 0 0;
  padding: 0 .15rem;
  font-size: .78rem;
  line-height: 1.35;
  color: #4a5b6b;
  font-weight: 700;
}
.lab-lec-credit a { color: #1a5c36; }
.lab-lec-credit-note {
  display: block;
  margin-top: .15rem;
  font-size: .72rem;
  font-weight: 600;
  color: #6a7a88;
}
.lab-video-note {
  margin: .45rem 0 0;
  padding: 0 .15rem;
  font-size: .88rem;
  line-height: 1.4;
  color: #3a4a58;
}
.lab-watch-credit {
  margin: 0 0 .75rem;
  color: #3a4a58;
  font-weight: 700;
}
.lab-watch-credit a { color: #1a5c36; }
.lab-media--grid {
  grid-template-columns: minmax(0, 1fr);
}
.lab-video--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}
.lab-media--grid .lab-sequence { margin-top: .15rem; }
.lab-video--grid .lab-lec .up-lec-meta span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab-legacy-note {
  margin: 0 0 1rem;
  font-size: .9rem;
}
.lab-back-top {
  margin: .15rem 0 .85rem;
  text-align: right;
}
.lab-back-top a {
  color: #1a5c36;
  font-weight: 800;
  font-size: .92rem;
  text-decoration: none;
}
.lab-back-top a:hover,
.lab-back-top a:focus {
  text-decoration: underline;
  outline: 2px solid #111;
  outline-offset: 2px;
}
.lab-legacy-note a { color: #1a5c36; font-weight: 700; }
.lab-video, .lab-lec, .lab-sequence, .lab-lec .up-lec-art, .lab-thumb {
  min-width: 0 !important;
  max-width: 100%;
}
.lab-lec .up-lec-art {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 0 !important;
  min-height: 0 !important;
  padding-bottom: 56.25%;
  overflow: hidden;
  background: #10243c;
}
.lab-lec .up-lec-art img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  object-position: center;
  filter: none;
  display: block;
}
.lab-lec .up-lec-title { display: none; }
.lab-lec .up-lec-play {
  right: 8px;
  bottom: 8px;
  z-index: 3;
}
.lab-lec .up-lec-play svg { width: 48px; height: 48px; }
.lab-lec .up-lec-time {
  right: 8px;
  top: 8px;
  bottom: auto;
  z-index: 3;
}
.lab-lec--soon {
  cursor: default;
  text-decoration: none;
  color: inherit;
}
.lab-lec-soon,
.lab-video-soon {
  background: #f3e3a1;
  color: #5c4a12;
  font-weight: 800;
  letter-spacing: .03em;
}
.lab-lec-soon {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  font-size: .72rem;
  padding: .14rem .42rem;
  border-radius: 999px;
  line-height: 1.15;
}
.lab-video-soon {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .95rem;
}

.lab-sequence {
  margin: 0;
  padding: .7rem .8rem .8rem;
  background: #fff;
  border: 1px solid #d5dde6;
  border-radius: 10px;
  min-width: 0;
  max-width: 100%;
}
.lab-sequence-heading {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1a5c36;
  margin: 0 0 .45rem;
}
.lab-sequence ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lab-sequence li + li { margin-top: .55rem; }
.lab-sequence strong {
  display: block;
  color: #16324f;
  font-size: 1rem;
}
.lab-sequence span {
  display: block;
  margin-top: .12rem;
  color: #4a5b6b;
  font-size: .9rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.lab-res-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .55rem .5rem .65rem;
}
.lab-res--pending {
  flex: 1 1 11rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .22rem;
  min-height: 4.4rem;
  padding: .7rem .85rem;
  background: #f4f7f2;
  border: 1px dashed #b7c9ae;
  border-radius: 10px;
  color: #5a6a5c;
  cursor: default;
  pointer-events: none;
  box-sizing: border-box;
}
.lab-res-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.lab-res-icon { display: flex; color: #1a5c36; }
.lab-res-icon svg { width: 22px; height: 22px; }
.lab-res-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #16324f;
}
.lab-res-status {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7a8c74;
}
.lab-res--soon .lab-res-status {
  text-transform: none;
  letter-spacing: .01em;
  font-size: .8rem;
}
.lab-resources .up-res {
  flex: 1 1 11rem;
  justify-content: center;
  min-height: 4.4rem;
  padding: .7rem .85rem;
  font-size: 20px;
  box-sizing: border-box;
}
.lab-resources .up-res-label span {
  font-size: 20px;
  font-weight: 800;
  color: #16324f;
}
.lab-resources .up-res-note {
  display: block;
  margin-top: .15rem;
  font-size: .72rem !important;
  font-weight: 700 !important;
  color: #4a5b6b !important;
}
.lab-extras, .lab-ngss {
  margin: 0 0 1rem;
  padding: .7rem .85rem;
  background: #fff;
  border: 1px solid #d5dde6;
  border-radius: 10px;
}
.lab-extras h2, .lab-ngss h2 {
  margin: 0 0 .35rem;
  color: #1a5c36;
  font-size: 1.05rem;
}
.lab-extras p, .lab-ngss li {
  margin: 0;
  color: #3a4a58;
  line-height: 1.45;
}
.lab-extra + .lab-extra { margin-top: .7rem; }
.lab-ngss ul { margin: 0; padding-left: 1.1rem; }

.lab-gallery-wrap { margin: .2rem 0 1.2rem; }
.lab-gallery-wrap h2 {
  margin: 0 0 .35rem;
  color: #1a5c36;
  font-size: 1.15rem;
}
.lab-gallery-note {
  margin: 0 0 .25rem;
  color: #4a5b6b;
  font-size: .9rem;
  max-width: 46rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.lab-gallery-credit {
  margin: 0 0 .7rem;
  color: #6a7a88;
  font-size: .8rem;
}
.lab-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  min-width: 0;
  max-width: 100%;
}
.lab-thumb {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: 0;
  padding: 0;
  border: 1px solid #d5dde6;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  color: inherit;
}
.lab-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #10243c;
}
.lab-thumb span {
  display: block;
  padding: 0 .55rem .55rem;
  font-size: .78rem;
  line-height: 1.3;
  color: #3a4a58;
  font-weight: 700;
}
.lab-thumb:hover, .lab-thumb:focus {
  outline: 2px solid #1a5c36;
  outline-offset: 2px;
}
.lab-ph {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  min-height: 168px;
  padding: .7rem .75rem;
  border: 1px dashed #c5b48a;
  border-radius: 10px;
  background: #f7f3ea;
  color: #5c4a2a;
}
.lab-ph strong { font-size: .88rem; }
.lab-ph span { font-size: .8rem; line-height: 1.3; }
.lab-ph code {
  font-size: .68rem;
  color: #6a5a3a;
  word-break: break-all;
}
.lab-gallery-toggle {
  grid-column: 1 / -1;
  justify-self: start;
  background: #fff;
  border: 1px solid #1a5c36;
  color: #1a5c36;
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: .45rem 1rem;
  cursor: pointer;
}
.lab-gallery-toggle:hover, .lab-gallery-toggle:focus {
  outline: 2px solid #111;
  outline-offset: 2px;
}
.lab-gallery-more {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
}
.lab-gallery-more[hidden] { display: none; }
.lab-gallery-group {
  grid-column: 1 / -1;
  display: grid;
  gap: .7rem;
  min-width: 0;
}
.lab-gallery-group h3 {
  grid-column: 1 / -1;
  margin: .85rem 0 0;
  color: #1a5c36;
  font-size: 1rem;
}
.lab-gallery-group--labeled {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.lab-gallery-group--closeup {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lab-gallery-group--microscopy {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.lab-gallery-group--microscopy .lab-thumb img {
  aspect-ratio: 1 / 1;
  max-height: none;
  background: #eef3ea;
  object-fit: contain;
}
.lab-thumb--ref img {
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  max-height: 16rem;
  object-fit: contain;
  object-position: center;
  background: #eef3ea;
}
.lab-thumb--labeled img {
  max-height: 22rem;
  background: #fff;
}
.lab-thumb-copy {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .15rem .55rem .6rem;
}
.lab-thumb-copy strong {
  font-size: .88rem;
  line-height: 1.25;
  color: #16324f;
}
.lab-thumb-copy span {
  padding: 0;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  color: #4a5b6b;
}

.lab-lb {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 16, 22, .84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.lab-lb[hidden] { display: none; }
.lab-lb img {
  max-width: min(92vw, 960px);
  max-height: 72vh;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}
.lab-lb--labeled img {
  max-width: min(96vw, 1600px);
  max-height: 86vh;
  background: #fff;
}
.lab-lb-title {
  margin: .55rem 0 0;
  color: #fff;
  font-weight: 800;
  text-align: center;
  max-width: 52rem;
}
.lab-lb-title[hidden] { display: none; }
.lab-lb-cap {
  margin: .35rem 0 0;
  color: #f2f4f0;
  font-weight: 700;
  text-align: center;
  max-width: 52rem;
}
.lab-lb-close,
.lab-lb-prev,
.lab-lb-next {
  position: absolute;
  background: #fff;
  border: 0;
  border-radius: 8px;
  padding: .4rem .7rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  z-index: 2;
}
.lab-lb-close {
  top: .8rem;
  right: .8rem;
}
.lab-lb-prev {
  left: .8rem;
  top: 50%;
  transform: translateY(-50%);
}
.lab-lb-next {
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
}
.lab-lb-close:focus,
.lab-lb-prev:focus,
.lab-lb-next:focus { outline: 3px solid #8fbc4a; outline-offset: 2px; }

.lab-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .15rem;
}
.lab-footer-chi,
.lab-footer-chi-line {
  margin: 0;
  color: #f2f4f0;
  font-size: 1rem;
  line-height: 1.25;
}
.lab-footer-chi strong {
  color: #8fbc4a;
  letter-spacing: .08em;
}
.lab-footer .up-footer-links { margin-top: .45rem; }
.lab-footer .up-footer-copy {
  margin-top: .35rem;
  text-align: center;
  white-space: normal;
}

.labs-hub-note {
  margin: .55rem 0 0;
  color: #4a5b6b;
  font-size: .9rem;
  max-width: 40rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.labs-hub-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 1rem;
}
.labs-hub-jumps a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .42rem .95rem;
  border: 2px solid #1a5c36;
  border-radius: 999px;
  background: #fff;
  color: #1a5c36;
  text-decoration: none;
  font-weight: 800;
  font-size: .92rem;
  line-height: 1.2;
  white-space: nowrap;
}
.labs-hub-jumps a:hover,
.labs-hub-jumps a:focus {
  background: #1a5c36;
  color: #fff;
  outline: 2px solid #111;
  outline-offset: 2px;
}
.labs-hub-section,
.labs-hub-activities,
#videos,
#resources,
#gallery {
  scroll-margin-top: .75rem;
}
.labs-hub-section > h2 {
  margin: 0 0 .55rem;
  color: #1a5c36;
  font-size: 1.15rem;
}
.labs-hub-page,
.labs-hub-grid,
.labs-hub-activities {
  min-width: 0;
  max-width: 100%;
}
.labs-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: 0 0 1.2rem;
}
.labs-hub-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d5e6c8;
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
a.labs-hub-card:hover,
a.labs-hub-card:focus {
  border-color: #1a5c36;
  box-shadow: 0 3px 12px rgba(22, 50, 79, .14);
}
a.labs-hub-card:hover img,
a.labs-hub-card:hover .labs-hub-plate {
  filter: brightness(.96);
}
a.labs-hub-card:focus,
a.labs-hub-card:focus-visible {
  outline: 3px solid #111;
  outline-offset: 2px;
}
.labs-hub-card img,
.labs-hub-plate {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
  background: #16324f;
  display: block;
}
.labs-hub-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a5c36;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
  padding: .6rem;
}
.labs-hub-name {
  display: block;
  margin: .4rem .45rem .5rem;
  padding: 0;
  text-align: center;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.25;
  color: #1a5c36;
}
.labs-hub-card--soon {
  cursor: default;
}
.labs-hub-soon {
  display: block;
  margin: 0 .55rem .55rem;
  padding: .14rem .4rem;
  border-radius: 999px;
  background: #f3e3a1;
  color: #5c4a12;
  text-align: center;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.labs-hub-activities {
  background: #fff;
  border: 1px solid #d9e3f0;
  border-radius: 12px;
  padding: .75rem .9rem .85rem;
  margin: 0 0 .8rem;
}
.labs-hub-activities h2 {
  margin: 0 0 .55rem;
  color: #16324f;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.labs-hub-activity--static {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  padding: .28rem 0;
  color: #16324f;
  font-weight: 700;
  cursor: default;
}
.labs-hub-activity-name {
  color: #16324f;
}
.labs-hub-updating,
.labs-hub-activity-soon {
  display: inline-block;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: #f3e3a1;
  color: #5c4a12;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.3;
  cursor: default;
}
.labs-hub-update-note {
  grid-column: 1 / -1;
  margin: .1rem 0 .45rem;
  padding: 0;
  color: #16324f;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 46rem;
}
.labs-hub-activities ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem .9rem;
}
.labs-hub-activities a {
  display: block;
  padding: .28rem 0;
  color: #1a5c36;
  font-weight: 700;
  text-decoration: none;
}
.labs-hub-activities a:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .lab-intro { grid-template-columns: minmax(0, 1fr); }
  .lab-intro-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lab-media { grid-template-columns: minmax(0, 1fr); }
  .labs-hub-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lab-video--grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lab-gallery, .lab-gallery-more,
  .lab-gallery-group--labeled,
  .lab-gallery-group--closeup,
  .lab-gallery-group--microscopy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .lab-intro-cards { grid-template-columns: minmax(0, 1fr); }
  .lab-gallery, .lab-gallery-more,
  .lab-gallery-group--labeled,
  .lab-gallery-group--closeup { grid-template-columns: minmax(0, 1fr); }
  .lab-gallery-group--microscopy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lab-res--pending,
  .lab-resources .up-res { flex: 1 1 100%; }
  .unit-page { padding-left: .75rem; padding-right: .75rem; }
  .labs-hub-grid { grid-template-columns: minmax(0, 1fr); }
  .labs-hub-activities ul { grid-template-columns: minmax(0, 1fr); }
  .lab-video--grid { grid-template-columns: minmax(0, 1fr); }
  .lab-lb-prev, .lab-lb-next { top: auto; bottom: .8rem; transform: none; }
  .lab-lb-prev { left: .8rem; }
  .lab-lb-next { right: 5.2rem; }
}
@media (max-width: 360px) {
  .lab-lec .up-lec-play svg { width: 42px; height: 42px; }
}
