/* Figure hover and lightbox treatment inspired by yuci-gpt.github.io/SplitMoE/. */
html.figure-lightbox-open { overflow: hidden; padding-right: var(--figure-scrollbar-gap, 0px); }

.figure-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  line-height: 0;
  cursor: zoom-in;
}
.figure-open {
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.figure-open img {
  cursor: zoom-in;
}
.figure-open:focus-visible { outline: 3px solid #7c9bd5; outline-offset: 5px; }
.intro-demo-media > .figure-open, .cmr-observed-slot > .figure-open { height: 100%; border-radius: inherit; }
.intro-demo-media > .figure-open > img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.cmr-preview-frame > .figure-open { height: 100%; }
@media (hover: hover) and (pointer: fine) {
  .figure-open:hover { transform: scale(1.02); }
}

.figure-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 72px 32px 32px;
  border: 0;
  background: transparent;
  color: #e4e9f3;
  overflow: auto;
  overscroll-behavior: contain;
}
.figure-lightbox[open] { display: flex; }
.figure-lightbox::backdrop {
  background: rgba(8, 12, 22, .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.figure-lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 1400px;
  margin: auto;
}
.figure-lightbox[open] .figure-lightbox-content {
  animation: figure-lightbox-enter .24s cubic-bezier(.2, .7, .3, 1);
}
.figure-lightbox-media { max-width: 100%; line-height: 0; }
.figure-lightbox-media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  max-height: calc(100dvh - 190px);
  object-fit: contain;
  margin: auto;
  border-radius: 10px;
  background: transparent;
}
.figure-lightbox-caption {
  width: 100%;
  max-width: 1100px;
  margin: 0;
  color: #e4e9f3;
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
}
.figure-lightbox-caption a { color: #8ac9f4; }
.figure-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 30px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.figure-lightbox-close:hover { background: rgba(255, 255, 255, .16); border-color: #65c1b9; }
@keyframes figure-lightbox-enter {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  .figure-lightbox { padding: 68px 16px 24px; }
  .figure-lightbox-content { gap: 14px; }
  .figure-lightbox-caption { font-size: 16px; line-height: 1.6; }
  .figure-lightbox-close { top: 12px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .figure-open { transition: none; }
  .figure-open:hover { transform: none; }
  .figure-lightbox[open] .figure-lightbox-content { animation: none; }
}
@media print {
  .figure-lightbox { display: none !important; }
  html.figure-lightbox-open { overflow: visible; padding-right: 0; }
}
