/* The embed frame. Colours come from the viewer's tokens (the theme defines them; the fallbacks are the viewer's
   light values so the shortcode also works in another theme). Rules of docs/wordpress/DESIGN.md: page radius,
   overflow hidden, NO border, the stage gradient as background, 16:9 on desktop and 4:5 on phones. */
.anatomy-embed {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-card, 0.75rem);
  background: linear-gradient(var(--bg-top, #f4f6f8), var(--bg-bottom, #d9e0e7));
}

@media (min-width: 48em) {
  .anatomy-embed {
    aspect-ratio: 16 / 9;
  }
}

.anatomy-embed picture,
.anatomy-embed__poster,
.anatomy-embed iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.anatomy-embed__poster {
  object-fit: cover;
}

/* The same boxes the viewer draws in ui=min, in the same places, so that loading changes nothing but the model. */
.anatomy-embed__name,
.anatomy-embed__size {
  background: var(--panel, rgb(255 255 255 / 0.9));
  border: 1px solid var(--border, rgb(15 23 42 / 0.18));
  backdrop-filter: blur(8px);
}

.anatomy-embed__name {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  max-width: min(22rem, calc(100% - 1.5rem));
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-card, 0.75rem);
  color: var(--text, #0f172a);
  line-height: 1.4;
}

.anatomy-embed__name strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.anatomy-embed__name span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--muted, #475569);
}

.anatomy-embed__load {
  position: absolute;
  inset-block-end: 0.75rem;
  inset-inline-start: 0.75rem;
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  max-width: calc(100% - 1.5rem);
}

.anatomy-embed__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent, #fff);
  background: var(--accent, #1d4ed8);
  border: 1px solid var(--accent, #1d4ed8);
  border-radius: var(--radius-control, 0.5rem);
  cursor: pointer;
}

.anatomy-embed__button:focus-visible {
  outline: 2px solid var(--focus, #1d4ed8);
  outline-offset: 2px;
}

.anatomy-embed__button svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.anatomy-embed__button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.8;
}

.anatomy-embed__size,
.anatomy-embed__noscript {
  margin: 0;
  padding: 0.15rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted, #475569);
  border-radius: var(--radius-chip, 0.4rem);
}

.anatomy-embed__noscript {
  position: absolute;
  inset-block-end: 0.75rem;
  inset-inline: 0.75rem;
  background: var(--panel-solid, #fff);
}

.anatomy-figure {
  margin: 0;
}

.anatomy-credit {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted, #475569);
  overflow-wrap: anywhere;
}

/* The host's answer to anatomy:paywall, under the embed. */
.anatomy-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.85rem;
  color: var(--text, #0f172a);
  background: var(--accent-soft, rgb(29 78 216 / 0.12));
  border-radius: var(--radius-card, 0.75rem);
}

.anatomy-notice a {
  color: var(--accent, #1d4ed8);
  font-weight: 600;
}

.anatomy-notice__close {
  min-height: 2.75rem;
  margin-inline-start: auto;
  padding: 0 0.85rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--border, rgb(15 23 42 / 0.18));
  border-radius: var(--radius-control, 0.5rem);
  cursor: pointer;
}

/* Practice questions. Feedback is a mark and a sentence; the colour only supports them. */
.anatomy-question {
  min-width: 0;
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.anatomy-question legend {
  padding: 0;
  font-weight: 650;
  line-height: 1.4;
}

.anatomy-question__options {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.anatomy-question__options .btn {
  justify-content: flex-start;
  min-height: 2.75rem;
  padding: 0.4rem 0.85rem;
  font-weight: 400;
  text-align: start;
}

.anatomy-question__options .btn:disabled {
  opacity: 1;
  cursor: default;
}

.anatomy-question__options .is-answer {
  border-color: var(--good, #15803d);
  box-shadow: inset 0 0 0 1px var(--good, #15803d);
}

.anatomy-question__options .is-wrong {
  border-style: dashed;
  border-color: var(--bad, #b91c1c);
}

.anatomy-question__feedback {
  min-height: 1.4em;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.anatomy-question__feedback.is-good {
  color: var(--good, #15803d);
}

.anatomy-question__feedback.is-bad {
  color: var(--bad, #b91c1c);
}
