/* The article header video (site/assets/video.js): plays muted behind the headline, then moves to
   the bottom-left corner as a player that can be dragged, resized, shrunk to a circle or closed. */

.cxo-player .cxo-video-frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0; transition: opacity .5s; }
.cxo-player.cxo-ready .cxo-video-frame { opacity: 1; }
/* faded out while the muted clip jumps back to its start, hiding YouTube's pause icon (video.js) */
.cxo-player.cxo-ready.cxo-hold .cxo-video-frame { opacity: 0; transition: opacity .25s; }
.cxo-player .cxo-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.cxo-player.cxo-docked .cxo-video-frame,
.cxo-player.cxo-bubble .cxo-video-frame,
.cxo-player.cxo-preview .cxo-video-frame { pointer-events: none; }
.cxo-player .cxo-ui { display: none; }
/* the theme's loading spinner sits over the middle of the video and would swallow clicks (pause, play) */
.cxo-player .cs-video-loader { pointer-events: none; }
.cxo-player.cxo-ready .cs-video-loader { display: none; }
/* the page's lazy-load rule `div:not(.e-lazyloaded) svg { opacity: 0 }` would hide the player's icons (▶, ×) */
.cxo-player.cxo-player svg, .cxo-ibtn.cxo-ibtn svg { opacity: 1; }

/* while it floats the header is off screen; drop the header's stacking level so the player sits above the article */
html.cxo-video-out .cs-entry__header-inner { z-index: auto; }
body:has(.cxo-player.cxo-touching) { user-select: none; -webkit-user-select: none; }

.cxo-player.cxo-floating,
.cxo-player.cxo-bubble { position: fixed; top: auto; right: auto; z-index: 60; background: #000; box-shadow: 0 18px 50px rgb(0 0 0 / .35); }
.cxo-player.cxo-floating { border-radius: 8px; animation: cxo-in .3s cubic-bezier(.2, .8, .2, 1); }
.cxo-player.cxo-floating .cxo-ui { display: block; }
@keyframes cxo-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

/* top bar: drag the player by it; × on the right */
.cxo-topbar { position: absolute; top: 0; left: 0; right: 22px; height: 40px; z-index: 3; display: flex; align-items: center; padding: 0 6px 0 10px;
  background: linear-gradient(180deg, rgb(0 0 0 / .7), transparent); cursor: grab; opacity: 0; transition: opacity .2s; touch-action: none; }
.cxo-player.cxo-floating:hover .cxo-topbar,
.cxo-player.cxo-floating.cxo-touching .cxo-topbar,
.cxo-player.cxo-floating.cxo-preview .cxo-topbar { opacity: 1; }
.cxo-topbar:active { cursor: grabbing; }
.cxo-grip { display: flex; gap: 3px; opacity: .8; flex: none; }
.cxo-grip i { width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.cxo-title { flex: 1; min-width: 0; margin: 0 10px; color: #fff; font-family: var(--cs-font-secondary-family), sans-serif; font-size: 12px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cxo-ibtn { width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cxo-ibtn:hover, .cxo-ibtn:focus-visible { background: rgb(0 0 0 / .9); }
.cxo-ibtn svg { display: block; }

/* muted preview: the whole card drags, with a play button in the middle */
.cxo-cover { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; cursor: grab; touch-action: none; }
.cxo-player.cxo-floating.cxo-preview .cxo-cover { display: grid; }
.cxo-playbtn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .95); color: #111; padding: 9px 16px 9px 10px; cursor: pointer;
  font-family: var(--cs-font-secondary-family), sans-serif; font-size: 13px; font-weight: 700; line-height: 1; box-shadow: 0 6px 20px rgb(0 0 0 / .3); }
.cxo-playbtn:hover, .cxo-playbtn:focus { background: #fff; color: #111; }
.cxo-playbtn span { width: 26px; height: 26px; border-radius: 50%; background: #111; display: grid; place-items: center; }
.cxo-muted-tag { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: none; padding: 4px 8px; border-radius: 99px; background: rgb(0 0 0 / .55); color: #fff;
  font-family: var(--cs-font-secondary-family), sans-serif; font-size: 11px; font-weight: 600; line-height: 1.2; pointer-events: none; }
.cxo-player.cxo-floating.cxo-preview .cxo-muted-tag { display: block; }

.cxo-soundbtn { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 3; display: none; border: 0; border-radius: 999px; background: #fff; color: #111; cursor: pointer;
  padding: 8px 14px; font-family: var(--cs-font-secondary-family), sans-serif; font-size: 12px; font-weight: 700; line-height: 1; box-shadow: 0 6px 20px rgb(0 0 0 / .3); }
.cxo-player.cxo-floating.cxo-needs-sound .cxo-soundbtn { display: block; }
.cxo-soundbtn:hover, .cxo-soundbtn:focus { background: #fff; color: #111; }

/* resize from the top-right corner (the player is anchored bottom-left) */
.cxo-resize { position: absolute; top: 0; right: 0; width: 22px; height: 22px; z-index: 4; cursor: nesw-resize; touch-action: none; opacity: 0; transition: opacity .2s; }
.cxo-resize::after { content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-top: 2px solid #fff; border-right: 2px solid #fff; }
.cxo-player.cxo-floating:hover .cxo-resize,
.cxo-player.cxo-floating.cxo-touching .cxo-resize { opacity: 1; }
@media (hover: none) { .cxo-player.cxo-floating .cxo-topbar, .cxo-player.cxo-floating .cxo-resize { opacity: 1; } }

/* circle: × on the player keeps the video playing in a circle; tap it to open the player again */
.cxo-player.cxo-bubble { border-radius: 50%; border: 3px solid #fff; cursor: pointer; animation: cxo-in .3s ease; touch-action: none; }
.cxo-player.cxo-bubble::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px #111; pointer-events: none; }
.cxo-bubble-x { position: fixed; z-index: 61; display: none; width: 26px; height: 26px; }
.cxo-bubble-x.cxo-on { display: grid; }

/* ▶ in the header: the whole video in a large popup, with the Key takeaway and the article's sections beside it */
html.cxo-pop-open, html.cxo-pop-open body { overflow: hidden; }
.cxo-pop { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; font-family: var(--cs-font-secondary-family), sans-serif; }
.cxo-pop-scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .82); animation: cxo-fade .25s ease; }
.cxo-pop-box { position: relative; width: min(1240px, 100%); max-height: calc(100vh - 32px); display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  background: #141416; color: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 90px rgb(0 0 0 / .5); animation: cxo-pop .3s ease; }
@media (min-width: 901px) { .cxo-pop-box > .cxo-pop-video { box-shadow: 0 0 0 100vmax #000; clip-path: inset(-100vmax 0); } } /* black above and below the video in its column */
.cxo-pop-video { position: relative; aspect-ratio: 16 / 9; background: #000; align-self: center; width: 100%; max-height: calc(100vh - 32px); }
.cxo-pop-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cxo-pop-side { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; overflow: auto; min-height: 0; max-height: calc(100vh - 32px); }
.cxo-pop .cxo-pop-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cxo-pop .cxo-pop-x:hover, .cxo-pop .cxo-pop-x:focus-visible { background: rgb(255 255 255 / .25); color: #fff; }
.cxo-pop .cxo-pop-x svg { opacity: 1; }
.cxo-pop-panel { display: contents; } /* its items are spaced by the panel's flex gap */
.cxo-pop .cxo-pop-kicker { margin: 0; padding-right: 48px; color: #ff5470; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cxo-pop .cxo-pop-title { margin: 0; padding-right: 32px; color: #fff; font-family: var(--cs-font-primary-family, inherit), sans-serif; font-size: 18px; font-weight: 700; line-height: 1.3; }
.cxo-pop .cxo-pop-text { margin: 0; color: #c8c8c8; font-size: 13px; line-height: 1.6; }
.cxo-pop .cxo-pop-label { margin: 4px 0 0; color: #888; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cxo-pop .cxo-pop-sections { margin: 0; padding: 0; list-style: none; border-top: 1px solid #2a2a2e; font-size: 13px; line-height: 1.4; }
.cxo-pop .cxo-pop-sections li { margin: 0; border-bottom: 1px solid #2a2a2e; }
.cxo-pop .cxo-pop-sections a { display: flex; gap: 10px; padding: 10px 0; color: #ddd; text-decoration: none; }
.cxo-pop .cxo-pop-sections a:hover, .cxo-pop .cxo-pop-sections a:focus-visible { color: #fff; text-decoration: underline; }
.cxo-pop .cxo-pop-sections span { width: 28px; flex: none; color: #888; font-variant-numeric: tabular-nums; }
.cxo-pop .cxo-pop-read { display: inline-block; text-decoration: none; margin-top: auto; align-self: flex-start; border: 0; border-radius: 999px; padding: 11px 18px; background: #e4002b; color: #fff;
  font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: normal; text-transform: none; cursor: pointer; }
.cxo-pop .cxo-pop-read:hover, .cxo-pop .cxo-pop-read:focus-visible { background: #c00025; color: #fff; }
@keyframes cxo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cxo-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .cxo-pop { padding: 12px; }
  .cxo-pop-box { grid-template-columns: 1fr; overflow: auto; max-height: calc(100vh - 24px); padding-top: 52px; }
  .cxo-pop-side { position: static; overflow: visible; max-height: none; padding: 18px; }
  .cxo-pop .cxo-pop-x { top: 6px; right: 6px; }  /* in a bar above the video, clear of YouTube's own buttons */
}

@media (prefers-reduced-motion: reduce) {
  .cxo-player.cxo-floating, .cxo-player.cxo-bubble, .cxo-pop-scrim, .cxo-pop-box { animation: none; }
}

@media (max-width: 480px) {
  .cxo-playbtn { padding: 6px 11px 6px 6px; font-size: 11px; gap: 6px; }
  .cxo-playbtn span { width: 20px; height: 20px; }
  .cxo-muted-tag { display: none !important; }
  .cxo-topbar { height: 34px; }
  .cxo-title { display: none; }
  .cxo-topbar { justify-content: space-between; }
}
