/* ============================================================
 * Omphalos — attachment.css
 *
 * Media surface for attachment pages (templates/attachment.html +
 * partials/attachment-media-*.php). This media renders OUTSIDE
 * `.wp-block-post-content` and as raw markup (wp_get_attachment_image), not
 * parsed core blocks, so neither prose.css (post-content scoped) nor the core
 * block stylesheets (only enqueued for real blocks) constrain it. Without the
 * rule below a full-size `<img width="1024">` renders at its native width and
 * overflows the content column. Enqueued only on is_attachment() (inc/attachment).
 *
 * Token-only values. The container/figure are already width-constrained by the
 * template's constrained layout; this just makes the media fit inside them.
 * ============================================================ */
.ax-attachment-media {
  margin-block: var(--space-lg);
}
/* Center the figure as a UNIT, shrunk to the image (fit-content). Centering the
 * image inside a full-width figure instead would leave the core/image lightbox
 * trigger — positioned relative to the figure — detached from a small (narrower
 * than content) image. With a fit-content figure the trigger lands on the image's
 * own top-right corner. */
.ax-attachment-media__figure,
.ax-attachment-media__cover {
  margin-block: 0;
  margin-inline: auto;
  inline-size: fit-content;
  max-inline-size: 100%;
}

/* Fit the proportional media (image incl. the raw SVG branch; video) to the
 * already content-width figure/wrapper. Audio is deliberately EXCLUDED: it is not
 * a proportional replaced element, so block-size:auto collapses its native
 * controls to 0 height (it disappears). core/audio (the partial always renders it
 * via do_blocks) already widths the player and keeps the controls' native height. */
.ax-attachment-media :is(img, video) {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}
.ax-attachment-media :is(img) {
  border-radius: var(--md-sys-shape-corner-medium);
}
