/* ============================================================================
   course-widgets/sequence-viewer.css -- widget #08

   a tight wrapping chain of clickable residue tiles built on the item-grid
   scaffold. overrides the scaffold's roomy auto-fit grid with a compact flex
   chain so residues read as a sequence rather than a card grid. theme-token
   styled; the highlight ring is the one place color encodes meaning (an active
   core / variant stretch) so it uses the library accent.
   ============================================================================ */

/* re-lay the scaffold grid as a wrapping residue chain */
.cw-sv .cw-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: stretch;
}

.cw-sv .cw-item {
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    min-width: 42px;
    padding: 8px 4px 6px;
    border-radius: 10px;
    text-align: center;
}

.cw-sv-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.cw-sv-code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    color: var(--cw-text);
}
.cw-sv-pos {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--cw-muted);
}

/* highlighted stretch: ring the tile's parent button (color encodes meaning) */
.cw-sv .cw-item:has(.cw-sv-tile--hl) {
    border-color: var(--cw-accent);
    background: var(--cw-accent-soft);
}
.cw-sv .cw-item:has(.cw-sv-tile--hl) .cw-sv-code { color: var(--cw-accent); }

/* fallback for engines without :has -- keep the accent code color at least */
.cw-sv-tile--hl .cw-sv-code { color: var(--cw-accent); }

.cw-sv-class {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
}
