/* Block 7 · Bleaching (V8-BLOCKS §7; LOCKED L8). Paper ground; the teeth row is the hero, standing on the page with
   no box (R1). Round 4 (David): H2 left and the line right over the row; the before / after codes set large at the
   row's top corners; the row cropped to the teeth across the container; an ink knob on a 2 px divider; under the row
   the shade scale as type: one continuous band in the shades' own colours with every name beneath, the current step
   raised and in ink. P: H2, line, row, the scale as a horizontal scroller (R7 edge masks), foot. */
.bl { background: var(--paper); }
.bl-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-grid); }
.bl-h { grid-column: 1 / 13; grid-row: 1; }
.bl-p { grid-column: 1 / 13; grid-row: 2; margin-top: 24px; max-width: 26em; }
.bl-row { grid-column: 1 / 13; grid-row: 3; margin: var(--gap-stack-l) 0 0; }
.bl-ctl { grid-column: 1 / 13; grid-row: 4; margin: 40px 0 0; padding: 0; border: 0; min-width: 0; }
.bl-foot { grid-column: 1 / 13; grid-row: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; margin-top: 40px; }

/* before / after: the codes are the labels' figures */
.bl-tags { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 8px; }
.bl-tag { display: grid; gap: 2px; }
.bl-tag--r { text-align: right; }
.bl-tag-l { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-64); }
.bl-tag-c { font-size: var(--fs-h4); line-height: 1.15; letter-spacing: var(--ls-h4); font-weight: var(--fw-display); color: var(--ink); font-variant-numeric: tabular-nums; }

/* the row, cropped to the teeth (stage = x .14–.86, y .22–.75 of the 5:2 render) */
.bl-stage { position: relative; aspect-ratio: 1728 / 509; overflow: hidden; touch-action: pan-y; }
.bl-img { position: absolute; left: -19.444%; top: -41.509%; width: 138.889%; height: auto; max-width: none; }
.bl-after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); will-change: clip-path; }
.bl-a { opacity: 0; transition: opacity .2s var(--ease-ui); }       /* purpose: only the colour changes, nothing moves */
.bl-a.is-on { opacity: 1; }
.bl-handle { position: absolute; z-index: 2; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; will-change: transform; }
.bl-knob {
  position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform .45s var(--spring-enter);
}
.bl-knob svg { width: 22px; height: 22px; }
@media (hover: hover) { .bl-stage:hover .bl-knob { transform: scale(1.08); } }
.bl-range { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.bl-stage:has(.bl-range:focus-visible) .bl-knob { outline: 2px solid var(--blue-deep); outline-offset: 3px; }
html.js .bl-handle { left: 0; }                      /* js paints the divider with a transform */

/* the shade scale: one band, light → dark, every name under its step; the current step raised and in ink */
.bl-segs { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); align-items: end; }
.bl-step { position: relative; display: grid; justify-items: center; gap: 12px; min-width: 0; padding-top: 12px; cursor: pointer; }
.bl-radio { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bl-sw { display: block; width: 100%; height: 8px; background: var(--sw); transform-origin: 50% 100%; transition: transform .45s var(--spring-enter); }
.bl-step:first-child .bl-sw { border-radius: 4px 0 0 4px; }
.bl-step:last-child .bl-sw { border-radius: 0 4px 4px 0; }
.bl-code {
  font-size: var(--fs-body); line-height: 1.2; color: var(--ink-64); white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: color var(--dur-ui) var(--ease-ui);
}
@media (hover: hover) { .bl-step:hover .bl-code { color: var(--ink); } .bl-step:hover .bl-sw { transform: scaleY(1.75); } }
.bl-step:has(.bl-radio:checked) .bl-sw { transform: scaleY(2.5); border-radius: 2px; }   /* purpose: the chosen step stands up from the band */
.bl-step:has(.bl-radio:checked) .bl-code { color: var(--ink); }
.bl-step:has(.bl-radio:focus-visible) .bl-code { outline: 2px solid var(--blue-deep); outline-offset: 4px; border-radius: 2px; }
.bl-step.is-off { cursor: default; }
.bl-step.is-off .bl-radio { cursor: default; }

.bl-link { gap: 8px; }
.bl-arrow svg { width: 18px; height: 18px; }
.bl-cap { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-64); }

/* D/T: H2 left, the line right on the H2's baseline */
@media (min-width: 810px) {
  .bl-h { grid-column: 1 / 7; align-self: end; }
  .bl-p { grid-column: 8 / 13; grid-row: 1; align-self: end; margin-top: 0; }
}
/* P: the scale scrolls sideways with edge masks */
@media (max-width: 809.98px) {
  .bl-ctl { margin: 32px calc(-1 * var(--side)) 0; }
  .bl-segs {
    grid-template-columns: repeat(16, 56px); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    padding: 0 var(--side) 4px; -webkit-mask-image: var(--mask-rail); mask-image: var(--mask-rail);
  }
  .bl-segs::-webkit-scrollbar { display: none; }
  /* R7 masks only on the side that scrolls: at rest the first shade is fully legible (js sets is-start / is-end) */
  .bl-segs.is-start { -webkit-mask-image: linear-gradient(to right, #000 85.5%, transparent); mask-image: linear-gradient(to right, #000 85.5%, transparent); }
  .bl-segs.is-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 14.5%); mask-image: linear-gradient(to right, transparent, #000 14.5%); }
  html.no-js .bl-segs { -webkit-mask-image: linear-gradient(to right, #000 85.5%, transparent); mask-image: linear-gradient(to right, #000 85.5%, transparent); }
  .bl-tag-c { font-size: var(--fs-h5); }
  .bl-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .bl-knob svg { width: 18px; height: 18px; }
}
