/* Click-to-load Figma embed facade. See js/figma-embeds.js. */
.figma-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #F5F5F5;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.figma-embed.is-square { aspect-ratio: 1 / 1; }
.figma-embed.is-fixed-height { aspect-ratio: auto; height: 450px; }

/* "[logo] Load Figma" pill, pinned bottom-right over the poster. Once loaded,
   the live embed has its own "open in Figma" control. Scoped under
   .figma-embed so it beats the site's rich-text link/button styles. */
.figma-embed .figma-embed__load {
  appearance: none;
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #222;
  background: #fff;
  color: #222;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-style: normal;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.figma-embed .figma-embed__load:hover,
.figma-embed .figma-embed__load:focus-visible {
  background: #222;
  color: #fff;
  font-style: normal;
}
.figma-embed__logo {
  display: inline-block;
  height: 0.9em;
  width: auto;
  flex: none;
  vertical-align: middle;
}

/* Static screenshot behind the button; clicking it also loads the embed.
   "scale-down" shows the whole frame, matching how the live embed zooms to
   fit, and never upscales past the source resolution. */
.figma-embed__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  padding: 1rem;
  box-sizing: border-box;
  cursor: pointer;
  transition: filter 0.2s, opacity 0.2s;
}
.figma-embed.has-poster:hover .figma-embed__poster { filter: brightness(0.94); }

/* Phones: the site bumps its base font size up, so shrink the pill to keep
   the screenshot visible behind it. */
@media (max-width: 767px) {
  .figma-embed .figma-embed__load {
    right: 0.5rem;
    bottom: 0.5rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
    gap: 0.4rem;
  }
}

.figma-embed iframe {
  z-index: 3;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #F5F5F5;
}
.figma-embed.is-loaded .figma-embed__poster { opacity: 0; }
.figma-embed.is-loaded .figma-embed__load { visibility: hidden; }
