
:root { --accent: #16294f; --data: #304e88; }
/* The stylesheet of Spawanie na wymiar: everything the site looks like. Edit it in the editor under
   Stylesheet; it is published like any other edit, after the automatic checks. The shared layout
   comes first, then the guide design. The colours set in Settings are added after it. */

/* Shared layout: reset, layout primitives, accessibility, and the pieces that depict data (bars,
   drawings to scale, grate swatches). The templates rely on these classes. --accent and --data are
   set from Settings when the site is built; the neutral colours below can be overridden in Settings
   (Background and text colours) or further down in this stylesheet. */

:root {
  color-scheme: light;
  --bg: #f6f4f0;
  --surface: #ffffff;
  --alt: #eeeae3;
  --ink: #17140f;
  --muted: #5d5851;
  --line: #dcd5ca;
  --gutter: 16px;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container, 1180px); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: var(--gutter); top: -80px; z-index: 30;
  padding: 10px 16px; background: var(--ink); color: #fff; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.notfound__actions { margin-top: 1.75rem; }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Tables become one card per row on narrow screens; each cell shows its column name. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: baseline; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 719px) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table, tbody, tr, th, td { display: block; }
  tbody td { display: flex; justify-content: space-between; gap: 16px; }
  tbody td::before { flex: none; content: attr(data-label); }
}

/* Bars beside the figures in a table: one scale per column, baseline on the left.
   The track is the data colour, see-through, so it shows on any background. */
.bar__track { fill: color-mix(in srgb, var(--data) 20%, transparent); }
.bar__fill { fill: var(--data); }
td.has-bar { white-space: nowrap; }
.cell-bar { display: inline-block; margin-right: 10px; vertical-align: middle; }
@media (max-width: 719px) {
  tbody td.has-bar { display: grid; grid-template-columns: minmax(0, 1fr) 64px 5.75rem; align-items: center; gap: 12px; }
  .cell-bar { margin: 0; }
  .cell-val { text-align: right; }
}

/* Drawings to scale: drain plans and tray footprints. */
.plan__body { fill: var(--plan-fill, var(--surface)); stroke: var(--plan-line, var(--muted)); stroke-width: 1px; }
.plan__channel,
.plan__drain { fill: var(--data); }
.plan__falls { fill: none; stroke: color-mix(in srgb, var(--plan-line, var(--muted)) 50%, transparent); stroke-width: 1px; }

/* Size chooser: the layout every design shares. Trays: tiles that share their rows (drawing,
   size, facts, links) so everything lines up across a row, drawings standing on one baseline.
   Drains: rows that switch from stacked to three columns on the width of the list itself. */
.chooser, .tiles, .tile__facts, .tile__links, .run__facts, .run__links { margin: 0; padding: 0; list-style: none; }
.chooser__group + .chooser__group { margin-top: clamp(2rem, 4vw, 2.75rem); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); column-gap: 16px; }
.tile { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 8px; margin-bottom: 24px; }
.tile__plan { grid-row: 1; display: flex; align-items: flex-end; }
.tile__size { grid-row: 2; }
.tile__facts { grid-row: 3; }
.tile__links { grid-row: 4; }
.tile__plan .plan,
.run__plan .plan { max-width: 100%; height: auto; }
.tile__facts { display: grid; align-content: start; }
.tile__links { display: grid; gap: 8px; align-content: end; }
.chooser--drain { container-type: inline-size; }
.run { display: grid; gap: 12px 24px; padding-block: 16px; }
.run__links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@container (min-width: 30rem) { .run__links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 52rem) { .run { grid-template-columns: 7.5rem minmax(0, 1fr) 30rem; align-items: center; } }
.grate { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; overflow-wrap: anywhere; text-decoration: none; }

/* Grate swatches: a picture of each grate's top. Plain; round perforations in mixed sizes;
   rows of small squares. Anything else shows plain steel. */
.grate::before {
  content: ""; flex: none; width: 20px; height: 11px; border-radius: 1px;
  background: linear-gradient(180deg, #e6e9eb, #b4bbc1);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 14%);
}
.grate--mistral::before {
  background:
    radial-gradient(circle, #4b535a 0 1.25px, transparent 1.6px) 1px 1px / 7px 10px,
    radial-gradient(circle, #4b535a 0 0.8px, transparent 1.1px) 4.5px 5px / 7px 10px,
    linear-gradient(180deg, #e6e9eb, #b4bbc1);
}
.grate--sirocco::before {
  background:
    conic-gradient(#4b535a 25%, transparent 0) 0 0 / 3px 3px,
    linear-gradient(180deg, #e6e9eb, #b4bbc1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Design: guide (spawanienawymiar.pl). A workshop manual you can read on screen: a title block,
   numbered sections, drawings with captions, ruled tables. One family with Polish letters,
   Archivo: bold for everything that labels, regular for everything that is read, as in the
   Spawanie na wymiar logo. See docs/design.md. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-pl.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

.design-guide {
  --container: 1000px;
  --serif: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --label: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --title: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --frame: 2px solid var(--ink);
  --rule: 1px solid var(--line);
  --plan-fill: #ffffff;
  --plan-line: var(--ink);
  background: var(--surface);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
}

.design-guide h1,
.design-guide h2,
.design-guide h3,
.design-guide h4 { font-family: var(--label); font-weight: 700; line-height: 1.15; }
.design-guide h2 { font-size: clamp(1.6rem, 1.2vw + 1.15rem, 2.1rem); }
.design-guide h3 { font-size: 1.1875rem; }

/* Links in the reading text and the fine print; the top bar, calls and buttons set their own. */
.design-guide :is(.chapter__intro, .chapter__body, .qa, .g-figure figcaption, .g-footer, .chapter__link, .chapter__note, .section__more) a { color: var(--accent); text-decoration-thickness: 1px; }
.design-guide :is(.chapter__intro, .chapter__body, .qa, .g-figure figcaption, .g-footer, .chapter__link, .chapter__note, .section__more) a:hover { text-decoration-thickness: 2px; }

/* Buttons */
.design-guide .btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.3rem;
  border: 2px solid transparent; border-radius: 0;
  font-family: var(--label); font-size: 1.0625rem; font-weight: 700; line-height: 1.2; text-decoration: none;
}
.design-guide .btn--primary { background: var(--accent); color: #fff; }
.design-guide .btn--primary:hover { background: var(--ink); }
.design-guide .btn--secondary { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.design-guide .btn--secondary:hover { background: var(--bg); }
.design-guide .btn--light { background: #fff; color: var(--ink); }
.design-guide .btn--outline-light { border-color: #fff; color: #fff; }
.design-guide .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.design-guide .lead { margin-top: 1rem; max-width: 40rem; font-size: 1.25rem; }

/* Top of the sheet */
.g-top { border-bottom: var(--frame); }
.g-top__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 72px; }
.g-top__brand { display: inline-flex; }
.g-top__logo { height: 36px; width: auto; }
@media (min-width: 640px) { .g-top__logo { height: 52px; } }
.g-top__phone { font-family: var(--label); font-size: 1rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.g-top__label { font-weight: 400; color: var(--muted); }
@media (max-width: 639px) { .g-top__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
html:has(.design-guide) { scroll-padding-top: 24px; }

/* Title block, like the one in the corner of a drawing sheet */
.g-hero { padding-block: clamp(2rem, 4vw, 3rem) 0; }
.titleblock { display: grid; border: var(--frame); }
.titleblock__title { padding: 18px 20px 20px; }
.titleblock h1 { font-family: var(--title); font-size: clamp(2.3rem, 3.6vw + 1rem, 3.9rem); font-weight: 700; line-height: 1.02; }
.titleblock__sub { margin-top: 0.6rem; font-family: var(--label); font-size: 1.0625rem; color: var(--muted); }
.titleblock__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: 0; border-top: var(--frame); }
.titleblock__meta > div { padding: 12px 20px; }
.titleblock__meta > div + div { border-left: 1px solid var(--ink); }
.titleblock__meta dt { font-family: var(--label); font-size: 0.875rem; color: var(--muted); }
.titleblock__meta dd { margin: 2px 0 0; font-family: var(--label); font-size: 1.0625rem; font-weight: 700; }
@media (min-width: 760px) {
  .titleblock:has(> .titleblock__meta) { grid-template-columns: minmax(0, 1fr) 13.5rem; }
  .titleblock__meta { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: var(--frame); align-content: stretch; }
  .titleblock__meta > div { display: flex; flex-direction: column; justify-content: center; }
  .titleblock__meta > div + div { border-left: 0; border-top: 1px solid var(--ink); }
}
.titleblock__meta.breadcrumbs ol { margin: 0; padding: 12px 20px; list-style: none; font-family: var(--label); }
.titleblock__meta.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }

.g-hero__lead { max-width: 44rem; padding-block: clamp(1.75rem, 3vw, 2.25rem) 0; }
.g-hero__intro { font-size: clamp(1.2rem, 0.4vw + 1.1rem, 1.35rem); line-height: 1.6; }
.g-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 1.5rem; }
.g-hero__call { font-family: var(--label); font-size: 1.0625rem; color: var(--ink); }
.g-hero__note { margin-top: 0.9rem; font-family: var(--label); font-size: 0.9375rem; color: var(--muted); }

/* Figures: drawings on a paper ground, captions in the labelling face */
.g-figure { margin: 2rem 0 0; }
.g-figure > svg,
.g-figure > img { width: 100%; height: auto; border: var(--rule); background: var(--bg); }
.g-figure > svg text { font-family: var(--label); }
.g-figure figcaption { margin-top: 0.7rem; font-family: var(--label); font-size: 0.9375rem; line-height: 1.5; color: var(--muted); }
.g-figure figcaption strong { color: var(--ink); }
.g-figure--hero { margin-top: clamp(2rem, 4vw, 2.75rem); }
.g-figures { display: grid; gap: 24px; margin-top: 1.5rem; }
.g-figures .g-figure { margin: 0; }
@media (min-width: 640px) { .g-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Contents beside the sections */
.guide { display: grid; gap: 0 56px; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem); }
.guide__toc { font-family: var(--label); font-size: 1rem; }
.guide__toc-title { padding-bottom: 8px; font-weight: 700; border-bottom: var(--frame); }
.guide__toc ol { margin: 0; padding: 0; list-style: none; }
.guide__toc li { border-bottom: var(--rule); }
.guide__toc a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 8px; padding: 9px 0; color: var(--ink); text-decoration: none; line-height: 1.35; }
.guide__toc a:hover { color: var(--accent); }
.guide__toc-num { color: var(--accent); font-weight: 700; }
.guide__main { max-width: 680px; min-width: 0; }
@media (min-width: 1000px) {
  .guide { grid-template-columns: 220px minmax(0, 1fr); gap: 0 48px; }
  .guide__toc { position: sticky; top: 24px; align-self: start; }
}

/* Sections: the number in the margin, like a manual */
.chapter { margin-top: 2.75rem; padding-top: 2.25rem; border-top: var(--rule); }
.guide__main > .chapter:first-child { margin-top: 1.75rem; }
@media (min-width: 1000px) { .guide__main > .chapter:first-child { margin-top: 0; padding-top: 0; border-top: 0; } }
.chapter__head { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: baseline; gap: 4px; }
.chapter__num { font-family: var(--label); font-size: clamp(1.6rem, 1.2vw + 1.15rem, 2.1rem); font-weight: 700; line-height: 1.15; color: var(--accent); }
.chapter__intro,
.chapter__body { margin-top: 1.1rem; }
.chapter__intro > * + *,
.chapter__body > * + * { margin-top: 1rem; }
.chapter__body ul { padding-left: 1.25rem; }
.chapter__body li + li { margin-top: 0.4rem; }
.chapter__link { margin-top: 1.25rem; font-family: var(--label); font-weight: 700; }
.chapter__note { margin-top: 0.75rem; font-family: var(--label); font-size: 0.9375rem; color: var(--muted); }
.chapter__chooser { margin-top: 1.5rem; }

.chapter__subhead { margin-top: 1.75rem; }
.chapter__action { margin-top: 1.5rem; }
.design-guide .guide-specs th { width: 34%; }

/* Checklist: things to check before buying, with boxes to tick */
.design-guide .checklist { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.design-guide .checklist li { position: relative; padding: 14px 0 14px 42px; border-bottom: var(--rule); }
.design-guide .checklist li:first-child { border-top: var(--rule); }
.design-guide .checklist li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 20px; height: 20px; border: 2px solid var(--ink); }
.design-guide .checklist strong { font-family: var(--label); font-weight: 700; }

/* Steps: a sequence */
.design-guide .guide-steps { margin: 1.75rem 0 0; padding: 0; list-style: none; counter-reset: gstep; }
.design-guide .guide-steps li { position: relative; padding: 0 0 1.6rem 60px; counter-increment: gstep; }
.design-guide .guide-steps li::before {
  content: counter(gstep); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 40px; height: 40px; border: var(--frame);
  font-family: var(--label); font-size: 1.125rem; font-weight: 700; line-height: 1;
}
.design-guide .guide-steps li:last-child { padding-bottom: 0; }
.design-guide .guide-steps h3 { padding-top: 7px; }
.design-guide .guide-steps p { margin-top: 0.35rem; color: var(--muted); }

/* Tables: ruled like a parts list */
.design-guide .guide-table { margin: 1.5rem 0 0; }
.design-guide .table-wrap { border-top: var(--frame); border-bottom: var(--frame); }
.design-guide table { font-size: 1.0625rem; }
.design-guide th,
.design-guide td { padding: 12px 18px 12px 0; }
.design-guide thead th { font-family: var(--label); font-weight: 700; border-bottom: 1px solid var(--ink); }
.design-guide tbody tr + tr { border-top: var(--rule); }
.design-guide tbody th { font-family: var(--label); font-weight: 700; }
.design-guide tbody td { color: var(--muted); }
.design-guide .guide-table__note { margin-top: 0.7rem; font-family: var(--label); font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 719px) {
  .design-guide tbody tr { padding: 12px 0; }
  .design-guide tbody th { padding: 0 0 6px; }
  .design-guide tbody td { padding: 3px 0; }
  .design-guide tbody td::before { font-family: var(--label); font-weight: 700; color: var(--ink); }
}

/* Questions and answers, all open */
.design-guide .qa { margin: 1.5rem 0 0; }
.design-guide .qa__item { padding: 1.1rem 0; border-bottom: var(--rule); }
.design-guide .qa__item:first-child { border-top: var(--rule); }
.design-guide .qa dt { font-family: var(--label); font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.design-guide .qa dd { margin: 0.45rem 0 0; color: var(--muted); }

/* The closing note: a framed box, as a manual sets off a note */
.g-note { margin-top: 3rem; padding: 24px 26px 26px; border: var(--frame); }
.g-note h2 { font-size: 1.5rem; }
.g-note > p:not(.g-note__actions) { margin-top: 0.5rem; }
.g-note__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 1.25rem; }
.g-note__call { font-family: var(--label); font-size: 1.0625rem; color: var(--ink); }

/* Size chooser inside a chapter: ruled like a parts list */
.design-guide .chooser__title { margin: 1.5rem 0 0.75rem; }
.design-guide .tile { padding: 12px; border: var(--rule); }
.design-guide .tile__size,
.design-guide .run__size { font-family: var(--label); font-weight: 700; }
.design-guide .tile__facts,
.design-guide .run__facts { font-family: var(--label); font-size: 0.9375rem; color: var(--muted); }
.design-guide .tile__flag,
.design-guide .run__flag { color: var(--ink); font-weight: 700; }
.design-guide .chooser--drain { border-top: var(--frame); }
.design-guide .run { border-bottom: var(--rule); }
.design-guide .grate { padding: 6px 10px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font-family: var(--label); font-size: 0.9375rem; font-weight: 700; }
.design-guide .grate:hover { background: var(--bg); }

/* Footer: one paragraph and the fine print */
.g-footer { padding-block: 2.5rem; border-top: var(--frame); font-family: var(--label); font-size: 1rem; }
.g-footer .container { max-width: 760px; }
.g-footer__about { line-height: 1.55; }
.g-footer__links ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.g-footer__fine { display: grid; gap: 0.4rem; margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }
.design-guide .legal { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; margin: 0; padding: 0; list-style: none; }

/* A page that is not the guide itself (404, or a page an editor adds) */
.design-guide .section { padding-block: clamp(3rem, 6vw, 5rem); }
.design-guide .container--narrow { max-width: 760px; }
.design-guide .section h1 { font-family: var(--title); font-size: clamp(2.2rem, 3vw + 1rem, 3.4rem); font-weight: 700; }

:root { --bg: #f5f7fa; --alt: #e9eef5; --line: #d5dce7; --ink: #15181d; --muted: #525c6a;
}
