/*
 * The Theme Kit in Workbench's look. The kit (themes/_shared/assets/css/kit.css) draws every block the theme has no
 * template for, and every module section; this file sets its tokens, linked after kit.css, so the values here win.
 * Change the look here first: the tokens reach every block at once, a rule for one kit class reaches one part.
 *
 * Workbench is a maker's workshop: headings in a sturdy slab face with a pencilled measure under each section heading,
 * a pegboard behind every other section, cards like boards with a solid edge, icons in brass rings, step numbers
 * stamped in a double ring, buttons stitched like a leather tab, and pattern pieces (dashed outlines) for the plans that
 * are not the featured one.
 *
 * Rules for this file: it loads nothing, no picture, font or address of any kind (the kit inlines it into module
 * previews; kit_components.test.php fails for one, and also for these words written in a comment);
 * colours only through the palette tokens the kit already reads (--text-primary, --surface, --primary, ...) or
 * color-mix() of them; weights only through the layout's --workbench-heading-weight and --workbench-body-strong.
 * Heading sizes are multiplied by --workbench-scale, the width of the heading face (base.php); a module preview has none
 * and keeps the plain sizes.
 *
 * --kit-radius and --kit-button-radius are repeated in this theme's line of the shared button table
 * (themes/_shared/assets/css/resilience.css, --chrome-radius and --chrome-button-radius) so the cookie notice and the
 * phone action bar match the theme's own cards and buttons: theme-chrome.test.mjs compares the two. Change both.
 */

.kit-root {
  --kit-radius: 0.375rem;
  --kit-radius-sm: 0.25rem;
  --kit-button-radius: 0.25rem;
  --kit-input-radius: 0.25rem;
  --kit-media-radius: 0.25rem;
  --kit-heading-weight: var(--workbench-heading-weight, 400);
  --kit-heading-tracking: 0;
  --kit-button-weight: var(--workbench-body-strong, 600);
  --kit-button-tracking: 0.01em;
  --kit-button-transform: none;
  --kit-eyebrow-tracking: 0.12em;
  --kit-focus: var(--accent-ink, #7e5a1e);
  --kit-star: var(--accent-ink, #7e5a1e);
  --kit-card-pad: clamp(1.25rem, 2.2vw, 1.75rem);
  --kit-gap-medium: clamp(1.25rem, 2vw, 1.75rem);
  --kit-gap-large: clamp(2rem, 4vw, 3rem);
  --kit-gutter: clamp(1rem, 4vw, 2rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.5rem, 2.5rem + 4.5vw, 6.5rem);
  --kit-pad-compact: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  /* A board's edge: a solid line under every card, and a soft shadow on the bench beneath. */
  --kit-shadow: 0 2px 0 color-mix(in srgb, var(--kit-text) 14%, transparent), 0 14px 24px -20px color-mix(in srgb, var(--kit-text) 45%, transparent);
  --kit-shadow-hover: 0 4px 0 color-mix(in srgb, var(--kit-text) 20%, transparent), 0 22px 32px -22px color-mix(in srgb, var(--kit-text) 55%, transparent);
  /* A pencil line: the text colour, faint. */
  --workbench-kit-pencil: color-mix(in srgb, var(--kit-text) 34%, transparent);
}

/* The pegboard: every other band is the plywood colour with a grid of holes, the wall the work hangs on. */
.kit-section--muted {
  background-image: radial-gradient(circle, color-mix(in srgb, var(--kit-text) 12%, transparent) 0.16rem, transparent 0.19rem);
  background-position: 0.8rem 0.8rem;
  background-size: 1.6rem 1.6rem;
}

/* Headings in the heading face. Sizes are set for ordinary words at 320 px; the shared script is only the net for a long
   word (cms/THEME_DEVELOPMENT.md, rule 1). A line height under about 1.1 cuts marks in a box that clips. */
.kit-heading {
  font-family: var(--font-heading, serif);
  line-height: 1.12;
  text-wrap: balance;
}

.kit-heading--1 {
  font-size: calc(clamp(2.2rem, 1.3rem + 3.3vw, 4rem) * var(--workbench-scale, 1));
  line-height: 1.08;
}

.kit-heading--2 {
  font-size: calc(clamp(1.8rem, 1.25rem + 2.1vw, 3rem) * var(--workbench-scale, 1));
}

.kit-heading--3 {
  font-size: calc(clamp(1.2rem, 1.08rem + 0.5vw, 1.45rem) * var(--workbench-scale, 1));
  line-height: 1.25;
}

/* The pencilled measure under a section heading: ticks at both ends with a slash through each, a fine line between,
   the way a drawing gives a length. It stands under the heading on the heading's side. */
.kit-heading-group > .kit-heading--2::after {
  content: "";
  display: block;
  width: 5.5rem;
  height: 0.75rem;
  margin-top: 0.85rem;
  background:
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) left center / 1.5px 100% no-repeat,
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) right center / 1.5px 100% no-repeat,
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) center / 100% 1px no-repeat,
    linear-gradient(135deg, transparent calc(50% - 0.8px), var(--workbench-kit-pencil) calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px)) left center / 0.75rem 0.75rem no-repeat,
    linear-gradient(135deg, transparent calc(50% - 0.8px), var(--workbench-kit-pencil) calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px)) right center / 0.75rem 0.75rem no-repeat;
}

.kit-heading-group.kit-text--center > .kit-heading--2::after {
  margin-inline: auto;
}

.kit-text--lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
}

/* Small labels above headings: a brass tag with a notched end and a punched hole, in small spaced capitals. */
.kit-eyebrow {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 0.3rem 0.8rem 0.3rem 1.45rem;
  border-radius: 0 0.2rem 0.2rem 0;
  background: var(--accent, #c08f3e);
  color: var(--on-accent, #21170b);
  font-size: 0.72rem;
  font-weight: var(--workbench-body-strong, 600);
  line-height: 1.35;
  clip-path: polygon(0.6rem 0, 100% 0, 100% 100%, 0.6rem 100%, 0 50%);
  -webkit-mask: radial-gradient(circle at 0.85rem 50%, transparent 0.17rem, #000 0.2rem);
  mask: radial-gradient(circle at 0.85rem 50%, transparent 0.17rem, #000 0.2rem);
}

.kit-card__eyebrow {
  font-size: 0.72rem;
  font-weight: var(--workbench-body-strong, 600);
}

/* A small button (a row of review links, Next under a list of posts) is still 40 px tall: the kit's own 36 px is under
   what a thumb needs on a phone (verify-theme-stress.mjs, button-small). */
.kit-button {
  position: relative;
  min-height: 3rem;
  padding: 0.7rem 1.45rem;
}

.kit-button--small {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
}

/* The stitch on a filled button: a dashed line a few pixels inside its edge, in the words' colour, faint. */
.kit-button:is(.kit-button--primary, .kit-button--light)::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed currentColor;
  border-radius: 2px;
  opacity: 0.42;
  pointer-events: none;
}

/* The second button is an outline in the text colour, filled faintly under the pointer. */
.kit-button--secondary {
  border: 1.5px solid var(--kit-text);
  color: var(--kit-text);
}

.kit-button--secondary:hover {
  border-color: var(--kit-text);
  background: color-mix(in srgb, var(--kit-text) 9%, transparent);
  color: var(--kit-text);
}

/* Cards: a board with a solid edge underneath, lifting a little when it leads somewhere. */
.kit-card--linked:hover {
  transform: translateY(-2px);
}

.kit-card__title {
  font-size: calc(clamp(1.2rem, 1.08rem + 0.5vw, 1.45rem) * var(--workbench-scale, 1));
  line-height: 1.25;
}

/* A plan that is not the featured one is drawn as a pattern piece: a dashed outline on the board. */
.kit-card--outline {
  border-width: 1.5px;
  border-style: dashed;
  border-color: var(--workbench-kit-pencil);
}

/* Icons in cards and feature lists sit in a brass ring, like a washer. */
:is(.kit-card, .kit-features) .kit-icon--large {
  box-sizing: content-box;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.6rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kit-accent) 13%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--kit-accent) 60%, transparent);
  color: var(--kit-accent-text);
}

/* A step's number is stamped in a double ring, a little askew. With an icon the kit makes the number a small label
   over the title (one lead mark per step), so the ring and the tilt go too. */
.kit-steps .kit-card__eyebrow {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.6rem;
  border: 2px solid var(--kit-accent-text);
  border-radius: 50%;
  outline: 1px solid var(--kit-accent-text);
  outline-offset: -6px;
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: calc(1.15rem * var(--workbench-scale, 1));
  font-variant-numeric: lining-nums;
  font-weight: var(--workbench-heading-weight, 400);
  letter-spacing: 0;
  line-height: 1;
  transform: rotate(-8deg);
}

.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__eyebrow {
  height: auto;
  outline: 0;
  transform: none;
}

/* Figures (stats_counter, a plan's price) in the heading face. From 1200 px five statistics stand in a row of about
   200 px each: "1500 m²" must stay on one line there. */
.kit-stat__value {
  font-family: var(--font-heading, serif);
  font-size: calc(clamp(2rem, 1.4rem + 1.6vw, 2.85rem) * var(--workbench-scale, 1));
  font-weight: var(--workbench-heading-weight, 400);
  line-height: 1.08;
}

/* Under each figure a short pencilled measure, then its label. */
.kit-stat__label {
  font-size: 0.9375rem;
}

.kit-stat__label::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.6rem;
  margin: 0.35rem 0 0.5rem;
  background:
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) left center / 1.5px 100% no-repeat,
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) right center / 1.5px 100% no-repeat,
    linear-gradient(var(--workbench-kit-pencil), var(--workbench-kit-pencil)) center / 100% 1px no-repeat;
}

.kit-align--center > .kit-stat .kit-stat__label::before,
.kit-text--center .kit-stat__label::before {
  margin-inline: auto;
}

/* A figure's icon stands in the same brass ring as a card's. */
.kit-stack:has(> .kit-stat) > .kit-icon {
  box-sizing: content-box;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0.55rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kit-accent) 13%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--kit-accent) 60%, transparent);
  color: var(--kit-accent-text);
}

/* A quotation is spoken, not titled: the body face, upright (no face here loads an italic), under a large quotation
   mark in brass instead of a bar at its side. */
.kit-quote {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.kit-quote::before {
  content: "\201C";
  display: block;
  height: 1.6rem;
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: 3.5rem;
  font-weight: var(--workbench-heading-weight, 400);
  line-height: 1;
}

.kit-quote__text {
  font-family: var(--font-body, sans-serif);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.2rem);
  font-style: normal;
  line-height: 1.6;
}

/* A picture beside words is a print, as in the opening: a pale border and a shadow on the bench. */
.kit-split > .kit-picture {
  padding: clamp(0.4rem, 0.8vw, 0.6rem);
  border-radius: 2px;
  background: var(--kit-surface);
  box-shadow: 0 1px 0 var(--kit-line), 0 22px 36px -24px color-mix(in srgb, var(--kit-text) 55%, transparent);
}

.kit-split > .kit-picture img {
  border-radius: 1px;
}

/* A portrait in a brass frame: a thin ring of the card's colour, then brass. */
.kit-avatar--large,
.kit-avatar--medium {
  box-shadow: 0 0 0 3px var(--kit-surface), 0 0 0 4.5px color-mix(in srgb, var(--kit-accent) 75%, transparent);
}

/* Questions: pencilled lines between them, the question in the heading face. */
.kit-accordion__item {
  border-bottom: 1px dashed var(--workbench-kit-pencil);
}

.kit-accordion__item:first-child {
  border-top: 1px dashed var(--workbench-kit-pencil);
}

.kit-accordion__title {
  font-family: var(--font-heading, serif);
  font-size: calc(clamp(1.08rem, 1rem + 0.35vw, 1.25rem) * var(--workbench-scale, 1));
  font-weight: var(--workbench-heading-weight, 400);
}

/* Fields: a firm outline, brass when in use. */
.kit-input {
  border-width: 1.5px;
}

.kit-field__label {
  font-weight: var(--workbench-body-strong, 600);
}

/* The price list's leaders are pencilled dots. */
.kit-list--menu .kit-list-item__title {
  font-weight: var(--workbench-body-strong, 600);
}
