/* Shared article-layout.css owns the tracks, typography, paper and outer gutters. */
#yaroshenko .story-g__hero-background { object-position: center 45%; }
#yaroshenko .story-g__hero-front { object-position: center 49%; }
#yaroshenko .story-g__slide:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--article-gallery-photo-height) auto;
}
#yaroshenko .story-g__slide > img[data-fit="contain"] {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  place-self: center;
  object-fit: contain;
}
/* Reuse the regular copy track for media when the pair stacks. Desktop track
   placement is explicit; the shared --media-left modifier sets track widths. */
@media (max-width: 1023px) {
  #yaroshenko .article-pair-media { max-width: var(--article-copy-width); margin-inline: auto; }
}
@media (min-width: 1024px) {
  #yaroshenko .article-pair--media-left > .article-pair-copy { grid-area: 1 / 2; }
  #yaroshenko .article-pair--media-left > .article-pair-media { grid-area: 1 / 1; }
}
#yaroshenko .article-pair-copy, #yaroshenko .story-g__paper { text-align: left; }
/* Same inter-image gap and corners as the approved Долина роз tiles. */
#yaroshenko .yaroshenko-photo-grid { margin: 0; }
#yaroshenko .yaroshenko-photo-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
#yaroshenko .yaroshenko-photo-tiles img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--article-photo-radius);
}
#yaroshenko .yaroshenko-photo-tiles img[data-fit="contain"] {
  object-fit: contain;
  background: var(--g-paper);
}
#yaroshenko .yaroshenko-photo-grid figcaption { margin-top: 16px; }
#yaroshenko .yaroshenko-photo-row {
  display: grid;
  grid-column: 1 / -1;
  gap: inherit;
}
#yaroshenko #institution-thanks .narzan-thanks {
  isolation: isolate;
}
#yaroshenko #institution-thanks .institution-thanks-logo {
  width: auto;
}
#yaroshenko #institution-thanks .institution-thanks-logo img {
  max-height: 100px;
  mix-blend-mode: darken;
}
@media (min-width: 640px) {
  #yaroshenko #institution-thanks .narzan-thanks {
    grid-template-columns: max-content minmax(0, 1fr);
    justify-content: center;
  }
  #yaroshenko #institution-thanks .narzan-thanks p {
    max-width: none;
    justify-self: stretch;
  }
}
#yaroshenko :is(.yaroshenko-photo-row, .yaroshenko-exhibition-column) img {
  aspect-ratio: auto;
  height: auto;
  background: none;
}
#yaroshenko .yaroshenko-photo-grid--exhibition .yaroshenko-photo-tiles {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
#yaroshenko .yaroshenko-exhibition-column {
  display: grid;
  align-self: start;
  gap: inherit;
}
#yaroshenko .yaroshenko-exhibition-column + .yaroshenko-exhibition-column {
  padding-top: clamp(12px, 5%, 32px);
}
#yaroshenko .yaroshenko-exhibition-column img[data-fit="contain"] {
  background: none;
}
#yaroshenko .yaroshenko-exhibition-column:last-child .yaroshenko-exhibition-tile:last-child {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  position: relative;
  border-radius: var(--article-photo-radius);
}
#yaroshenko .yaroshenko-exhibition-column img[data-photo-id="renaissance-wing-sign-2024"] {
  position: absolute;
  inset: -8% 0 auto auto;
  width: 123%;
  max-width: none;
  border-radius: 0;
}
#yaroshenko :is(.yaroshenko-portrait-landscape,.yaroshenko-portrait-oval,.yaroshenko-portrait-tall,.yaroshenko-art,.yaroshenko-document) > img:first-child {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
  background: none;
}
#yaroshenko :is(.yaroshenko-portrait-oval,.yaroshenko-portrait-tall) { max-width: var(--article-copy-width); margin-inline: auto!important; }
#yaroshenko .yaroshenko-portrait-oval > img:first-child {
  clip-path: ellipse(47.8% 47.3% at 50.3% 50.3%);
  border: 0;
  box-shadow: none;
}
#yaroshenko :is(.yaroshenko-portrait-oval,.yaroshenko-portrait-tall) figcaption { text-align: center; }

#yaroshenko .story-g__paper > :is(p,blockquote) {
  width: 100%;
  max-width: var(--article-paper-text-max);
  margin-inline: auto;
}
#yaroshenko .yaroshenko-letter-quote {
  margin-block: 0;
  padding: 0;
  border: 0;
  font: 400 var(--article-body-size)/var(--article-body-leading) var(--article-body-font);
}
#yaroshenko .yaroshenko-letter-quote p { max-width: none; margin: 0; text-align: left; }
#yaroshenko .narzan-side-photo--left > img:first-child { object-position: 53% center; }
#yaroshenko .narzan-side-photo--right > img:first-child { object-position: 54% center; }
@media (max-width: 639px) {
  #yaroshenko .narzan-side-photo { --article-pin-side: 0px; }
}
body[data-article-sample="yaroshenko-local-v6"] .g-skip:not(:focus) { clip-path: inset(50%); }

/* Compact article rhythm, with dedicated space at the paper transitions. */
#yaroshenko {
  --yaroshenko-section-inset: calc(var(--article-section-space) * .55);
  --yaroshenko-ending-inset: 16px;
}
#yaroshenko :is(.article-section, .story-g__gallery-section) {
  padding-block: var(--yaroshenko-section-start, var(--yaroshenko-section-inset))
    var(--yaroshenko-section-end, var(--yaroshenko-section-inset));
}
#yaroshenko :is(.article-papers, .article-papers + .article-section, .yaroshenko-estate-band + .article-section) {
  --yaroshenko-section-start: var(--article-section-space);
}
#yaroshenko :is(.article-papers, .article-section:has(+ .article-papers)) {
  --yaroshenko-section-end: var(--article-section-space);
}
#yaroshenko .story-g__gallery-section {
  --yaroshenko-section-end: 16px;
}
#yaroshenko .yaroshenko-estate-band > .article-section:first-of-type {
  --yaroshenko-section-start: max(56px, var(--yaroshenko-section-inset));
}
#yaroshenko #photos-balcony {
  --yaroshenko-section-start: 0px;
}
#yaroshenko .yaroshenko-estate-band > .article-section:last-of-type {
  --yaroshenko-section-end: calc(var(--article-section-space) + 16px);
}
#yaroshenko .article-section:has(+ .article-ending) {
  --yaroshenko-section-end: var(--yaroshenko-ending-inset);
}
#yaroshenko .article-ending {
  padding-block-start: var(--yaroshenko-ending-inset);
}
@media (min-width: 1024px) and (max-width: 1279px) {
  /* Balance the wrapped caption when the text is taller than the photograph. */
  #photos-history .article-photo {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
  }
  #photos-history .article-photo > img { grid-row: 2; }
  #photos-history .article-photo > figcaption { grid-row: 3; }
}
@media (min-width: 1280px) {
  /* The image and text share the first row. The caption has its own row. */
  #photos-history .article-pair {
    grid-template-rows: auto auto;
    row-gap: 0;
  }
  #yaroshenko #photos-history :is(.article-pair-media, .article-photo) {
    display: grid;
    grid-row: 1 / span 2;
    grid-template-rows: subgrid;
    align-self: stretch;
  }
  #photos-history .article-photo > img { grid-row: 1; align-self: center; }
  #photos-history .article-photo > figcaption { grid-row: 2; }
}
@media (min-width: 1024px) {
  #maria-yaroshenko .article-pair-copy,
  #photos-caucasus .article-pair-copy,
  #photos-caucasus .article-pair-media { align-self: start; }
}
#saturdays .story-g__paper > p:has(+ .yaroshenko-letter-quote) { margin-bottom: 0; }
#saturdays .story-g__paper > :is(p,.yaroshenko-letter-quote) { text-align: left; }
#yaroshenko .yaroshenko-drawing {
  width: 132px;
  top: 0;
  right: -4px;
  z-index: 2;
  transform: translateY(-64%);
}
#yaroshenko .yaroshenko-drawing img { display: block; height: auto; max-height: none; }
#yaroshenko .yaroshenko-drawing--singer {
  width: 76px;
  right: -16px;
  transform: translateY(-72%);
}
#yaroshenko .yaroshenko-drawing--laundry { width: 144px; transform: translateY(-58%); }
@media (min-width: 640px) {
  #yaroshenko .yaroshenko-drawing { width: 204px; right: -14px; }
  #yaroshenko .yaroshenko-drawing--laundry { width: 222px; }
  #yaroshenko .yaroshenko-drawing--piano { transform: translateY(-70%); }
  #yaroshenko .yaroshenko-drawing--singer {
    width: 92px;
    top: auto;
    right: -29px;
    bottom: 0;
    transform: translateY(11%);
  }
}
@media (min-width: 1024px) {
  #yaroshenko .yaroshenko-drawing--singer {
    width: auto;
    height: min(86%, clamp(230px, calc(42vw - 307.6px), 320px));
    aspect-ratio: 1 / 2.04;
    right: -48px;
    transform: translateY(10%);
  }
  #yaroshenko .yaroshenko-drawing--singer img { width: 100%; height: 100%; }
}

#yaroshenko .yaroshenko-landscape-grid .yaroshenko-photo-tiles {
  align-items: start;
  grid-template-columns: minmax(0, 1.497118fr) minmax(0, 1.616628fr);
}
#yaroshenko .yaroshenko-landscape-grid .yaroshenko-photo-tiles > :first-child { grid-column: 1 / -1; }
#yaroshenko .yaroshenko-landscape-grid .yaroshenko-photo-tiles img {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}
/* The lower columns follow the original paintings' proportions at equal height. */
#yaroshenko .yaroshenko-landscape-grid .yaroshenko-photo-tiles > :nth-child(2) img { aspect-ratio: 2078 / 1388; }
#yaroshenko .yaroshenko-landscape-grid .yaroshenko-photo-tiles > :nth-child(3) img { aspect-ratio: 2100 / 1299; }
#yaroshenko .yaroshenko-after-art {
  width: min(96.2%, 520px);
  margin-inline: auto !important;
}
#yaroshenko #photos-estate-after figcaption { text-align: center; }

#yaroshenko .yaroshenko-restoration-grid > svg { position: absolute; }
#yaroshenko .yaroshenko-restoration-grid img { filter: url(#yaroshenko-archive-sharpen); }

#yaroshenko .yaroshenko-memorial-photo {
  max-width: 520px;
  margin-inline: auto !important;
}
#yaroshenko .yaroshenko-memorial-photo > img:first-child { filter: brightness(1.08); }
#yaroshenko .yaroshenko-balcony-video {
  width: min(100%, 420px);
  margin: 0 auto;
}
#yaroshenko .yaroshenko-video-frame {
  position: relative;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--article-photo-radius);
  background: #17241b;
}
#yaroshenko .yaroshenko-video-play,
#yaroshenko .yaroshenko-video-play img,
#yaroshenko .yaroshenko-video-frame > video {
  display: block;
  width: 100%;
  height: 100%;
}
#yaroshenko .yaroshenko-video-play {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
#yaroshenko .yaroshenko-video-play img { object-fit: cover; }
#yaroshenko .yaroshenko-video-play:focus-visible,
#yaroshenko .yaroshenko-video-frame > video:focus-visible {
  outline: 3px solid white;
  outline-offset: -4px;
}
#yaroshenko .yaroshenko-video-play-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgb(61 50 138 / 86%);
  color: white;
}
#yaroshenko .yaroshenko-video-frame video::cue {
  color: white;
  background-color: rgb(0 0 0 / 76%);
}
#yaroshenko .yaroshenko-video-frame video.has-caption-layer:not(:fullscreen)::cue {
  opacity: 0;
  color: transparent;
  background-color: transparent;
  text-shadow: none;
}
#yaroshenko .yaroshenko-video-caption-layer {
  position: absolute;
  inset-inline: .5rem;
  inset-inline: clamp(.25rem, 2cqw, .7rem);
  inset-block-end: clamp(3.75rem, 14%, 7rem);
  display: grid;
  justify-items: center;
  pointer-events: none;
}
#yaroshenko .yaroshenko-video-caption-layer[hidden] { display: none; }
#yaroshenko .yaroshenko-video-caption {
  box-sizing: border-box;
  max-inline-size: 100%;
  padding: .46em .9em .5em;
  padding-inline: clamp(.4rem, 3.6cqw, .9em);
  border-radius: .56rem;
  background: rgb(61 50 138 / 72%);
  color: #fffaf0;
  font-family: "PT Sans Local", system-ui, sans-serif;
  font-size: 1rem;
  font-size: clamp(.875rem, 4.85cqw, 1.25rem);
  font-weight: 400;
  line-height: 1.22;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#yaroshenko .yaroshenko-balcony-video figcaption { margin-top: 10px; text-align: center; }
