/* Highest weight representations.
   Phone: the figure, the lists of algebras, the name of the representation with its highest
   weight on the Dynkin diagram, then the readouts. Wide: the figure and the lists under it
   on the left, readouts on the right. Then the sections of text. */

/* Data colours by meaning; main.js reads the same names through MM.color.
   Yellow is the handle and blue the weights, which the selected one shares
   with a ring round it, as in Root systems. */
body {
  --wt: var(--c1);          /* the weights */
  --wt-neg: var(--c5);      /* tensor products: weights that a reflection takes away elsewhere */
  --wt-part: var(--c3);     /* tensor products: the summands */
  --fund: var(--c4);        /* the fundamental weights, ringed and named */
  --root: var(--c2);        /* the roots, arrows from the origin */
}

/* wide: the answers beside the picture, which stays in view while they scroll (.split in
   theme.css), with the hint and the lists under it */
.hw { --split-main: 1.25fr; --split-below: 190px; }
.hw-plane.is-line { --fit-ratio: 3; }
/* On a phone the two columns become one list, so that the lists come under the picture,
   then the name of the representation and its highest weight. */
@media (max-width: 899.98px) {
  .hw > .split-main, .hw > .split-side { display: contents; }
  .hw .side-head { order: 1; }
  .hw .side-block:not(.side-head) { order: 3; }
}

/* ---------- the figure ---------- */
.hw-plane { position: relative; }
#canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); }
/* sl2: its weights lie on a line */
.hw-plane.is-line #canvas { aspect-ratio: 3; }
/* (a picture in space turns under a drag, MM.turnDrag; one in the plane or on the line moves
   under a drag with a mouse or pen, .pannable; both zoom by pinching, MM.pinchZoom) */
#canvas.is-over:not(.is-panning) { cursor: pointer; }

/* the handles (.handle, MM.handle): elements of their own over the canvas, so that only they
   take over touch and they can hold the keyboard focus. Placed by main.js. */
/* as a hoop round a weight, which shows through it (λ in the tensor product) */
.h-hoop, .h-hoop-edge, .h-focus-hoop { display: none; fill: none; }
.h-hoop { stroke: var(--handle); stroke-width: 4; }
.h-hoop-edge { stroke: var(--handle-ring); stroke-width: 6.5; }
.hw-handle.is-hoop :is(.handle-ring, .handle-gap, .handle-dot, .focus-ring:not(.h-focus-hoop)) { display: none; }
.hw-handle.is-hoop :is(.h-hoop, .h-hoop-edge, .h-focus-hoop) { display: inline; }
@media (forced-colors: active) {
  .h-hoop { stroke: Highlight; }
  .h-hoop-edge { stroke: CanvasText; }
}
.hw-main .hint { margin-top: 10px; }

/* (the lists of algebras, under the picture: .strip-block) */

/* ---------- the sections of text ---------- */
/* the hexagons and triangles of sl3: its own λ on its Dynkin diagram above it (.fig-bar); drawn one unit to a pixel (main.js) */
#shells { display: block; margin: 0 auto; max-width: 100%; overflow: visible; }
.sh-hull { fill: none; stroke: color-mix(in srgb, var(--wt) 55%, var(--surface)); stroke-width: 1.3; stroke-linejoin: round; }
.sh-dot { fill: var(--wt); }
.sh-num { font-family: var(--sans); font-size: 11.5px; font-weight: 500; text-anchor: middle; dominant-baseline: central; fill: var(--ink-2); } /* (on a halo: .halo) */

/* ---------- readouts (.split-side in theme.css) ---------- */
/* on a phone the algebra's name has a line of its own, so that the title keeps its height as λ changes */
@media (max-width: 520px) { #title .side-kind { flex-basis: 100%; } }
#sel { min-height: 6.4em; }
#sel p { margin: 0 0 .35em; }
#sel p:last-child { margin-bottom: 0; }
#sel .hw-sel-name { font-size: 17px; margin-bottom: 2px; }

/* legend marks, drawn in the figure's colours (.dot, .swatch, .legend-line; a weight with its multiplicity) */
.hw-dotnum { display: inline-block; width: 22px; height: 14px; flex: none; overflow: visible; }
.hw-dotnum circle { fill: var(--c); }
.hw-dotnum text { font-family: var(--sans); font-size: 9.5px; font-weight: 500; fill: var(--ink-2); }
.legend-line { --c: var(--ink-3); --line-width: 1.25; }
.legend-line.hull { --c: color-mix(in srgb, var(--wt) 55%, var(--surface)); --line-width: 1.5; }
.legend-line.nu { --c: var(--ink); --line-width: 1.4; }
.legend-line.special { --c: var(--ink-2); }
.legend-line.root { --c: var(--root); --line-width: 1.3; }
/* the level of an affine algebra, under the title, where nothing above it changes height as it
   moves (the name and the legend under the Dynkin diagram do). It runs from −7 to 6 and may be
   a fraction, so there is room for "−0.25" at all times and the track keeps its length. */
#level { max-width: 380px; margin: 10px 0 6px; --slider-value-width: 8ch; }

/* the tables (.data-table-sm): dominant weights, summands, or strings, the one selected .is-on */
.hw-more td { color: var(--ink-3); font-size: 13.5px; }
.hw-string { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
/* the name of a weight, a button that selects it */
.hw-pick {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: var(--accent-ink); text-align: left; white-space: nowrap;
}
.hw-pick:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the highest weight on the Dynkin diagram, under the name ----------
   The numbers on the nodes are drawn in the SVG (so Save image takes them); under it lie
   the places that take the pointer, one for each number, whose ground and arrows show
   through. A drag sideways changes a number, a click on either side steps it (main.js). */
/* (right under the title, so that a name appearing under it as λ changes does not move it) */
.hw-weights { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; margin: 2px 0 8px; }
.hw-weights:empty { display: none; }
.hw-wt { display: flex; align-items: center; gap: 8px; }
.hw-wt-sym { font-size: 16px; min-width: 1.1em; }
.hw-dk { position: relative; flex: none; }
.hw-dkpic { position: relative; z-index: 1; display: block; overflow: visible; pointer-events: none; }
.hw-dk-line { stroke: var(--ink); stroke-width: 1.3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hw-dk-node { fill: var(--surface); stroke: var(--ink); stroke-width: 1.3; }
.hw-dk-num { font-family: var(--math); font-size: 14px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.hw-dk-num.is-on { fill: var(--accent-ink); }
.hw-dk-idx { font-family: var(--sans); font-size: 10px; text-anchor: middle; dominant-baseline: central; fill: var(--ink-3); }
.hw-dknums { position: absolute; inset: 0; }
.hw-num {
  position: absolute; display: flex; align-items: center; justify-content: space-between;
  height: 20px; margin-top: -10px; padding: 0 5px; box-sizing: border-box; border-radius: var(--radius-sm);
  color: var(--ink-3); cursor: ew-resize; user-select: none; -webkit-user-select: none;
}
/* a number's place is the height of its line, 21px from its node, so that its focus ring,
   flush with it, stays above the node; a finger reaches a little beyond it (::before) */
.hw-num::before { content: ""; position: absolute; left: 0; right: 0; top: -3px; bottom: -3px; }
.hw-num:hover { background: var(--sunken); }
.hw-num:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.hw-num.is-held { background: var(--accent-soft); color: var(--accent-ink); }
.hw-step { display: block; transition: opacity .15s var(--ease); }
.hw-step svg { display: block; width: 5px; height: 8px; fill: currentColor; }
.hw-step.is-off { opacity: 0; }
/* where λ may be any weight, a click between a number's arrows types it: in a box over it,
   at its place (main.js, typeNumber), the number in the drawing hidden meanwhile */
.hw-mid { flex: 1; align-self: stretch; }
.hw-num.is-typeable .hw-mid { cursor: text; }
.hw-num .hw-step { cursor: pointer; }
.hw-dk-num.is-typed { visibility: hidden; }
/* the box: one of the site's number boxes (.field), made as small as the number's line and
   about six characters wide, centred on the number; its focus ring flush with it, so that
   it stays clear of the node (on a touch screen its text stays 16px, so that a phone does
   not zoom in on it) */
.hw-numfield {
  --field-height: 20px; --field-font-size: 12.5px;
  position: absolute; z-index: 2; box-sizing: border-box; width: calc(6ch + 12px); padding: 0 5px;
  transform: translate(-50%, -50%); text-align: center;
}
.hw-numfield:focus-visible { outline-offset: 0; }
@media (pointer: coarse) { .hw-numfield { --field-height: 24px; --field-font-size: 16px; } }
/* with a mouse, the arrows show while the pointer is over the diagram, or a number has the focus */
@media (hover: hover) and (pointer: fine) {
  .hw-dk:not(:hover) .hw-num:not(:focus-visible):not(.is-held) .hw-step { opacity: 0; }
}

/* type A: the tableaux of a weight */
.hw-tabs { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 8px; }
.hw-yt { border-collapse: collapse; font-family: var(--mono); font-size: 12px; line-height: 1; }
.hw-yt td { width: 17px; height: 17px; padding: 0; text-align: center; border: 1px solid var(--ink-3); background: var(--surface); }
.hw-yt td.empty { border: 0; background: none; }
