/* Shared Narzan geometry remains authoritative. Only asset placement/crops here. */
/* Marina, 23 Nov: raise the beige edge into the empty space below the carousel.
   Content, paper geometry and the bottom edge keep their shared positions. */
#safonov>.article-beige-band{--safonov-beige-rise:var(--article-section-space)}
#safonov>.article-beige-band::before{content:"";position:absolute;inset-inline:0;top:calc(-1*var(--safonov-beige-rise));height:var(--safonov-beige-rise);background:var(--g-paper);pointer-events:none}
#safonov>.article-beige-band>.story-g__edge:first-child{top:calc(-1*var(--safonov-beige-rise))}
#safonov .article-hero-figure{position:relative;z-index:1}
#safonov .article-hero-figure figcaption{position:relative;margin-top:20px;padding:6px 10px;border-radius:8px;width:fit-content;max-width:100%;background:var(--g-paper)}
#safonov .article-opening .article-photo{position:relative}
/* Approved contain role from the Yaroshenko carousel: the shared window stays fixed,
   while the visible photograph itself receives rounded corners. */
#safonov .story-g__slide:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--article-gallery-photo-height) auto}
#safonov .story-g__slide>img{width:auto;height:auto;max-width:100%;max-height:100%;aspect-ratio:auto;place-self:center;object-fit:contain}
#safonov .safonov-paper-people{position:absolute;z-index:2;pointer-events:none;width:110px;right:-4px;top:calc(var(--article-paper-pad-block) - 95px)}
#safonov .safonov-paper-people img{display:block;width:100%;height:auto;max-height:none}
#safonov .narzan-side-photo figcaption{margin-top:8px;font:400 var(--article-caption-size)/var(--article-caption-leading) var(--article-body-font)}
#safonov .institution-logo{display:block;width:79px;height:102px;margin:auto}
#safonov .safonov-native-photo{--safonov-photo-width:var(--photo-native-width)}
#safonov .safonov-native-photo>img:first-child{width:min(100%,var(--safonov-photo-width));max-width:100%;height:auto;aspect-ratio:var(--photo-ratio);margin-inline:auto;object-fit:contain}
#safonov .safonov-expanded-photo{--safonov-photo-width:calc(var(--article-copy-width)*1.25)}
#safonov .safonov-native-photo>figcaption{width:min(100%,var(--safonov-photo-width));box-sizing:border-box;margin-inline:auto}
#safonov .safonov-native-photo:has(>.safonov-crop-window){--safonov-photo-width:100%}
#safonov #shalyapin .safonov-native-photo{--safonov-photo-width:var(--article-copy-width)}
#safonov #twentieth-century .safonov-native-photo{--safonov-photo-width:var(--article-copy-width)}
#safonov .safonov-crop-window{width:100%;overflow:hidden;border-radius:var(--article-photo-radius)}
#safonov .safonov-crop-window>img{display:block;width:100%;height:auto;aspect-ratio:var(--photo-ratio);object-fit:contain;border-radius:0}
#safonov :is(.safonov-paper-musicians,.safonov-paper-aquarium){position:absolute;z-index:2;pointer-events:none;width:168px;right:-4px;top:-82px}
#safonov :is(.safonov-paper-musicians,.safonov-paper-aquarium) img{display:block;width:100%;height:auto;max-height:none}
#safonov .safonov-paper-aquarium{width:144px;top:-88px}
#safonov .article-text-columns{display:grid}
#safonov .safonov-photo-grid{margin:0}
#safonov .safonov-photo-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
#safonov .safonov-photo-tiles img{display:block;width:100%;height:auto;aspect-ratio:var(--photo-ratio);border-radius:var(--article-photo-radius)}
#safonov .safonov-photo-grid figcaption{margin-top:16px}
#safonov .safonov-four-halls{margin-block:var(--article-column-gap)}
#safonov .safonov-hall-mosaic{grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)}
#safonov .safonov-hall-mosaic>div{display:grid;gap:16px;align-content:start}
#safonov .safonov-four-halls{margin-block:0}
#safonov .safonov-blue{color:var(--article-accent)}
#safonov .safonov-ending-bold{color:var(--article-accent)}
#safonov #today .narzan-side-photo>img:first-child{aspect-ratio:var(--photo-ratio);height:auto;object-fit:contain}
#safonov #institution-thanks .institution-thanks-logo img{max-height:140px}
#safonov #institution-thanks .narzan-thanks{gap:8px}
#safonov #institution-thanks .institution-thanks-logo{width:auto;max-width:120px}
#safonov #institution-thanks .narzan-thanks p{width:max-content;max-width:calc(100% + 16px)}
#safonov .safonov-city-copy p{margin-top:0}
@media(min-width:1024px){
 #safonov .article-opening .safonov-native-photo>figcaption{left:50%;transform:translateX(-50%)}
 #safonov #twentieth-century .article-pair{align-items:start}
 #safonov .article-pair--media-left>.article-pair-copy{grid-area:1/2}
 #safonov .article-pair--media-left>.article-pair-media{grid-area:1/1}
}
#safonov a{color:var(--article-accent);text-decoration:none}
#safonov a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.g-readable #safonov a{text-decoration:underline}
/* Accepted mobile dot appearance, v5: all slides remain available. */
@media(max-width:1023px){
 #safonov .story-g__gallery :is(.story-g__gallery-prev,.story-g__gallery-next){display:none}
 #safonov .story-g__gallery-dots{display:grid;grid-template-columns:repeat(var(--dot-count),minmax(0,28px));justify-content:center;align-items:center;column-gap:0;width:100%;height:10px;margin:0}
 #safonov .story-g__gallery-dots button{position:relative;width:100%;height:10px;padding:0;border:0;background:transparent;border-radius:0}
 #safonov .story-g__gallery-dots button::after{content:"";position:absolute;inset-inline:0;top:50%;height:32px;transform:translateY(-50%)}
 #safonov .story-g__gallery-dots button::before{content:"";position:absolute;width:4px;height:4px;border-radius:50%;left:50%;top:50%;transform:translate(-50%,-50%);background:#d1cddb}
 #safonov .story-g__gallery-dots button[data-middle-distance]::before{width:7px;height:7px;background:#c2bbd1}
 #safonov .story-g__gallery-dots button[data-near-current]::before{width:10px;height:10px;background:#b8b1cc}
 #safonov .story-g__gallery-dots button[aria-pressed=true]::before{background:var(--g-blue)}
 #safonov .story-g__gallery-dots button:focus-visible{outline:2px solid var(--g-blue);outline-offset:0;border-radius:8px}
 .g-readable #safonov .story-g__gallery-dots button::before{background:#777}
 .g-readable #safonov .story-g__gallery-dots button[aria-pressed=true]::before{background:#000}
}
@media(min-width:640px){#safonov .safonov-paper-people{width:140px;right:-12px;top:calc(var(--article-paper-pad-block) - 125px)}}
@media(min-width:640px){
 #safonov #institution-thanks .narzan-thanks{grid-template-columns:max-content max-content;justify-content:center;gap:16px}
 #safonov .safonov-paper-musicians{width:240px;right:-60px;top:-104px}
 #safonov .safonov-paper-aquarium{width:160px;right:-12px;top:-100px}
}
@media(max-width:359px){#safonov #institution-thanks .narzan-thanks p{font-size:12px;line-height:18px}}
@media(min-width:1024px){#safonov .safonov-paper-musicians{width:280px;left:calc(100% - var(--article-paper-copy-inset) + 16px);right:auto;top:calc(var(--article-paper-pad-block) + 15px - 94.5px)}}
@media(max-width:639px){#safonov .safonov-paper-musicians{width:210px;right:-20px;top:-98px}}
@media(min-width:1024px){#safonov .safonov-paper-people{width:150px;top:calc(var(--article-paper-pad-block) - 135px)}}
@media(max-width:639px){
 #safonov .narzan-side-photo{transform-origin:center 60px}
 #safonov .narzan-side-photo--left .story-g__pin{left:8px}
 #safonov .narzan-side-photo--right .story-g__pin{right:8px}
 #safonov .narzan-side-photo figcaption{transform-origin:top center;text-align:center}
 #safonov .narzan-side-photo--left figcaption{transform:rotate(15deg)}
 #safonov .narzan-side-photo--right figcaption{transform:rotate(-15deg)}
}
