/* ==========================================================================
   Media blocks from the visual article editor (images + videos with size,
   alignment, text wrap, captions). Loaded on the public site, in the editor
   and in admin previews, so all three look the same.
   ========================================================================== */
.prose .media{display:block;box-sizing:border-box;max-width:100%;margin:1.7em auto;padding:0;clear:both}
.prose .media.align-left{margin-left:0;margin-right:auto}
.prose .media.align-right{margin-left:auto;margin-right:0}
.prose .media.align-center{margin-left:auto;margin-right:auto}
.prose .media.align-full{width:100%!important}

/* images */
.prose .media-img img{display:block;width:100%;height:auto;max-width:100%;margin:0;border-radius:10px}
.prose .media-img:not([style*="width"]){width:fit-content}
.prose .media-img:not([style*="width"]) img{width:auto}
.prose .media.custom-ar img{aspect-ratio:var(--ar);object-fit:cover;height:auto}

/* videos */
.prose .media-video{width:100%}
.prose .media-video .embed,.prose .media-video .media-frame{position:relative;width:100%;max-width:none;margin:0;border-radius:12px;overflow:hidden;background:#000}
.prose .media-video .media-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* captions */
.prose .media figcaption{margin-top:.6em;text-align:center;color:var(--muted,var(--a-muted,#667085));font-size:.88rem;line-height:1.45}
.prose .media figcaption:empty{display:none}

/* text wrapping around left / right media */
.prose .media.wrap{clear:none}
.prose .media.wrap.align-left{float:left;margin:.3em 1.6em 1em 0}
.prose .media.wrap.align-right{float:right;margin:.3em 0 1em 1.6em}
.prose h2,.prose h3,.prose h4,.prose hr,.prose table,.prose blockquote{clear:both}
.prose:after{content:"";display:table;clear:both}

/* nothing may overflow the article column */
.prose iframe,.prose video,.prose embed,.prose object,.prose img{max-width:100%}
.prose > *{max-width:100%}

/* phones: no floats, small media grow so they stay readable */
@media (max-width:640px){
  .prose .media.wrap.align-left,.prose .media.wrap.align-right{float:none;margin:1.4em auto}
  .prose .media{min-width:min(100%,300px)}
  .prose .media-video{width:100%!important}
}

/* social posts (Instagram, Facebook, X, TikTok, Spotify) */
.prose .media-embed{width:100%}
.prose .media-embed .embed{margin:0 auto;max-width:100%}
.prose .media-embed.align-left .embed{margin-left:0}.prose .media-embed.align-right .embed{margin-right:0}
.prose .media-embed .instagram-media,.prose .media-embed .twitter-tweet,.prose .media-embed .tiktok-embed{margin-left:auto!important;margin-right:auto!important;max-width:100%!important}
.prose .media-embed .embed-fb iframe{max-width:100%}
