/* v2 motion layer (PR_MOTION=on only). Rules fill in by later tasks; every animation lives inside @media (prefers-reduced-motion: no-preference). */

/* ── Cinematic photo hero (Task 2): the existing .v2-hero-photo lifts to a full-bleed cover behind the copy ── */
body.v2 .v2-hero.v2-hero--cine { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: min(92vh, 900px); background: #000; overflow: hidden; padding-bottom: 56px; }
body.v2 .v2-hero--cine .v2-hero-photo { position: absolute; inset: 0; z-index: -1; margin: 0; padding: 0; max-width: none; width: 100%; }
body.v2 .v2-hero--cine .v2-hero-photo .v2-figure { position: absolute; inset: 0; margin: 0; }
body.v2 .v2-hero--cine .v2-hero-photo picture { display: block; width: 100%; height: 100%; }
body.v2 .v2-hero--cine .v2-hero-photo img { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 0; margin: 0; transform-origin: 50% 50%; will-change: transform; }
body.v2 .v2-hero--cine .v2-hero-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 30%, rgba(0, 0, 0, .72) 100%); }
body.v2 .v2-hero--cine .v2-figcap { position: absolute; right: var(--v2-gut); bottom: 8px; z-index: 1; margin: 0 !important; color: var(--v2-on-dark-2) !important; }
body.v2 .v2-hero--cine .v2-figcap a { color: inherit; }
body.v2 .v2-hero--cine .v2-h1 .v2-gt { background: none; -webkit-text-fill-color: currentColor; color: var(--v2-on-dark); }
body.v2 .v2-hero--cine .v2-crumbs, body.v2 .v2-hero--cine .v2-crumbs a, body.v2 .v2-hero--cine .v2-eyebrow { color: var(--v2-on-dark); text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
body.v2 .v2-hero--cine .v2-hero-grid { position: relative; z-index: 1; }
body.v2 .v2-hero--cine .v2-h1 { color: var(--v2-on-dark); text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
body.v2 .v2-hero--cine .v2-sub { background: rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; padding: 16px 20px; max-width: 520px; color: var(--v2-on-dark); }
/* money pages: the affiliate disclosure sits in the hero copy and must stay in the first screen (v2-measure disclosureY < 700), so the bottom-anchored copy gets a shorter hero */
body.v2 .v2-hero.v2-hero--cine:has(.v2-disclosure) { min-height: min(74vh, 700px); padding-top: 52px; }
body.v2 .v2-hero--cine:has(.v2-disclosure) .v2-sub { padding: 10px 16px; max-width: 760px; }
@media (max-width: 734px) {
  body.v2 .v2-hero.v2-hero--cine { min-height: min(88vh, 720px); padding-bottom: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  body.v2 .v2-hero--cine .v2-hero-photo img { animation: pr-kb 22s ease-in-out infinite alternate; }
  body.v2 .v2-hero--cine .v2-sub { animation: pr-fade-in 1s ease both; }
  @keyframes pr-kb { from { transform: scale(1); } to { transform: scale(1.12) translate(-2%, -2%); } }
  @keyframes pr-fade-in { from { opacity: 0; } to { opacity: 1; } }
}

/* ── Photo rail (Task 3): its own band between two text bands; fixed height, scrolls inside its own track ── */
body.v2 .v2-band--rail { padding: 40px 0; }
body.v2 .v2-rail__track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline: var(--v2-gutter, var(--v2-gut, 20px)); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
body.v2 .v2-rail__track::-webkit-scrollbar { display: none; }
body.v2 .v2-rail__track:focus-visible { outline: 3px solid var(--v2-focus, #0C98A6); outline-offset: 4px; }
body.v2 .v2-rail__item { flex: 0 0 min(78vw, 360px); margin: 0; scroll-snap-align: start; }
body.v2 .v2-rail__item picture { display: block; aspect-ratio: 3 / 2; border-radius: 18px; overflow: hidden; }
body.v2 .v2-rail__item img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
body.v2 .v2-rail__item .v2-figcap { margin: 8px 0 0; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  body.v2 .v2-rail__item img { transition: transform .5s ease; }
  body.v2 .v2-rail__item:hover img { transform: scale(1.06); }
}
/* mouse users: no arrows, so show a thin scrollbar under the rail (touch keeps the hidden one) */
@media (hover: hover) {
  body.v2 .v2-rail__track { scrollbar-width: thin; scrollbar-color: rgba(27, 36, 48, .35) transparent; padding-bottom: 12px; }
  body.v2 .v2-rail__track::-webkit-scrollbar { display: block; height: 6px; }
  body.v2 .v2-rail__track::-webkit-scrollbar-thumb { background: rgba(27, 36, 48, .35); border-radius: 3px; }
}

/* ═══ 2030 round 1 (site-wide; brand/v2.css is deliberately NOT touched this round) ═══ */

/* r1.1 review card without a product image: single column (v2.css forces every child into column 2, which left column 1 empty) */
body.v2 .pr-review-card:not(:has(> .pr-product-image)) { grid-template-columns: minmax(0, 1fr); }
body.v2 .pr-review-card:not(:has(> .pr-product-image)) > * { grid-column: 1; }

/* r1.4 corner radius: Tim decided 12 px for photo and card corners on 20 Nov. Token override only (v2.css :root has 28 / 20); inline radii in legacy blocks stay. */
:root { --v2-r-l: 12px; --v2-r-m: 12px; }

/* r1.5 dark bands: a soft teal edge light along the top edge, static, no animation, no image request. Painted as inset box-shadows, so it sits above whatever background the band has and
   needs no pseudo-element (stage bands already own ::after for grain). Grain: stage bands already carry it (v2.css .v2-stage::after, opacity .07), so nothing is added; a plain dark band
   (no .v2-stage) does not occur in the current build. The court island is excluded (own surface, hidden until its data loads). */
body.v2 .v2-band.v2-tone-dark:not(.v2-court) { box-shadow: inset 0 1px 0 rgb(67 195 205 / .32), inset 0 90px 90px -70px rgb(12 152 166 / .28); }
@media (forced-colors: active) { body.v2 .v2-band.v2-tone-dark { box-shadow: none; } }

/* r1.6 staggered reveals in card grids. The base reveal (v2.css: v2-rise on a view() timeline) is scroll-linked, so a time delay would be ignored;
   the stagger is therefore a per-item shift of the entry range (5% of the viewport per step, steps capped at 6 items = no item waits longer than 25%).
   Only where animation-timeline AND sibling-index() exist; reduced motion is excluded here and again by the global `animation: none !important` in v2.css. */
@supports (animation-timeline: view()) and (width: calc(sibling-index() * 1px)) {
  @media (prefers-reduced-motion: no-preference) {
    body.v2 :is(.pr-light-grid > *, .v2-tile, .pr-sg-cell, .pr-roadmap-card) {
      animation-range: entry calc((min(sibling-index(), 6) - 1) * 5%) entry calc(40% + (min(sibling-index(), 6) - 1) * 5%);
    }
  }
}

/* 2030 r1 part 2: path-card link labels on the German home. brand/v2.css shows a card's closing CTA with `text-transform: lowercase` because
   English cards are authored in capitals ("authored in caps; shown sentence-case"). The German home stores them in correct case
   ("Zu den Verletzungen", "Zum Präventions-Guide", "Zum Ausrüstungs-Hub"), and lower-casing turned the nouns small. German home only. */
body.v2:lang(de):has(.v2-hero--home) :is(a.pr-rc, a.pr-ic) > span,
body.v2:lang(de):has(.v2-hero--home) a.pr-ic > div:last-child > span { text-transform: none; }

/* ═══ 2030 round 2 (brand/v2.css is still NOT touched) ═══ */

/* r2.7 phone "On this page" label: the section name wraps instead of being cut with an ellipsis (v2.css .v2-localnav__cur is nowrap + ellipsis).
   Normal case: at most two lines of 13px, which fit the 44px bar, so scroll-margin-top (116px) and the panel max-height stay correct.
   WCAG 1.4.12: a reader's wider spacing can need a third line, so the clamp is three lines and the bar grows (min-height, not height) instead of clipping. */
@media (max-width: 1279px) {
  body.v2 .v2-localnav__btn { height: auto; min-height: 44px; padding-block: 4px; }
  body.v2 .v2-localnav__cur { white-space: normal; overflow: hidden; text-overflow: clip; overflow-wrap: break-word; hyphens: manual;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 13px; line-height: 1.15; }
}

/* r2.6 directory tile hubs (.v2-band--dir-tiles, 23 hubs EN+DE): no orphan card, no blurb cut to one line.
   v2.css gives 5 / 4 / 3 / 2 columns by width and count rules only for lists of 1-4 tiles, so 6 tiles = 5+1 and 5 tiles at 735 px = 2+2+1.
   Rule: keep the width's column count unless it leaves a last row of ONE tile; then take the nearest count that does not (an even split first, 3+ columns only),
   else the lone last tile spans the row. The counts 5 to 40 are written out because CSS cannot compute a remainder (generated once, kept as text).
   Each block sits in its own width range. The 735-860 range states its own columns on purpose: that is where 5 tiles gave 2+2+1 and the count rules of v2.css (1-4 tiles) do not reach. */
@media (min-width: 735px) { body.v2 .v2-band--dir-tiles .pr-cidx-desc { -webkit-line-clamp: 3; } }
@media (min-width: 735px) and (max-width: 860px) {
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(5):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(9):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(11):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(15):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(17):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(21):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(23):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(27):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(29):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(33):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(35):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(39):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(7):last-child) > :nth-child(7),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(13):last-child) > :nth-child(13),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(19):last-child) > :nth-child(19),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(25):last-child) > :nth-child(25),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(31):last-child) > :nth-child(31),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(37):last-child) > :nth-child(37) { grid-column: 1 / -1; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(7):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(10):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(16):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(19):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(22):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(28):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(31):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(34):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(40):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(13):last-child) > :nth-child(13),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(25):last-child) > :nth-child(25),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(37):last-child) > :nth-child(37) { grid-column: 1 / -1; }
}
@media (min-width: 1101px) and (max-width: 1199px) {
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(9):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(17):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(21):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(29):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(33):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(5):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(13):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(25):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(37):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(6):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(21):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(11):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(16):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(26):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(31):last-child),
  body.v2 .v2-band--dir-tiles .pr-cidx-list:has(> :nth-child(36):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* r2.3 calmer evidence rows. Nothing is hidden and no markup changes (data-fact and #pr-src-N anchors stay).
   Source lists: the rows are already claim + meta line; only the 40 px number column is narrowed (24 px) so the claim gets the width.
   "Why this matters" list on the shoe and racket guides (.pr-matters-list, tools/gear-evidence-block.js) had no CSS at all, so each row ran on as one paragraph:
   claim, then source / certainty / date as a second, quieter line with the date in mono. */
body.v2 .pr-src-list > li { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
body.v2 .pr-src-n { text-align: left; }
body.v2 .pr-matters ul.pr-matters-list { list-style: none; margin: 24px 0 0; padding: 0; max-width: var(--v2-col, 72ch); }
body.v2 .pr-matters ul.pr-matters-list > li { display: block; padding: 16px 0; margin: 0; border-top: 1px solid var(--v2-line); }
body.v2 .pr-matters ul.pr-matters-list > li:last-child { border-bottom: 1px solid var(--v2-line); }
body.v2 .pr-matters-claim { display: block; font-size: var(--fs-17); line-height: 1.5; color: var(--v2-ink); max-width: 68ch; }
body.v2 .pr-matters-meta { display: block; margin-top: 6px; font-size: var(--fs-14); line-height: 1.5; color: var(--v2-ink-3); }
body.v2 .pr-matters-meta a { color: var(--v2-teal-ink); }
body.v2 .pr-matters-meta time { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .02em; white-space: nowrap; }
body.v2 .pr-matters-caveat { display: block; margin-top: 4px; font-size: var(--fs-14); line-height: 1.5; color: var(--v2-ink-3); font-style: italic; }

/* r2.2 recovery milestones (.pr-recovery-stats, a 3-item dl on 26 pages) as a vertical timeline. No markup change, no text hidden or delayed.
   Static, always: a left track, a teal line over it and a dot on each milestone. Only where the view() scroll timeline exists AND motion is allowed does the teal line
   grow from the top as the list scrolls through the viewport (transform only, so no layout shift); everywhere else the full line shows. */
body.v2 .pr-recovery-stats dl { position: relative; padding-left: 30px; }
body.v2 .pr-recovery-stats dl::before, body.v2 .pr-recovery-stats dl::after { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; }
body.v2 .pr-recovery-stats dl::before { background: var(--v2-line); }
body.v2 .pr-recovery-stats dl::after { background: var(--v2-teal); transform-origin: top center; }
body.v2 .pr-recovery-stats dt { position: relative; }
body.v2 .pr-recovery-stats dt::before { content: ""; position: absolute; left: -30px; top: .12em; box-sizing: border-box; width: 12px; height: 12px; border-radius: 50%;
  background: var(--v2-white); border: 2px solid var(--v2-teal); }
@keyframes pr-tl-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body.v2 .pr-recovery-stats dl::after { transform: scaleY(0); animation: pr-tl-fill linear both; animation-timeline: view(); animation-range: entry 15% cover 60%; }
  }
}
@media (forced-colors: active) { body.v2 .pr-recovery-stats dl::before { background: CanvasText; } body.v2 .pr-recovery-stats dl::after { background: Highlight; } }

/* r2.1 the page's own pain diagram pinned in the right gutter of long injury articles (25 pages), from 1400 px.
   Markup: tools/lib/v2-sidefig.js adds ONE <aside class="v2-sidefig" aria-hidden="true"> as the LAST CHILD of <main> (no wrapper div, so the hero/capsule and tone-hairline
   sibling rules are untouched). <main> becomes the positioned ancestor; the aside is out of flow (zero layout change) and starts at 960 px, below the hero (measured: the hero ends at 943 px on all 25 pages at 1400, 1440 and 1920 wide), and its
   image sticks while the article scrolls. The gutter lies outside the 980 px wrap, so no component can collide with it. Below 1400 px it is not displayed (lazy image not fetched). */
body.v2 .v2-sidefig { display: none; }
@media (min-width: 1400px) {
  body.v2 main#main:has(> .v2-sidefig) { position: relative; }
  body.v2 main#main > aside.v2-sidefig { display: block; position: absolute; top: 960px; bottom: 0; right: 24px; width: clamp(160px, calc((100% - 980px) / 2 - 56px), 220px);
    margin: 0; padding: 0; max-width: none; background: none; border: 0; border-radius: 0; box-shadow: none; pointer-events: none; z-index: 2; }
  body.v2 main#main > aside.v2-sidefig img { position: sticky; top: 96px; display: block; width: 100%; height: auto; max-height: 50vh; object-fit: contain; margin: 0; padding: 12px;
    background: var(--v2-white); border-radius: var(--v2-r-m); box-sizing: border-box; box-shadow: 0 1px 0 rgb(27 36 48 / .06), 0 12px 32px -16px rgb(27 36 48 / .22); }
}
@media print { body.v2 aside.v2-sidefig { display: none; } }

/* r2.safety: a medical warning band stays plain. The r1 teal edge light (rule above) is a decoration; the "When it is time to see a professional" band
   (section.v2-band--safety, class added by renderBands when the band holds .pr-doctor) carries none. */
body.v2 .v2-band.v2-tone-dark.v2-band--safety { box-shadow: none; }

/* home-2030 MORPH (flag-free CSS, harmless where cross-document view transitions are not supported): the title of a home path card becomes the headline of the page it opens.
   Pairs by name: the card's h3 on the home and the target page's h1 carry the same view-transition-name (unique per card, one card per target). The target page is found by its
   canonical link, so no page-specific markup is needed. The list below must equal the home's path cards: tools/lib/home-morph.test.js fails when it drifts.
   Reduced motion: no names are set at all (and brand/spectacle.css additionally zeroes the transition animations). */
@supports (view-transition-name: x) {
  @media (prefers-reduced-motion: no-preference) {
    /* morph-pairs:begin */
    body.v2:has(.v2-hero--home) a.pr-rc[href="/start-here/"] h3, body.v2:has(.v2-hero--home) a.pr-rc[href="/de/verletzungen/"] h3, html:has(link[rel="canonical"][href="https://padelrevive.com/start-here/"]) .v2-h1, html:has(link[rel="canonical"][href="https://padelrevive.com/de/verletzungen/"]) .v2-h1 { view-transition-name: vt-path-1; }
    body.v2:has(.v2-hero--home) a.pr-rc[href="/prevention/padel-injury-prevention-exercises/"] h3, body.v2:has(.v2-hero--home) a.pr-rc[href="/de/praevention/"] h3, html:has(link[rel="canonical"][href="https://padelrevive.com/prevention/padel-injury-prevention-exercises/"]) .v2-h1, html:has(link[rel="canonical"][href="https://padelrevive.com/de/praevention/"]) .v2-h1 { view-transition-name: vt-path-2; }
    body.v2:has(.v2-hero--home) a.pr-rc[href="/padel-gear/"] h3, body.v2:has(.v2-hero--home) a.pr-rc[href="/de/ausruestung/"] h3, html:has(link[rel="canonical"][href="https://padelrevive.com/padel-gear/"]) .v2-h1, html:has(link[rel="canonical"][href="https://padelrevive.com/de/ausruestung/"]) .v2-h1 { view-transition-name: vt-path-3; }
    /* morph-pairs:end */
  }
}
