/* Homepage only. Twelve shared columns; four columns on small screens. */
#featured {
  --featured-frame: 16 / 9;
  --featured-row-space: calc(var(--baseline, 8px) * 12);
  background: #fff;
}

#featured .hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap, 24px);
  row-gap: var(--hero-gap, 56px);
  grid-template-rows: max-content 1fr;
  align-items: start;
  padding-top: var(--hero-top, 48px);
  padding-bottom: var(--hero-bottom, 48px);
}
#featured .hero-copy { display: contents; }
#featured .hero-title-wrap { grid-column: var(--hero-text-col, 1) / span var(--hero-text-span, 6); grid-row: 1; min-width: 0; }
#featured .hero .eyebrow {
  margin: 0 0 28px;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--muted, #73736d);
}
#featured .hero h1 {
  margin: 0;
  font-family: "Bryan Arrows","Times New Roman", Times, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(64px, 7vw, 112px);
  line-height: .97;
  letter-spacing: -.035em;
}
#featured .hero-statement {
  grid-column: var(--hero-text-col, 1) / span var(--hero-intro-span, 4);
  grid-row: 2;
  min-width: 0;
  padding-top: 0;
  align-self: start;
}
#featured .hero-statement .intro {
  max-width: 31ch;
  margin: 0;
  font-family: var(--sans, "Bryan Arrows",Arial, sans-serif);
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.5;
  letter-spacing: -.02em;
}

#featured .hero-statement .text-link {
  display: inline-flex;
  min-width: 0;
  margin-top: 26px;
  gap: 28px;
  padding-bottom: 6px;
  font-size: 12px;
  line-height: 1.4;
}
#featured .hero-work {
  grid-column: var(--hero-image-col, 8) / span var(--hero-image-span, 5);
  grid-row: 1 / span 2;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  align-self: start;
}
#featured .hero-image,
#featured .selected-grid .selected-card:nth-child(n) .selected-image {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: var(--featured-frame);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}
#featured .hero-image { aspect-ratio: var(--hero-frame, 3 / 4); }
#featured .selected-grid .selected-card:nth-child(n) .selected-image.is-phantom img { object-position: 50% 74%; }
#featured .hero-image > img,
#featured .selected-grid .selected-card:nth-child(n) .selected-image img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  background: #fff;
  filter: grayscale(1);
  transform: none;
  transition: transform 320ms ease-out, filter 240ms ease, opacity 180ms ease;
}
#featured .hero-image > img { object-fit: var(--hero-fit, cover); object-position: var(--hero-position, 50% 50%); }
@media (hover: hover) {
  #featured .hero-image:hover > img,
  #featured .selected-grid .selected-card:nth-child(n) .selected-image:hover img {
    filter: grayscale(0); transform: scale(1.04); opacity: .94;
  }
}
#featured .hero-image:focus-visible > img,
#featured .selected-grid .selected-card:nth-child(n) .selected-image:focus-visible img {
  filter: grayscale(0);
  transform: scale(1.04);
  opacity: .94;
}
#featured .hero-image:focus-visible,
#featured .selected-image:focus-visible { outline: 2px solid var(--ink, #171715); outline-offset: 5px; }
#featured .image-corner,
#featured .selected-image::after {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  right: 10px;
  bottom: 10px;
  padding: 0;
  color: var(--ink, #171715);
  background: #ffffffe8;
  font-size: 16px;
  line-height: 1;
  text-shadow: none;
}
#featured .hero-work figcaption {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: var(--grid-gap, 24px);
  row-gap: 5px;
  margin: 0;
  padding-top: var(--work-cover-caption-gap, 10px);
  font-size: 12px;
  line-height: 1.5;
}
#featured .hero-work figcaption > span:first-child { grid-column: 1 / span 2; }
#featured .hero-work figcaption > .mono {
  grid-column: 3 / span 3;
  justify-self: end;
  max-width: none;
  padding: 0;
  font-size: 9px;
  line-height: 1.7;
  text-align: right;
  color: var(--muted, #73736d);
}

#featured .selected-section { padding-top: 0; padding-bottom: 120px; }
#featured .selected-section > .section-heading { margin-bottom: 64px; padding-top: 21px; }
#featured .selected-section .section-heading h2 { font-size: 32px; line-height: 1.2; }
#featured .selected-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap, 24px);
  row-gap: var(--featured-row-space);
  align-items: start;
}
#featured .selected-grid > .selected-card:nth-child(n) {
  position: static;
  min-width: 0;
  margin: 0;
  padding: 0;
  align-self: start;
  transform: none;
}
#featured .selected-grid > .selected-card:nth-child(1) { grid-column: 1 / span 7; grid-row: 1; align-self: start; }
#featured .selected-grid > .selected-card:nth-child(2) { grid-column: 10 / span 3; grid-row: 1; align-self: end; }
#featured .selected-grid > .selected-card:nth-child(3) { grid-column: 3 / span 7; grid-row: 2; align-self: start; }
#featured .selected-grid > .selected-card:nth-child(4) { grid-column: 1 / span 4; grid-row: 3; align-self: start; }
#featured .selected-grid > .selected-card:nth-child(5) { grid-column: 8 / span 5; grid-row: 3; align-self: end; }
#featured .selected-grid > .selected-card:nth-child(6) { grid-column: 1 / span 5; grid-row: 4; align-self: start; }
#featured .selected-grid > .selected-card:nth-child(7) { grid-column: 8 / span 5; grid-row: 4; align-self: end; }
#featured .selected-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; }
#featured .selected-caption h3 { margin: 0; font: 400 13px/1.4 var(--sans, "Bryan Arrows",Arial, sans-serif); letter-spacing: -.01em; }
#featured .selected-caption > .mono { display: inline; margin: 0; font-size: 9px; line-height: 1.6; white-space: nowrap; }
#featured .selected-meta { margin-top: 5px; font: 9px/1.7 var(--mono, "IBM Plex Mono", monospace); color: var(--muted, #73736d); }

@media (min-width: 761px) {
  #featured .hero[data-hero-layout="stacked"] .hero-work { grid-row: 3; }
  #featured .hero[data-hero-ratio="auto"] .hero-image > img { position: static; height: auto; }

  /* Image and headline share the first row; both captions share the second.
     Changing the image, its ratio, the language or the type scale preserves the alignments. */
  #featured .hero:not([data-hero-layout="stacked"]):has(.hero-work) {
    grid-template-rows: max-content max-content;
    row-gap: 14px;
    align-content: center;
  }
  #featured .hero:not([data-hero-layout="stacked"]) .hero-work { display: contents; }
  #featured .hero:not([data-hero-layout="stacked"]) .hero-work > * {
    grid-column: var(--hero-image-col, 8) / span var(--hero-image-span, 5);
    width: 100%;
    min-width: 0;
    justify-self: end;
  }
  #featured .hero[data-hero-layout="left"] .hero-work > * { justify-self: start; }
  #featured .hero:not([data-hero-layout="stacked"]) .hero-image { grid-row: 1; align-self: center; }
  #featured .hero:not([data-hero-layout="stacked"]) .hero-work figcaption {
    grid-row: 2;
    padding-top: 0;
  }

  /* Balance both sides of the headline itself, even when an eyebrow sits above it. */
  #featured .hero:not([data-hero-layout="stacked"]):has(.hero-work) .hero-title-wrap {
    align-self: stretch;
    display: grid;
    grid-template-rows: 1fr auto 1fr;
  }
  #featured .hero-title-wrap > .eyebrow { grid-row: 1; align-self: end; }
  #featured .hero-title-wrap > h1 { grid-row: 2; }
  #featured .hero[data-hero-title-align="start"]:not([data-hero-layout="stacked"]):has(.hero-work) .hero-title-wrap {
    grid-template-rows: auto auto 1fr;
  }
  #featured .hero[data-hero-title-align="end"]:not([data-hero-layout="stacked"]):has(.hero-work) .hero-title-wrap {
    grid-template-rows: 1fr auto 0;
  }

  #featured .hero:not([data-hero-layout="stacked"]):has(.hero-work) :is(.hero-statement,figcaption) { align-self: baseline; }
  #featured .hero[data-hero-caption-spacing="text"][data-hero-caption-align="center"]:not([data-hero-layout="stacked"]):has(.hero-work) :is(.hero-statement,figcaption) { align-self: center; }
  #featured .hero[data-hero-caption-spacing="text"][data-hero-caption-align="end"]:not([data-hero-layout="stacked"]):has(.hero-work) :is(.hero-statement,figcaption) { align-self: last baseline; }

  /* A caption attached to the cover must not follow a taller text column. */
  #featured .hero:not([data-hero-layout="stacked"], [data-hero-caption-spacing="text"]):has(.hero-work) {
    row-gap: var(--work-cover-caption-gap, 10px);
  }
  #featured .hero:not([data-hero-layout="stacked"], [data-hero-caption-spacing="text"]):has(.hero-work) .hero-image { align-self: end; }
  #featured .hero:not([data-hero-layout="stacked"], [data-hero-caption-spacing="text"]):has(.hero-work) .hero-work figcaption { align-self: start; }

  @supports (height: 1cqh) {
    .panels-ready #featured { container-type: size; }
    .panels-ready #featured .hero:not([data-hero-layout="stacked"]):has(.hero-work) { min-block-size: 100cqh; }
    .panels-ready #featured .hero:not([data-hero-layout="stacked"],[data-hero-ratio="auto"]) .hero-work > * {
      max-inline-size: max(12rem, calc((100cqh - var(--hero-top, 48px) - var(--hero-bottom, 48px) - 9rem) * var(--hero-width-ratio, .75)));
    }
  }
}

@media (max-width: 760px) {
  #featured { --featured-row-space: 60px; }
  #featured .hero {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--grid-gap, 16px);
    row-gap: 36px;
    grid-template-rows: auto auto auto;
    padding-top: var(--hero-mtop, 36px);
    padding-bottom: var(--hero-mbottom, 36px);
  }
  #featured .hero-title-wrap { grid-column: 1 / -1; grid-row: 1; }
  #featured .hero .eyebrow { margin-bottom: 22px; font-size: 9px; }
  #featured .hero h1 { font-size: clamp(46px, 13.8vw, 84px); line-height: .98; letter-spacing: -.03em; }
  #featured .hero-statement { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  #featured .hero-statement .intro { max-width: 33ch; font-size: 18px; line-height: 1.5; }
  #featured .hero-statement .text-link { margin-top: 22px; font-size: 11px; }
  #featured .hero-work { grid-column: 1 / -1; grid-row: 3; }
  #featured .hero-image { aspect-ratio: var(--hero-mframe, 3 / 4); }
  #featured .hero[data-hero-mobile-ratio="auto"] .hero-image > img { position: static; height: auto; }
  #featured .hero-work figcaption { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--grid-gap, 16px); padding-top: var(--work-cover-caption-gap, 10px); font-size: 11px; }
  #featured .hero-work figcaption > span:first-child { grid-column: 1 / span 2; }
  #featured .hero-work figcaption > .mono { grid-column: 3 / span 2; font-size: 8px; }
  #featured .selected-section { padding-bottom: 68px; }
  #featured .selected-section > .section-heading { margin-bottom: 40px; padding-top: 18px; }
  #featured .selected-section .section-heading h2 { font-size: 28px; }
  #featured .selected-section .section-heading .text-link { font-size: 10px; gap: 12px; }
  #featured .selected-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--grid-gap, 16px); }
  #featured .selected-grid > .selected-card:nth-child(n) { grid-column: 1 / -1; grid-row: auto; align-self: start; margin: 0; padding: 0; }
  #featured .selected-grid > .selected-card:nth-child(2),
  #featured .selected-grid > .selected-card:nth-child(6) { grid-column: 2 / span 3; }
  #featured .selected-grid > .selected-card:nth-child(3),
  #featured .selected-grid > .selected-card:nth-child(5) { grid-column: 1 / span 3; }
  #featured .selected-caption { margin-top: 12px; gap: 10px; }
  #featured .selected-caption h3 { font-size: 13px; }
  #featured .selected-caption > .mono,#featured .selected-meta { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  #featured .hero-image > img,
  #featured .selected-grid .selected-card:nth-child(n) .selected-image img { transition: none; }
  #featured .hero-image:is(:hover,:focus-visible) > img,
  #featured .selected-grid .selected-card:nth-child(n) .selected-image:is(:hover,:focus-visible) img { transform: none; }
}
