/* Approved plan-set drawings. Artwork supplies its own line weights and redline. */
.visual-cover,
.visual-band {
  display: block;
  width: 100%;
  margin: 0;
  background: #1D3A57;
}
/* One owner for the cover crop: the D10 image and the D12 inline SVG.
   Covers keep every essential element inside the x 240 to 1080 safe zone. */
.visual-cover > img,
.visual-cover > svg,
svg[data-motion-cover] {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1320 / 500;
  object-fit: cover;
  object-position: center;
  overflow: hidden;
}
/* F4: leaf article pages show a slim band of the cluster cover. */
.visual-band > svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1320 / 200;
  overflow: hidden;
}
.stage-index span.visual-stage-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  flex: none;
  color: #1D3A57;
}
.visual-stage-icon svg,
.visual-stage-head svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.visual-stage-head svg text { font-family: "Saira Condensed", sans-serif; }
.visual-stage-title {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-width: 0;
}
.visual-stage-title h1 { min-width: 0; }
.visual-stage-head {
  display: block;
  width: 64px;
  flex: 0 0 64px;
  color: #E6ECF0;
}
.visual-diagram {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin: 32px 0;
  background: #EEF2F5;
  color: #1D3A57;
  container: visual-diagram / inline-size;
}
.visual-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.visual-diagram svg text { font-family: "Saira Condensed", sans-serif; }
.visual-diagram-narrow { display: none; }
/* The narrow drawing stays readable but never grows into a poster. */
.visual-diagram-narrow svg { max-width: 440px; margin-inline: auto; }
.visual-diagram figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #C9D2D9;
  font-family: "Saira", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #355A7C;
  overflow-wrap: anywhere;
}
/* F4: the drawing's full text, for screen readers only. */
.visual-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  .stage-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* F4: the narrow drawing takes over up to 900 px, so diagram text never
   renders below 13 px. */
@media (max-width: 900px) {
  .visual-diagram-wide { display: none; }
  .visual-diagram-narrow { display: block; }
}
/* Wide drawings whose smallest text needs more room than 900 px gives them.
   Threshold = viewBox width x 13 / smallest font size. */
@container visual-diagram (max-width: 899.98px) {
  .visual-diagram[data-visual="same-machine"] > .visual-diagram-wide { display: none; }
  .visual-diagram[data-visual="same-machine"] > .visual-diagram-narrow { display: block; }
}
@container visual-diagram (max-width: 714.98px) {
  .visual-diagram[data-visual="stamp-sequence"] > .visual-diagram-wide { display: none; }
  .visual-diagram[data-visual="stamp-sequence"] > .visual-diagram-narrow { display: block; }
}
@media (max-width: 559.98px) {
  /* Phones crop covers to the safe zone exactly: 840 x 500 units. */
  .visual-cover > img,
  .visual-cover > svg,
  svg[data-motion-cover] { aspect-ratio: 840 / 500; }
  .visual-band > svg { aspect-ratio: 840 / 200; }
  .visual-stage-title { gap: 14px; }
  .visual-stage-head { width: 48px; flex-basis: 48px; }
  .stage-index { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 359.98px) {
  /* Narrow text is 14 units on a 320-unit drawing: use the full viewport. */
  .visual-diagram {
    width: auto;
    max-width: none;
    margin-inline: -20px;
  }
  .visual-diagram figcaption { padding-inline: 20px; }
}
