/* 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; }

/* Framing and decorative quote marks are siblings of [data-hero-flow] inside
   .quote-portrait-copy so their line boxes wrap beside the float (same shape
   as the quote). The quote paragraph is inline inside .quote-detail-prose so
   the marks share that wrap — opener on line 1, closer after the last glyphs.
   Do not give the copy overflow/flex — that would establish a BFC and pin the
   column narrow for its whole height. Do not put framing or marks inside
   [data-hero-flow]; that node is color:transparent when .is-shaped. Mobile
   column-reverse still keeps the whole copy (framing + quote + marks) above
   the portrait. */
.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 beneath it. The signature rides the
   info-tray collapse (mirrored from #originatorInfoPanel), so it folds away on
   scroll while the portrait stays put. The tray itself is a sibling BELOW the
   masthead row — never a child of .originator-header-content — so a long bio
   cannot stretch this column into an empty strip. */
.originator-header-aside {
  align-items: center;
  align-self: flex-start;
  display: flex;
  flex: 0 0 8rem;
  flex-direction: column;
  gap: .35rem;
  justify-content: flex-start;
}
.originator-signature-slot { width: 100%; }
.originator-signature { display: block; height: auto; margin: 0 auto; max-width: 100%; }

.originator-header-row {
  align-items: flex-start;
  display: flex;
  gap: .75rem;
}
.originator-header-content { flex: 1; min-width: 0; }
.originator-header-row.side-left { flex-direction: row-reverse; }
/* Fixed masthead size. Tabs sit in #originatorInfoPanel below this row, so the
   portrait no longer tracks an in-row tray or lands on a tab rule. 7.2rem is
   the compact side-portrait cap (title + description + breathing room). Nudge
   --originator-portrait-max if those masthead rows change height. Explicit
   height (not max-height + stretch) is required: the img is absolutely
   positioned, so the figure has no intrinsic height once the aside stops
   stretching to the row. */
.originator-header-portrait {
  height: var(--originator-portrait-max, 7.2rem);
  margin: 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 { height: 4.5rem; }
}
