/* ============================================================
   Process pages — /process/ and one option
   Everything shared lives in style.css's catalog components; only
   what these two layouts need on top of them is here, and every
   rule is scoped to .pg--process so it cannot reach another page.
   Nothing here encodes a record value.
   ============================================================ */

/* A layer row is one line on a wide screen. Below that the description cannot
   sit beside the title without both wrapping into each other, so it takes a
   line of its own under the number and the title. */
@media (max-width: 640px) {
  .pg--process .layer { flex-wrap: wrap; }
  .pg--process .layer__d { margin-left: 0; flex-basis: 100%; }
}

/* Here a chip is a link to a fabric record, so it has to look like one: the
   plain chip carries no affordance because nothing else in it is clickable.
   The cue is an underline rather than a second border, which would fight the
   pill's own outline. */
.pg--process .chip a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--op-stone-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.pg--process .chip a:hover,
.pg--process .chip a:focus-visible {
  color: var(--op-accent);
  text-decoration-color: var(--op-accent);
}

/* An option with no featured image reuses `.record-hero--text` from
   catalog-cloth.css: one variant for "facts without a picture" across the whole
   catalog, rather than a second name for the same thing. */

/* The catalogue keeps the site frame — the same --frame gutter every other page, the header and the
   footer use — so its filter column starts on the same line as the type above it and the grid stops
   where the rest of the site stops. A narrower gutter of its own was tried to give the photographs
   the width; it made the page run to the window's edge and read wider than any other page. */
.pg--process-index .side-layout { gap: var(--s6) }

/* The catalogue's row is measured by the same rule as the product page's own customization row
   (`.bld-opts` in product-build.css): one photograph of a finish is judged at one size wherever it
   appears, so its frame here is the size its frame is there — about 250px on a 1440 window, 180 at
   1200. The filter column takes 300px of the page that the product page does not, so three frames
   only fit at that size on a wide window; below that two wider ones stay nearer the same measure
   than three squeezed ones would. */
.pg--process-index .proc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 34px);
}

@media (min-width: 1050px) {
  .pg--process-index .proc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}

/* ── /customization/: the finishes, photographed, in one place ─────────────────────────────────
 * The page is a catalogue now, not an index of pages: each finish is a card of one photograph and
 * its name, sized so the finish itself is what is compared. The photograph is the button — it opens
 * the site's viewer, whose own styles live in catalog-shots.css.
 */
.pg--process-index .proc-index { margin-top: var(--s8) }

/* The section's own rhythm already spaces the groups; the banner's line above the first one is
   enough, so the first group does not add a second gap under it. */
.pg--process-index .proc-index > .proc-group:first-child { margin-top: 0 }

.pg--process-index .proc-group + .proc-group { margin-top: var(--s8) }

/* The filter column is a table of contents: every row jumps into this page (a group's heading, an
   option's card). The site header is sticky, so a jump has to stop below it rather than under it. */
.pg--process-index .proc-group,
.pg--process-index .proc-card { scroll-margin-top: 104px }

.pg--process-index .proc-group > .section-h {
  margin: 0 0 var(--s4);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--op-line);
}

.proc-grid {
  display: grid;
  /* The fallback for any grid of option cards: as many as the column allows, never one tiny card.
     The catalogue sets its own count, matched to the product page's row (see .pg--process-index). */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The card is the frame and the name, nothing else. A white box with a hairline of its own around the
   photograph made the same picture read larger here than on the product page, where the frame is the
   card: one rule for both, so a finish is one size wherever it is looked at. */
.proc-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 0;
  background: transparent;
  border: 0;
}

.proc-card:hover .proc-card__shot,
.proc-card:focus-within .proc-card__shot { border-color: var(--op-ink-900) }

/* The frame is the box the dots and the corner mark are placed in, so it is the positioned
   ancestor: the picture and everything laid over it stay inside the frame's own border. It is also
   the hairline the photograph sits behind — the product page's option frames are drawn the same way. */
.proc-card__shot {
  position: relative;
  margin: 0;
  border: 1px solid var(--op-line);
  background: var(--op-white);
  transition: border-color .16s ease;
}

/* Every photograph of the finish is a link of the viewer's root, stacked in one cell: the one on
   show is the only one in sight, and the rest keep their place so a dot can bring one forward
   without the frame changing height. */
.proc-card__slides {
  display: grid;
  position: relative;
}

.proc-card__slides > .proc-card__open { grid-area: 1 / 1 }

.proc-card__open {
  display: block;
  position: relative;
}

.proc-card__open:not(.is-current) { visibility: hidden }

.proc-card__open:focus-visible {
  outline: 2px solid var(--op-accent);
  outline-offset: 2px;
}

.proc-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  /* The photograph fills the frame edge to edge. The window is pale blue and this frame is pure
     white, so a shot that was not exactly 4:3 left a band of white down each side of the card, which
     reads as a mistake rather than as a mount. The card is a thumbnail, so it is filled (`cover`) and
     the photograph is shown whole — nothing cropped away — in the viewer it opens. */
  object-fit: cover;
  /* Which part of the picture the frame keeps: the card names it (the record's "Card crop", printed
     by optic_shot_card()), and a card that names none is centred. Only the frame is cropped — the
     viewer under it opens the whole file. */
  object-position: var(--proc-focus, 50% 50%);
  background: var(--op-white);
}

.proc-card__empty {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--op-paper-2);
}

/* One dot per photograph, centred at the foot of the frame: how many there are, which one is on
   show (the darker one), and a way to bring any of the others forward. The strip sits on its own
   pale ground so it reads over a pale photograph as well as a dark one. */
.proc-card__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 10px;
  list-style: none;
  background: rgb(255 255 255 / .84);
  border-radius: 999px;
  transform: translateX(-50%);
}

.proc-card__dot {
  display: block;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--op-stone-300);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}

.proc-card__dot:hover { border-color: var(--op-ink-700) }

.proc-card__dot.is-current {
  border-color: var(--op-ink-900);
  background: var(--op-ink-900);
}

.proc-card__dot:focus-visible {
  outline: 2px solid var(--op-accent);
  outline-offset: 2px;
}

/* The corner mark: the frame can be looked at larger. It takes no pointer, so the click still lands
   on the photograph underneath and opens the viewer. */
.proc-card__zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--op-ink-900);
  background: rgb(255 255 255 / .86);
  border-radius: 50%;
  pointer-events: none;
}

.proc-card__zoom svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* The words that say what kind of thing a card is, after its name: the logo positions sit in the
   Printing group, and without this line "Centre" reads as a seventh way of printing. */
.proc-card__tag {
  display: inline-block;
  margin-left: .45rem;
  padding: 2px 7px;
  font-family: var(--op-f-body);
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.6;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--op-stone-600);
  background: var(--op-paper-2);
  border-radius: 999px;
}

.proc-card__tag,
.proc-card__dots { -webkit-print-color-adjust: exact; print-color-adjust: exact }

/* The same words on the group page's tiles and in the filter column, one step quieter: they qualify
   a name, they are not a second name. */
.pg--process .card__tag,
.pg--process .side-nav__tag {
  display: inline-block;
  margin-left: .4rem;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.6;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--op-stone-600);
}

.pg--process .card__tag {
  padding: 1px 6px;
  background: var(--op-paper-2);
  border-radius: 999px;
}

@media (max-width: 600px) {
  .proc-card__tag,
  .pg--process .card__tag,
  .pg--process .side-nav__tag { font-size: .62rem }
}

.proc-card__name {
  margin: 0;
  font-family: var(--op-f-display);
  font-weight: 400;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--op-ink-900);
}

@media (max-width: 600px) {
  .proc-card__name { font-size: 1.08rem }
}
