/* International style — subgrid. A strict twelve-column grid on the article; every chapter is a subgrid of it, so
   chapter numbers, headings and text line up down the whole page. Helvetica, flush left, ragged right, one red.
   Designed by machine for the Slopwright. */
:root { color-scheme: light; --red: #d40f14; --ink: #111; --grey: #595959; --rule: #111; }
* { box-sizing: border-box; }
html { overflow-x: clip; }
body { min-width: 320px; margin: 0; background: #fff; color: var(--ink); font: 17px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:where(a, [tabindex]):focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; top: -80px; left: 8px; padding: 8px 12px; background: var(--red); color: #fff; }
.skip:focus { top: 8px; }
.page { max-width: 1320px; margin: auto; padding: 0 4vw; }
.main:focus { outline: none; }
.extra { display: none; }
h1, h2 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }

.site-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px; padding: 20px 0; border-bottom: 2px solid var(--rule); }
.masthead { display: flex; align-items: center; gap: 14px; }
.masthead .brand { display: flex; align-items: center; min-height: 40px; }
.masthead .brand img { display: block; height: 24px; width: auto; }
.site-name { display: inline-flex; align-items: center; min-height: 40px; padding-left: 14px; border-left: 1px solid var(--rule); font-weight: 700; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }

.manual, .outfits { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; }
.manual > *, .outfits > * { grid-column: 1 / -1; }

.title-block { display: grid; grid-template-columns: subgrid; padding: 72px 0 48px; border-bottom: 2px solid var(--rule); }
.edition { grid-column: 1 / 4; margin: 0; padding-top: 12px; color: var(--grey); font-size: 14px; }
.title { grid-column: 4 / -1; font-size: clamp(54px, 9vw, 150px); letter-spacing: -.045em; line-height: .9; }
.title::first-line { color: var(--red); }
.subtitle { grid-column: 4 / 10; margin: 28px 0 0; font-size: 22px; line-height: 1.3; }

.contents { display: grid; grid-template-columns: subgrid; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.contents-title { grid-column: 1 / 4; font-size: 14px; }
.contents-list { grid-column: 4 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 20px; margin: 0; padding: 0; list-style: none; counter-reset: c; }
.contents-list li { counter-increment: c; }
.contents-list a { display: inline-block; min-height: 30px; text-decoration: none; font-size: 15px; }
.contents-list a::before { content: counter(c); display: inline-block; width: 1.6em; color: var(--red); font-weight: 700; }

.chapter { display: grid; grid-template-columns: subgrid; padding: 36px 0 40px; border-bottom: 1px solid var(--rule); scroll-margin-top: 16px; }
.chapter-title { grid-column: 1 / 5; display: grid; grid-template-columns: subgrid; align-items: start; align-self: start; }
.chapter-num { grid-column: 1 / 2; color: var(--red); font-size: 64px; font-weight: 700; line-height: .8; letter-spacing: -.05em; }
.chapter-name { grid-column: 2 / 5; font-size: 26px; line-height: 1.05; }
.chapter-body { grid-column: 6 / 12; }
.chapter-body > :first-child { margin-top: 0; }
.first { font-size: 21px; line-height: 1.35; }
.plate { margin: 28px 0 0; }
.plate img { display: block; width: 100%; filter: grayscale(1) contrast(1.05); }
.plate figcaption { margin-top: 8px; color: var(--grey); font-size: 13px; }
.tools, .rules { padding: 0; list-style: none; }
.tools li, .rules li { padding: 10px 0; border-top: 1px solid #ccc; }
.rules { counter-reset: r; }
.rules li::before { content: counter(r); counter-increment: r; display: inline-block; width: 1.6em; color: var(--red); font-weight: 700; }
.note { margin: 20px 0; padding: 16px 0 16px 18px; border-left: 6px solid var(--red); }
.note p { margin: 0; }
.saying { margin: 28px 0 0; font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.saying p { margin: 0; }
.saying footer { margin-top: 8px; color: var(--grey); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { padding-bottom: 8px; color: var(--grey); font-size: 13px; text-align: left; }
th, td { padding: 10px 12px 10px 0; border-top: 1px solid #ccc; text-align: left; vertical-align: top; }
thead th { border-top: 2px solid var(--rule); font-size: 13px; }
.hazards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 20px; margin: 0; }
.hazard { border-top: 4px solid var(--red); padding-top: 10px; }
.hazard dt { font-weight: 700; }
.hazard dd { margin: 4px 0 0; font-size: 15px; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 0; }

.outfits { padding: 48px 0; }
.outfits-title { grid-column: 1 / 6; font-size: 34px; }
.outfits-lede { grid-column: 6 / 12; margin: 0; color: var(--grey); }
.outfit-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; margin: 32px 0 0; padding: 0; list-style: none; }
.outfit { padding: 10px 0 12px; border-top: 1px solid var(--rule); font-size: 14px; }
.outfit-link { display: inline-block; min-height: 26px; font-weight: 700; font-size: 16px; text-decoration: none; }
.outfit-by, .outfit-note { display: none; }
.outfit-technique { display: block; color: var(--grey); }
#th-swiss { border-top: 6px solid var(--red); }
#th-swiss .outfit-link { color: var(--red); }
#th-swiss .outfit-link::after { content: " — current"; color: var(--ink); font-weight: 400; }
#th-swiss .outfit-note { display: block; }

.site-foot { padding: 20px 0 48px; border-top: 2px solid var(--rule); color: var(--grey); font-size: 14px; }
.site-foot p { max-width: 70ch; margin: 4px 0; }

@supports not (grid-template-columns: subgrid) {
  .title-block, .contents, .chapter { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; }
  .chapter-title { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 20px; }
}
@media (max-width: 860px) {
  .edition, .title, .subtitle, .contents-title, .contents-list, .chapter-body, .outfits-title, .outfits-lede { grid-column: 1 / -1; }
  .chapter-title { grid-column: 1 / -1; }
  .chapter-num { grid-column: 1 / 3; font-size: 48px; }
  .chapter-name { grid-column: 3 / -1; align-self: end; }
  .chapter-body { margin-top: 20px; }
  .title-block { padding: 40px 0 32px; }
  .subtitle { font-size: 19px; }
  .hazards { grid-template-columns: 1fr; }
  .outfits-lede { margin-top: 12px; }
}

/* moving between outfits: a cross-document view transition where the browser has them (Chromium did, Firefox did not, when check.mjs last ran), with the
   masthead and the title carried across; an ordinary page load elsewhere, and under reduced motion */
@view-transition { navigation: auto; }
.masthead { view-transition-name: masthead; }
.title { view-transition-name: manual-title; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
