/* Block 3 · Behandlungen (V8-BLOCKS §3, L6, R7). Paper. Section head: H2 cols 1–6, „Alle Behandlungen" cols 9–12 on
   the same baseline. Rail: four photo cards at one photo height (D 440 · T 360 · P 260), widths by crop, gap 24 (P 16);
   it starts on the container's left edge and runs to the viewport's right edge.
   Static (no JS, reduced motion, P): a native horizontal scroller with snap. Live (html.js, ≥ 810, .is-scrub from
   03-behandlungen.js): the rail clips hard at its edges (no fade on the
   photos: V8-IMAGE-REVIEW §2.8), the track's translateX follows the block's scroll. Widths and heights never change under the pointer. */
.bh { --ph: 440px; --gap: 24px; --rail-l: max(var(--side), calc((100% - var(--container)) / 2));
  padding-block: min(var(--sec-pad), var(--sec-pad-dark)); }                /* one section padding, no empty bands (SLOP M12) */
.bh-head { align-items: end; }
.bh-h { grid-column: 1 / 7; min-width: 0; }
.bh-all {
  grid-column: 9 / 13; justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  margin-bottom: 6px;                     /* the link's 18 px text sits on the H2's baseline (56 / 1.2: 11 px below the cap's foot) */
  font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-64);
}
.bh-all svg { width: 20px; height: 20px; flex: none; }
.bh-all:hover { text-decoration-color: var(--ink); }

.bh-rail { margin-top: var(--gap-stack-l); }
.bh-track {
  display: flex; gap: var(--gap); width: max-content;
  padding-inline: var(--rail-l) var(--rail-l);
}
.bh-card { position: relative; flex: none; width: calc(var(--ph) * var(--ar)); min-width: 0; }
/* crop boxes (x0–x1, y0–y1 of the source frame); the card's ratio is the crop's (LOCKED V12: no face in this block) */
.bh-card--1 { --ar: 1.28; }                                                /* card-foto-30 (cut file, foto-30 x .14–.86) · hands, the prosthesis on its model */
.bh-card--2 { --ar: 1.2; }                                                 /* render A1 · six front teeth on mist */
.bh-card--3 { --ar: .778;  --x0: .20; --x1: .62; --y0: .50; --y1: .86; }  /* foto-04 · gloved hand and instrument */
.bh-card--4 { --ar: 1.326; --x0: 0;   --x1: .46; --y0: .44; --y1: .96; }  /* foto-07 · instruments and the tray */
.bh-link { color: var(--ink); text-decoration: none; }
.bh-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-sm); }   /* the whole card is the link */
.bh-link:focus-visible { outline: none; }
.bh-link:focus-visible::after { outline: 2px solid var(--blue-deep); outline-offset: 4px; }
.bh-ph { position: relative; display: block; height: var(--ph); border-radius: var(--r-sm); overflow: hidden; background: var(--ph-bg, var(--mist)); }
/* placeholders (phone round C): the crop's own mean colour at the card's final size until the photo has decoded */
.bh-card--1 { --ph-bg: #c7bbb9; }   /* card-foto-30 */
.bh-card--3 { --ph-bg: #777173; }   /* foto-04 crop */
.bh-card--4 { --ph-bg: #b5b2b2; }   /* foto-07 crop · card 2 keeps mist: the render sits on mist by design */
.bh-ph img {
  position: absolute; max-width: none;
  width: calc(100% / (var(--x1) - var(--x0))); height: calc(100% / (var(--y1) - var(--y0)));
  left: calc(-100% * var(--x0) / (var(--x1) - var(--x0))); top: calc(-100% * var(--y0) / (var(--y1) - var(--y0)));
}
.bh-card--1 .bh-ph img { inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* the cut file at the card's own ratio */
.bh-card--2 .bh-ph img { width: 130%; height: auto; left: -15%; top: 18.8%; }   /* the render (5 : 2) centred on mist, all six teeth inside */
.bh-t { width: fit-content; max-width: 100%; margin-top: 20px; font-size: var(--fs-h5); line-height: var(--lh-h5); letter-spacing: var(--ls-h5); }
.bh-s { width: fit-content; max-width: 100%; margin-top: 4px; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-75); }
@media (hover: hover) {
  .bh-card:hover .bh-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
}

/* static rail: native scroll with snap (the leading edge never masked) */
.bh-rail { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--rail-l); scrollbar-width: thin; }
.bh-card { scroll-snap-align: start; }

/* live rail (≥ 810): clipped hard at the rail's edges and scrubbed by the scroll (no edge fade on photos, review §2.8) */
.bh.is-scrub .bh-rail { overflow: clip; scroll-snap-type: none; }
.bh.is-scrub .bh-track { will-change: transform; }
/* a line that the rail's edge would cut waits outside until it fits (it sits in the page margin meanwhile) */
.bh.is-scrub .bh-t, .bh.is-scrub .bh-s { transition: opacity .3s var(--ease-ui), visibility .3s; }
.bh.is-scrub .is-cut { visibility: hidden; opacity: 0; }

@media (max-width: 1199.98px) { .bh { --ph: 360px; } }
@media (max-width: 809.98px) {
  .bh { --ph: 260px; --gap: 16px; }
  .bh-h { grid-column: 1 / -1; }
  .bh-all { grid-column: 1 / -1; justify-self: start; margin: 12px 0 0; }
  .bh-rail { margin-top: 36px; scrollbar-width: none; }
  .bh-rail::-webkit-scrollbar { display: none; }
}

/* Index (V8-GAPS §2 A, 2026-11-09). Concept: the contents page of a printed treatment guide under the photo rail.
   Group name at H3 in cols 1–4, its treatments in cols 5–12: the name (link, --fs-h5) and its one line in ink 75 % on
   one baseline; a hairline above each group is the index's one device (the rail is the section's photo device). */
.bh-ix { margin-top: calc(var(--gap-stack-l) + var(--gap-stack)); }
.bh-ix-g { align-items: baseline; padding-block: 28px 32px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.bh-ix-g:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.bh-ix-h { grid-column: 1 / 5; min-width: 0; font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.bh-ix-list { grid-column: 5 / 13; min-width: 0; display: grid; gap: 14px; }
.bh-ix-e { position: relative; display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); column-gap: var(--gap-grid); align-items: baseline; }
.bh-ix-a {
  justify-self: start; font-size: var(--fs-h5); line-height: var(--lh-h5); letter-spacing: var(--ls-h5); color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, var(--ink) 24%, transparent);
}
.bh-ix-a::after { content: ""; position: absolute; inset: -6px 0; }       /* the whole entry (name and line) is the target */
.bh-ix-a:focus-visible { outline: none; }
.bh-ix-e:has(.bh-ix-a:focus-visible) { outline: 2px solid var(--blue-deep); outline-offset: 6px; border-radius: 4px; }
.bh-ix-l { min-width: 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-75); }
@media (hover: hover) {
  .bh-ix-a { transition: text-decoration-color var(--dur-ui) var(--ease-ui); }
  .bh-ix-e:hover .bh-ix-a { text-decoration-color: var(--ink); }     /* the entry answers the pointer */
}

/* T: the names over their lines; the group name keeps cols 1–4 */
@media (max-width: 1199.98px) {
  .bh-ix-e { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .bh-ix-list { gap: 18px; }
}
/* P: the group name above its treatments */
@media (max-width: 809.98px) {
  .bh-ix { margin-top: var(--gap-stack); }
  .bh-ix-g { row-gap: 14px; padding-block: 20px 24px; }
  .bh-ix-h, .bh-ix-list { grid-column: 1 / -1; }
  .bh-ix-h { font-size: var(--fs-h5); line-height: var(--lh-h5); letter-spacing: var(--ls-h5); }
  .bh-ix-a { font-size: var(--fs-body); line-height: var(--lh-body); }
  .bh-ix-a::after { inset: -4px 0; }
}
