/* A figure in a blog post: after the answer paragraph (hero) or after the first block under an H2 (inline) */
.prose .cf-fig { margin: 28px 0 32px; }
.cf-fig .frame { box-shadow: var(--shadow); }
.cf-fig img { display: block; }
.cf-fig .caption { margin-top: 12px; font-size: .88rem; line-height: 1.5; }
/* A video slot placed in a post: the player's own frame, spaced like a figure */
.prose .cf-media { margin: 28px 0 32px; }
.prose .cf-media .cf-transcript p { margin: 0 0 .8em; }

/* A cover at the top of a card: edge to edge, cropped from the top left like the tour thumbnails */
.card > .cf-cover {
  display: block; margin: -28px -28px 18px; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--cloud); border-bottom: 1px solid var(--slate-200); border-radius: var(--radius) var(--radius) 0 0;
}
.card.blog-card > .cf-cover { margin-bottom: 8px; }
.cf-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .3s ease; }
a.card:hover > .cf-cover img { transform: scale(1.03); }
/* The featured post: the cover beside the text */
.blog-feature > .cf-cover { flex: 0 0 min(36%, 360px); margin: -40px 0 -40px -40px; aspect-ratio: auto; align-self: stretch; border-bottom: 0; border-right: 1px solid var(--blue-100); border-radius: var(--radius) 0 0 var(--radius); }
@media (max-width: 820px) {
  .blog-feature > .cf-cover { flex: none; width: calc(100% + 56px); margin: -28px -28px 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--blue-100); border-radius: var(--radius) var(--radius) 0 0; }
}
@media (prefers-reduced-motion: reduce) { .cf-cover img { transition: none; } }

/* Before and After: two real screens side by side (stacked on phones), each under its label, above the lists */
.cf-ba { margin: 0 0 28px; }
.cf-ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cf-ba-grid > * { min-width: 0; }
.cf-ba-side { margin: 0; }
.cf-ba-label {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: #fff; color: var(--slate); border: 1px solid var(--slate-200);
}
.cf-ba-after .cf-ba-label { background: var(--blue-50); color: var(--blue-text); border-color: var(--blue-100); }
.cf-ba .frame { box-shadow: var(--shadow); }
.cf-ba img { display: block; }
.cf-ba .caption { margin-top: 14px; font-size: .88rem; line-height: 1.5; }
@media (max-width: 640px) { .cf-ba-grid { grid-template-columns: 1fr; gap: 18px; } }

/* Figures inside core-page sections (the manifest's "pages"): one image (a wide and, on phones, a narrow file), a step
   strip or a stepper. Real screens keep the product frame or a hairline frame per step; numbers, labels and captions sit
   outside the screens, visibly separate from the UI. */
.cf-pfig, .cf-steps { margin: 36px auto; text-align: left; }
.cf-pfig { max-width: 820px; }
.cf-pfig .frame { box-shadow: var(--shadow); }
.cf-pfig img { display: block; width: 100%; height: auto; }
.cf-pfig picture { display: block; }
.cf-pfig > .caption, .cf-steps > .caption { margin: 14px auto 0; max-width: 760px; font-size: .88rem; line-height: 1.5; text-align: center; }
.cf-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.cf-step { min-width: 0; margin: 0; }
.cf-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cf-step-n {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-family: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace; font-weight: 600; font-size: .85rem;
  background: #fff; color: var(--blue-text); border: 1px solid var(--blue-100);
}
.cf-step-label { font-weight: 700; color: var(--ink); line-height: 1.3; }
.cf-step-note { margin: 10px 0 0; color: var(--slate); font-size: .9rem; line-height: 1.5; }
.cf-step-shot { display: flex; justify-content: center; align-items: flex-start; }
.cf-step-shot img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 340px;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
/* Strip: two or three steps in a row; four as two rows of two, so each screen stays readable */
.cf-strip { max-width: 1100px; }
@media (min-width: 640px) { .cf-strip .cf-steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 28px; } }
@media (min-width: 1000px) { .cf-strip[data-cf-steps="3"] .cf-steps-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Stepper: one step per row, its number and label beside its screen; stacked on phones */
.cf-stepper { max-width: 1000px; }
.cf-stepper .cf-step + .cf-step { padding-top: 28px; border-top: 1px solid var(--slate-200); }
@media (min-width: 820px) {
  .cf-stepper .cf-step {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
    grid-template-areas: "head shot" "note shot"; column-gap: 32px; align-items: start;
  }
  .cf-stepper .cf-step-head { grid-area: head; margin: 0; }
  .cf-stepper .cf-step-note { grid-area: note; margin-left: 42px; }
  .cf-stepper .cf-step-shot { grid-area: shot; justify-content: flex-start; }
  .cf-stepper .cf-step-shot img { max-height: 320px; }
}
