/* ================================================================
   percent-frac-dec-bridge.css
   ----------------------------------------------------------------
   Styling for "Connecting Percentage to Fractions and Decimals"
   (Tier 3 - the crucial bridge, built on top of the "What is a
   percentage?" foundations tier and the "Reading, Writing &
   Visualizing Percentages" tier) - A.1 Friendly Fraction -> Percent
   Match, A.2 Grid Overlay Proof, A.3 Percent -> Decimal Slide,
   A.4 Convert Any Fraction to Percent (Guided), and A.5 Convert Any
   Percent to Fraction/Decimal (Guided) - on the Class 5 Math page.

   Same conventions as percent-foundations.css / percent-rwv.css /
   fraction-rwv.css / decimal-fraction-unified.css:
     - reuses the shared .quiz-modal / .card / .quiz-number-opt /
       .bq-feedback / .slot-dot classes (and CSS variables like
       --sun, --sky, --pink, --purple, --line, --bg-light) from
       common.css / computation.css / quiz-popup-theme.css /
       quiz-modal-responsive.css, already loaded on the page
     - ALSO reuses .pf-options / .pf-opt / .pf-picker / .pf-grid100 /
       .pf-question-card from percent-foundations.css and the
       frac-friendly-picker / frac-parts-stage shells used by every
       other percent skill - this file must be linked AFTER
       percent-foundations.css and percent-rwv.css.
     - only adds the handful of rules unique to these five skills:
       the segmented fraction bar (A.1 / A.4), the fraction-wedge
       overlay drawn on top of a 100-grid (A.2), the three-costume
       "percent = decimal = fraction" row (A.3), and the small
       guided-steps box used by the two "Convert Any..." skills
       (A.4 / A.5).

   Loaded on class5-math.html as a plain stylesheet link, right
   after percent-rwv.css:

     <link rel="stylesheet" th:href="@{/css/percent-rwv.css}" />
     <link rel="stylesheet" th:href="@{/css/percent-frac-dec-bridge.css}" />

   The matching modal markup lives alongside the other percentage
   modals in partials/percentage-modals.html (same fragment,
   "percentageModals"), so no extra th:replace block is needed.
   Behavior lives in percent-frac-dec-bridge.js, loaded after
   percent-foundations.js and percent-rwv.js.
   ================================================================ */

/* ---- Big single-value display (A.5's "42%" prompt, etc.) ---- */
.pfd-bigval {
    text-align: center;
    font-weight: 800;
    color: #1E3A5F;
    font-size: clamp(28px, 8vw, 40px);
    margin: 6px 0 2px;
}

/* ---- Segmented Fraction Bar (A.1 / A.4) ----
   A horizontal bar split into exactly `den` equal cells with the
   first `num` shaded - the fraction sibling of the Percent Bar (A.3
   of the Reading/Writing tier), so a fraction and a percent read as
   the same kind of picture. */
.pfd-fracbar-wrap {
    width: 100%;
    max-width: 380px;
    margin: 8px auto 6px;
}
.pfd-fracbar-label {
    text-align: center;
    font-weight: 800;
    color: #1E3A5F;
    font-size: clamp(20px, 6vw, 28px);
    margin-bottom: 8px;
}
.pfd-fracbar-track {
    display: flex;
    width: 100%;
    height: clamp(34px, 9vw, 46px);
    border: 3px solid var(--line, #d7dde5);
    border-radius: 10px;
    overflow: hidden;
    background: #eef1f5;
    box-sizing: border-box;
}
.pfd-fracbar-seg {
    flex: 1 1 0;
    border-right: 2px solid #fff;
    box-sizing: border-box;
}
.pfd-fracbar-seg:last-child { border-right: none; }
.pfd-fracbar-seg.is-shaded {
    background: linear-gradient(90deg, #7ecbff, #2e9bf5);
}

@media (min-width: 700px) {
    .pfd-fracbar-wrap { max-width: 440px; }
}

/* ---- Grid Overlay Proof (A.2) ----
   A 100-grid (reusing the shared .pf-grid100 renderer) with a
   translucent wedge overlay drawn on top, split into `den` equal
   vertical bands with the first `num` highlighted - a visual proof
   that the fraction's shaded wedges cover the same area as the
   matching number of grid squares. */
.pfd-overlay-outer {
    position: relative;
    display: inline-block;
    margin: 10px auto 4px;
}
.pfd-overlay-gridhost { display: block; }
.pfd-overlay-bands {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}
.pfd-overlay-band {
    height: 100%;
    box-sizing: border-box;
    border-right: 3px solid rgba(30, 58, 95, 0.5);
}
.pfd-overlay-band:last-child { border-right: none; }
.pfd-overlay-band.is-active {
    background: rgba(245, 66, 125, 0.2);
    box-shadow: inset 0 0 0 3px rgba(245, 66, 125, 0.75);
}
.pfd-overlay-caption {
    margin: 10px auto 0;
    max-width: 320px;
    font-size: clamp(11px, 2.8vw, 13px);
    font-weight: 700;
    color: #8a94a6;
    text-align: center;
    line-height: 1.35;
}

/* ---- Percent = Decimal = Fraction "costume" row (A.3) ----
   Three small cards shown side by side on ONE line - Percent /
   Decimal / Fraction - with one card blanked out ("?") for the
   child to identify, the "same amount, three costumes" visual. */
.pfd-costume-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 460px;
    margin: 14px auto 8px;
}
.pfd-costume-card {
    flex: 1 1 0;
    min-width: 0;
    background: #fff;
    border: 3px solid var(--line, #d7dde5);
    border-radius: 14px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
}
.pfd-costume-card.is-blank {
    border-style: dashed;
    border-color: #f5427d;
    background: #fff5f8;
}
.pfd-costume-label {
    font-size: clamp(9px, 2.4vw, 11px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a94a6;
}
.pfd-costume-value {
    font-weight: 800;
    color: #1E3A5F;
    font-size: clamp(14px, 4.4vw, 19px);
    white-space: nowrap;
}
.pfd-costume-card.is-blank .pfd-costume-value { color: #f5427d; }
.pfd-costume-equals {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-weight: 800;
    color: #8a94a6;
    font-size: clamp(14px, 4vw, 18px);
}

@media (max-width: 380px) {
    .pfd-costume-row { gap: 4px; }
    .pfd-costume-card { padding: 8px 3px; border-radius: 12px; }
}
@media (min-width: 700px) {
    .pfd-costume-row { max-width: 520px; }
}

/* ---- Guided Steps box (A.4 / A.5) ----
   A small dashed-border card listing the 2-3 scaffolded steps for
   converting a fraction to a percent (or a percent to a fraction /
   decimal), shown beneath the fraction bar / big percent value. */
.pfd-steps {
    background: #f5f8fc;
    border: 2px dashed var(--line, #d7dde5);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 10px auto 12px;
    max-width: 420px;
    text-align: left;
    box-sizing: border-box;
}
.pfd-step {
    font-size: clamp(12px, 3.2vw, 14px);
    color: #1E3A5F;
    font-weight: 600;
    margin: 4px 0;
    line-height: 1.35;
}
.pfd-step b { color: #2e9bf5; }

@media (min-width: 700px) {
    .pfd-steps { max-width: 480px; }
}

/* ---- Force all 4 answer chips onto a single readable line ----
   Belt-and-braces reinforcement (on top of the shared .pf-options /
   .quiz-number-options rules already loaded from
   percent-foundations.css) scoped to this tier's five overlays, so
   the 4 chips never wrap onto a second line and stay legible on
   narrow Android phone browsers. */
#pfdfracpct-quiz-overlay .quiz-number-options,
#pfdgridoverlay-quiz-overlay .quiz-number-options,
#pfdslide-quiz-overlay .quiz-number-options,
#pfdfractopct-quiz-overlay .quiz-number-options,
#pfdpcttofracdec-quiz-overlay .quiz-number-options {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: clamp(4px, 1.6vw, 10px);
    width: 100%;
}
#pfdfracpct-quiz-overlay .quiz-number-opt,
#pfdgridoverlay-quiz-overlay .quiz-number-opt,
#pfdslide-quiz-overlay .quiz-number-opt,
#pfdfractopct-quiz-overlay .quiz-number-opt,
#pfdpcttofracdec-quiz-overlay .quiz-number-opt {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(12px, 3.6vw, 16px);
    padding: 10px 4px !important;
    text-align: center;
}

@media (max-width: 380px) {
    #pfdfracpct-quiz-overlay .quiz-number-opt,
    #pfdgridoverlay-quiz-overlay .quiz-number-opt,
    #pfdslide-quiz-overlay .quiz-number-opt,
    #pfdfractopct-quiz-overlay .quiz-number-opt,
    #pfdpcttofracdec-quiz-overlay .quiz-number-opt {
        font-size: clamp(11px, 3.4vw, 14px);
        padding: 8px 3px !important;
    }
}

/* Short windows / landscape phones - trim vertical spacing so the
   Next button stays reachable, same belt-and-braces pattern as
   percent-foundations.css / percent-rwv.css. */
@media (max-height: 700px) {
    .pfd-costume-row { margin: 8px auto 6px; }
    .pfd-steps { margin: 6px auto 8px; padding: 8px 12px; }
    .pfd-overlay-outer { margin: 6px auto 2px; }
    .frac-parts-stage { margin: 8px auto 4px; }
}

/* Scroll safety net for the five new overlays on this page, same
   pattern used for every skill on the page: however tall a given
   question's content gets on a short screen, the chips and Next
   button stay reachable by scrolling. */
#pfdfracpct-quiz-overlay .quiz-modal,
#pfdgridoverlay-quiz-overlay .quiz-modal,
#pfdslide-quiz-overlay .quiz-modal,
#pfdfractopct-quiz-overlay .quiz-modal,
#pfdpcttofracdec-quiz-overlay .quiz-modal {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}