/* learn-genres.css — /learn/ part three, the genres (plan C, task C10): dub, minimal-techno, cumbia.
   Loaded after studio.css and learn-course.css by the three lesson templates. The three Grid-guide machines
   (static/learn-w-dub-station.js, learn-w-polymeter.js, learn-w-clave.js) sit on the kit's charcoal panel; each
   keeps its guide module color (dub station green, polymeter cyan, clave the part's pink) through --st-accent,
   and its one display: the chord, the loop count, the record speed. Recipes and groove pads (C1 macros) are laid
   out here. No animation: the echo trail and the meters change only on input or on a played step. */

/* ── module colors: the guide's --on-mod for text on a full accent step ── */
.learn-widget[data-widget="dub-station"] { --st-on-accent: #00210F; }
.learn-widget[data-widget="polymeter"] { --st-on-accent: #00222B; }
.learn-widget[data-widget="clave"] { --st-on-accent: #fff; }

.lgen-wait {
    margin: 0;
    padding: 1.4rem 1.2rem;
    border: 1px dashed var(--st-line);
    border-radius: 16px;
    color: var(--st-muted);
    font-size: 0.95rem;
}

/* ── machine panel ───────────────────────────────────────────────────── */
.lgen-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: var(--st-font);
}
.learn-body .lgen-panel p { margin: 0; max-width: none; }
.lgen-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--st-panel-line);
}
.lgen-title { min-width: 0; }
.learn-body .lgen-panel h3 {
    margin: 0;
    font-family: var(--st-font);
    font-size: clamp(1.7rem, 4.2vw, 2.35rem);
    font-weight: 800;
    font-stretch: 70%;
    line-height: 0.95;
    letter-spacing: -0.005em;
    color: var(--st-panel-ink);
}
.learn-body .lgen-panel .lgen-sub {
    margin-top: 0.35rem;
    color: var(--st-panel-muted);
    font-size: 0.9rem;
    font-weight: 600;
    font-stretch: 92%;
}

/* the one display per machine: a lit numeral in the module color, its caption under it */
.lgen-meter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    min-width: 0;
    text-align: end;
}
.lgen-meter > :first-child {
    font-size: clamp(2.6rem, 6.4vw, 3.9rem);
    font-weight: 850;
    font-stretch: 125%;
    line-height: 0.82;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--st-accent);
    text-shadow: 0 0 18px color-mix(in srgb, var(--st-accent) 45%, transparent);
}
.lgen-meter-cap {
    max-width: 19rem;
    color: var(--st-panel-muted);
    font-size: 0.8rem;
    font-weight: 650;
    font-stretch: 90%;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.lgen-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}
.lgen-bar--segs { align-items: flex-start; gap: 0.75rem 1.25rem; }
.lgen-bar--rule { padding-top: 0.9rem; border-top: 1px solid var(--st-panel-line); }
.lgen-bar--rule + .lgen-ctls { padding-top: 0; border-top: 0; }
.lgen-seg-field .learn-field-label { color: var(--st-panel-muted); }
.lgen-seg-field .st-seg { align-self: flex-start; }

.lgen-hint {
    color: var(--st-panel-muted);
    font-size: 0.86rem;
    line-height: 1.45;
    max-width: 70ch;
}
.lgen-panel .st-readout { color: var(--st-panel-ink); font-size: 0.95rem; }

.lgen-ctls {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
    gap: 0.9rem 1.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--st-panel-line);
}

/* ── dub station: the throw, the scope and the echo trail ────────────── */
.lgen-throw {
    min-width: 7.5rem;
    min-height: var(--st-target);
    padding-block: 0.55rem 0.6rem;
}
.lgen-throw .st-pad-name { font-size: 1.05rem; }
.lgen-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 0.9rem;
    align-items: center;
}
.lgen-scope { height: 7.5rem; }   /* fixed: Studio.scope sizes its bitmap from clientHeight */
.lgen-echo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    min-height: 7.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    background: var(--st-well);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}
.learn-body .lgen-panel .lgen-echo-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.2rem 1rem;
    color: var(--st-panel-muted);
    font-size: 0.82rem;
    font-weight: 650;
    font-stretch: 90%;
    font-variant-numeric: tabular-nums;
}
.lgen-echo-k { color: var(--st-panel-ink); font-weight: 750; }
.lgen-echo-fb,
.lgen-filter-now { color: var(--st-panel-ink); font-weight: 750; }
.lgen-trail { margin: 0; gap: 5px; }
.lgen-trail .st-led { min-height: 14px; border-radius: 3px; }
/* held throw: the trail runs red, toward runaway */
.is-throwing .lgen-trail .st-led.is-on { background: var(--st-led); box-shadow: 0 0 9px 1px var(--st-led); }
.is-throwing .lgen-echo-fb { color: var(--st-led); }
@media (max-width: 640px) {
    .lgen-screen { grid-template-columns: 1fr; }
    .lgen-meter { align-items: flex-start; text-align: start; }
}

/* ── clave: the record-speed meter dims with the slowdown ────────────── */
.lgen-reb > :first-child { opacity: calc(1 - var(--lgen-reb, 0) * 0.35); }
.lgen-flip { min-height: var(--st-target); }
.lgen-flip[hidden] { display: none; }
.lgen-clave .lg .st-grid { --st-label-w: 7.75rem; }

/* ── recipes and groove pads (C1 macros) ─────────────────────────────── */
.lgen-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
    gap: 0.8rem;
    margin: 1rem 0 1.4rem;
}
.lgen-recipes .learn-recipe { max-width: none; margin: 0; }
.lgen-grooves {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0;
    margin: 0.4rem 0 1rem;
}
.lgen-grooves .learn-groove-pad { min-height: 5rem; }
@media (max-width: 640px) {
    .lgen-grooves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.75rem; }
    .lgen-grooves .learn-groove { margin: 0; }
    .lgen-grooves .learn-groove-pad { min-width: 0; width: 100%; }
}

.lgen-listen { color: var(--st-muted); font-size: 0.97rem; }
.lgen-listen em { color: var(--st-ink); }

@media (forced-colors: active) {
    .lgen-meter > :first-child { text-shadow: none; }
    .lgen-trail .st-led.is-on { forced-color-adjust: none; background: Highlight; }
}
