/* Continue Watching row — measured from Figma node 2060:1829 (row) and
   2049:3554 / 2060:2081 (overflow menu, default + hover state). All lengths
   are literal Figma px on a 995-wide row; the composer scales the document. */

@font-face {
  font-family: "Inter";
  src: url("assets/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --on-surface: #121212;
  --on-surface-variant: #52525c;
  --surface-bright: #ffffff;
  --track: #e0e0e3;
  --primary: #05a55d;
  --hairline: rgba(9, 9, 11, 0.1);
  --state-layer: rgba(18, 18, 18, 0.08);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);

  --row-width: 995px;
  --item-width: 227.481px;
  --item-gap: 14.535px;
  --thumb-height: 127.865px;
  --thumb-radius: 11.894px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f6f6f7;
  color: var(--on-surface);
  font-family: "Inter", system-ui, sans-serif;
  font-feature-settings: "ss01" 1, "ss07" 1;
  -webkit-font-smoothing: antialiased;
}

.demo-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

/* ------------------------------------------------------------------ section */

.cw {
  position: relative;
  width: var(--row-width);
}

.cw__heading {
  display: flex;
  align-items: center;
  gap: 14.535px;
  padding: 19.38px 0 26.38px;
}

.cw__title {
  flex: 1 0 0;
  min-width: 0;
  margin: 0;
  font-size: 22.82px;
  line-height: 32.71px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw__trailing {
  display: grid;
  place-items: center;
  width: 29.07px;
  height: 29.07px;
}

.cw__chevron {
  width: 24.226px;
  height: 24.226px;
  transform: rotate(180deg); /* Figma glyph is chevron-left, rotated 180° */
}

/* ----------------------------------------------------------------- carousel */

.carousel {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
  /* room for the menu button's state layer without clipping */
  padding-bottom: 2px;
}

.carousel.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: var(--item-gap);
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------- item */

.item {
  display: flex;
  flex-direction: column;
  gap: 11.894px;
  width: var(--item-width);
  flex-shrink: 0;
  min-width: 0;
}

/* Removal: the item fades, then its width and trailing gap collapse so the
   following items slide left into the space (flex does the shifting). */
.item.is-removing {
  overflow: hidden;
  opacity: 0;
  width: 0;
  margin-right: calc(-1 * var(--item-gap));
  transition:
    opacity 160ms var(--ease-std),
    width 320ms var(--ease-std) 80ms,
    margin-right 320ms var(--ease-std) 80ms;
}

.item.is-removing .thumb,
.item.is-removing .meta,
.item.is-entering .thumb,
.item.is-entering .meta {
  width: var(--item-width); /* keep content from reflowing while collapsing */
}

/* Re-entry (5s after removal): the slot opens first so the neighbours shift
   right, then the content slides in from the left of its old position. */
.item.is-entering {
  overflow: hidden;
  transition:
    width 320ms var(--ease-std),
    margin-right 320ms var(--ease-std);
}

.item.is-entering .thumb,
.item.is-entering .meta {
  transition:
    transform 360ms var(--ease-std) 120ms,
    opacity 240ms var(--ease-std) 160ms;
}

.item.is-entering.is-collapsed {
  width: 0;
  margin-right: calc(-1 * var(--item-gap));
}

.item.is-entering.is-collapsed .thumb,
.item.is-entering.is-collapsed .meta {
  transform: translateX(-48px);
  opacity: 0;
}

.thumb {
  position: relative;
  width: var(--item-width);
  height: var(--thumb-height);
  border-radius: var(--thumb-radius);
  overflow: hidden;
  background: #1e1e1f;
}

/* Figma's 1.487 inside stroke — drawn as an overlay so it paints ABOVE the
   absolutely positioned image (an inset box-shadow on .thumb would be hidden
   under it). One hairline only; the image itself stays borderless. */
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.487px var(--hairline);
  pointer-events: none;
}

.thumb__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.thumb__scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 63.143px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.thumb__tag {
  position: absolute;
  left: 11.894px;
  bottom: 14.87px;
  font-size: 16.355px;
  line-height: 23.789px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5.947px;
  background: var(--track);
  overflow: hidden;
}

.progress__fill {
  display: block;
  height: 100%;
  width: calc(var(--progress, 0) * 100%);
  border-radius: 0 1485px 1485px 0;
  background: var(--primary);
}

.meta {
  display: flex;
  align-items: flex-start;
  gap: 5.947px;
  width: 100%;
}

.meta__text {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2.974px;
}

.meta__title,
.meta__subtitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta__title {
  font-size: 20.815px;
  line-height: 32.71px;
  font-weight: 500;
}

.meta__subtitle {
  font-size: 17.842px;
  line-height: 29.736px;
  font-weight: 400;
  color: var(--on-surface-variant);
}

/* ------------------------------------------------------------- menu button */

.menu-button {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 35.683px;
  height: 35.683px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8.921px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-button img {
  width: 23.789px;
  height: 23.789px;
  pointer-events: none;
}

.menu-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--state-layer);
  opacity: 0;
  transition: opacity 160ms var(--ease-std);
}

.menu-button:hover::after,
.menu-button:focus-visible::after,
.menu-button[aria-expanded="true"]::after {
  opacity: 1;
}

.menu-button:focus-visible {
  outline: none;
}

/* ------------------------------------------------------------ overflow menu */

.menu {
  position: absolute;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 243.467px;
  padding: 9.69px;
  border-radius: 9.69px;
  background: var(--surface-bright);
  filter: drop-shadow(0 4.845px 4.845px rgba(0, 0, 0, 0.16));
  transform-origin: var(--origin-x, 0) var(--origin-y, top);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity 120ms var(--ease-std),
    transform 120ms var(--ease-std);
}

.menu[data-place="above"] {
  transform: translateY(4px) scale(0.98);
}

.menu.is-open {
  opacity: 1;
  transform: none;
  transition:
    opacity 160ms var(--ease-std),
    transform 200ms var(--ease-std);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 14.535px;
  width: 100%;
  margin: 0;
  padding: 14.535px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--on-surface);
  font: inherit;
  font-size: 15.747px;
  line-height: 24.226px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 120ms var(--ease-std);
}

.menu__item img {
  flex-shrink: 0;
  width: 24.226px;
  height: 24.226px;
  pointer-events: none;
}

.menu__item span {
  flex: 1 0 0;
  min-width: 0;
}

/* Figma 2060:2081 — hovered/pressed item */
.menu__item:hover,
.menu__item:active,
.menu__item:focus-visible {
  background: var(--state-layer);
  outline: none;
}
