/* More than one picture or clip in a post (social-carousel.js).
   One picture shows at a time at the post's normal size. Sideways moves through the pictures inside one post; up and down stays with
   the page. The track is a native scroll-snap scroller, so nothing here handles a drag and nothing traps the page's own scroll.
   Tokens only. The two fixed colours are white on the dark count pill, which sits on a photo in every theme. */
.scx { display:block; min-width:0; margin:0; }
/* The width is stated so the height cap cannot narrow the frame through its ratio: on a wide screen the picture is cropped, not shrunk. */
.scx-frame { position:relative; overflow:hidden; width:100%; aspect-ratio:16 / 10; max-height:430px; border-radius:var(--r-md,12px); background:var(--shot-surface-light); }
.scx-track { display:flex; width:100%; height:100%; margin:0; padding:0; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x mandatory; overscroll-behavior-x:contain; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.scx-track::-webkit-scrollbar { display:none; }
.scx-track:focus-visible { outline-offset:-3px; }
.scx-slide { position:relative; flex:0 0 100%; min-width:0; height:100%; overflow:hidden; scroll-snap-align:start; scroll-snap-stop:always; }
.scx-media { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
/* A picture that has not been asked for yet has no source: keep the browser's empty-image mark out of sight. */
.scx-media:not([src]) { visibility:hidden; }

/* The stock label every picture and clip keeps. */
.scx-tag { position:absolute; left:8px; bottom:8px; max-width:calc(100% - 16px); padding:4px 8px; border-radius:var(--r-sm,8px);
  background:var(--shot-surface); color:var(--shot-text-secondary); font-size:var(--fs-caption,12px); line-height:1.3; pointer-events:none; }

/* "2/5", top right. */
.scx-count { position:absolute; top:8px; right:8px; padding:4px 9px; border-radius:var(--r-full,999px); background:rgb(0 0 0 / .72); color:#fff;
  font-size:var(--fs-caption,12px); font-weight:700; line-height:1.3; letter-spacing:.02em; pointer-events:none; }

/* Previous and Next: real buttons, 44px. A swipe does the job on a phone, so they wait out of sight until a keyboard reaches them;
   with a mouse they show on hover or focus. They are not drawn at the first and last picture (the hidden attribute). */
.scx-nav { position:absolute; top:50%; z-index:2; display:grid; place-items:center; width:44px; height:44px; margin:-22px 0 0; padding:0;
  border:1px solid var(--shot-border); border-radius:50%; background:var(--shot-surface); color:var(--shot-text); cursor:pointer;
  opacity:0; pointer-events:none; }
.scx-nav[hidden] { display:none; }
.scx-prev { left:8px; }
.scx-next { right:8px; }
.scx-nav svg { width:20px; height:20px; }
.scx-nav:focus-visible { opacity:1; pointer-events:auto; border-radius:50%; }
@media (hover:hover) {
  .scx:is(:hover,:focus-within) .scx-nav { opacity:1; pointer-events:auto; }
  .scx-nav:hover { background:var(--shot-surface-hover); }
}
@media (prefers-reduced-motion:no-preference) { .scx-nav { transition:opacity .15s ease-out; } }

/* Dots under the picture: at most 10, the current one teal (teal marks what you are watching). */
.scx-dots { display:flex; justify-content:center; gap:5px; padding:8px 0 2px; }
.scx-dots i { flex:0 0 auto; width:6px; height:6px; border-radius:50%; background:var(--shot-control-off); }
.scx-dots i.is-on { background:var(--status-upcoming-text); }

/* A clip inside the set: a still and a play button until the person presses play. */
.scx-clip { position:absolute; inset:0; }
.scx-clip video { opacity:0; pointer-events:none; }
.scx-clip[data-ready] video { opacity:1; pointer-events:auto; }
.scx-clip[data-ready] :is(img,.scx-play) { display:none; }
.scx-play { position:absolute; inset:0; z-index:1; display:grid; place-items:center; width:100%; margin:0; padding:0; border:0; background:transparent;
  color:var(--shot-text); cursor:pointer; }
.scx-play span { display:grid; place-items:center; width:56px; height:56px; padding-left:3px; border:1px solid var(--shot-border); border-radius:50%;
  background:var(--shot-surface); }
.scx-play svg { width:24px; height:24px; }
.scx-play:focus-visible { outline-offset:-3px; }
.scx-status:empty { display:none; }
.scx-status { position:absolute; z-index:1; inset:auto 8px 40px; margin:0; padding:6px 8px; border-radius:var(--r-sm,8px); background:var(--shot-surface);
  color:var(--shot-text); font-size:var(--fs-caption,12px); }
.scx-credit { color:var(--shot-text-secondary); font-size:var(--fs-caption,12px); }

/* In the feed on a phone: edge to edge and 4:5, the same as a single clip there. */
@media (max-width:767px) {
  :is([data-sc-feed],.sc-river) > .sc-post .scx { margin-inline:calc(-1 * var(--s3,12px)); }
  :is([data-sc-feed],.sc-river) > .sc-post .scx-frame { aspect-ratio:4 / 5; max-height:none; border-radius:0; }
  :is([data-sc-feed],.sc-river) > .sc-post .scx-credit { margin-inline:var(--s3,12px); }
}

/* Inside a Shot: the set fills the Shot's stage and is shown whole. Sideways belongs to the pictures. The track hands up and down back
   to the Shot (no pan-y), so a vertical swipe that starts on a picture still changes Shot. */
.scx--fill { position:absolute; inset:0; }
.scx--fill .scx-frame { height:100%; max-height:none; aspect-ratio:auto; border-radius:0; background:transparent; }
.scx--fill .scx-track { touch-action:pan-x pinch-zoom; }
.scx--fill .scx-media { object-fit:contain; }
.scx--fill .scx-dots { position:absolute; left:0; right:0; bottom:8px; padding:0; pointer-events:none; }
.scx--fill .scx-tag { bottom:22px; }

/* Profile grid: the stack mark on a tile whose post holds more than one. It takes the place of the play mark. */
.scx-stack svg { width:14px; height:14px; }

/* Composer: "Pictures and video". A chooser with Add, then small tiles in order. */
.scx-field { display:grid; gap:var(--s2,8px); min-width:0; }
.scx-field-add { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--s2,8px); align-items:end; }
.scx-field-add .w-field-group { min-width:0; margin-bottom:0; }
.scx-field .scx-field-note { margin:0; }
.scx-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:var(--s2,8px); margin:0; padding:0; list-style:none; }
.scx-tiles[hidden] { display:none; }
.scx-tile { position:relative; aspect-ratio:1; overflow:hidden; border-radius:var(--r-md,12px); background:var(--shot-surface-light); }
.scx-tile img { display:block; width:100%; height:100%; object-fit:cover; }
.scx-tile-n { position:absolute; top:8px; left:8px; display:grid; place-items:center; min-width:24px; height:24px; padding:0 6px; border-radius:var(--r-full,999px);
  background:var(--shot-surface); color:var(--shot-text); font-size:var(--fs-caption,12px); font-weight:700; }
.scx-tile-clip { position:absolute; top:50%; left:50%; display:grid; place-items:center; width:24px; height:24px; margin:-12px 0 0 -12px; border-radius:50%;
  background:var(--shot-surface); color:var(--shot-text); pointer-events:none; }
.scx-tile-clip svg { width:12px; height:12px; }
/* Each tile button is a 44px target with a smaller round face. */
.scx-tile .scx-tile-btn { position:absolute; display:grid; place-items:center; justify-self:auto; width:44px; height:44px; min-height:44px; margin:0; padding:0; border:0;
  border-radius:50%; background:transparent; color:var(--shot-text); cursor:pointer; }
.scx-tile-btn span { display:grid; place-items:center; width:30px; height:30px; border:1px solid var(--shot-border); border-radius:50%; background:var(--shot-surface); }
.scx-tile-btn svg { width:16px; height:16px; }
.scx-tile-btn:focus-visible { outline-offset:-4px; border-radius:50%; }
.scx-tile-btn[disabled] { cursor:default; }
.scx-tile-btn[disabled] span { color:var(--shot-text-disabled); }
.scx-tile-x { top:0; right:0; }
.scx-tile-l { bottom:0; left:0; }
.scx-tile-r { bottom:0; right:0; }
@media (hover:hover) { .scx-tile-btn:not([disabled]):hover span { background:var(--shot-surface-hover); } }
