/* ===========================================================================
   ols-explorer.css -- chapter 14's movable line with a square on every
   residual (assets/js/ols-explorer.js).

   The container carries `dx cx olx`: the two preset buttons come from the
   .dx rules in dist-explorer.css, the text from the .cx rules in
   calc-explorer.css. Defined here: the line of values (numbers in UW
   purple), the light grid, the line, the squares and residual segments, the
   points, and the two handles with their larger touch targets and focus
   ring. The two square colours come from R (OLSDATA.colors) as css
   variables on the svg; the static PDF figure uses the same ones (chunk
   regression-ols-static). The handles, as controls, stay UW purple.

   Nothing here is needed by the PDF build; the LaTeX format never loads css.
   =========================================================================== */

/* The panel spans the text column, edge to edge; the script widens the svg's
   x axis to match, so its text keeps the static figures' sizes. */
.cx.olx { max-width: none; }

.olx .olx-tabs { justify-content: center; margin-bottom: 0; }

/* the equation and the sum, between the buttons and the plot */
.olx .olx-read { margin: 0.5rem 0 0.2rem; text-align: center; }
.olx .olx-read b { color: #32006e; font-weight: 600; font-variant-numeric: tabular-nums; }

/* text a size up from the .cx defaults, like the chapter's static figures,
   which are drawn to fill the column; no halo on the axis letters */
.olx svg .cx-tk { font-size: 13px; }
.olx svg .cx-lb { font-size: 15px; stroke: none; }

.olx svg .olx-grid { stroke: #ebebeb; stroke-width: 1; }
.olx svg .olx-line { stroke: #000; stroke-width: 1.6; }

/* a residual: its segment, and the square with that segment as a side */
.olx svg .olx-s   { fill-opacity: 0.2; stroke-opacity: 0.55; stroke-width: 1; }
.olx svg .olx-res { stroke-width: 2.2; }
.olx svg .olx-pos { fill: var(--olx-pos); stroke: var(--olx-pos); }
.olx svg .olx-neg { fill: var(--olx-neg); stroke: var(--olx-neg); }

.olx svg .olx-dot { fill: #000; stroke: #fff; stroke-width: 1; }

/* the point of averages, the pivot of the line after Least Squares Line, and
   its label (with a white halo, since the turning line can pass behind it);
   shown only while the line turns about it (.olx-seesaw on the panel) */
.olx svg .olx-piv-g { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.olx.olx-seesaw svg .olx-piv-g { opacity: 1; }
.olx svg .olx-piv { fill: #fff; stroke: #000; stroke-width: 1.6; }
.olx svg .cx-lb.olx-piv-lb { font-size: 13px; paint-order: stroke; stroke: #fff; stroke-width: 3px;
                             stroke-linejoin: round; }

/* a handle: the knob, and a larger invisible circle that takes the pointer */
.olx svg .olx-h { cursor: ns-resize; touch-action: none; outline: none; }
.olx svg .olx-hit  { fill: #fff; fill-opacity: 0; }
.olx svg .olx-knob { fill: #fff; stroke: #32006e; stroke-width: 2.5; }
.olx svg .olx-h.olx-on .olx-knob,
.olx svg .olx-h:focus-visible .olx-knob { fill: #32006e; stroke: #c9b6e6; stroke-width: 3; }

@media (prefers-reduced-motion: reduce) {
  .olx svg .olx-piv-g { transition: none; }
}

@media print { .olx { display: none; } }
