/* factor-tree-v1.css
 *
 * Presentation for the interactive factor tree widget (factor-tree-v1.js,
 * arithmetic built by prime-engine-v1.js). Extracted from the inline <style>
 * block in prime-factorization-calculator.php so a second host page can pick
 * the widget up with one <link> plus MWFactorTree.mountInto(el).
 *
 * Cache-busted by query string at the <link> (?v1, ?v2, ...), NOT by
 * filename. The sitefiles/ build's filename-increment rule does not apply to
 * this file -- editing it without bumping the suffix ships a change nobody
 * sees.
 *
 * The host page wraps this widget in a class="no-split" container. That class
 * string is keyed to configuration on Raptive's ad account, is invisible from
 * this repo, and must never be renamed or used as a CSS or JS hook -- every
 * selector in this file is an element id or an mw- prefixed class instead.
 * See docs/reference/AD_LAYOUT_NOTES.md.
 */

/* ---- interactive factor tree -------------------------------------- */
/* Selectors here are element ids and mw- prefixed classes only. The
   surrounding wrapper's class string is keyed to configuration on the ad
   network's account and must never be used as a styling hook -- see
   docs/reference/AD_LAYOUT_NOTES.md. */
.mw-ft {
    margin: 0.75rem 0 0.25rem 0;
    padding: 0 0.25rem;
}
#mw-ft-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.mw-ft-controls-label {
    font-size: 13px;
    color: #555;
    margin-right: 0.25rem;
}
.mw-ft-rest {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.mw-ft-split {
    font-size: 13px;
    white-space: nowrap;
}
.mw-ft-split--tried {
    border-style: dashed;
    color: #6c757d;
}
.mw-ft-split--active,
.mw-ft-split--active.mw-ft-split--tried {
    background-color: #e96d7c;
    border-color: #e96d7c;
    border-style: solid;
    color: #fff;
}
.mw-ft-more {
    font-size: 13px;
    padding: 0 0.25rem;
}
.mw-ft-caption {
    font-size: 14px;
    color: #555;
    margin: 0;
}
/* min-height, never a fixed height: a fixed height cannot grow with a
   taller tree. Same lesson as the header ad container. */
#mw-ft-canvas {
    min-height: 60px;
    margin: 0 auto 0.25rem 0;
}
.mw-ft-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.mw-ft-edge {
    stroke: #b9b9c3;
    stroke-width: 1.5;
}
.mw-ft-box {
    stroke-width: 1.5;
}
.mw-ft-node--composite .mw-ft-box {
    fill: #fff;
    stroke: #9aa0b5;
}
.mw-ft-node--prime .mw-ft-box {
    fill: #fdeef0;
    stroke: #e96d7c;
}
/* Deliberately no font-size here. The renderer sets it from FONT_SIZE in
   factor-tree-v1.js, which is the same constant CHAR_W's node-box geometry is
   calibrated against -- one source, so the box width and the text it has to
   hold cannot drift apart. Do not re-add a font-size rule. */
.mw-ft-value {
    font-family: inherit;
    fill: #333;
}
.mw-ft-node--prime .mw-ft-value {
    fill: #b93d4c;
    font-weight: 600;
}
.mw-ft-branches {
    transition: opacity 0.2s ease;
}
.mw-ft-branches--enter {
    opacity: 0;
}
.mw-ft-branches--exit {
    opacity: 0;
    pointer-events: none;
}
.mw-ft-strip-line {
    font-size: 15px;
    margin: 0.25rem 0 0 0;
    word-break: break-word;
}
.mw-ft-strip-label {
    font-size: 13px;
    color: #555;
}
.mw-ft-invariant {
    font-size: 13px;
    font-style: italic;
    color: #6c757d;
    margin: 0.35rem 0 0 0;
}
/* display: none, so while hidden the copy is out of the layout AND out of the
   accessibility tree. That is the deliberate fix: an earlier opacity: 0 left
   a screen reader reading the punchline out before the student had re-split
   and earned it, and left a phantom gap in the layout. setInvariant() toggles
   this class; there is no transition, because display is not transitionable. */
.mw-ft-hidden {
    display:none;
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .mw-ft-branches {
        transition: none;
    }
}
