/* Memorial Muster biography design, based on the Nathaniel Bennett page. */
body:has(.mm-bio-hero) {
  --mm-ink: #182f3a;
  --mm-navy: #123047;
  --mm-paper: #fbf8f0;
  --mm-archive: #f2ebde;
  --mm-border: #e4dacf;
  --mm-gold: #e5cb9c;
  --mm-muted: #52606a;
  --mm-link: #214e69;
  --mm-serif: Georgia, "Times New Roman", serif;
  --mm-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mm-copy-width: 682px;
  --mm-media-width: 980px;
  margin: 0;
  padding: 0;
  color: var(--mm-ink);
  background: var(--mm-paper);
  font: 16px/1.6 var(--mm-sans);
}

body:has(.mm-bio-hero),
body:has(.mm-bio-hero) :where(main, main *, footer) {
  box-sizing: border-box;
}

main:has(> .mm-bio-hero) {
  width: 100%;
  max-width: none;
  min-width: 0;
  flex: 1 0 auto;
  margin: 0;
  padding: 0;
  text-align: start;
  color: inherit;
  background: var(--mm-paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.mm-bio-hero {
  color: var(--mm-paper);
  background: var(--mm-navy);
}

.mm-bio-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(235px, .8fr);
  grid-template-rows: 1fr repeat(5, min-content) 1fr;
  column-gap: clamp(27px, 6vw, 84px);
  width: min(1100px, calc(100% - 72px));
  margin-inline: auto;
  padding-block: clamp(40px, 6vw, 80px);
}

.mm-bio-hero-inner:not(:has(> :is(figure, img))) {
  grid-template-columns: minmax(0, 1fr);
  min-height: 230px;
}

.mm-bio-hero-inner > :is(.biography-back, .back) {
  grid-area: 2 / 1;
  margin: 0 0 26px;
  text-align: start;
  font-size: .86rem;
  font-weight: 600;
}

.mm-bio-hero-inner > .veteran-details,
.mm-bio-hero-inner > .mm-bio-service {
  grid-area: 3 / 1;
  margin: 0;
  color: var(--mm-gold);
  text-align: start;
  font: 650 .79rem/1.55 var(--mm-sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.mm-bio-hero-inner > .veteran-details + .veteran-details {
  grid-area: 5 / 1;
  margin-top: 16px;
  color: #f5efdf;
  font: 400 1rem/1.65 var(--mm-sans);
  letter-spacing: normal;
  text-transform: none;
}

.mm-bio-hero-inner > .veteran-name {
  grid-area: 4 / 1;
  margin: .14em 0 0;
  color: var(--mm-paper);
  text-align: start;
  font: 400 clamp(2.55rem, 5.7vw, 5.35rem)/1.03 var(--mm-serif);
  letter-spacing: -.047em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.mm-bio-hero-inner > .mm-bio-summary {
  grid-area: 6 / 1;
  max-width: 33em;
  margin: 17px 0 0;
  color: #f5efdf;
  font: clamp(1.11rem, 2vw, 1.35rem)/1.55 var(--mm-serif);
}

.mm-bio-hero-inner > :is(figure, img) {
  grid-area: 1 / 2 / -1 / 3;
  align-self: center;
  justify-self: center;
  min-width: 0;
  margin: 0;
}

.mm-bio-hero-inner > figure { width: min(100%, 365px); }

.mm-bio-hero-inner > img,
.mm-bio-hero-inner > figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 445px;
  margin: 0;
  border: 1px solid #b09b79;
  border-radius: 0;
  object-fit: contain;
}

.mm-bio-hero-inner > figure figcaption {
  margin-top: 9px;
  color: #e3d9c9;
  text-align: start;
  font: .83rem/1.5 var(--mm-sans);
  overflow-wrap: anywhere;
}

.mm-bio-hero a,
.mm-bio-hero :is(.biography-back, .back) a {
  color: var(--mm-gold);
  text-decoration: underline;
}

.mm-bio-hero a,
.mm-bio-body a,
body:has(.mm-bio-hero) footer a {
  text-underline-offset: .18em;
}

.mm-bio-hero a:focus-visible,
.mm-bio-body a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.mm-bio-body {
  display: flow-root;
  min-width: 0;
  padding-top: clamp(35px, 5vw, 62px);
  padding-bottom: clamp(40px, 6vw, 82px);
  color: var(--mm-ink);
  text-align: start;
  font: 1.13rem/1.76 var(--mm-serif);
  overflow-wrap: anywhere;
}

.mm-bio-body > :not(footer, script, style) {
  max-width: min(var(--mm-copy-width), calc(100% - 48px));
  margin-inline: auto;
}

.mm-bio-body > :is(.two-col, .archive-pair, .transfer-wrapper, .mm-bio-gallery) {
  max-width: min(var(--mm-media-width), calc(100% - 48px));
}

.mm-bio-body :is(.biography, .biography-text) {
  color: inherit;
  text-align: start;
  font: inherit;
}

.mm-bio-body p { margin-block: 0 1em; }

.mm-bio-body :is(h2, h3) {
  color: var(--mm-ink);
  font: 400 clamp(1.5rem, 3.5vw, 2.6rem)/1.18 var(--mm-serif);
  letter-spacing: -.025em;
  margin-block: 1.45em .55em;
}

.mm-bio-body h3 { font-size: clamp(1.32rem, 2.65vw, 2rem); }
.mm-bio-body :is(.biography-text, section) > :is(h2, h3):first-child { margin-top: 0; }
.mm-bio-body a { color: var(--mm-link); }
.mm-bio-body a:hover { text-decoration-thickness: 2px; }

.mm-bio-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.mm-bio-body figure {
  min-width: 0;
  max-width: 100%;
  margin: 28px 0;
}

.mm-bio-body > figure { margin-inline: auto; }

.mm-bio-body figure img {
  display: block;
  margin: 0;
  border: 1px solid #cbbdab;
}

.mm-bio-body :is(figcaption, .picture-headers, .photo-details, .caption, .caption-text),
.mm-bio-body > .veteran-details {
  color: var(--mm-muted);
  font: .86rem/1.6 var(--mm-sans);
}

.mm-bio-body figcaption { margin-top: 8px; }
.mm-bio-body > .veteran-details { margin-block: 0 1.65em; }

.mm-bio-body :is(.two-col, .archive-pair, .transfer-wrapper, .mm-bio-gallery) {
  margin-block: clamp(24px, 4vw, 40px);
  padding: clamp(14px, 3vw, 30px);
  background: var(--mm-archive);
  border-block: 1px solid var(--mm-border);
}

.mm-bio-body :is(.two-col, .archive-pair, .transfer-wrapper, .stack-on-mobile, .mm-bio-plates) {
  gap: clamp(12px, 3vw, 26px);
}

.mm-bio-body :is(.two-col, .archive-pair, .transfer-wrapper, .mm-bio-plates) > * {
  min-width: 0;
}

.mm-bio-body :is(.two-col, .archive-pair, .mm-bio-plates) figure { margin: 0; }

.mm-bio-body :is(.bio-callout, .photo-callout) {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--mm-ink);
  font: 1rem/1.65 var(--mm-serif);
}

.mm-bio-body :is(.bio-callout, .photo-callout) > :last-child { margin-bottom: 0; }

.mm-bio-body blockquote {
  border-inline-start: 3px solid #947244;
  margin-inline: 0;
  padding: 12px 20px;
  background: var(--mm-archive);
}

.mm-bio-body .sources {
  margin-block: clamp(37px, 6vw, 65px) 0;
  padding: 25px 0 0;
  color: var(--mm-ink);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--mm-border);
  border-radius: 0;
  box-shadow: none;
  font: .9rem/1.67 var(--mm-sans);
  text-align: start;
}

.mm-bio-body .sources :is(h2, h3):first-child { margin-top: 0; }
.mm-bio-body .sources li { margin-bottom: .65em; scroll-margin-top: 1.2em; }
.mm-bio-body .sources li:target { background-color: #efe3ce; }

.mm-bio-gallery h2 {
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  margin-top: 0;
}

.mm-bio-plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body:has(.mm-bio-hero) footer {
  margin: 0;
  padding: 24px;
  color: var(--mm-paper);
  background: var(--mm-navy);
  text-align: center;
  font: .85rem/1.6 var(--mm-sans);
}

body:has(.mm-bio-hero) footer a { color: inherit; }

.mm-bio-body:has(> footer) { padding-bottom: 0; }
.mm-bio-body > footer { margin-top: clamp(40px, 6vw, 82px); }

@media (max-width: 680px) {
  .mm-bio-hero-inner,
  .mm-bio-hero-inner:not(:has(> :is(figure, img))) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    width: calc(100% - 44px);
    min-height: 0;
  }

  .mm-bio-hero-inner > * { grid-column: 1; }
  .mm-bio-hero-inner > .veteran-name { font-size: clamp(2.55rem, 8vw, 3.5rem); }
  .mm-bio-hero-inner > :is(figure, img) {
    grid-area: 7 / 1;
    justify-self: start;
    max-width: min(100%, 320px);
    margin-top: 24px;
  }

  .mm-bio-hero-inner > img,
  .mm-bio-hero-inner > figure img { max-height: 350px; }

  .mm-bio-body > :is(.two-col, .archive-pair, .transfer-wrapper, .mm-bio-gallery) {
    max-width: calc(100% - 32px);
  }

  .mm-bio-plates { grid-template-columns: 1fr; }
}

@media print {
  body:has(.mm-bio-hero),
  main:has(> .mm-bio-hero),
  .mm-bio-hero { background: white; color: black; }

  .mm-bio-hero-inner a,
  .mm-bio-hero-inner > :is(.veteran-name, .veteran-details, .mm-bio-service, .mm-bio-summary),
  .mm-bio-hero-inner > figure figcaption { color: black; }
  body:has(.mm-bio-hero) :is(footer, .main-nav, .biography-back, .back) { display: none; }
  .mm-bio-body :is(figure, .two-col) { break-inside: avoid; }
}
