/* Electromagnetic Waves: its colours, drawings, graphs and answer fields; the general look is in ui.css
   (shared by the apps). */
:root {
  --grid: #ebe8e1;
  --grid-major: #d9d5cb;
  /* the colour of the displacement, as s in Motion Graphs */
  --q-y: #c62828;
  --band: #fdf0c4;
  --motion: #1f5fd6;
  /* the electric field red, the magnetic field blue, the direction of travel ink */
  --ew-e: #c62828;
  --ew-b: #1f5fd6;
  --ew-c: #1f2328;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grid: #2a2e33;
    --grid-major: #3a3f45;
    --q-y: #ff7b72;
    --band: #3a3320;
    --motion: #74a7ff;
    --ew-e: #ff7b72;
    --ew-b: #74a7ff;
    --ew-c: #e6e3dc;
  }
}

#prompt p { margin: 6px 0; }

/* graphs y(t) */
svg text { font-family: var(--serif); }
svg.ygraph { display: block; width: 100%; max-width: 440px; height: auto; }
#figure .fig svg.ygraph, #sol-figure .fig svg.ygraph, #t-figure .fig svg.ygraph { width: 440px; }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .grid.major { stroke: var(--grid-major); }
svg .ax { stroke: var(--muted); stroke-width: 1.2; }
svg .tick { fill: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }
svg .axis { fill: var(--ink); font-size: 14px; }
svg .it { font-style: italic; }
svg .band { fill: var(--band); }
svg .vline { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; }
svg .qc-y { --qc: var(--q-y); }
svg .qlabel { fill: var(--qc); }
svg .curve { stroke: var(--qc); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .tdot { fill: var(--qc); stroke: var(--card); stroke-width: 1.5; }
svg .pname { fill: var(--ink); font: italic 600 15px var(--serif); paint-order: stroke; stroke: var(--card); stroke-width: 4px; }

svg .curve.bcurve { stroke: var(--ew-b); stroke-dasharray: 7 5; }

/* the drawings (figures.js, on the shared figure kit) */
svg.tb .ew-vec line { stroke: var(--vc); stroke-width: 2.2; }
svg.tb .ew-vec polygon { fill: var(--vc); }
svg.tb .ew-vec text { fill: var(--vc); font: 15px var(--serif); paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
svg.tb .ew-e { --vc: var(--ew-e); }
svg.tb .ew-b { --vc: var(--ew-b); }
svg.tb .ew-c { --vc: var(--ew-c); }
svg.tb .ew-vec.ew-small line { stroke-width: 1.6; }
svg.tb .ew-wave { fill: none; stroke: var(--vc); stroke-width: 2.2; }
svg.tb .ew-spoke { fill: none; stroke: var(--vc); stroke-width: 1; opacity: 0.6; }
svg.tb .ew-band { stroke: var(--card); stroke-width: 1; }
svg.tb .ew-band0 { fill: #ece3f5; } svg.tb .ew-band1 { fill: #e3e6f7; } svg.tb .ew-band2 { fill: #e6eefb; }
svg.tb .ew-band4 { fill: #fbe4dc; } svg.tb .ew-band5 { fill: #f7ecd9; } svg.tb .ew-band6 { fill: #eef1dc; }
svg.tb .ew-bandtext { fill: var(--ink); font: 12px system-ui, sans-serif; text-anchor: middle; }
svg.tb .ew-vislabel { paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
svg.tb .ew-mark { fill: var(--ew-e); }
svg.tb .ew-markline { fill: none; stroke: var(--ew-e); stroke-width: 1.6; stroke-dasharray: 4 3; }
svg.tb .ew-z { fill: var(--card); stroke: var(--vc); stroke-width: 1.8; }
svg.tb .ew-vec circle:not(.ew-z) { fill: var(--vc); }
svg.tb .ew-x { fill: none; stroke: var(--vc); stroke-width: 1.8; }
@media (prefers-color-scheme: dark) {
  svg.tb .ew-band0 { fill: #33294a; } svg.tb .ew-band1 { fill: #2a2f4a; } svg.tb .ew-band2 { fill: #24344a; }
  svg.tb .ew-band4 { fill: #4a2c26; } svg.tb .ew-band5 { fill: #46391f; } svg.tb .ew-band6 { fill: #343a22; }
}

/* answers that are no numbers: a choice of words, equations (one below the other) or graphs */
.field.choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.field.choice .what { margin-right: 4px; }
.field.choice.wide { flex-direction: column; align-items: stretch; }
/* every answer part on its own row of the grid of fields (ui.css) */
.fields > .field.choice { grid-column: 1 / -1; }
.field.choice .choices.levels { flex-wrap: wrap; flex-shrink: 1; }
.choices { flex-wrap: wrap; }
.choices.stack { flex-direction: column; align-items: stretch; }
.choices.stack > label > span { border-left: 0; border-top: 1px solid var(--line); text-align: left; padding: 6px 12px; }
.choices.stack > label:first-child > span { border-top: 0; }
.choices.pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; background: none; }
.choices.pics > label > span { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.choices.pics svg.ygraph { max-width: none; }
@media (max-width: 560px) { .choices.pics { grid-template-columns: minmax(0, 1fr); } }

/* a ranking in practice, by drag and drop (dnd.js, dnd.css), on a row of its own */
.fields > .field.rank { display: block; grid-column: 1 / -1; }
.field.rank .fb { display: block; margin: 8px 0 0; }
.field.rank .fb:empty { display: none; }

/* a result in the text of a step (in formulas, KaTeX marks it: see ui.css) */
span.result { background: var(--ok-bg); border-radius: 3px; padding: 0.05em 0.25em; }

