/* Fans254 V1114 — restore ordinary Feed margins while retaining a fully
 * scrollable sponsored rail, use real ad video aspect, and fix both-theme palette.
 * Scoped: sponsored feed media + valid CTA + atomic theme switch only. */

/* The V1112 negative margin and fixed left padding shifted images against the
 * phone edge. A flex leading spacer scrolls WITH the photos. At scrollLeft=0,
 * slide one starts at exactly the same inset as the caption/CTA. Later, earlier
 * slides can travel all the way to the card edge, with no phantom left mask. */
.social-shell .social-post.f830-sponsored:not(.social-reel-post) > .social-post-media.f830-ad-media.f830-ad-carousel {
  position:relative!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-flow:row nowrap!important;
  justify-content:flex-start!important;
  align-items:flex-start!important;
  gap:var(--f1105-ad-gap,6px)!important;
  width:100%!important;
  max-width:100%!important;
  margin:7px 0 5px 0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  -webkit-mask:none!important;
  mask:none!important;
  clip-path:none!important;
  -webkit-clip-path:none!important;
  scroll-padding-inline-start:0!important;
  scroll-snap-type:x proximity!important;
  overscroll-behavior-x:contain!important;
  touch-action:pan-x pan-y!important;
}
.social-shell .social-post.f830-sponsored:not(.social-reel-post) > .social-post-media.f830-ad-media.f830-ad-carousel::before {
  content:"";
  display:block;
  align-self:stretch;
  flex:0 0 max(0px,calc(var(--f1105-ad-inset,54px) - var(--f1105-ad-gap,6px)));
  width:max(0px,calc(var(--f1105-ad-inset,54px) - var(--f1105-ad-gap,6px)));
  height:1px;
  pointer-events:none;
  scroll-snap-align:start!important;
}
.social-shell .social-post.f830-sponsored:not(.social-reel-post) > .social-post-media.f830-ad-media.f830-ad-carousel > :is(img,video){
  scroll-snap-align:start!important;
  scroll-snap-stop:normal!important;
}
/* Non-carousel video cards are limited by the existing admin cap. Portrait
 * source videos too tall for the cap retain CONTAIN, but their containing box
 * adopts their actual ratio instead of painting unnecessary black side bars.
 * A landscape/short video keeps its existing cover geometry. No crop modes or
 * source URLs of normal feeds, sponsored native posts, and Reels are changed. */
.social-shell .social-post.f832-new-sponsored:not(.social-reel-post) > .social-post-media.f842-ad-video-stage.f837-limited-media[data-f1114-over-cap="1"] {
  box-sizing:border-box!important;
  width:min(calc(100% - var(--f1105-ad-inset,54px)),var(--f1114-portrait-width,100%))!important;
  max-width:calc(100% - var(--f1105-ad-inset,54px))!important;
  height:var(--f1114-video-cap,450px)!important;
  max-height:var(--f1114-video-cap,450px)!important;
  margin-left:var(--f1105-ad-inset,54px)!important;
  aspect-ratio:auto!important;
  background:transparent!important;
}
.social-shell .social-post.f832-new-sponsored:not(.social-reel-post) > .social-post-media.f842-ad-video-stage.f837-limited-media[data-f1114-over-cap="1"] > video[data-f1114-ad-video]{
  display:block!important;width:100%!important;height:100%!important;
  max-width:100%!important;max-height:100%!important;
  object-fit:contain!important;object-position:center!important;
  background:transparent!important;
}
.social-shell .social-post.f832-new-sponsored:not(.social-reel-post) > .social-post-media.f842-ad-video-stage.f837-limited-media[data-f1114-over-cap="0"] > video[data-f1114-ad-video]{
  object-fit:cover!important;
}

/* Palette is sourced from media/server, not the theme. Both themes must use
 * identical CTA foreground/contrast, including formerly neutral surface CTAs.
 * Plain website links and ads without a destination are not converted. */
html[data-theme="light"] .social-shell .social-post.f826-sponsored:not(.social-reel-post) [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="dark"] .social-shell .social-post.f826-sponsored:not(.social-reel-post) [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="light"] .social-shell .f826-ad-reel-panel [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="dark"] .social-shell .f826-ad-reel-panel [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="light"] .ad20-page [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="dark"] .ad20-page [data-ad-cta][data-f1114-palette-ready].is-ad-vivid:not(.f837-website-link),
html[data-theme="light"] .social-shell [data-organic-promotion-cta][data-f1114-palette-ready].is-ad-vivid,
html[data-theme="dark"] .social-shell [data-organic-promotion-cta][data-f1114-palette-ready].is-ad-vivid {
  background:var(--ad-palette,var(--ad-cta-palette,#1769e8))!important;
  background-image:none!important;
  border-color:var(--ad-palette,var(--ad-cta-palette,#1769e8))!important;
  color:var(--ad-palette-text,#fff)!important;
  transition:background-color .55s ease,color .55s ease,border-color .55s ease!important;
}
/* Preserve generated Reel/story image colors equally in both visual themes. */
html[data-theme="light"] .social-shell .social-reel-watch .social-reel-media.f1107-contain-palette,
html[data-theme="dark"] .social-shell .social-reel-watch .social-reel-media.f1107-contain-palette{
  background-color:#08090c!important;
  background-image:linear-gradient(90deg,#000c 0%,#0006 33%,#0006 67%,#000c 100%),radial-gradient(ellipse at center,var(--f1107-reel-color,#252932) 0%,#08090c 95%)!important;
}
/* V1117: cancel CSS color, shadow, layout and border transitions only while
 * the root theme swaps. The root and all descendants resolve the new palette
 * in one style calculation, with no view-transition snapshot overlay. The
 * class is released after two paint frames; ordinary UI effects are retained. */
html.f1117-theme-atomic,
html.f1117-theme-atomic *,
html.f1117-theme-atomic *::before,
html.f1117-theme-atomic *::after {
  transition-property:none!important;
  transition-duration:0s!important;
  transition-delay:0s!important;
}
