/* ============================================================================
   highlights.css: /highlights. The page borrows the project template's shell
   (css/work.css: hero, rail, chapters, mosaic); this file only adds the
   hero's section chips and the per-section piece count.
   ========================================================================= */

/* hero: the section index, as a row of chips */
.hl-index { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: flex-end; }
.hl-index a { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none;
  font-size: 14px; transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.hl-index a:hover { border-color: var(--accent-500); color: var(--accent-500); }
.hl-index__no { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent-500); }
/* Large screens: the six pills stay on one line (Michael, 2026-11-18: two lines
   "looks odd"). The index takes its natural width and the intro takes the rest,
   instead of the hero's usual half-and-half. */
@media (min-width: 1360px) {
  .workHero__foot:has(.hl-index) { grid-template-columns: minmax(0, 1fr) auto; }
  .hl-index { flex-wrap: nowrap; }
}

/* section head: number, rule, title, and a piece count on the right */
.hl-head { grid-template-columns: auto 48px auto 1fr; }
.hl-head__count { justify-self: end; color: var(--fg-2); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

/* Logos: an even 3-up grid of light tiles, each mark in its own colors.
   The built images have a white ground; multiply lets the tile's warm paper
   show through instead, so the wall reads as one surface, not 24 white boxes. */
.hl-logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: var(--s-6); }
.hl-logo { display: block; margin: 0; color: inherit; text-decoration: none; }
.hl-logo__tile { display: block; background: var(--paper-200); aspect-ratio: 5 / 4; overflow: hidden; }
.hl-logo__tile .pic, .hl-logo__tile img { display: block; width: 100%; height: 100%; }
.hl-logo__tile img { object-fit: contain; mix-blend-mode: multiply; }
.hl-logo .fig__cap { display: flex; justify-content: space-between; gap: 12px; }

/* Websites: every shot in the same 16:10 window, cut from the top of the page.
   The first few sit two to a row, the archive three to a row, so nothing is
   ever smaller than a third of the column (Michael, 2026-11-11). */
.hl-sites { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 20px; margin-top: var(--s-6); }
.hl-site { grid-column: span 2; display: block; margin: 0; color: inherit; text-decoration: none; }
.hl-site--lead { grid-column: span 3; }
.hl-site__frame { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg, var(--ink-800)); }
.hl-site__frame .pic, .hl-site__frame img { display: block; width: 100%; height: 100%; }
/* --pos / --zoom / --bg: optional per-shot framing (amHlFrameStyle, php/highlights-render.php) */
.hl-site__frame img { object-fit: cover; object-position: var(--pos, top center);
  transform: scale(var(--zoom, 1)); transform-origin: var(--pos, top center); }
.hl-site .fig__cap { display: flex; justify-content: space-between; gap: 12px; }
.hl a.hl-site .fig__cap { transition: color var(--dur-base) var(--ease-out); }
.hl a.hl-site:hover .fig__cap, .hl a.hl-site:focus-visible .fig__cap { color: var(--fg); }

/* A long client name shortens with an ellipsis; it never cuts off mid-letter. */
.hl .fig__cap > span:first-child { flex: none; }
.hl .fig__cap > span:last-child:not(:first-child) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

/* No zoom on hover here (Michael, 2026-11-11). A linked piece answers with its
   caption instead: it lifts to full contrast. */
.hl .pj-fig:hover .pj-fig__frame img { transform: none; }
.hl .mz-link .fig__cap, .hl a.hl-logo .fig__cap { transition: color var(--dur-base) var(--ease-out); }
.hl .mz-link:hover .fig__cap, .hl .mz-link:focus-visible .fig__cap,
.hl a.hl-logo:hover .fig__cap, .hl a.hl-logo:focus-visible .fig__cap { color: var(--fg); }

.hl-end { padding: var(--s-9) 0; border-top: 1px solid var(--line); }
.hl-end .work-cta { margin-top: var(--s-6); }

@media (max-width: 720px) {
  .hl-index { justify-content: flex-start; }
  .hl-head { grid-template-columns: auto 32px 1fr; }
  .hl-head__count { display: none; }
  .hl-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hl-sites { gap: 20px 12px; }
  .hl-site { grid-column: span 3; }
  .hl-site--lead { grid-column: span 6; }
}

/* ---- the viewer (js/highlights.js) ---------------------------------------
   A native <dialog>: the piece large, its caption, a counter, previous / next,
   and a link to the Showcase project when there is one. */
.hl .hl-open { cursor: zoom-in; }
.hl .hl-open:focus-visible { outline: var(--focus-ring); outline-offset: 6px; }

.hlv { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: color-mix(in oklab, var(--ink-1000) 38%, transparent); color: var(--fg); overflow: hidden; }
.hlv[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.hlv::backdrop { background: transparent; }
.hlv__bar, .hlv__foot { display: flex; align-items: center; gap: var(--s-5); padding: 18px var(--gutter); }
.hlv__bar { justify-content: space-between; border-bottom: 1px solid var(--line); }
.hlv__count { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); white-space: pre; }
.hlv__x { background: none; border: 0; padding: 8px 10px; margin-right: -10px; cursor: pointer; color: var(--fg);
  font-family: var(--font-sans); font-size: 14px; display: inline-flex; align-items: center; gap: 10px; }
.hlv__x span { font-size: 22px; line-height: 1; color: var(--accent-500); }
.hlv__x:hover { color: var(--accent-500); }

.hlv__stage { touch-action: pan-y; display: flex; align-items: center; justify-content: center; padding: var(--s-5) var(--gutter); min-height: 0; cursor: zoom-out; }
.hlv__pic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.hlv__pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block;
  view-transition-name: hlv-piece; cursor: default; }
/* a framed website keeps its thumbnail's framing: the same 16:10 window, --pos
   and --zoom, as large as the stage allows (js/highlights.js, 2026-11-19) */
.hlv__stage { container-type: size; }
.hlv__frame { width: min(100cqw, 160cqh); aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--bg, var(--ink-800)); view-transition-name: hlv-piece; }
.hlv__frame .hlv__pic img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover;
  object-position: var(--pos, top center); transform: scale(var(--zoom, 1)); transform-origin: var(--pos, top center);
  view-transition-name: none; }
/* a logo keeps its paper tile in the viewer (same multiply as the grid) */
.hlv__pic--logo { width: auto; height: auto; max-height: 100%; background: var(--paper-200); }
.hlv__pic--logo img { max-height: min(72vh, 720px); mix-blend-mode: multiply; view-transition-name: none; }
.hlv__pic--logo { view-transition-name: hlv-piece; }

.hlv__foot { border-top: 1px solid var(--line); flex-wrap: wrap; }
.hlv__cap { margin: 0; flex: 1 1 240px; display: flex; flex-direction: column; gap: 4px; font-size: 18px; }
.hlv__client { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.hlv__client:empty { display: none; }
.hlv__link[hidden] { display: none; }
.hlv__arrows { display: flex; gap: 10px; }

/* While the viewer is open the page content steps aside, so what shows behind
   the piece is the smoke field itself (the fixed canvas sits under .page). */
.hlv-open .page { visibility: hidden; }
.hlv__bar, .hlv__foot { background: color-mix(in oklab, var(--ink-1000) 55%, transparent); }

/* While a piece grows into the viewer or shrinks back, the page fades quickly
   instead of running the site's slower cross-page fade (css/site.css). */
.hlv-vt::view-transition-old(root) { animation: 260ms ease-out both vt-fade-out; }
.hlv-vt::view-transition-new(root) { animation: 320ms ease-out both vt-fade-in; }
.hlv-vt::view-transition-group(hlv-piece) { animation-duration: 520ms; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
.hlv-vt::view-transition-old(hlv-piece), .hlv-vt::view-transition-new(hlv-piece) { height: 100%; object-fit: cover; }

@media (max-width: 720px) {
  .hlv__bar, .hlv__foot { padding: 14px var(--gutter); }
  .hlv__cap { font-size: 16px; }
}

/* "More on" link under a section's intro line (to its service page). */
.hl-more { margin: var(--s-3) 0 0; }
