/* Article figures use the width available to them, including editor previews. */
.article-visual { container: article-visual / inline-size; width: 100%; margin: clamp(28px, 5vw, 44px) 0; padding: 0; color: var(--ink); font: 400 16px/1.55 var(--font-body); }
.article-visual *, .article-visual *::before, .article-visual *::after { box-sizing: border-box; }
.article-visual :is(p, h3) { margin: 0; }
.article-visual .av-controls { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.av-controls legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.av-choice { position: relative; display: inline-flex; cursor: pointer; }
.av-choice > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; clip-path: inset(50%); }
.av-choice > span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 14px; border: 1px solid var(--taupe); border-radius: var(--radius-control, 6px); color: var(--steel); font: 500 13px/1.35 var(--font-body); transition: background-color 160ms ease, color 160ms ease, scale 180ms ease; }
.av-choice:has(input:checked) > span { color: var(--bone); background: var(--steel); border-color: var(--steel); }
.av-choice:active > span { scale: .97; transition-duration: 80ms; }
.av-choice input:focus-visible + span { outline: 2px solid var(--steel); outline-offset: 4px; }
@media (hover: hover) { .av-choice:hover > span { border-color: var(--steel); } }

/* A typographic poster is the subject, rather than boxes standing for a layout. */
.av-poster-stage { display: grid; border: 1px solid var(--taupe); border-radius: var(--radius-media, 12px); overflow: hidden; }
.av-poster { display: grid; grid-area: 1 / 1; visibility: hidden; min-height: 490px; padding: clamp(22px, 5cqw, 38px); gap: 18px; background: var(--bone); align-items: start; }
.av-poster--center { visibility: visible; grid-template-columns: 1fr; grid-template-areas: 'image' 'speaker' 'heading' 'description' 'date' 'action'; gap: 10px; text-align: center; }
.av-poster__image { grid-area: image; width: 100%; min-width: 0; overflow: hidden; background: var(--steel); border-radius: 4px; }
.av-letter { display: block; width: 100%; height: 100%; min-height: 150px; max-height: 350px; }
.av-letter__back { fill: var(--bone); }
.av-letter__front { fill: var(--taupe); }
.av-letter__rule { fill: none; stroke: var(--bone); stroke-width: 1; }
.av-poster__speaker { grid-area: speaker; color: var(--steel); font: 400 13px/1.5 var(--font-body); }
.av-poster__heading { grid-area: heading; min-width: 0; font: 700 clamp(26px, 6cqw, 44px)/1.17 var(--font-display); letter-spacing: -.04em; overflow-wrap: normal; }
.av-poster__description { grid-area: description; color: var(--steel); font: 400 14px/1.55 var(--font-body); }
.av-poster__date { grid-area: date; align-self: center; text-align: left; color: var(--steel); font: 400 13px/1.5 var(--font-body); }
.av-poster__action { grid-area: action; justify-self: end; align-self: center; display: inline-flex; align-items: center; gap: 14px; padding: 11px 13px; border-radius: var(--radius-control, 6px); background: var(--steel); color: var(--bone); font: 500 13px/1.3 var(--font-body); white-space: nowrap; }
.av-poster--center .av-poster__image { width: 40%; height: 140px; justify-self: center; }
.av-poster--center .av-poster__heading { max-width: 13ch; justify-self: center; font-size: clamp(26px, 6cqw, 42px); }
.av-poster--center .av-poster__description { max-width: 38ch; justify-self: center; }
.av-poster--center .av-poster__date, .av-poster--center .av-poster__action { justify-self: center; text-align: center; }
.av-poster--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; grid-template-areas: 'speaker image' 'heading image' 'description image' 'date image' 'action image'; }
.av-poster--split .av-poster__image { height: 100%; }
.av-poster--split .av-poster__heading { font-size: clamp(21px, 5cqw, 36px); }
.av-poster--split .av-poster__action { justify-self: start; }
.av-poster--third { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; grid-template-areas: 'image speaker' 'image heading' 'image description' 'image date' 'image action'; }
.av-poster--third .av-poster__image { height: 100%; }
.av-poster--third .av-poster__heading { font-size: clamp(21px, 4.5cqw, 32px); }
.av-poster--third .av-poster__action { justify-self: start; }
.av-poster--free { grid-template-columns: minmax(0, 1fr) 20px minmax(0, .9fr); grid-template-rows: auto auto 1fr auto; grid-template-areas: 'speaker . image' 'heading heading image' 'description . image' 'date . action'; }
.av-poster--free .av-poster__image { height: 88%; align-self: start; }
.av-poster--free .av-poster__heading { font-size: clamp(22px, 5cqw, 38px); }
.av-composition-layout:has(input[value='split']:checked) .av-poster--center,
.av-composition-layout:has(input[value='third']:checked) .av-poster--center,
.av-composition-layout:has(input[value='free']:checked) .av-poster--center { visibility: hidden; }
.av-composition-layout:has(input[value='split']:checked) .av-poster--split,
.av-composition-layout:has(input[value='third']:checked) .av-poster--third,
.av-composition-layout:has(input[value='free']:checked) .av-poster--free { visibility: visible; }
/* A browser fragment makes the three inspection questions visible in context. */
.av-composition-balance > .av-controls { margin-bottom: 8px; }
.av-guide-switch { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; margin: 0 0 14px; color: var(--steel); cursor: pointer; font: 400 13px/1.4 var(--font-body); }
.av-guide-switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--steel); }
.av-guide-switch input:focus-visible { outline: 2px solid var(--steel); outline-offset: 4px; }
.av-browser { overflow: hidden; border: 1px solid var(--taupe); border-radius: var(--radius-media, 12px); }
.av-browser__chrome { display: grid; grid-template-columns: 18px 1fr 18px; align-items: center; gap: 10px; min-height: 40px; padding: 8px 16px; border-bottom: 1px solid var(--taupe); color: var(--steel); font: 400 13px/1.4 var(--font-mono); }
.av-site-sample { --sample-pad: 28px; position: relative; min-height: 350px; padding: var(--sample-pad) var(--sample-pad) 0; }
.av-site-sample__copy { position: relative; width: 58%; z-index: 1; }
.av-site-sample__name { position: relative; display: block; width: fit-content; margin-bottom: 26px; font: 700 clamp(17px, 4cqw, 28px)/1.28 var(--font-display); letter-spacing: -.04em; }
.av-site-sample__name::after { position: absolute; content: ''; height: 7px; left: 0; right: 0; bottom: -8px; border-bottom: 2px solid var(--steel); border-radius: 50%; rotate: -1deg; }
.av-site-sample__group { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; width: fit-content; }
.av-site-sample__group::before { position: absolute; content: ''; left: -12px; top: -5px; bottom: -7px; width: 7px; border: 2px solid var(--steel); border-right: 0; opacity: 0; }
.av-site-sample__roles { color: var(--steel); font: 400 14px/1.6 var(--font-body); }
.av-site-sample__action { display: inline-flex; gap: 14px; padding: 11px 14px; border-radius: var(--radius-control, 6px); background: var(--steel); color: var(--bone); font: 500 13px/1.4 var(--font-body); white-space: nowrap; }
.av-site-portrait-wrap { position: absolute; right: 0; bottom: 0; width: 44%; height: 82%; overflow: hidden; }
.article-visual .av-site-sample__portrait { position: absolute; left: 50%; bottom: 0; display: block; height: 100%; width: auto; max-width: none; margin: 0; transform: translateX(-50%); }
.av-action-mark { display: block; width: min(100%, 150px); height: 65px; margin-top: 8px; opacity: 0; }
.av-action-mark path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.av-site-guides { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; pointer-events: none; }
.av-site-guides i { position: absolute; display: block; background: var(--taupe); }
.av-guide-left, .av-guide-column, .av-guide-right { top: 0; bottom: 0; width: 1px; }
.av-guide-left { left: var(--sample-pad); }
.av-guide-column { left: 56%; }
.av-guide-right { right: var(--sample-pad); }
.av-guide-top, .av-guide-bottom { left: 0; right: 0; height: 1px; }
.av-guide-top { top: var(--sample-pad); }
.av-guide-bottom { bottom: 0; }
.av-composition-balance:has(input[type='checkbox']:checked) .av-site-guides { opacity: 1; }
.av-composition-balance:has(input[value='groups']:checked) .av-site-sample__name::after,
.av-composition-balance:has(input[value='action']:checked) .av-site-sample__name::after { opacity: 0; }
.av-composition-balance:has(input[value='groups']:checked) .av-site-sample__group::before,
.av-composition-balance:has(input[value='action']:checked) .av-action-mark { opacity: 1; }
.av-site-guides, .av-action-mark, .av-site-sample__name::after, .av-site-sample__group::before { transition: opacity 180ms ease; }

@container article-visual (max-width: 460px) {
  .av-poster { min-height: 360px; padding: 18px; gap: 10px; }
  .av-letter { min-height: 0; }
  .av-poster--center .av-poster__image { width: 40%; height: 100px; }
  .av-poster--center .av-poster__heading { font-size: 26px; }
  .av-poster--split { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); column-gap: 14px; }
  .av-poster--split .av-poster__heading { font-size: 21px; }
  .av-poster--split .av-poster__description, .av-poster--third .av-poster__description, .av-poster--free .av-poster__description { font-size: 13px; }
  .av-poster--split .av-poster__action { padding-inline: 9px; gap: 8px; font-size: 13px; }
  .av-poster--third { grid-template-columns: 1fr 1fr; grid-template-areas: 'image image' '. speaker' 'heading heading' 'description description' 'date action'; }
  .av-poster--third .av-poster__image { width: 70%; height: 100px; }
  .av-poster--third .av-poster__heading, .av-poster--third .av-poster__description { width: 80%; justify-self: end; }
  .av-poster--third .av-poster__heading { font-size: 26px; }
  .av-poster--free { grid-template-columns: minmax(0, 1fr) 4px minmax(0, .8fr); column-gap: 10px; }
  .av-poster--free .av-poster__heading { font-size: 21px; }
  .av-poster--free .av-poster__action { padding-inline: 9px; gap: 7px; font-size: 13px; }
  .av-site-sample { --sample-pad: 18px; min-height: 250px; }
  .av-site-portrait-wrap { width: 48%; height: 64%; }
  .av-guide-column { left: 52%; }
  .av-site-sample__roles { font-size: 13px; }
  .av-site-sample__group { gap: 16px; }
  .av-site-sample__action { padding-inline: 10px; gap: 7px; }
  .av-site-sample__name { margin-bottom: 24px; }
  .av-site-sample__group::before { left: -9px; width: 5px; }
  .av-choice > span { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-visual *, .article-visual *::before, .article-visual *::after { animation: none !important; transition: none !important; }
  .av-choice:active > span { scale: none; }
}
