/* Shared styles of every case study page (site/case-studies/<slug>/). Loaded after the classic site's CSS (Bootstrap +
   styles.css for the navbar and footer that case-shell.js adds), so everything is scoped to .case / .cs-* and avoids
   Bootstrap's class names (.table, .card, .tooltip...). A page with its own needs adds a style.css next to it. */
[hidden] { display: none !important; }

body.case-page { display: flex; flex-direction: column; min-height: 100vh; }
body.case-page > main { flex: 1 0 auto; width: 100%; }

.case { --line: rgba(255, 255, 255, .14); --muted: rgba(255, 255, 255, .65); --faint: rgba(255, 255, 255, .35);
    --gold: #F5C518; max-width: 980px; margin: 0 auto; padding: 120px 1rem 3rem; }

/* Header */
.cs-head { text-align: center; margin-bottom: 2.2rem; }
.cs-kicker, .cs-label, .cs-step { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.cs-kicker { margin: 0 0 .6rem; }
.cs-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 400; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 .8rem; }
.cs-intro { color: #fff; font-size: 1.05rem; max-width: 640px; margin: 0 auto .6rem; text-transform: none; }
.cs-meta { color: var(--muted); font-size: 13px; margin: 0; text-transform: none; }
.cs-meta a { color: #fff; }

/* Key numbers */
.cs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.cs-stat { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1rem; }
.cs-stat b { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.15; }
.cs-stat span { display: block; color: var(--muted); font-size: 13.5px; margin-top: .35rem; line-height: 1.4; }
.cs-stat.gold b { color: var(--gold); }
.cs-stat strong { color: #fff; font-weight: 700; }
a.cs-stat { display: block; color: #fff; text-decoration: none; transition: box-shadow .3s ease, transform .3s ease; }
a.cs-stat:hover, a.cs-stat:focus-visible { box-shadow: 0 10px 30px rgba(255, 255, 255, .35); transform: translateY(-2px); outline: none; color: #fff; }

/* The one-line answer under the title, and a short note under the answer cards */
.cs-answer { font-size: clamp(1.3rem, 3.6vw, 2rem); font-weight: 700; line-height: 1.25; margin: 1rem 0 0; text-transform: none; }
.cs-answer span { color: var(--gold); }
.cs-aside { color: var(--muted); font-size: 14.5px; text-align: center; margin: -.4rem 0 0; text-transform: none; }
.cs-aside strong { color: #fff; }

/* Waffle: 100 squares next to its key */
.cs-waffle { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; margin-bottom: 1.4rem; }
.cs-waffle-grid { flex: none; }
.cs-waffle-key { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; color: var(--muted); font-size: 15px; }
.cs-waffle-key i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: .6rem; vertical-align: -1px; }
.cs-waffle-key b { color: #fff; font-size: 1.35rem; margin-right: .3rem; }

/* Country lookup */
.cs-lookup { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.cs-label { display: block; margin-bottom: .6rem; }
.cs-lookup-line { display: flex; gap: .6rem; align-items: center; }
.case input[type=text], .case input[type=search] { flex: 1 1 auto; min-width: 0; width: 100%; background: #000; color: #fff;
    border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; font: inherit; font-size: 15px; }
.case input:focus { outline: none; border-color: rgba(255, 255, 255, .6); }
.cs-combo { position: relative; flex: 1 1 auto; min-width: 0; }
.cs-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none;
    background: #0b0b0b; border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .7); }
.cs-suggest li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: 7px; cursor: pointer; color: #fff; font-size: 14px; }
.cs-suggest li[aria-selected=true], .cs-suggest li:hover { background: rgba(255, 255, 255, .1); }
.cs-suggest .cs-opt-meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cs-suggest li.note { color: var(--muted); cursor: default; font-size: 12.5px; }
.cs-pill { flex: none; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px;
    padding: .45rem .9rem; font: inherit; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.cs-pill:hover, .cs-pill:focus-visible { box-shadow: 0 10px 30px rgba(255, 255, 255, .35); outline: none; }
.cs-country { margin-top: 1rem; }
.cs-country h3 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .15rem; text-transform: none; }
.cs-country .cs-sub { color: var(--muted); font-size: 13px; margin: 0 0 .9rem; }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.cs-facts div { background: rgba(255, 255, 255, .05); border-radius: 10px; padding: .7rem .8rem; }
.cs-facts b { display: block; font-size: 1.2rem; font-weight: 700; }
.cs-facts span { color: var(--muted); font-size: 12.5px; }
.cs-country .cs-line { color: var(--muted); font-size: 14px; margin: .8rem 0 0; }
.cs-country .cs-line b { color: #fff; }

/* Chapters */
.cs-chapter { padding: 3.2rem 0 0; }
.cs-step { margin: 0 0 .3rem; }
.cs-chapter h2 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); font-weight: 400; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 .8rem; }
.cs-text { color: rgba(255, 255, 255, .85); font-size: 1rem; line-height: 1.6; margin: 0 0 1.1rem; text-transform: none; }
.cs-text strong { color: #fff; }
.cs-text em { font-style: normal; border-bottom: 1px solid var(--faint); }
.cs-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: .8rem 0 0; text-transform: none; }

.cs-controls { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 1rem; }
.cs-seg { background: transparent; color: var(--muted); border: 0; border-radius: 999px; padding: .45rem 1rem; font: inherit;
    font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: color .2s ease, background .2s ease; }
.cs-seg:hover { color: #fff; }
.cs-seg.active { background: #fff; color: #000; }
.cs-seg:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
.cs-controls + .cs-figure, .cs-chips + .cs-controls { margin-top: 0; }

/* Chips: pick one item out of many (e.g. a country); same look as .cs-seg, wrapping over several lines. */
.cs-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.cs-chip { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem;
    font: inherit; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; transition: color .2s ease, background .2s ease; }
.cs-chip:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.cs-chip.active { background: #fff; color: #000; border-color: #fff; }
.cs-chip:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }

.cs-sub-h { font-size: 1.05rem; font-weight: 400; text-transform: uppercase; letter-spacing: 1px; margin: 2.2rem 0 .6rem; }
.cs-stats.cs-verdict { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-verdict .cs-stat .cs-tag { display: inline-block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }

.cs-figure { position: relative; width: 100%; }
.cs-figure svg { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.cs-figure text { fill: var(--muted); font-size: 12px; }
.cs-figure .axis line, .cs-figure .grid line { stroke: rgba(255, 255, 255, .1); stroke-width: 1; }
.cs-figure .tick { font-variant-numeric: tabular-nums; }
.cs-figure .label-strong { fill: #fff; }
.cs-figure .hit { fill: transparent; cursor: pointer; }
.cs-figure .country { cursor: pointer; transition: opacity .15s ease; }
.cs-figure .country:hover, .cs-figure .country:focus { stroke: #fff; stroke-width: 1.2; outline: none; }
.cs-figure .picked { stroke: var(--gold) !important; stroke-width: 2 !important; }

.cs-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; color: var(--muted); font-size: 12.5px; margin: .7rem 0 .6rem; }
.cs-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .4rem; }
.cs-legend i.dot { border-radius: 50%; }
.cs-legend i.ring { border-radius: 50%; border: 2px solid var(--muted); background: #000; }
.cs-legend i.dash { width: 18px; height: 0; border-top: 2px dashed #fff; border-radius: 0; vertical-align: 3px; }
.cs-legend .scale { display: inline-flex; }
.cs-legend .scale i { width: 44px; height: 10px; border-radius: 0; margin: 0 2px 0 0; }
.cs-legend .scale-labels { display: flex; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cs-legend .scale-labels span { width: 46px; }

/* Tables */
.cs-numbers { margin-top: 1rem; }
.cs-numbers summary { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.cs-numbers summary:hover { color: #fff; }
.cs-numbers[open] summary { margin-bottom: .7rem; }
.cs-table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 12px;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
/* A section with class cs-wide (e.g. a big table) breaks out of the text column on big screens, up to 1240px. */
@media (min-width: 1100px) {
    .cs-wide .cs-table-wrap, .cs-wide .cs-search { --w: min(1240px, calc(100vw - 3rem)); width: var(--w); margin-left: calc(50% - var(--w) / 2); }
}
.cs-numbers .cs-table-wrap { max-height: none; }
/* More columns off to the right (set by case-kit.js): fade the edge as a "swipe for more" hint */
.cs-table-wrap.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.cs-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cs-grid th, .cs-grid td { padding: .5rem .6rem; border-bottom: 1px solid rgba(255, 255, 255, .07); text-align: right; white-space: nowrap; }
.cs-grid th:first-child, .cs-grid td:first-child { text-align: left; }
.cs-grid td.l, .cs-grid th.l { text-align: left; }
.cs-grid th { position: sticky; top: 0; background: #0b0b0b; color: var(--muted); font-weight: 400; font-size: 11.5px;
    letter-spacing: 1px; text-transform: uppercase; z-index: 1; }
.cs-grid th button { background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 0; cursor: pointer; }
.cs-grid th button:hover, .cs-grid th[aria-sort] button { color: #fff; }
.cs-grid tbody tr { cursor: default; }
.cs-grid tbody tr.clickable { cursor: pointer; }
.cs-grid tbody tr.clickable:hover { background: rgba(255, 255, 255, .05); }
.cs-grid td.muted { color: var(--faint); }
.cs-search { margin-bottom: .8rem; }

.cs-about ul { color: rgba(255, 255, 255, .85); padding-left: 1.1rem; line-height: 1.6; }
.cs-about li { margin-bottom: .35rem; }

/* Tooltip */
.cs-tip { position: fixed; z-index: 1050; pointer-events: none; max-width: 260px; background: #0b0b0b; color: #fff;
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; padding: .55rem .7rem; font-size: 13px; line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .8); }
.cs-tip b { display: block; font-size: 14px; margin-bottom: .15rem; }
.cs-tip .k { color: var(--muted, rgba(255, 255, 255, .65)); }
.cs-tip .row-line { display: flex; justify-content: space-between; gap: 1rem; }

@media (max-width: 767.98px) {
    .cs-stats.cs-verdict { grid-template-columns: minmax(0, 1fr); }
    .case { padding-top: 96px; }
    .cs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-stat b { font-size: 1.35rem; }
    .cs-chapter { padding-top: 2.6rem; }
    .cs-figure text { font-size: 11px; }
}

/* Two-column ranked lists (e.g. "disliked trailer, loved movie"), and the search box above a big table */
.cs-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 2.2rem; margin: 0 0 1.4rem; }
.cs-list h3 { font-size: 12px; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; }
.cs-list ol { list-style: none; margin: 0; padding: 0; }
.cs-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0;
    border-bottom: 1px solid var(--line); font-size: 15px; text-transform: none; }
.cs-list li a { color: #fff; text-decoration: none; }
.cs-list li a:hover, .cs-list li a:focus-visible { text-decoration: underline; }
.cs-list li .yr { color: var(--muted); font-size: 13px; margin-left: .3rem; }
.cs-list li .n { color: var(--muted); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs-list li .n b { color: #fff; font-weight: 700; }
.cs-list li.gold a, .cs-list li.gold .n b { color: var(--gold); }
.cs-search { margin: .8rem 0; max-width: 360px; }
@media (max-width: 640px) {
    .cs-lists { grid-template-columns: minmax(0, 1fr); }
}
