/* The portrait is floated, not a flex column, so the text wraps beside it and
   then runs full width once it clears — the same shape the shaped layout builds.
   That keeps the un-enhanced height within ~a line of the enhanced one, so the
   space reserved before the upgrade is the space it ends up needing and nothing
   moves (FR-005). A flex column instead held the text narrow for its whole
   height, reserving two lines more than the shaped layout used.
   flow-root contains the float so a quote shorter than the portrait still
   wraps it; position: relative anchors the absolutely positioned lines. */
.quote-portrait-hero {
  display: flow-root;
  margin: 0;
  min-height: 19rem;
  position: relative;
}

/* Square, matching the published asset, so object-fit leaves no letterbox for
   the text to contour around. */
.quote-portrait-media {
  aspect-ratio: 1;
  float: right;
  margin: 0 0 1rem 1rem;
  position: relative;
  width: min(42%, 19rem);
}
.quote-portrait-hero.side-left .quote-portrait-media {
  float: left;
  margin: 0 1rem 1rem 0;
}
.quote-portrait-media > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.quote-portrait-lines { inset: 0; position: absolute; }
.quote-portrait-lines > span { position: absolute; white-space: pre; }
.quote-portrait-hero.is-shaped [data-hero-flow] { color: transparent; }

.js-hero-pending [data-hero-copy] {
  animation: portrait-reveal 0s 2s forwards;
  opacity: 0;
}

@keyframes portrait-reveal { to { opacity: 1; } }

/* Provenance credits in the header tabs. Muted italic swallowed the link
   affordance, so every source link here states it is clickable. */
.originator-credit a { color: var(--bs-primary); text-decoration: underline; }
/* The bio's sourcing line — biography and portrait — is centred under the bio;
   the other tabs keep their own alignment. */
.originator-bio-credit { text-align: center; }
/* linebreaks wraps the bio in <p>; its trailing margin plus a top margin here
   opened a two-line gap above the credit. */
.bio-content > p:last-child { margin-bottom: .35rem; }

/* Portrait column: image on top, signature filling the space beneath it. The
   signature rides the info-tray collapse, so it folds away on scroll while the
   portrait stays put. */
.originator-header-aside {
  align-items: center;
  display: flex;
  flex: 0 0 8rem;
  flex-direction: column;
  gap: .35rem;
  justify-content: flex-start;
  /* Stretches to the row height so the portrait can track the tray collapsing;
     min-height:0 is what lets it actually shrink below its content size. */
  min-height: 0;
}
.originator-signature-slot { width: 100%; }
.originator-signature { display: block; height: auto; margin: 0 auto; max-width: 100%; }

.originator-header-row { display: flex; gap: .75rem; }
.originator-header-content { flex: 1; min-width: 0; }
.originator-header-row.side-left { flex-direction: row-reverse; }
/* The portrait tracks the available column height so it scales down as the info
   tray collapses — but is capped so that, with the tray open, its bottom edge
   lands on the rule the tabs sit on. 7.2rem == the measured 115.2px from the row
   top to that rule, which held constant across short names, long names and a
   missing description. Nudge --originator-portrait-max if the header's rows ever
   change height. min-height:0 permits the shrink. */
.originator-header-portrait {
  flex: 1 1 auto;
  margin: 0;
  max-height: var(--originator-portrait-max, 7.2rem);
  min-height: 0;
  position: relative;
  width: 100%;
}
.originator-header-portrait > img {
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
}

@media (max-width: 575.98px) {
  /* column-reverse, because the portrait leads in source order for the float but
     the complete quote must still come first on a narrow screen. */
  .quote-portrait-hero,
  .quote-portrait-hero.side-left {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
  }
  .quote-portrait-media,
  .quote-portrait-hero.side-left .quote-portrait-media {
    align-self: center;
    float: none;
    height: 11rem;
    margin: 0;
    width: 11rem;
  }
  .quote-portrait-hero.is-shaped [data-hero-flow] { color: inherit; }
  .quote-portrait-lines { display: none; }
  .originator-header-aside { flex-basis: 4.5rem; }
  .originator-header-portrait { max-height: 4.5rem; }
}
