/* Design and Technologies lab activities (food and machines): yeast and gears
   (site/js/science/design-make.js). They share the lab look of lab-motion.css (.mo-in,
   .mo-kit, .mo-table, .mo-row, .mo-note) and the layout of design-build.css: on the iPad
   each fills the space under the instruction, on a phone the step scrolls. */

.lab-yeast .mo-in, .lab-gears .mo-in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "world" "kit" "note" "side"; }
.ye-world, .ge-world {
  grid-area: world;
  justify-self: center;
  position: relative;
  width: min(100%, (100dvh - 780px) * 2);
  aspect-ratio: 2;
  overflow: hidden;
  container-type: inline-size;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.ye-world .mo-fair, .ge-world .mo-fair { top: 4%; right: 2%; font-size: max(11px, 1.8cqw); }
.ye-world .mo-fair { right: auto; left: 23%; } /* next to the clock, clear of the biggest balloon */
.ye-art, .ge-art { display: block; width: 100%; height: 100%; }
.lab-yeast .ye-wait, .lab-gears .ge-turn { min-width: 150px; }

/* ---- Yeast ---- */

.ye-wall { fill: #fdf3e1; }
.ye-bench { fill: #c9955c; }
.ye-clock { fill: #fff; stroke: #1d2433; stroke-width: 1.2; }
.ye-hand { stroke: #e8564a; stroke-width: 1.4; stroke-linecap: round; }
.ye-clock-n { fill: #1d2433; font: 700 7px/1 var(--ui); }
.ye-glass { fill: rgb(220 240 255 / 0.25); stroke: #5d7894; stroke-width: 0.9; }
.ye-heap { fill: #c8a771; }
.ye-foam { fill: #fff8e6; }
.ye-bubble { fill: rgb(255 255 255 / 0.85); stroke: rgb(93 120 148 / 0.4); stroke-width: 0.2; }
.ye-shine { fill: rgb(255 255 255 / 0.55); }
.ye-temp { fill: #3b2a14; font: 700 5.2px/1 var(--ui); text-anchor: middle; }
.ye-hit { fill: transparent; cursor: pointer; touch-action: manipulation; }
.ye-tape line { stroke: #e8564a; stroke-width: 0.8; stroke-dasharray: 2 1; }
.ye-tape text { fill: #fff; paint-order: stroke; stroke: #e8564a; stroke-width: 2.4px; stroke-linejoin: round; font: 800 6px/1 var(--ui); text-anchor: middle; }
.lab-yeast .mo-kit .ye-card.picked:not(.tested) { border-color: var(--subject, var(--accent)); }

/* ---- Gears ---- */

.ge-board { fill: #eef2f6; stroke: #c3ccd8; stroke-width: 0.8; }
.ge-teeth { fill: #9aa6b6; stroke: #4e5966; stroke-width: 0.6; stroke-linejoin: round; }
.ge-driver .ge-teeth { fill: #f2b632; stroke: #9a6a00; }
.ge-face { fill: rgb(255 255 255 / 0.35); }
.ge-axle { fill: #4e5966; }
.ge-mark { fill: #e8564a; }
.ge-crank { stroke: #6d4b1f; stroke-width: 2.4; stroke-linecap: round; }
.ge-knob { fill: #e8564a; stroke: #8f2b22; stroke-width: 0.8; }
.ge-hit { fill: transparent; cursor: grab; touch-action: none; }
.ge-arrow { fill: var(--subject-dark, var(--accent)); font: 800 9px/1 var(--ui); text-anchor: middle; }
.ge-count { fill: #1d2433; font: 700 5.6px/1 var(--ui); text-anchor: end; }
.ge-icon { display: block; width: calc(22px + var(--teeth) * 1px); height: calc(22px + var(--teeth) * 1px); }
.ge-icon .ge-teeth { fill: #9aa6b6; }
.mo-row .ge-icon { width: calc(16px + var(--teeth) * 0.6px); height: calc(16px + var(--teeth) * 0.6px); }
.mo-kit .ge-card .card-emoji { display: grid; place-items: center; min-height: 44px; }

/* ---- iPad on its side: the results go to the right ---- */

@container (min-aspect-ratio: 3 / 2) {
  .lab-yeast .mo-in, .lab-gears .mo-in { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "world side" "kit side" "note side"; align-content: start; }
  .ye-world, .ge-world { width: min(100%, (100dvh - 500px) * 2); }
}

/* ---- Phones: everything at its own height; the step scrolls ---- */

@media (max-width: 600px), (max-height: 500px) {
  /* The step scrolls, and the picture stays in sight while the buttons under it are tapped. */
  .ye-world, .ge-world { position: sticky; top: 0; z-index: 5; width: 100%; border-radius: 16px; }
  .lab-yeast .big, .lab-gears .big { min-height: 52px; }
  .lab-yeast .ye-wait, .lab-gears .ge-turn { min-width: 0; }
  .ge-icon { width: calc(18px + var(--teeth) * 0.75px); height: calc(18px + var(--teeth) * 0.75px); }
  .mo-row .ge-icon { width: calc(14px + var(--teeth) * 0.45px); height: calc(14px + var(--teeth) * 0.45px); }
  .mo-kit .ge-card .card-emoji { min-height: 34px; }
}

/* A phone on its side: picture on the left, the rest on the right. */
@media (max-height: 500px) {
  .lab-yeast .mo-in, .lab-gears .mo-in { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "world kit" "world note" "world side"; align-items: start; }
}
