/* ==========================================================================
   case.css - the work example on the Data science & analytics page (#data-derby): Juventus v Inter.
   Club colours: Juventus takes the house gold; Inter a blue checked on No. 26 with the dataviz validator
   (contrast 3.8:1, chroma above the 0.10 floor, OKLab difference from the gold 23.7 under protan/deutan
   simulation and 25.2 in normal vision). Text never wears a club colour; the mark beside it carries identity.
   Every name here starts with cs- so it cannot collide with the site's own styles.
   ========================================================================== */
:root{--cs-juve:#ECD065;--cs-inter:#86B6F7;--cs-on-fill:#1F2A0E;--cs-tip-bg:#2E3B19}
.cs-sr{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* The Data page: the work example entry --------------------------------- */
.cs-teaser{position:relative;grid-column:4 / span 9;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,15rem);column-gap:var(--col-gap);row-gap:16px;align-items:center;margin-inline:-16px;padding:18px 16px 20px;color:inherit;text-decoration:none;transition:background-color .25s}
.cs-teaser::before{content:"";position:absolute;top:0;left:16px;right:16px;border-top:1px solid var(--ink)}
.cs-teaser:hover{background:var(--tint)}
.cs-teaser:focus-visible{outline-offset:-2px}
.cs-teaser-title{display:block;font:500 clamp(1.3rem,1.9vw,1.7rem)/1.2 var(--serif);letter-spacing:-.01em}
.cs-teaser-desc{display:block;margin-top:8px;max-width:52ch;color:var(--ink-2)}
.cs-teaser .entry-link{display:inline-block;margin-top:12px}
.cs-teaser:hover .entry-link{text-decoration-color:var(--ink)}
.cs-teaser-fig{display:block;aspect-ratio:2/1}
.cs-teaser-fig svg{display:block;width:100%;height:100%;overflow:visible}

/* The work example: the opening, with the network as its figure --------- */
.practice--case .d-title{grid-column:1 / span 7;align-self:end}
.practice--case .d-intro{grid-column:8 / span 5;align-self:end}
.practice--case .d-intro .d-facts{margin-top:18px}
.cs-hero-fig{grid-column:1 / -1;display:grid;gap:14px;min-width:0;padding-top:14px;border-top:1px solid var(--ink)}

/* Blocks: a text, its controls, then the figure ------------------------- */
.cs-body{grid-column:4 / span 9;display:grid;gap:16px;min-width:0}
.cs-text{max-width:60ch;color:var(--ink-2)}
.cs-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px 26px}
.cs-seg{display:inline-flex;gap:22px}
.cs-seg button{appearance:none;margin:0;padding:8px 0;min-height:38px;border:0;background:none;color:var(--ink-2);font:500 14.5px/1.2 var(--sans);white-space:nowrap;cursor:pointer;box-shadow:inset 0 -2px 0 transparent;transition:color .2s,box-shadow .2s}
.cs-seg button:hover{color:var(--ink);box-shadow:inset 0 -1px 0 var(--rule-strong)}
.cs-seg button[aria-pressed="true"]{color:var(--ink);box-shadow:inset 0 -2px 0 var(--ink)}
.cs-legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:13.5px;color:var(--ink-2)}
.cs-legend span{display:inline-flex;align-items:center;gap:8px}
.cs-legend i,.cs-tip .row i,.cs-table th i{display:inline-block;flex:none;width:16px;height:2px}
.cs-legend i.juve,.cs-tip i.juve,.cs-table i.juve{background:var(--cs-juve)}
.cs-legend i.inter,.cs-tip i.inter,.cs-table i.inter{background:var(--cs-inter)}
.cs-legend i.band,.cs-tip i.band{height:10px;background:var(--band);opacity:.3}
.cs-tip i.other{background:var(--ink-3)}
.cs-tally,.cs-forms{font-size:14.5px;color:var(--ink-2)}
.cs-fig{position:relative;min-width:0}
.cs-fig > svg{display:block;width:100%;height:auto;overflow:visible}
.cs-fig[tabindex]:focus-visible{outline-offset:6px}
.cs-quiet{justify-self:start;appearance:none;margin:0;padding:6px 0;border:0;background:none;color:var(--ink-2);font:500 14.5px/1.3 var(--sans);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;text-decoration-color:var(--rule-strong);cursor:pointer;transition:color .2s,text-decoration-color .2s}
.cs-quiet:hover{color:var(--ink);text-decoration-color:var(--ink)}
.cs-actions{display:flex;flex-wrap:wrap;gap:6px 26px}

/* Tooltip: values lead, labels follow */
.cs-tip{position:absolute;z-index:4;display:grid;gap:4px;min-width:9rem;max-width:17rem;padding:9px 11px 10px;border:1px solid var(--rule-strong);background:var(--cs-tip-bg);font-size:13px;line-height:1.35;color:var(--ink-2);pointer-events:none}
.cs-tip b{font-weight:600;font-size:14px;color:var(--ink)}
.cs-tip .row{display:flex;align-items:baseline;gap:8px}
.cs-tip .row i{align-self:center}
.cs-tip .row strong{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}

/* Tables: the numbers behind a figure, and the measures in numbers */
.cs-table-wrap{overflow-x:auto}
.cs-table{width:100%;border-collapse:collapse;font-size:14px}
.cs-table-wrap .cs-table{min-width:30rem}
.cs-table th,.cs-table td{padding:7px 10px;border-bottom:1px solid var(--rule);text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.cs-table th:first-child,.cs-table td:first-child{padding-left:0;text-align:left}
.cs-table thead th{font-weight:500;color:var(--ink-3);border-bottom-color:var(--ink)}
.cs-table tbody th{font-weight:400;color:var(--ink)}
.cs-table th i{margin-right:8px;vertical-align:middle}
.cs-numbers{font-size:15px}
.cs-numbers th,.cs-numbers td{padding-block:11px}
.cs-numbers tbody th{white-space:normal;color:var(--ink-2);max-width:40ch}
.cs-numbers td{font-weight:600;color:var(--ink)}

/* Figures: pitches, flows and lines ------------------------------------- */
.cs-pitch{fill:var(--tint);stroke:var(--rule-strong);stroke-width:1}
.cs-pline{fill:none;stroke:var(--rule-strong);stroke-width:1}
.cs-club{fill:var(--ink);font:600 14px var(--sans)}
.cs-keyline{stroke-width:3}
.cs-keyline.juve,.cs-line.juve,.cs-flow.juve,.cs-arrow.juve,.cs-era.juve{stroke:var(--cs-juve)}
.cs-keyline.inter,.cs-line.inter,.cs-flow.inter,.cs-arrow.inter,.cs-era.inter{stroke:var(--cs-inter)}
.cs-ah.juve,.cs-node.juve,.cs-dot.juve,.cs-sdot.juve,.cs-vbar.juve,.cs-rv-dot.juve{fill:var(--cs-juve)}
.cs-ah.inter,.cs-node.inter,.cs-dot.inter,.cs-sdot.inter,.cs-vbar.inter,.cs-rv-dot.inter{fill:var(--cs-inter)}
/* The dash length is set on every drawing; this fallback keeps a line whole if it ever is not */
.cs-fig .draw,.cs-teaser-fig .draw{stroke-dasharray:var(--len,none)}

.cs-flow{fill:none;stroke-linecap:round;opacity:.9;transition:opacity .2s}
.cs-hit{fill:none;stroke:transparent;stroke-width:14;pointer-events:stroke}
.cs-dim .cs-flow{opacity:.08}
.cs-dim .cs-flow.on{opacity:1}
.cs-node{stroke:var(--tint);stroke-width:2}
.cs-nd{outline:none}
.cs-focus{fill:none;stroke:var(--mark);stroke-width:2;opacity:0}
.cs-nd:focus-visible .cs-focus{opacity:1}
.cs-nlabel{fill:var(--cs-on-fill);font:600 10px var(--sans);pointer-events:none}
.cs-nlabel.out{fill:var(--ink-2);font-weight:500;paint-order:stroke;stroke:var(--tint);stroke-width:3px;stroke-linejoin:round}

.cs-grid{stroke:var(--rule);stroke-width:1}
.cs-axis{stroke:var(--rule-strong);stroke-width:1}
.cs-tick{fill:var(--ink-3);font:400 11px var(--mono)}
.cs-num{fill:var(--ink-2);font:400 11.5px var(--mono)}
.cs-lab{fill:var(--ink-2);font:400 12.5px var(--sans)}
.cs-lab.strong{fill:var(--ink);font-weight:600}
.cs-lab.soft{fill:var(--ink-3);font-size:12px}
.cs-bandarea{fill:var(--band);fill-opacity:.16}
.cs-bandmid{fill:none;stroke:var(--ink-3);stroke-width:1;opacity:.7}
.cs-line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.cs-dot{stroke:var(--ground);stroke-width:2;transform-box:fill-box;transform-origin:center;transition:transform .15s}
.cs-dot.on{transform:scale(1.4)}
.cs-cross{stroke:var(--ink-2);stroke-width:1}
.cs-overlay{fill:transparent;cursor:crosshair}
.cs-era{stroke-width:4}
.cs-era-lab{fill:var(--ink-3);font:400 10.5px var(--sans)}

/* The starting line-up: dots grow and shrink between seasons */
.cs-sdot{stroke:var(--tint);stroke-width:1.5;vector-effect:non-scaling-stroke;transform-box:fill-box;transform-origin:center;transition:transform .7s cubic-bezier(.4,.1,.2,1)}
.cs-sdot.gk{fill:var(--ink-3)}
.cs-scrub{gap:10px 14px}
.cs-step{appearance:none;flex:none;width:32px;height:38px;margin:0;padding:0;border:0;background:none;color:var(--ink-2);font:500 20px/1 var(--sans);cursor:pointer;transition:color .2s}
.cs-step:hover{color:var(--ink)}
.cs-season{min-width:4.6em;font:600 1.15rem/1 var(--sans);font-variant-numeric:tabular-nums;color:var(--ink)}
.cs-range{flex:1 1 12rem;min-width:8rem;margin:0;accent-color:var(--ink)}

/* Who moved where: a pitch and the list of players */
.cs-movers{display:grid;grid-template-columns:minmax(0,330px) minmax(0,1fr);column-gap:var(--col-gap);row-gap:18px;align-items:start}
.cs-slot{fill:var(--ground);stroke:var(--rule-strong);stroke-width:1}
.cs-slot-lab{fill:var(--ink-3);font:500 9.5px var(--sans);pointer-events:none;paint-order:stroke;stroke:var(--ground);stroke-width:3px;stroke-linejoin:round}
.cs-arrow{fill:none;stroke-width:2.2;stroke-linecap:round;opacity:.85;transition:opacity .2s,stroke-width .2s}
.cs-dim .cs-arrow{opacity:.14}
.cs-dim .cs-arrow.on{opacity:1;stroke-width:3}
.cs-mv-list{display:grid;border-top:1px solid var(--ink)}
.cs-mv{appearance:none;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px;row-gap:2px;width:100%;margin:0;padding:9px 8px 10px;border:0;border-bottom:1px solid var(--rule);background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background-color .2s}
.cs-mv .nm{font:500 1.02rem/1.3 var(--serif)}
.cs-mv .se{font:400 12.5px/1.6 var(--mono);color:var(--ink-3);text-align:right}
.cs-mv .mo{grid-column:1 / -1;font-size:14px;color:var(--ink-2)}
.cs-mv:hover,.cs-mv.on{background:var(--tint)}
.cs-mv[aria-pressed="true"]{box-shadow:inset 3px 0 0 var(--ink)}
.cs-mv:focus-visible{outline-offset:-2px}

/* Market value: moved players as filled bars, kept players as open ones (still hoverable inside) */
.cs-vbar{pointer-events:all}
.cs-vbar.kept.juve,.cs-vbar.kept.inter{fill:none;stroke-width:1.5}
.cs-vbar.kept.juve{stroke:var(--cs-juve)}
.cs-vbar.kept.inter{stroke:var(--cs-inter)}
.cs-rv-hit{fill:transparent}
.cs-rv:hover .cs-rv-hit{fill:var(--tint)}
.cs-rv-seg{stroke:var(--rule-strong);stroke-width:2}
.cs-rv-dot{stroke:var(--ground);stroke-width:2}
.cs-rv-dot.other{fill:var(--ink-3)}

/* Closing blocks */
.cs-steps{padding-top:clamp(30px,3.6vw,48px);border-top:1px solid var(--rule)}
.cs-wide{grid-column:4 / span 8}
.cs-method{grid-column:4 / span 8;max-width:70ch}

/* Responsive ------------------------------------------------------------- */
@media (max-width:1100px){
  .practice--case .d-title{grid-column:1 / span 6}
  .practice--case .d-intro{grid-column:7 / span 6}
}
@media (max-width:860px){
  .cs-teaser,.cs-body,.cs-wide,.cs-method,.practice--case .d-title,.practice--case .d-intro{grid-column:1 / -1}
  .cs-teaser{grid-template-columns:1fr;margin-inline:0;padding-inline:0}
  .cs-teaser::before{left:0;right:0}
  .cs-teaser-fig{max-width:360px}
  .cs-movers{grid-template-columns:1fr}
  .cs-movers .cs-fig{max-width:340px}
}
@media (max-width:560px){
  .cs-table-wrap .cs-table{min-width:0}
  .cs-table th,.cs-table td{padding-inline:6px}
  .cs-numbers{font-size:14px}
}
