#elsa-dacha .article-opening .article-photo {
  position: relative;
}

#elsa-dacha figcaption a {
  color: inherit;
  text-decoration: none;
}

#elsa-dacha figcaption a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.g-readable #elsa-dacha figcaption a {
  text-decoration: underline;
}

#elsa-dacha .story-g__slide > .elsa-slide-contained {
  display: block;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  object-fit: contain;
  height: auto;
  max-height: var(--article-gallery-photo-height);
  aspect-ratio: auto;
  place-self: center;
}

/* Marina's v5 spacing request; caption height follows its actual content. */
#elsa-dacha .story-g__slide figcaption { min-block-size: 0; }
#elsa-dacha .story-g__gallery-section { padding-bottom: var(--article-column-gap); }

#elsa-dacha .elsa-document > img:first-child {
  margin-inline: auto;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 30rem;
  aspect-ratio: auto;
}

#elsa-dacha .elsa-document figcaption,
#elsa-dacha .narzan-side-photo figcaption {
  text-align: center;
}

#elsa-dacha .elsa-family-portrait > img:first-child {
  display: block;
  width: min(88%, 480px);
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  margin-inline: auto;
}
#elsa-dacha .elsa-family-portrait figcaption { text-align: center; }

/* Marina's v3 request: a smaller drawing, without the photographed fixings. */
#elsa-dacha .elsa-shakhovskaya-trimmed > img:first-child {
  display: block;
  width: min(88%, 520px);
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  margin-inline: auto;
}
#elsa-dacha .elsa-shakhovskaya-trimmed figcaption { text-align: center; }

/* Existing two-column photo composition, with the standard radius and pair width. */
#elsa-dacha .elsa-ruin-grid { margin: 0; min-width: 0; }
#elsa-dacha .elsa-ruin-tiles { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
#elsa-dacha .elsa-ruin-column { display: grid; align-content: start; gap: 16px; min-width: 0; }
#elsa-dacha .elsa-ruin-column figure { margin: 0; min-width: 0; }
#elsa-dacha .elsa-ruin-column img { display: block; width: 100%; height: auto; border-radius: var(--article-photo-radius); }
#elsa-dacha .elsa-ruin-grid > figcaption { margin-top: 16px; text-align: center; }

#elsa-dacha :is(.elsa-paper-turret,.elsa-paper-bag) {
  z-index: 2;
  width: 140px;
  right: -10px;
  top: -112px;
}
#elsa-dacha :is(.elsa-paper-turret,.elsa-paper-bag) img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}
#elsa-dacha .elsa-paper-bag { width: 60px; right: -4px; top: auto; bottom: 26px; }
#elsa-dacha .elsa-paper-turret { width: 50px; right: 20px; top: -78px; bottom: auto; }
@media (min-width: 640px) {
  #elsa-dacha .elsa-paper-turret { width: 78.96px; right: -5.96px; top: -104px; }
  #elsa-dacha .elsa-paper-bag { width: 90px; right: -8px; bottom: 28px; }
}
@media (min-width: 1024px) {
  #elsa-dacha .elsa-paper-turret { width: 108px; right: -28px; top: -96px; }
  #elsa-dacha .elsa-paper-bag { width: 120px; right: -8px; bottom: 4px; }
  #elsa-dacha .article-opening .article-split { grid-template-rows: auto auto; }
  #elsa-dacha .article-opening .article-split-copy { display: contents; }
  #elsa-dacha .article-opening h2 { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  #elsa-dacha .article-opening .article-split-body { grid-column: 1; grid-row: 2; }
  #elsa-dacha .article-opening .article-photo { grid-column: 2; grid-row: 2; align-self: center; }
  #elsa-dacha #origins .article-pair { align-items: start; }
  #elsa-dacha .article-pair--media-left > .article-pair-copy { grid-area: 1 / 2; }
  #elsa-dacha .article-pair--media-left > .article-pair-media { grid-area: 1 / 1; }
  /* The image and copy share row 1. Caption owns row 2 in normal flow. */
  #elsa-dacha .elsa-image-centered { grid-template-rows: auto auto; row-gap: 0; }
  #elsa-dacha .elsa-image-centered > .article-pair-copy { grid-column: 1; grid-row: 1; }
  #elsa-dacha .elsa-image-centered > .article-pair-media {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: stretch;
    margin: 0;
  }
  #elsa-dacha .elsa-image-centered > .article-pair-media > img { align-self: center; grid-row: 1; }
  #elsa-dacha .elsa-image-centered > .article-pair-media > figcaption { grid-row: 2; text-align: center; }
  #elsa-dacha .elsa-image-centered.article-pair--media-left > .article-pair-copy { grid-column: 2; grid-row: 1; }
  #elsa-dacha .elsa-image-centered.article-pair--media-left > .article-pair-media { grid-column: 1; grid-row: 1 / span 2; }
  #elsa-dacha .elsa-workshop-pair > .article-pair-media > figcaption {
    margin-bottom: 16px;
  }
}

/* Requested crop: show only the upper portion of the existing hero photo. */
#elsa-dacha .elsa-hero-crop { overflow: hidden; }
#elsa-dacha .elsa-hero-crop__image {
  position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 125%; object-fit: cover; object-position: 50% 0%;
}
/* Keep the shared photo track; round the actual contained photo, without a matte. */
#elsa-dacha .story-g__slide:not([hidden]):has(> .elsa-slide-contained) {
  display: grid; grid-template-rows: var(--article-gallery-photo-height) auto; align-items: center;
}
#elsa-dacha #closing { margin-top: -24px; }
#elsa-dacha #closing strong { color: var(--article-accent); }
@media (min-width: 1024px) { #elsa-dacha #closing { margin-top: -64px; } }

@media (min-width: 1440px) { #elsa-dacha .elsa-paper-turret { right: 28px; top: -80px; } }

/* Requested lower connector; keep paper geometry and flow unchanged. */
#elsa-dacha .elsa-history .article-paper-connector .narzan-connector-line { top: 0; }
@media (min-width: 640px) { #elsa-dacha .elsa-history .article-paper-connector .narzan-connector-line { top: -40px; } }
@media (min-width: 1024px) { #elsa-dacha .elsa-history .article-paper-connector .narzan-connector-line { top: -120px; } }

@media (min-width: 1200px) and (max-width: 1439px) { #elsa-dacha .elsa-paper-turret { width: 99.36px; right: -23.36px; top: -84px; } #elsa-dacha .elsa-paper-bag { right: -16px; } }
