/* Click-to-load demo embeds. Pairs with simam-demo-embed.js.
 *
 * Lifted out of the apartment-viewer case studies on 17 Nov 2026 so the
 * sector pages can use the same component instead of a second copy of it.
 * Every custom property has a literal fallback, because these rules now
 * have to work on pages whose stylesheet may not define the editorial
 * palette, and a var() with no fallback resolves to nothing rather than to
 * something sensible.
 *
 * 16/9 on both the poster and the frame so swapping one for the other
 * cannot move the page under the reader's cursor.
 */
.sx-embed {
  position: relative;
  margin: 2rem 0 0;
  border: 1px solid var(--ed-line, #e2ded1);
  border-radius: var(--ed-radius, 6px);
  overflow: hidden;
  background: #0d1014;
}

.sx-embed-start {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  line-height: 0;
}

.sx-embed-start img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* The loop that plays when the reader scrolls to it. It sits ON the
   still rather than replacing it, and only becomes visible once it is
   actually painting, so a refused autoplay or a failed load leaves the
   picture in place instead of a black rectangle. Same box as the poster
   and the frame, so nothing moves under the cursor at any rung. */
.sx-embed-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}

.sx-embed-film[data-playing="1"] { opacity: 1; }

/* THE LARGE ONE. Junaid, 17 Nov: "it'll be like a large screen. It
   won't be a small window." The ordinary embed sits inside the reading
   column at about 1080px; this one gets 1320, the same cap the home
   page bands use, so the widest thing on the site stays one width
   rather than two.

   THE SECTION IS WIDENED, NOT THE FIGURE. The first attempt broke the
   figure out of its column with margin-left:50% and a translate. The
   margin lost to the page's own editorial rules on specificity while
   the translate won, so the band rendered 1320px wide and shifted a
   clean half-width left: measured left:-487 at 1440 and left:-163 at
   390, each exactly minus half the element. Widening the section's own
   wrap needs no transform, no breakout arithmetic, and has nothing to
   lose a specificity fight with.

   overflow-x: clip on the section, not hidden, because hidden on an
   ancestor kills position: sticky everywhere inside it. */
.sx-flagship { overflow-x: clip; }
.sx-flagship .wrap { max-width: 1320px; }
.sx-embed-wide { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  /* Belt and braces: the script does not fetch the film at all under
     this setting, so this only matters if that check ever regresses. */
  .sx-embed-film { display: none; }
}

.sx-embed-play {
  position: absolute;
  inset: auto 0 0 0;
  display: block;
  padding: 3rem 1.15rem 1.05rem;
  text-align: left;
  line-height: 1.4;
  background: linear-gradient(to top, rgba(8, 10, 13, .9), rgba(8, 10, 13, 0));
}

.sx-embed-play b {
  display: inline-block;
  color: #0d1014;
  background: #fff;
  border-radius: 999px;
  padding: .5rem 1.05rem;
  font-size: .95rem;
  font-weight: 650;
  margin-bottom: .5rem;
}

.sx-embed-play span {
  display: block;
  color: rgba(255, 255, 255, .86);
  font-size: .88rem;
  max-width: 56ch;
}

.sx-embed-start:hover b { background: var(--ed-olive, #44562f); color: #fff; }
.sx-embed-start:focus-visible {
  outline: 3px solid var(--ed-olive, #44562f);
  outline-offset: -3px;
}

.sx-embed-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #0d1014;
}

.sx-embed-note {
  font-size: .84rem;
  line-height: 1.6;
  color: var(--ed-faint, #6b6a62);
  padding: .7rem 1.05rem .85rem;
  margin: 0;
  background: var(--ed-card, #fff);
  border-top: 1px solid var(--ed-line, #e2ded1);
}

@media (max-width: 640px) {
  .sx-embed-play { padding: 2.2rem .85rem .8rem; }
  /* Taller on a phone: a 16/9 strip at 375px is 211px and the controls
     inside the demo are built for more room than that. */
  .sx-embed-frame,
  .sx-embed-start img { aspect-ratio: 4 / 3; }
}
