/* Production page /production/ (owner: production module). Shared components live in main.css.
   Tokens only; breakpoints 600 / 900 / 1200 / 1440 (min-width). */

/* ------------------------------------------------------------ 5.1 hero: split + «Из портфолио» tag on the photo */
/* the photo is the last cell of .hero-split in both layouts, so the wrapper's bottom-right corner is the photo's */
.prod-hero { position: relative; }
.prod-hero__caption { left: auto; right: 0; }
@media (min-width: 900px) { .page-production .hero-split__text { max-width: 44rem; } }

/* ------------------------------------------------------------ 5.2 facts (white, under the hero) */
/* 6 facts: shared .stats--n6 (2 columns < 900, 3 × 2 at 900–1199, one row ≥ 1200) */
.page-production .prod-stats .stat__label { font-size: .9375rem; }
/* ≤ 399 px: two 156 px columns are a hair short for «алюминиевого профиля» — a narrower gap and no tracking keep it on one line */
@media (max-width: 399px) {
  .page-production .prod-stats { column-gap: 12px; }
  .page-production .prod-stats .stat__label { letter-spacing: 0; }
}
@media (max-width: 359px) { .page-production .prod-stats .stat__value { font-size: 3rem; } }
.prod-why { padding-top: var(--section-s); }

/* ------------------------------------------------------------ 5.4 path of an item */
.prod-path__grid { display: grid; gap: 40px; }
.prod-path__head .label { margin-bottom: 16px; }
.prod-path__lead { margin-top: 24px; font-size: var(--fs-lead); font-weight: var(--w-lead); line-height: 1.45; max-width: 26em; }
.prod-path__steps { margin: 0; padding: 0; list-style: none; }
.prod-step { position: relative; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 12px;
  padding: 0 0 28px 32px; }
.prod-step::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.prod-step:first-child::before { top: 10px; }
.prod-step:last-child { padding-bottom: 0; }
.prod-step:last-child::before { bottom: auto; height: 10px; }
.prod-step::after { content: ""; position: absolute; left: 0; top: 8px; width: 9px; height: 9px; background: var(--navy); }
.prod-step__num { font: 300 1.25rem/1.25 var(--font-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.prod-step__title { font: 500 var(--fs-h4)/1.25 var(--font-text); letter-spacing: 0; color: var(--navy); text-wrap: balance; }
.prod-step__text { grid-column: 2; margin-top: 6px; font-size: 1rem; line-height: 1.55; color: var(--muted); }
@media (min-width: 900px) {
  .prod-path__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
  /* the heading travels with the 12 steps instead of leaving an empty column (same as .request__head) */
  .prod-path__head { grid-column: 1 / 6; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
  .prod-path__steps { grid-column: 7 / 13; padding-top: 6px; }
  .prod-step { grid-template-columns: 3rem minmax(0, 1fr); padding-bottom: 36px; }
  .prod-step__num { font-size: 1.5rem; line-height: 1.05; }
}

/* ------------------------------------------------------------ quality control: ui.caps_list as a grid of six checks */
/* < 600 the shared rows; 600–899 two columns; ≥ 900 three columns (number + title on one line, text under them).
   The shared rule closes only the last row; in a grid every cell of the bottom row gets the closing line. */
@media (min-width: 600px) {
  .prod-qc__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
  .prod-qc__list .caps__row:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (min-width: 900px) {
  .prod-qc__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod-qc__list .caps__row { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-content: start; }
  .prod-qc__list .caps__num { grid-column: 1; }
  .prod-qc__list .caps__title { grid-column: 2; }
  .prod-qc__list .caps__text { grid-column: 1 / -1; max-width: 34em; }
  .prod-qc__list .caps__row:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
}

/* ------------------------------------------------------------ 5.5 opener with the index of workshops */
.prod-opener__lead { max-width: 40em; margin: 0 auto; text-align: center; color: #fff;
  font-size: var(--fs-lead); font-weight: var(--w-lead); line-height: 1.45; }
.prod-toc { margin-top: clamp(40px, 5vw, 72px); }
.prod-toc ol { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line-on-navy); }
.prod-toc a { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px;
  min-height: 44px; padding: 14px 0; border-top: 1px solid var(--line-on-navy); color: #fff; text-decoration: none; }
.prod-toc__num { font: 300 1.125rem/1.2 var(--font-display); color: var(--on-navy-muted); font-variant-numeric: tabular-nums; }
.prod-toc__title { font: 300 1.375rem/1.2 var(--font-display); }
.prod-toc__count { font-size: .875rem; color: var(--on-navy-muted); white-space: nowrap; }
.prod-toc a:hover .prod-toc__title { text-decoration: underline 1px; text-underline-offset: .2em; }
@media (min-width: 900px) {
  .prod-toc ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--gap); border-bottom: 0; }
  .prod-toc a { height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; row-gap: 8px;
    padding: 20px 0 4px; }
  .prod-toc__title { font-size: var(--fs-card); }
}

/* ------------------------------------------------------------ 5.5 workshops */
.prod-shops .container > .shop + .shop { margin-top: clamp(56px, 7vw, 112px); padding-top: clamp(56px, 7vw, 112px);
  border-top: 1px solid var(--line); }
.shop { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
.shop__num { margin-bottom: 16px; }
.shop__intro { font-size: var(--fs-lead); font-weight: var(--w-lead); line-height: 1.45; max-width: 34em; }
.shop__head { display: grid; row-gap: 20px; }
.shop__media { margin: 0; }
.shop__media .media { --ratio: 1/1; }
.shop__media figcaption { margin-top: 10px; font-size: var(--fs-small); line-height: 1.45; color: var(--muted); }
.shop__sublabel { margin-bottom: 16px; }
.shop__list > li + li { margin-top: .5em; }

/* equipment: <details open data-fold> — a folded list < 900 px (the page script closes it), always open ≥ 900 px */
.shop__sum { display: flex; align-items: center; gap: 10px; min-height: 52px; padding-block: 12px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--navy); cursor: pointer; list-style: none; color: var(--navy); }
.shop__sum::-webkit-details-marker { display: none; }
.shop__sum .label { color: var(--navy); }
.shop__count { font-size: var(--fs-small); color: var(--muted); }
.shop__chev { width: 20px; height: 20px; margin-left: auto; transition: transform var(--dur-2) var(--ease-std); }
.shop__equip[open] .shop__chev { transform: rotate(180deg); }
.shop__sum:hover .label { text-decoration: underline 1px; text-underline-offset: .2em; }
.shop__keys { margin: 0; padding: 0; list-style: none; }
.shop__keys li + li { margin-top: 2px; }
.shop__table td:nth-child(2) { color: var(--ink); }
/* the caption is sr-only; < 900 px main.css gives .spec-table caption width:auto — keep it a 1 px box */
.spec-table.shop__table caption { width: 1px; }
@media (min-width: 900px) {
  .shop__sum { display: none; }
}
@media (max-width: 899px) {
  .shop__table tr { padding-block: 16px; }
  .shop__table tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .shop__table td:first-child { font-size: 1.25rem; margin-bottom: 4px; }
  .shop__table td:not(:first-child)::before { content: none; }
  .shop__table td:nth-child(2) { font-size: var(--fs-small); color: var(--ink); }
  .shop__table td:nth-child(3) { margin-top: 6px; color: var(--muted); }
  .shop__keys li { position: relative; padding-left: 1.1em; }
  .shop__keys li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5em; height: 1px; background: currentColor; opacity: .6; }
}
/* tablets: machine cards two per row instead of one long thin list */
@media (min-width: 600px) and (max-width: 899px) {
  .shop__table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
  .shop__table tbody tr:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (min-width: 600px) {
  .shop { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
  .shop__head, .shop__equip { grid-column: 1 / -1; }
  .shop__media { grid-column: 1; }
  .shop__caps { grid-column: 2; align-self: start; }
}
@media (min-width: 900px) {
  .shop { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: clamp(40px, 4vw, 56px); align-items: start; }
  .shop__head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
  .shop__headline { grid-column: 1 / 6; }
  .shop__intro { grid-column: 7 / 13; padding-bottom: .2em; }
  .shop__media { grid-column: 1 / 6; grid-row: 2; }
  .shop__media .media { --ratio: 4/5; }
  .shop__caps { grid-column: 7 / 13; grid-row: 2; }
  .shop__equip { grid-column: 1 / -1; grid-row: 3; }
}
@media (min-width: 1200px) {
  .shop { grid-template-rows: auto auto 1fr; }
  .shop__media { grid-row: 2 / span 2; position: sticky; top: calc(var(--header-h) + 32px); }
  .shop__equip { grid-column: 7 / 13; grid-row: 3; }
  .shop__table td:nth-child(1) { width: 40%; }
  .shop__table td:nth-child(2) { width: 24%; }
}
/* 1200–1439 the half-width table is narrower: a wider model column keeps «Nanxing NCG3021E», «Ostermann T 1003» on one line */
@media (min-width: 1200px) and (max-width: 1439px) {
  .shop__table td:nth-child(1) { width: 36%; }
  .shop__table td:nth-child(2) { width: 27%; }
}
@media (min-width: 1200px) and (max-height: 760px) { .shop__media { position: static; } }

/* two closing lines under the workshops: studios (operations) · large objects (batches) */
.prod-more { list-style: none; margin: clamp(56px, 7vw, 112px) 0 0; padding: 0; }
.prod-more__row { display: grid; gap: 16px; padding-block: 28px; border-top: 1px solid var(--line); }
.prod-more__row:last-child { padding-bottom: 0; }
.prod-more__row p { max-width: 44em; font-size: var(--fs-body); }
@media (min-width: 900px) {
  .prod-more__row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: baseline; }
  .prod-more__row p { grid-column: 1 / 9; }
  .prod-more__row .link-arrow { grid-column: 9 / 13; justify-self: end; }
}

/* ------------------------------------------------------------ 5.7 details: a swipe rail on phones */
@media (max-width: 599px) {
  .prod-details .caps--materials { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain; margin-inline: calc(-1 * var(--margin)); padding: 0 var(--margin) 12px;
    scroll-padding-inline: var(--margin); }
  .prod-details .mat { flex: 0 0 78%; scroll-snap-align: start; }
  .prod-details .mat__media { aspect-ratio: 1 / 1; }
  .js .prod-details .caps--materials [data-reveal] { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ 5.7 + 5.9: one mist surface, two sections */
/* «Материалы и фурнитура» continues the mist of «Детали» after a hairline (the wrapper .prod-mist carries the surface) */
.prod-mat { margin-top: var(--section-s); }
.prod-mat__body { padding-top: var(--section-s); border-top: 1px solid var(--line-strong); }
.prod-mat__cols { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
.prod-mat__col { min-width: 0; padding-top: 24px; border-top: 1px solid var(--navy); }
.prod-mat__title { font: 300 var(--fs-h3)/1.15 var(--font-display); color: var(--navy); }
.prod-mat__content { max-width: 40em; }
.prod-mat__content > :first-child { margin-top: 20px; }
.prod-mat__sub { margin: 28px 0 12px; }
.prod-mat__text { margin-top: 16px; font-size: 1rem; line-height: 1.55; }
.prod-mat__list { margin: 12px 0 0; font-size: 1rem; line-height: 1.55; }
.prod-mat__list > li + li { margin-top: .6em; }
.prod-mat__proj { display: block; width: fit-content; margin-top: 2px; font-size: var(--fs-small); line-height: 1.45; color: var(--navy); }
/* hardware: brand (strong, navy) over what it is used for */
.prod-mat__brands { margin: 20px 0 0; display: grid; row-gap: 14px; }
.prod-mat__brands div { padding-top: 14px; border-top: 1px solid var(--line-strong); }
.prod-mat__brands dt { font-size: 1rem; font-weight: var(--w-strong); letter-spacing: 0; color: var(--navy); }
.prod-mat__brands dd { margin: 2px 0 0; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.prod-mat__brands + .prod-mat__text { margin-top: 24px; }
@media (min-width: 900px) and (max-width: 1199px) {
  /* one column per row: title on the left, text on the right (like the shared caps rows) */
  .prod-mat__col { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding-top: 28px; }
  .prod-mat__title { grid-column: 1 / 5; }
  .prod-mat__content { grid-column: 5 / 13; max-width: none; }
  .prod-mat__content > :first-child { margin-top: 0; }
  .prod-mat__content > .prod-mat__sub:first-child { margin-top: .5em; }
}
@media (min-width: 1200px) {
  .prod-mat__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); }
  .prod-mat__content { max-width: none; }
}

/* fittings photos: 2 per row < 600, 3 per row 600–1199, one row of 6 ≥ 1200; square frames, lightbox */
.prod-fill { list-style: none; margin: clamp(48px, 6vw, 80px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px var(--gap); }
.prod-fill__item { min-width: 0; }
.prod-fill__fig { margin: 0; }
.prod-fill__link { display: block; aspect-ratio: 1 / 1; cursor: zoom-in; }
.prod-fill__fig figcaption { margin-top: 10px; font-size: var(--fs-small); line-height: 1.45; color: var(--muted); }
.prod-fill__fig figcaption a { display: block; width: fit-content; margin-top: 2px; color: var(--navy); }
@media (min-width: 600px) { .prod-fill { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .prod-fill { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
