/* Shared post behavior; each gallery supplies its own palette and chrome. */
.mg-main{max-width:1200px;margin:24px auto 0;padding:0 clamp(12px,2vw,24px)}
.mg-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);gap:24px;align-items:start}
.mg-primary,.mg-rail,.mg-related{min-width:0}
.mg-stage:not(:has(.mg-topics)):not(:has(.mg-rail .ad-slot:not([hidden]))){grid-template-columns:minmax(0,1fr)}
.mg-rail:not(:has(.mg-topics)):not(:has(.ad-slot:not([hidden]))){display:none}
.mg-viewer h1{font-size:clamp(23px,3vw,36px);margin:0 0 16px;line-height:1.12}
.mg-frame{margin:0;width:100%;min-width:0}
body[data-site-theme] .mg-frame img{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;margin:auto}
.mg-tags,.mg-neighbors,.mg-topics{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.mg-tags,.mg-neighbors{margin:14px 0}.mg-neighbors{justify-content:space-between}.mg-neighbors [rel=next]{margin-left:auto}
.mg-neighbors a,.mg-tags a,.mg-topics a{padding:4px 8px;text-decoration:underline}
.mg-topics h2{width:100%;margin:0 0 6px;font-size:1rem}
.mg-related{margin-top:32px}.mg-related>h2{font-size:clamp(20px,2.8vw,28px);margin:0 0 14px}
.mg-viewer .ad-slot:not([hidden]){max-width:100%;margin:14px auto}
body[data-site-theme="media-catalog"] .mg-main{max-width:1200px}
body[data-site-theme="media-catalog"] .mg-viewer h1{border-bottom:2px solid #bd2026;padding-bottom:10px}
body[data-site-theme="media-catalog"] .mg-tags a,body[data-site-theme="media-catalog"] .mg-topics{background:white;color:#222}
body[data-site-theme="media-catalog"] .mg-topics{padding:14px}
body[data-site-theme="media-mosaic"] .mg-main{max-width:1900px}
body[data-site-theme="media-mosaic"] .mg-stage{grid-template-columns:minmax(200px,300px) minmax(0,1fr)}
body[data-site-theme="media-mosaic"] .mg-primary{grid-column:2;grid-row:1}
body[data-site-theme="media-mosaic"] .mg-rail{grid-column:1;grid-row:1}
body[data-site-theme="media-mosaic"] .mg-stage:not(:has(.mg-topics)):not(:has(.ad-slot:not([hidden]))){display:block}
body[data-site-theme="media-mosaic"] .mg-frame img{border-radius:5px}
body[data-site-theme="media-albums"] .mg-main{max-width:1000px}
body[data-site-theme="media-albums"] .mg-primary,body[data-site-theme="media-albums"] .mg-topics{background:rgba(0,0,0,.24);padding:14px}
body[data-site-theme="media-albums"] .mg-viewer h1{text-align:center;font-size:24px}
body[data-site-theme="media-albums"] .mg-tags a{background:rgba(255,255,255,.15);border-radius:3px}
body[data-site-theme="media-magazine"] .mg-cover{position:relative}
body[data-site-theme="media-magazine"] .mg-main{max-width:1000px}
body[data-site-theme="media-magazine"] .mg-topics{background:white;padding:14px}
body[data-site-theme="media-magazine"] .mg-cover:has(img) h1{position:absolute;inset:auto 0 0;background:rgba(0,0,0,.76);color:white;border-left:5px solid #db1326;margin:0;padding:12px 16px}
body[data-site-theme="media-captions"] .mg-main{max-width:1600px}
body[data-site-theme="media-captions"] .mg-frame img{max-height:85vh}
body[data-site-theme="media-captions"] .mg-viewer h1{font-size:clamp(20px,3vw,32px);margin:12px 0}
@media(max-width:759px){
 .mg-main{margin:12px auto 0;padding:0 10px}.mg-stage,body[data-site-theme="media-mosaic"] .mg-stage{display:flex;flex-direction:column;gap:12px}
 .mg-primary,.mg-rail{width:100%}.mg-rail .mg-topics{display:none}.mg-rail:not(:has(.ad-slot:not([hidden]))){display:none}
 .mg-related{margin-top:20px}
}
