/* Current and Charge: Faraday's Law (CHM2001, Lectures 3-4)
   Layout only - every colour comes from the model-shell palette at runtime, through inline styles
   and the --cch-* custom properties that the script sets on the model container. Same pattern as
   the Lectures 1-2 lessons (standard-cell-potential.css, nernst-equation.css). */

.cch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.cch-layout > * {
  min-width: 0;
}

/* Elements with their own display value would otherwise ignore the hidden attribute. */
.cch-layout [hidden] {
  display: none !important;
}

/* The key idea heads the results card. */
.cch-key {
  margin: 0 0 0.5rem;
  text-align: center;
  line-height: 1.2;
}

/* Faraday's law first and large; the moles of metal come second. */
.cch-key-main {
  display: block;
  font-size: clamp(2rem, 5.2vw, 2.9rem);
  font-weight: 800;
}

.cch-key-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(0.95rem, 2.1vw, 1.15rem);
  font-weight: 600;
}

.cch-key:empty {
  display: none;
}

.cch-stage,
.cch-plot {
  display: block;
  width: 100%;
  height: 300px;
}

.cch-plot {
  margin-top: 0.5rem;
}

/* The verdict sits directly above the picture it explains. */
.cch-verdict {
  min-height: 5.1rem;          /* the same height idle, running and finished, so the page does not jump */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 0 0.5rem;
  text-align: center;
  padding: 0.5rem 0.8rem;
  border: 3px solid;
  border-radius: 10px;
}

.cch-verdict-main {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

.cch-verdict-sub {
  display: block;
  font-size: 1.02rem;
  margin-top: 0.2rem;
  line-height: 1.45;
}

.cch-verdict-sub:empty {
  display: none;
}

/* The numbers substituted into each equation, with units at every step, updated live. */
.cch-calc {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--cch-grid, #ccc);
  border-radius: 10px;
  font-size: 1.02rem;
}

.cch-calc:empty {
  display: none;
}

.cch-calc-row {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.3rem;
  margin: 0.15rem 0;
  line-height: 1.45;
}

.cch-bridge {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--cch-red, red);
  border-radius: 10px;
  background: var(--cch-red-t, #fff3f3);
  line-height: 1.5;
}

.cch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.cch-tab {
  flex: 1 1 8rem;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.45rem 0.5rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.cch-process {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.cch-process:empty {
  display: none;
}

.cch-guide {
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.cch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cch-row--centre {
  justify-content: center;
}

.cch-strong {
  font-weight: 800;
}

.cch-go {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 800;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.cch-notes {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.cch-notes li {
  margin: 0.25rem 0;
}

.cch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

/* Explore freely: one coloured strip of controls directly under the picture. */
.cch-strip {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.8rem 0.6rem;
  border: 3px solid var(--cch-red, red);
  border-radius: 12px;
  background: var(--cch-bg, #fff);        /* plain background, so the sliders stand out */
}

.cch-strip-head {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  text-align: center;
  text-wrap: balance;
}

/* Large choice tiles (couples, metals, directions, circuit) */
.cch-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.6rem;
}

.cch-tile {
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  padding: 0.5rem 0.4rem;
  border: 3px solid;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}

.cch-tile small {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.cch-tile:disabled {
  opacity: 0.4;
  cursor: default;
}

.cch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin: 0 0 0.5rem;
}

.cch-chip {
  font: inherit;
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.cch-slider {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) 6.2rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.cch-slider label {
  font-weight: 800;
  font-size: 1.1rem;
}

/* Sliders: a dark outlined track, filled in the colour of the process up to the thumb, and a large white
   thumb with a dark ring, so they are easy to see and to grab. */
.cch-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}

.cch-slider input[type="range"]::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--cch-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--cch-sl, var(--cch-red, #c00)) var(--p), var(--cch-trk, #ddd) var(--p));
}

.cch-slider input[type="range"]::-moz-range-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--cch-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--cch-sl, var(--cch-red, #c00)) var(--p), var(--cch-trk, #ddd) var(--p));
}

.cch-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin-top: -6px;
  border: 4px solid var(--cch-fg, #000);
  border-radius: 50%;
  background: var(--cch-bg, #fff);
}

.cch-slider input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 4px solid var(--cch-fg, #000);
  border-radius: 50%;
  background: var(--cch-bg, #fff);
}

.cch-slider input[type="range"]:focus-visible {
  outline: 3px solid var(--cch-fg, #000);
  outline-offset: 3px;
  border-radius: 8px;
}

.cch-val {
  font-weight: 800;
  font-size: 1.1rem;
  text-align: right;
  white-space: nowrap;
}

/* Test your knowledge */
.cch-progress {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.cch-dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid;
  display: inline-grid;
  place-items: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.cch-dot[aria-current="true"] {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.cch-score {
  font-weight: 800;
  font-size: 1rem;
}

.cch-task {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.cch-intro {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.cch-step {
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.5rem;
  border: 2px solid;
  border-radius: 8px;
}

.cch-step-q {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.cch-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
}

.cch-options button {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
}

.cch-feedback {
  margin: 0.6rem 0 0;
  min-height: 2.6em;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .cch-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cch-verdict-main {
    font-size: 1.2rem;
  }
}

@media (max-width: 560px) {
  .cch-slider {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label value" "input input";
  }
  .cch-slider label { grid-area: label; }
  .cch-slider input { grid-area: input; }
  .cch-val { grid-area: value; }
  .cch-calc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cch-tab,
  .cch-chip,
  .cch-tile {
    transition: none;
  }
}

.cch-stage {
  height: 470px;
}

/* The graph of current and mass against time */
.cch-plotwrap {
  margin: 0 0 0.8rem;
}

.cch-plotwrap .cch-plot {
  height: 340px;
  margin-top: 0;
}

.cch-plotwrap .cch-small {
  text-align: left;
  margin-top: 0.3rem;
}

/* Run and Reset side by side */
.cch-run + .model-reset-btn {
  align-self: center;
}

/* The question dots in "Predict, then see" are markers, not buttons */
.cch-progress span.cch-dot {
  cursor: default;
}

/* The Run button: the main button of the exploring view */
.cch-run {
  min-width: 11rem;
  padding: 0.6rem 1.6rem;
  font-size: 1.2rem;
  border-width: 3px;
}

.cch-runhint {
  margin: 0.35rem 0 0;
  text-align: center;
  font-weight: 700;
}

.cch-small {
  margin: 0.5rem 0 0.2rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
}

.cch-calc-ph {
  margin: 0.2rem 0;
  text-align: center;
}


/* ---------------- 2026: Faraday's law, live (right-hand column) ---------------- */
.cch-live {
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.75rem 0.6rem;
  border: 3px solid var(--cch-fg, #000);
  border-radius: 12px;
  background: var(--cch-bg, #fff);
  font-size: 1.05rem;
}

.cch-live-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.cch-live-title {
  font-weight: 800;
  font-size: 1.15rem;
}

.cch-live-status {
  font-weight: 700;
}

.cch-half {
  margin: 0.3rem 0 0.1rem;
  font-size: 1.05rem;
}

/* symbols on top, this moment's numbers underneath */
.cch-eqtab {
  border-collapse: collapse;
  margin: 0.15rem auto 0.4rem;
}

.cch-eqtab td {
  padding: 0.05rem 0.3rem;
  text-align: center;
  white-space: nowrap;
}

.cch-eqtab .cch-sym td {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
}

.cch-eqtab .cch-num td {
  font-size: 1.2rem;
  font-weight: 700;
  border-top: 1px dashed var(--cch-grid, #bbb);
  padding-top: 0.2rem;
}

/* the working: one step per line, as in the lectures */
.cch-live .cch-calc {
  margin: 0;
  padding: 0.35rem 0 0;
  border: 0;
  border-top: 2px solid var(--cch-red, red);
  border-radius: 0;
  font-size: 1.05rem;
}

.cch-live .cch-calc-row {
  grid-template-columns: 4.4rem minmax(0, 1fr);
}

/* what has just changed */
.cch-flash {
  background: #fff1a8;
  color: inherit;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #e0b800;
}

.high-contrast .cch-flash {
  background: transparent;
  box-shadow: 0 0 0 2px currentColor;
}

.cch-so {
  margin: 0.45rem 0 0;
  padding: 0.4rem 0.6rem;
  border-left: 4px solid var(--cch-grid, #999);
  background: var(--cch-red-t, #f6f6f6);
  line-height: 1.45;
}

.cch-so:empty {
  display: none;
}

.cch-const {
  margin: 0.4rem 0 0;
  font-size: 1rem;
  line-height: 1.4;
}

/* text in drop-downs */
.cch-more {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--cch-grid, #ccc);
  border-radius: 10px;
  font-size: 1.04rem;
}

.cch-more > summary {
  font-weight: 800;
  cursor: pointer;
}

.cch-more ul {
  margin: 0.35rem 0 0.2rem;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.cch-more li {
  margin: 0.25rem 0;
}

.cch-more-text {
  margin: 0.35rem 0 0.15rem;
  line-height: 1.5;
}

.cch-go {
  font-size: 1.05rem;
}

.cch-process {
  font-size: 1.15rem;
}

.cch-task {
  font-size: 1.15rem;
}

.cch-intro,
.cch-step-q,
.cch-feedback {
  font-size: 1.04rem;
}

/* on a narrow screen the live box sits under the controls */
.model-card--results .cch-live {
  margin: 0.6rem 0 0;
}

@media (max-width: 560px) {
  .cch-eqtab .cch-sym td {
    font-size: 1.6rem;
  }
  .cch-eqtab .cch-num td {
    font-size: 1.05rem;
  }
  .cch-live .cch-calc-row {
    grid-template-columns: 3.6rem minmax(0, 1fr);
    gap: 0.2rem;
  }
}


/* Nov 2026: the rate under the equation, and the four-step working in a drop-down inside the live box */
.cch-rate {
  margin: 0.1rem 0 0;
  text-align: center;
  font-size: 1.08rem;
}

.cch-rate:empty {
  display: none;
}

.cch-work {
  margin-top: 0.45rem;
  font-size: 1rem;
}

.cch-work .cch-calc {
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
}

.cch-live .cch-work .cch-calc-row {
  grid-template-columns: 4.4rem minmax(0, 1fr);
}

@media (max-width: 560px) {
  .cch-live .cch-work .cch-calc-row {
    grid-template-columns: 3.6rem minmax(0, 1fr);
  }
}
