/* Podcast player, one component family for the article pages and
 * /insights/podcast/ (driven by assets/podcast/podcast.js, markup from
 * tools/build-podcast.py). Colours are the handoff tokens, so the file works
 * on any page that loads it.
 *
 * Shared parts, the same everywhere:
 *   .i-play / .i-pause   the play and pause symbols, one size
 *   .pod-btn             primary pill: white circle with the symbol + label
 *   .pod-btn2            secondary pill (All episodes, Get new episodes)
 *   .pod-plat, .ep-plat  round icon links to Apple Podcasts and Spotify
 *   .pod-round           round play / pause (.is-lg larger, .is-soft grey)
 *   .pod-wave            waveform slider with a playhead
 *   .pod-time, .pod-rate time and speed
 * Compact variants: the byline player in the article and the mini player.
 * Expanded variants: the episode card (#episode) and the latest episode on
 * the podcast page. Panels: 1px #E6E9EE border, radius 24 (large) or 16 (small). */

/* ── Symbols. Drawn in currentColor; [data-pod-toggle].is-playing swaps them. */
.i-play{display:block;flex:none;width:0;height:0;border-style:solid;border-color:transparent transparent transparent currentColor;border-width:6px 0 6px 10px;margin-left:2px}
.i-pause{display:none;flex:none;gap:3px}
.i-pause i{display:block;width:3px;height:12px;border-radius:1px;background:currentColor}
.is-playing .i-play{display:none}
.is-playing .i-pause{display:flex}

/* ── Buttons */
.pod-btn{font:inherit;height:44px;padding:0 18px 0 6px;border-radius:999px;border:0;cursor:pointer;display:inline-flex;align-items:center;gap:10px;background:#1A56DB;color:#fff;font-size:14px;font-weight:600;line-height:1;white-space:nowrap;transition:background .3s,transform .4s cubic-bezier(.32,.72,0,1)}
.pod-btn:hover{background:#1E429F;color:#fff}
.pod-btn:active{transform:scale(.97)}
.pod-btn-ic{width:32px;height:32px;flex:none;border-radius:50%;background:#fff;color:#1A56DB;display:flex;align-items:center;justify-content:center}
.pod-btn2{position:relative;font:inherit;height:44px;padding:0 18px;border-radius:999px;border:0;cursor:pointer;display:inline-flex;align-items:center;gap:8px;background:#fff;color:#1C2A33;font-size:14px;font-weight:600;line-height:1;white-space:nowrap;text-decoration:none;box-shadow:inset 0 0 0 1px #E6E9EE;transition:background .3s,color .3s}
.pod-btn2:hover,.pod-btn2[aria-expanded="true"]{background:#E6EDFD;color:#1A56DB}
.ins a.pod-btn2,.ins article a.pod-btn2{color:#1C2A33;text-decoration:none}
.ins a.pod-btn2:hover,.ins article a.pod-btn2:hover{color:#1A56DB}
.pod-round{position:relative;flex:none;width:40px;height:40px;padding:0;border-radius:50%;border:0;cursor:pointer;background:#1A56DB;color:#fff;display:flex;align-items:center;justify-content:center;transition:background .3s,transform .4s cubic-bezier(.32,.72,0,1)}
.pod-round:hover{background:#1E429F;color:#fff}
.pod-round:active{transform:scale(.94)}
.pod-round.is-lg{width:48px;height:48px}
.pod-round.is-soft{background:#F5F6FA;color:#1C2A33}
.pod-round.is-soft:hover{background:#E6EDFD;color:#1A56DB}
.pod-rate{position:relative;flex:none;font:inherit;font-size:12px;font-weight:600;line-height:1;height:28px;min-width:40px;padding:0 8px;border-radius:999px;border:0;background:#F5F6FA;color:#1C2A33;cursor:pointer;font-variant-numeric:tabular-nums;transition:background .3s}
.pod-rate:hover{background:#E6EDFD}
.pod-time{flex:none;font-size:13px;line-height:1.2;color:#4B5563;font-variant-numeric:tabular-nums;white-space:nowrap}
/* Small controls get a 44 × 44 px hit area. */
.pod-rate::after,.pm-x::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;min-width:100%;transform:translate(-50%,-50%)}

/* ── Waveform: a slider (click, drag-free, arrow keys). Played bars blue, the
      rest a clear grey, and a playhead once the episode has started. */
.pod-wave{position:relative;flex:1;min-width:0;height:44px;padding:8px 0;display:flex;align-items:center;gap:2px;cursor:pointer;--p:0}
.pod-wave i{flex:1;min-width:1px;border-radius:1px;background:#A3ADBB;transition:height .35s cubic-bezier(.32,.72,0,1),background .4s,transform .35s cubic-bezier(.32,.72,0,1)}
.pod-wave i.done,.pod-wave i.at{background:#1A56DB}
.pod-wave::after{content:"";position:absolute;top:4px;bottom:4px;left:calc(var(--p) * 100%);width:2px;margin-left:-1px;border-radius:1px;background:#1C2A33;opacity:0;transition:opacity .3s}
.pod-wave.is-started::after{opacity:1}
.pod-wave:focus-visible{outline:2px solid #1A56DB;outline-offset:2px;border-radius:6px}

/* ── Floating mini player: once an episode has started and the first screen is scrolled past. */
.pod-mini{position:fixed;left:50%;bottom:20px;z-index:102;width:min(560px,calc(100% - 32px));padding:8px 10px 8px 8px;border-radius:999px;background:rgba(255,255,255,.88);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);box-shadow:0 1px 2px rgba(28,42,51,.06),0 24px 60px -20px rgba(28,42,51,.4);display:flex;align-items:center;gap:12px;overflow:hidden;color:#1C2A33;font-family:Inter,system-ui,sans-serif;line-height:1.4;opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,24px) scale(.96);transition:opacity .45s cubic-bezier(.32,.72,0,1),transform .7s cubic-bezier(.32,.72,0,1),visibility 0s .7s}
.pod-mini.show{opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0);transition:opacity .45s cubic-bezier(.32,.72,0,1),transform .7s cubic-bezier(.32,.72,0,1),visibility 0s}
.pod-mini .pm-cover{width:40px;height:40px;flex:none;border-radius:6px}
.pm-txt{flex:1;min-width:0}
.pm-st{font-size:11px;font-weight:600;color:#1A56DB;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pm-ti{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pm-x{position:relative;flex:none;font:inherit;width:28px;height:28px;border-radius:50%;border:0;background:transparent;color:#65676B;cursor:pointer;font-size:16px;line-height:1}
.pm-x:hover{color:#1C2A33}
.pm-bar{position:absolute;left:0;right:0;bottom:0;height:2px;background:rgba(28,42,51,.06)}
.pm-bar div{height:100%;width:0;background:#1A56DB}
.pod-mini :focus-visible{outline:2px solid #1A56DB;outline-offset:2px}
@media (max-width:400px){.pod-mini .pod-time{display:none}}
/* The page ends above the mini player, never under it. */
body.pod-started .footer{padding-bottom:122px}

/* ── Article: "Listen from m:ss" under an H2. Always below the heading, quiet;
      only the chapter that is playing is highlighted. */
article .h2-row{margin:3.5rem 0 16px}
article .h2-row>h2{margin:0}
@media (max-width:620px){article .h2-row{margin-top:2.5rem}}
.ch-chip{position:relative;width:fit-content;margin:8px 0 0 -8px;font:inherit;height:28px;padding:0 10px 0 8px;border:0;border-radius:999px;display:flex;align-items:center;gap:8px;background:transparent;color:#4B5563;font-size:13px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer;transition:background .3s,color .3s}
.ch-chip .i-play{margin-left:0;color:#1A56DB}
.ch-chip:hover{background:#F5F6FA;color:#1A56DB}
.ch-chip.is-on{background:#E6EDFD;color:#1A56DB}
.ch-chip::after{content:"";position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%)}
.cc-t{font-variant-numeric:tabular-nums}

/* ── Article: "Also a podcast" under the contents */
.ins a.toc-pod{margin-top:22px;padding:12px;border-radius:16px;border:1px solid #E6E9EE;background:#fff;display:flex;gap:10px;align-items:center;color:#1C2A33;text-decoration:none;transition:background .3s,border-color .3s}
.ins a.toc-pod:hover{background:#E6EDFD;border-color:#E6EDFD;color:#1C2A33}
.toc-pod .tp-cover{width:40px;height:40px;flex:none;border-radius:6px}
.tp-txt{min-width:0}
.tp-t{display:block;font-size:13px;line-height:1.4;font-weight:700}
.tp-s{display:block;margin-top:1px;font-size:13px;line-height:1.4;font-weight:600;color:#1A56DB}

/* ── Listen on Apple Podcasts / Spotify: icon buttons with a tooltip (podcast page hero) */
.pod-plats{display:flex;gap:6px;align-items:center}
.pod-plat{position:relative;width:46px;height:46px;flex:none;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(28,42,51,.08),inset 0 0 0 1px #E6E9EE;display:flex;align-items:center;justify-content:center;transition:transform .4s cubic-bezier(.32,.72,0,1)}
.pod-plat:hover{transform:translateY(-2px)}
.pod-plat::after{content:attr(data-tip);position:absolute;left:50%;top:calc(100% + 8px);z-index:2;transform:translate(-50%,-4px);opacity:0;pointer-events:none;padding:5px 10px;border-radius:8px;background:#1C2A33;color:#fff;font-size:11px;line-height:1.4;font-weight:600;white-space:nowrap;transition:opacity .25s ease,transform .4s cubic-bezier(.32,.72,0,1)}
.pod-plat:first-child::after{left:0;transform:translateY(-4px)}
.pod-plat:hover::after,.pod-plat:focus-visible::after{opacity:1;transform:translate(-50%,0)}
.pod-plat:first-child:hover::after,.pod-plat:first-child:focus-visible::after{transform:none}

/* ── Article: episode card (#episode) */
.ep-card{margin:40px 0 0;border:1px solid #E6E9EE;border-radius:24px;background:#fff;overflow:hidden;scroll-margin-top:84px}
.ep-top{padding:24px;display:flex;flex-wrap:wrap;gap:22px;align-items:center}
.ep-card .ep-cover{width:132px;height:132px;flex:none;border-radius:8px}
.ep-intro{flex:1 1 280px;min-width:0}
.ep-k{font-size:11px;line-height:1.4;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#1A56DB}
.ep-k-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.ep-k-row .ep-k{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ep-plats{flex:none;display:flex;gap:4px;margin:-6px -6px -6px 0}
.ep-plat{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background .3s}
.ep-plat:hover{background:#F5F6FA}
.ep-card .ep-t{margin:8px 0 0;font-size:22px;line-height:1.2;letter-spacing:-.02em;font-weight:700;color:#1C2A33}
.ep-card .ep-d{margin:6px 0 0;font-size:14px;line-height:1.55;color:#4B5563}
.ep-acts{margin-top:16px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ep-bar{height:3px;background:#EEF1F6}
.ep-bar div{height:100%;width:0;background:#1A56DB;transition:width .25s linear}
.ep-chs{padding:20px 24px 8px;scroll-margin-top:84px}
.ep-card .ep-h{margin:0;font-size:11px;line-height:1.4;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#65676B}
.ep-card ol.ep-ch{list-style:none;margin:8px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:2px 12px}
.ep-card ol.ep-ch>li{margin:0;padding:0}
.ep-ch button{font:inherit;width:calc(100% + 20px);min-height:44px;margin:0 -10px;padding:8px 10px;border:0;border-radius:10px;display:flex;align-items:center;gap:12px;background:none;color:#1C2A33;text-align:left;cursor:pointer;transition:background .4s ease,color .3s}
.ep-ch button:hover{background:#F5F6FA;color:#1A56DB}
.ep-ch .ts{flex:none;width:40px;font-size:13px;font-weight:600;color:#1A56DB;font-variant-numeric:tabular-nums}
.ep-ch .ct{flex:1;min-width:0;font-size:14px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ep-ch .dot{flex:none;width:6px;height:6px;border-radius:50%;background:transparent;transition:background .4s}
.ep-ch button.is-on{background:#E6EDFD}
.ep-ch .is-on .ct{font-weight:700}
.ep-ch .is-on .dot{background:#1A56DB}
.ep-ch .is-past .dot{background:#B2C6F3}
.ep-tr{margin:12px 24px 0;border-top:1px solid #EEF0F4;scroll-margin-top:84px}
.ep-tr-h{font:inherit;width:100%;min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border:0;background:none;cursor:pointer;color:#1C2A33;font-size:15px;font-weight:700;text-align:left}
.ep-tr-h:hover{color:#1A56DB}
.ep-tr-s{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:#4B5563}
.ep-tr-h .chev{transition:transform .5s cubic-bezier(.32,.72,0,1)}
.ep-tr-h[aria-expanded="true"] .chev{transform:rotate(180deg)}
.ep-tr-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .7s cubic-bezier(.32,.72,0,1)}
.ep-tr-body.is-open{grid-template-rows:1fr}
.ep-tr-in{min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:2px}
.ep-line{font:inherit;margin:0 -12px;padding:10px 12px;border:0;border-radius:12px;display:flex;gap:14px;background:none;text-align:left;cursor:pointer;transition:background .4s}
.ep-line:last-child{margin-bottom:16px}
.ep-line:hover{background:#F5F6FA}
.ep-line.is-on{background:#E6EDFD}
.ep-line .who{flex:none;width:52px;font-size:12px;line-height:1.9;font-weight:700}
.ep-line .who-host{color:#1A56DB}
.ep-line .who-guest{color:#584896}
.ep-line .tx{flex:1;min-width:0;font-size:14px;line-height:1.6;color:#4B5563}
.ep-line.is-on .tx{color:#1C2A33}
.ep-line .ts{flex:none;font-size:12px;line-height:1.9;color:#65676B;font-variant-numeric:tabular-nums}
.ep-card .ep-note{margin:0;padding:12px 24px 18px;font-size:12px;line-height:1.5;color:#65676B;background:#F5F6FA}
@media (max-width:620px){
  .ep-top,.ep-chs{padding-left:18px;padding-right:18px}
  .ep-tr{margin-left:18px;margin-right:18px}
  .ep-card .ep-note{padding-left:18px;padding-right:18px}
  .ep-card .ep-cover{width:96px;height:96px}
  .ep-line{gap:10px}
  .ep-line .who{width:46px}
}

@media (prefers-reduced-motion:reduce){
  .pod-mini,.pod-mini.show{transform:translate(-50%,0);transition:opacity .2s,visibility 0s}
  .pod-btn,.pod-round,.pod-wave i,.ep-tr-body,.ep-tr-h .chev,.ep-bar div,.pod-plat,.pod-plat::after{transition:none}
  .pod-btn:active,.pod-round:active,.pod-plat:hover{transform:none}
}
