/* Work detail hierarchy from the approved Design:
   header and maturity first, narrative second, stack and scale third, gallery
   plates fourth, real continuation last. Scoped to .work-detail so no other
   surface inherits these rules; colors use the site's scheme tokens. */

/* UI round 9 (operator-directed Podium polish): the header keeps its grid with a
   calmer title; the eyebrow is the mono crumb line; the stamp is a detail well;
   the narrative is the reading sheet (r14 gradient, sheet hairline, shadow);
   facts are wells; plates are r10 preview plates; the continuation is the mono
   utility key. The left-aligned column is kept (the header lockup and Menu
   anchor the edges). [SPEC 8.9, 8.10; MAPPING 9] */
.work-detail {
  --work-detail-copy: var(--text-body);
  --work-detail-label: var(--text-2);
  --work-detail-plate: var(--plate);
  --work-detail-rule: var(--rule);
  display: block;
  max-width: 76rem;
}

.work-detail .entry-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, .55fr);
  align-items: end;
  gap: 1.5rem 2rem;
  max-width: 76rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.work-detail .entry-header h1 {
  max-width: 22ch;
  margin: 0 0 .85rem;
  color: var(--text-hi);
  font-size: var(--title-size);
  letter-spacing: .005em;
  line-height: 1.08;
}

.work-detail .eyebrow { margin: 0 0 1rem; color: var(--text-label); }
.work-detail .entry-attribution { margin-top: -.55rem; }
/* UI round 19: the partner firms in the credit are shown by their logos. The
   line centres its words on the logos; each logo link keeps a 44px target. */
.work-detail .entry-attribution:has([data-partner-link]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: .9em;
  margin-top: -.9rem;
  margin-bottom: .55rem;
}
/* The firms stay together: when the line is too narrow they wrap as one group. */
.work-detail .entry-attribution-firms {
  display: inline-flex;
  align-items: center;
  column-gap: .9em;
  white-space: nowrap;
}
/* The attribution partners are prose links inside the line: underlined. */
.work-detail .eyebrow a { color: var(--text-hi); text-decoration-color: color-mix(in srgb, var(--text-hi) 55%, transparent); text-underline-offset: .22em; }
/* UI round 14: the section word of the eyebrow is the way back to its index
   ("← Work"). The arrow is drawn here, so the eyebrow's words are unchanged;
   the link keeps a 44px target without growing the line. */
.work-detail .eyebrow .parent-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -17px;
  text-decoration: none;
}
.work-detail .eyebrow .parent-link::before { content: "\2190"; margin-right: .6em; letter-spacing: 0; }
.work-detail .eyebrow .parent-link:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.work-detail .lede {
  max-width: 56ch;
  margin: 0;
  color: var(--text-2);
  font-size: var(--lede-size);
  line-height: 1.55;
}

/* The stamp: Podium's detail well with divided rows [SPEC 8.9 .dv-trio, 8.10]. */
.work-detail .entry-stamp {
  padding: 4px 16px;
  border: 1px solid var(--line-detail);
  border-radius: var(--radius-well);
  background: var(--well-quiet);
  box-shadow: var(--groove-quiet);
}

/* Labels share the first-line baseline of the value beside them (UI round 5);
   each row's label and value carry the same padding, so the shared baseline holds. */
.work-detail .entry-stamp dl { display: grid; grid-template-columns: 7rem 1fr; align-items: baseline; gap: 0 .75rem; margin: 0; }
.work-detail .entry-stamp dt,
.work-detail .entry-stamp dd { padding: 11px 0; border-top: 1px solid var(--work-detail-rule); }
.work-detail .entry-stamp dt:first-of-type,
.work-detail .entry-stamp dd:first-of-type { border-top: 0; }
.work-detail .entry-stamp dt { color: var(--text-2); font-size: var(--label-size); line-height: 1.5; text-transform: uppercase; letter-spacing: .14em; }
.work-detail .entry-stamp dd { margin: 0; color: var(--text-hi); font-size: .875rem; line-height: 1.45; }
.work-detail .maturity { color: var(--jade-word); }

.work-detail .narrative {
  display: grid;
  grid-template-columns: minmax(10rem, .4fr) minmax(18rem, 1fr);
  align-items: baseline;
  gap: .5rem clamp(1.5rem, 4vw, 3.5rem);
  max-width: 68rem;
  margin: 0 0 2.75rem;
}

.work-detail .narrative-label {
  margin: 0;
  color: var(--work-detail-label);
  font-family: var(--font-meta, "JetBrains Mono", ui-monospace, SFMono-Regular, monospace);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.work-detail .narrative-copy { color: var(--work-detail-copy); font-size: var(--body-size); line-height: 1.65; }
.work-detail .narrative-copy p { max-width: 62ch; margin: 0; }

/* The narrative is the reading sheet: the document on the desk [SPEC 8.9 .doc-sheet]. */
.work-detail .entry-narrative {
  max-width: 68rem;
  margin: 0 0 2.75rem;
  padding: 26px 30px 30px;
  border: 1px solid var(--line-sheet);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
  box-shadow: var(--shadow-sheet);
}
.work-detail .entry-narrative .narrative { margin-bottom: 0; padding: 18px 0; border-top: 1px solid var(--rule-soft); }
.work-detail .entry-narrative .narrative:first-child { padding-top: 4px; border-top: 0; }
.work-detail .entry-narrative .narrative:last-child { padding-bottom: 0; }

.work-detail .fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 12px;
  max-width: 76rem;
  margin: 0 0 2.75rem;
  background: none;
  border: 0;
}

.work-detail .fact-strip section {
  padding: 14px 16px 16px;
  border: 1px solid var(--line-lift);
  border-radius: var(--radius-well);
  background: var(--well);
  box-shadow: var(--groove);
}
.work-detail .fact-strip h2 {
  margin: 0 0 .55rem;
  color: var(--text-2);
  font-family: var(--font-meta, "JetBrains Mono", ui-monospace, SFMono-Regular, monospace);
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.work-detail .fact-strip p { margin: 0; color: var(--work-detail-copy); font-size: .9375rem; line-height: 1.6; }

/* Gallery screens always sit on a plate: the figure carries the surface, the
   image never paints directly onto the page background. */
.work-detail .gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; max-width: 76rem; margin: 0 0 2.75rem; }
.work-detail .gallery.two { grid-template-columns: 1.25fr .75fr; }
.work-detail .gallery > * { margin: 0; }
/* Podium's preview plate [SPEC 8.9 .dv-page]: r10, gradient ground, detail hairline. */
.work-detail .media-frame {
  position: relative;
  overflow: hidden;
  padding: clamp(.75rem, 2vw, 1.25rem);
  border: 1px solid var(--line-detail);
  border-radius: var(--radius-plate);
  background: var(--work-detail-plate);
  box-shadow: var(--shadow-plate);
}
.work-detail .media-frame img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 4px; }
.work-detail .media-frame[data-dark-native="true"] { background: color-mix(in srgb, var(--bg-elevated) 70%, #000); }
/* UI round 6: the approved Design's plate caption (designs-v2 site.css
   .gallery figcaption), on the plate under its image. */
.work-detail .media-frame .media-caption { margin: 0; padding-top: .65rem; color: var(--text-2); font-size: .8rem; line-height: 1.5; }
/* A dark-native plate stays dark-mixed in the light scheme (a mid-grey ground), where
   the muted ink falls under 4.5:1; its caption takes the full text ink there. */
:root[data-theme="light"] .work-detail .media-frame[data-dark-native="true"] .media-caption,
body[data-scheme="light"] .work-detail .media-frame[data-dark-native="true"] .media-caption { color: var(--text); }

/* UI round 8: a full-page capture (taller than 1.6 x its width) shows its top,
   cropped for display only at min(1.6 x its width, 90vh), and fades into the
   plate at the cut; "View full image" opens the whole capture. Without
   JavaScript the plate is not cropped and the link is not shown. */
.js .work-detail .media-frame--tall .media-crop {
  width: 100%;
  aspect-ratio: 5 / 8;
  max-height: 90vh;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 6rem), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - 6rem), transparent);
}
.js .work-detail .media-frame--tall .media-crop img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.work-detail .media-frame--tall .media-full-link { margin-top: .9rem; }

/* Continuations (public site, brand book, full image) are the mono utility key
   [SPEC 8.7 .dv-open]: r8, detail hairline, 44px target. It carries no filled
   ground, so it never reads as the conversion control (AC-088-01); hover steps
   its hairline up one ramp stop. */
.work-detail :is(.inline-action.verification-link, [data-book-launcher-link], .media-full-link) {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-control);
  color: var(--text-hi);
  background-color: transparent;
  box-shadow: var(--lip);
  font: 500 .6875rem/1.2 var(--font-meta, "JetBrains Mono", ui-monospace, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.work-detail :is(.inline-action.verification-link, [data-book-launcher-link], .media-full-link):hover {
  color: var(--text-hi);
  border-color: var(--control-line-strong);
}
.work-detail .verification-link-body { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.work-detail .verification-link { margin-top: 0; }
.work-detail .inline-action.verification-link::after { content: "↗"; margin-left: .55rem; color: var(--cyan); }
.work-detail .linkless-reason,
.work-detail .availability-note { max-width: 62ch; margin: 0; color: var(--work-detail-copy); font-size: var(--body-size); line-height: 1.65; }

@media (max-width: 1023px) {
  .work-detail .entry-header { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .work-detail .entry-header h1 { font-size: var(--title-size); }
  .work-detail .narrative { grid-template-columns: 1fr; gap: .6rem; }
  .work-detail .entry-narrative { padding: 20px 17px 24px; }
  .work-detail .fact-strip { grid-template-columns: 1fr; }
  .work-detail .gallery.two { grid-template-columns: 1fr; }
}
