/* SgInstagramReels — Instagram's own players (from links) in framed cards on a rail */
.cc_b3eorip4_PnYYBKdlvM .sg-igr__rail {
  --gap: 16px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--igr-per, 4) - 1) * var(--gap)) / var(--igr-per, 4));
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cc_b3eorip4_PnYYBKdlvM .sg-igr__rail::-webkit-scrollbar { display: none; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr__card {
  position: relative;
  height: var(--igr-h, 620px);
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--sg-line);
  border-radius: calc(var(--sg-r-media) + 10px);
  background: #fff;
}
.cc_b3eorip4_PnYYBKdlvM .sg-igr__frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
/* placeholder until Instagram's player is in */
.cc_b3eorip4_PnYYBKdlvM .sg-igr__wait {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  color: var(--sg-ink-3); font-size: 13px;
  background: linear-gradient(100deg, var(--sg-surface-2) 30%, color-mix(in srgb, var(--sg-surface-2) 40%, #fff) 50%, var(--sg-surface-2) 70%) 0 0 / 300% 100%;
  animation: cc_b3eorip4_PnYYBKdlvM_sg-igr-wait 1.4s ease-in-out infinite;
}
.cc_b3eorip4_PnYYBKdlvM .sg-igr__wait svg { color: var(--sg-accent); }
@keyframes cc_b3eorip4_PnYYBKdlvM_sg-igr-wait { from { background-position: 100% 0; } to { background-position: 0 0; } }
.cc_b3eorip4_PnYYBKdlvM .sg-igr__empty { padding: 32px 0; text-align: center; }

@media (max-width: 1023px) {
  .cc_b3eorip4_PnYYBKdlvM .sg-igr__rail { grid-auto-columns: calc((100% - var(--gap)) / 2.2); }
}
@media (max-width: 767px) {
  .cc_b3eorip4_PnYYBKdlvM .sg-igr__rail { --gap: 12px; grid-auto-columns: 78%; }
  .cc_b3eorip4_PnYYBKdlvM .sg-igr__card { height: min(var(--igr-h, 620px), 560px); }
}
@media (prefers-reduced-motion: reduce) { .cc_b3eorip4_PnYYBKdlvM .sg-igr__wait { animation: none; } }

/* video only: the card takes the video's shape; Instagram's player is moved up by its header
   band and made tall enough that its footer (likes, comments, "view more") falls below the card */
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card { height: auto; aspect-ratio: var(--igr-ratio, 81 / 100); }
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__frame {
  position: absolute; left: 0; top: calc(-1 * var(--igr-crop, 54px));
  width: 100%; height: calc(100% + var(--igr-crop, 54px) + 320px);
}
@media (max-width: 767px) {
  .cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card { height: auto; }
}

/* sharper video: the player is opened --igr-k times larger and scaled down into the card
   (Instagram serves the video quality for the player size). The header crop is in player
   pixels, so it is divided by the same factor. */
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__frame {
  top: calc(-1 * var(--igr-crop, 54px) / var(--igr-k, 1));
  width: calc(100% * var(--igr-k, 1));
  height: calc(100% * var(--igr-k, 1) + var(--igr-crop, 54px) + 420px);
  transform: scale(calc(1 / var(--igr-k, 1)));
  transform-origin: 0 0;
}

/* drag shield: covers the player until the card is clicked */
.cc_b3eorip4_PnYYBKdlvM .sg-igr__shield {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; padding: 0; border: 0; background: transparent;
  cursor: grab;
}
.cc_b3eorip4_PnYYBKdlvM .sg-igr__rail.is-dragging .sg-igr__shield, .cc_b3eorip4_PnYYBKdlvM .sg-igr__shield:active { cursor: grabbing; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr__card.is-active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--sg-accent) 45%, transparent); }
.cc_b3eorip4_PnYYBKdlvM .sg-igr__rail { scroll-snap-type: x proximity; }

/* fill: the player is --igr-z wider than the card and centred, so the letterbox bars beside a
   vertical reel are cut off; the card (9:16) then shows the video edge to edge */
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card { aspect-ratio: var(--igr-ratio, 57 / 100); background: #000; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__frame {
  left: calc((1 - var(--igr-z, 1)) / 2 * 100%);
  width: calc(100% * var(--igr-z, 1) * var(--igr-k, 1));
  height: calc(100% * var(--igr-k, 1) + var(--igr-crop, 54px) + 420px);
}

/* the card trims a hair off the bottom (the player height rounds differently per width), so no
   white sliver ever shows under the video — on phones too */
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__frame { margin-bottom: 0; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #000; z-index: 1; pointer-events: none; }
@media (max-width: 767px) { .cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card { aspect-ratio: var(--igr-ratio, 57 / 100); height: auto; } }

/* raw video only: no frame, no fill, no cover strip — just the video with rounded corners.
   The player is over-cropped a few px on every side (zoom / crop / ratio below), so no edge of
   Instagram's box ever shows. */
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card { border: 0; background: transparent; box-shadow: none; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card::after { content: none; }
.cc_b3eorip4_PnYYBKdlvM .sg-igr--video .sg-igr__card.is-active { box-shadow: none; }
