/*
 * The Theme Kit in Bespoke'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 and the look of its parts, linked after kit.css, so
 * the values here win. What depends on a block's kind (the swing tags of a price table, the mounted pictures beside
 * words) is in theme.css, which knows each block's type.
 *
 * The look: square and tailored. A card is a piece of cloth with a line of stitches just inside its edge, and its picture
 * is mounted inside the stitches; a small label is a woven tag; a section's heading is a confident serif over a short
 * seam; the quieter bands are a linen woven in herringbone and the dark ones the suiting with its pinstripe. Buttons are
 * square, their labels in spaced capitals, with stitches inside their edge.
 *
 * 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 --bespoke-heading-weight and --bespoke-body-strong.
 *
 * --kit-radius, --kit-button-radius and --kit-button-transform are repeated in this theme's line of the shared button
 * table (themes/_shared/assets/css/resilience.css, --chrome-radius, --chrome-button-radius, --chrome-button-case) so the
 * cookie notice and the phone action bar match the theme's own cards and buttons: theme-chrome.test.mjs compares them.
 */

.kit-root {
  --kit-radius: 0px;
  --kit-radius-sm: 0px;
  --kit-button-radius: 0px;
  --kit-input-radius: 0px;
  --kit-media-radius: 0px;
  --kit-chip-radius: 0px;
  --kit-heading-weight: var(--bespoke-heading-weight, 700);
  --kit-heading-tracking: -0.005em;
  --kit-button-weight: var(--bespoke-body-strong, 600);
  --kit-button-transform: uppercase;
  --kit-button-tracking: 0.14em;
  --kit-eyebrow-tracking: 0.16em;
  --kit-focus: var(--accent-ink, #82572b);
  --kit-star: var(--accent-ink, #82572b);
  --kit-shadow: none;
  --kit-shadow-hover: 0 22px 40px -28px color-mix(in srgb, var(--text-primary, #1d222c) 55%, transparent);
  --kit-card-pad: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  --kit-gap-medium: clamp(1.25rem, 2vw, 1.75rem);
  --kit-gap-large: clamp(2rem, 1.5rem + 2vw, 3rem);
  --kit-gutter: clamp(1.25rem, 4vw, 2.5rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(4rem, 3rem + 4.5vw, 7.5rem);
  --kit-pad-compact: clamp(2.5rem, 2rem + 2vw, 4rem);
  --kit-pad-spacious: clamp(5rem, 3.5rem + 6vw, 9rem);
  --kit-measure: 62ch;
}

/* ------------------------------------------------------------------ Bands */

/* The quieter band is a linen woven in herringbone: columns of fine diagonal threads, every other column leaning the
   other way, under the content. Two layers, each shown through every other column by a gradient mask. */
.kit-section--muted::before,
.kit-section--muted::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--kit-text) 5.5%, transparent) 0 1px, transparent 1px 6px);
  -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
  mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
  -webkit-mask-size: 24px 100%;
  mask-size: 24px 100%;
  pointer-events: none;
}

.kit-section--muted::after {
  background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--kit-text) 5.5%, transparent) 0 1px, transparent 1px 6px);
  -webkit-mask-position: 12px 0;
  mask-position: 12px 0;
}

/* The dark band is the suiting: the primary colour with a fine pinstripe of its own words' colour, and a seam of
   stitches along each edge. */
.kit-section--inverse {
  background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--kit-section-fg) 8%, transparent) 0 1px, transparent 1px 11px);
}

.kit-section--inverse::after {
  content: "";
  position: absolute;
  inset: 7px 0;
  z-index: -1;
  border-block: 1px dashed color-mix(in srgb, var(--accent, #b8895a) 62%, var(--kit-section-fg));
  pointer-events: none;
}

/* On the suiting and on a photograph the main button is the camel thread: the accent with its own readable words (a
   pair the colour contract keeps), where the kit would draw a pale button in the band's words. */
.kit-section--inverse,
.kit-section--image,
.kit-slide {
  --kit-primary: var(--accent, #b8895a);
  --kit-primary-hover: var(--accent, #b8895a);
  --kit-on-primary: var(--on-accent, #17202f);
}

/* A band with a photograph: the words framed by a line of stitches a little in from the band's edge. */
.kit-section--image::after {
  content: "";
  position: absolute;
  inset: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 0;
  border: 1px dashed color-mix(in srgb, var(--kit-section-fg) 42%, transparent);
  pointer-events: none;
}

/* ------------------------------------------------------------------ Type */

/* Headings: a confident classic serif. Sizes are chosen for ordinary words at 320 px (a word of fourteen letters fits a
   section's heading there in the widest face, Libre Baskerville); the shared script is only the net for a longer one
   (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.15;
  text-wrap: balance;
}

.kit-heading--1 {
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
  line-height: 1.12;
}

.kit-heading--2 {
  font-size: clamp(1.85rem, 1.4rem + 1.9vw, 3rem);
  line-height: 1.14;
}

.kit-heading--3 {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  line-height: 1.25;
}

.kit-heading--4 {
  font-size: 1.0625rem;
}

.kit-heading.kit-heading--long {
  font-size: clamp(1.3rem, 1.15rem + 0.7vw, 1.65rem);
  line-height: 1.3;
}

/* A section's heading stands over a short seam of stitches, at its side or under its middle. */
.kit-heading-group > .kit-heading--2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 1px;
  margin-top: clamp(0.9rem, 0.75rem + 0.5vw, 1.25rem);
  background: repeating-linear-gradient(90deg, var(--kit-accent-text) 0 6px, transparent 6px 10px);
}

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

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

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

/* Small labels are woven tags: spaced capitals on a strip of the lighter cloth with a fine horizontal weave and a line of
   stitches just inside its edge. Short words only stand here (a year, Recommended, a category, a step's number). */
.kit-eyebrow,
.kit-card__eyebrow {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 0.32em 0.85em 0.26em;
  outline: 1px dashed color-mix(in srgb, var(--kit-accent-text) 55%, transparent);
  outline-offset: -3px;
  background-color: var(--kit-surface-alt);
  background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--kit-text) 6%, transparent) 0 1px, transparent 1px 3px);
  color: var(--kit-accent-text);
  font-size: 0.6875rem;
  font-weight: var(--bespoke-body-strong, 600);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.5;
  text-transform: uppercase;
}

.kit-link {
  color: var(--kit-text);
  text-decoration-color: var(--kit-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.kit-rich-text a {
  color: var(--kit-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.kit-rich-text a:hover,
.kit-link:hover {
  color: var(--kit-accent-text);
}

/* ------------------------------------------------------------------ Buttons */

/* Square, the label in small spaced capitals, and a line of stitches just inside the edge in the label's own colour. A
   label may take two lines. theme-chrome.test.mjs holds this corner and case and the shared notice's together. */
.kit-button {
  position: relative;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.78125rem;
  line-height: 1.35;
}

.kit-button:is(.kit-button--primary, .kit-button--secondary, .kit-button--light)::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed currentColor;
  opacity: 0.42;
  pointer-events: none;
  transition: opacity var(--kit-speed) ease;
}

.kit-button:is(.kit-button--primary, .kit-button--secondary, .kit-button--light):hover::after {
  opacity: 0.85;
}

/* A small button (a row of review links, Next under a list of posts) is still 42 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--small {
  min-height: 2.625rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.71875rem;
}

.kit-button--small::after {
  inset: 3px;
}

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

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

.kit-button--ghost {
  color: var(--kit-text);
  text-decoration: underline;
  text-decoration-color: var(--kit-accent-text);
  text-underline-offset: 0.35em;
}

.kit-button-group {
  gap: 0.75rem;
}

/* ------------------------------------------------------------------ Cards */

/* A card is a piece of the lighter cloth with a line of stitches just inside its edge. Its picture is mounted inside the
   stitches. On a linked card the thread deepens under the pointer. */
.kit-card--surface,
.kit-card--outline {
  border-color: var(--kit-line);
  background: var(--kit-surface);
  box-shadow: none;
}

.kit-card--surface::after,
.kit-card--outline::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed color-mix(in srgb, var(--kit-accent-text) 48%, transparent);
  pointer-events: none;
  transition: border-color var(--kit-speed) ease;
}

.kit-card:is(.kit-card--surface, .kit-card--outline) > .kit-card__media {
  margin: 0.6rem 0.6rem 0;
}

.kit-card__title {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.kit-card__meta {
  font-size: 0.8125rem;
}

.kit-card--linked:hover {
  border-color: var(--kit-line-strong);
}

.kit-card--linked:hover::after {
  border-color: var(--kit-accent-text);
}

.kit-card--linked:hover .kit-card__link {
  color: var(--kit-text);
}

.kit-grid.kit-features .kit-icon,
.kit-card__body > .kit-icon:first-child {
  color: var(--kit-accent-text);
}

/* Steps: one lead mark per step, in a roundel with a ring of stitches, the way the website's monogram is drawn. A step
   with an icon (every step of a new website has one) puts its icon in the roundel and its number in the kit's small
   label above the title; a step without one puts its number in the roundel. kit.css resets the number's own look where
   the icon leads, and this resets its stitches. */
.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__body > .kit-icon:first-child {
  box-sizing: content-box;
  width: 1.375rem;
  height: 1.375rem;
  margin-bottom: 0.9rem;
  padding: 0.8rem;
  outline: 1px dashed color-mix(in srgb, var(--kit-accent-text) 60%, transparent);
  outline-offset: -5px;
  border: 1px solid var(--kit-line-strong);
  border-radius: 50%;
  background: var(--kit-surface);
  color: var(--kit-accent-text);
}

.kit-steps .kit-card__eyebrow {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  padding: 0;
  outline: 1px dashed color-mix(in srgb, var(--kit-accent-text) 60%, transparent);
  outline-offset: -4px;
  border: 1px solid var(--kit-line-strong);
  border-radius: 50%;
  background: var(--kit-surface);
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: 1rem;
  font-style: italic;
  font-synthesis: none;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: var(--bespoke-heading-weight, 700);
  letter-spacing: 0;
  text-transform: none;
}

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

/* ------------------------------------------------------------------ Figures */

/* A statistic: the figure in the heading face, a short seam under it, the label in spaced capitals. The sizes hold
   "1500 m²" on one line in a row of four on a desktop and two on a phone. */
.kit-stat {
  gap: 0.6rem;
}

.kit-stat__value {
  font-family: var(--font-heading, serif);
  font-size: clamp(2rem, 1.4rem + 1.8vw, 2.875rem);
  font-weight: var(--bespoke-heading-weight, 700);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.kit-stat__suffix {
  color: var(--kit-accent-text);
}

.kit-stat__label {
  padding-top: 0.75rem;
  background-image: repeating-linear-gradient(90deg, var(--kit-accent-text) 0 5px, transparent 5px 9px);
  background-position: 50% 0;
  background-repeat: no-repeat;
  background-size: 2.25rem 1px;
  font-size: 0.6875rem;
  font-weight: var(--bespoke-body-strong, 600);
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.kit-section--align-left .kit-stat__label {
  background-position: 0 0;
}

/* A price in the heading face. */
.kit-price__amount {
  font-family: var(--font-heading, serif);
  font-weight: var(--bespoke-heading-weight, 700);
}

/* ------------------------------------------------------------------ Lists, questions, quotes */

/* Questions on lines of stitches. */
.kit-accordion {
  border-top: 1px dashed var(--kit-line-strong);
}

.kit-accordion__item {
  border-bottom: 1px dashed var(--kit-line-strong);
}

.kit-accordion__title {
  padding: 1.25rem 0;
  font-family: var(--font-heading, serif);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  font-weight: var(--bespoke-heading-weight, 700);
  line-height: 1.35;
}

.kit-accordion__title:hover {
  color: var(--kit-accent-text);
}

.kit-accordion__chevron {
  color: var(--kit-accent-text);
}

.kit-accordion__body {
  padding-bottom: 1.4rem;
}

/* A quotation in the heading face's italic under a large opening mark in the thread's colour. No bar at its side: the
   card it stands in frames it. */
.kit-quote {
  padding-inline-start: 0;
  border-inline-start: 0;
}

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

.kit-quote__text {
  font-family: var(--font-heading, serif);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.2rem);
  font-style: italic;
  font-synthesis: none;
  font-weight: var(--bespoke-heading-weight, 700);
  line-height: 1.5;
}

.kit-quote__author {
  font-size: 0.75rem;
  font-weight: var(--bespoke-body-strong, 600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kit-quote__role {
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* A portrait in a roundel with a ring of stitches a little way out. */
.kit-avatar {
  outline: 1px dashed color-mix(in srgb, var(--kit-accent-text) 60%, transparent);
  outline-offset: 3px;
}

.kit-list--menu .kit-list-item__title {
  font-weight: var(--bespoke-body-strong, 600);
}

.kit-list--menu .kit-list-item__meta {
  font-family: var(--font-heading, serif);
  font-weight: var(--bespoke-heading-weight, 700);
}

.kit-list--check .kit-list-item__icon,
.kit-list--plain .kit-list-item > .kit-icon:first-child {
  color: var(--kit-accent-text);
}

/* ------------------------------------------------------------------ Forms */

.kit-field__label {
  font-size: 0.6875rem;
  font-weight: var(--bespoke-body-strong, 600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kit-input {
  min-height: 3rem;
  border-color: var(--kit-line-strong);
  background: var(--kit-surface);
}

.kit-input:focus {
  border-color: var(--kit-text);
}

/* ------------------------------------------------------------------ Pictures and frames */

.kit-picture,
.kit-picture.kit-rounded,
.kit-card__media,
.kit-frame,
.kit-video,
.kit-compare__frame {
  border-radius: 0;
}

.kit-carousel__button,
.kit-slideshow__button {
  border-radius: 0;
}

.kit-slideshow__dot {
  border-radius: 0;
}

.kit-chip {
  letter-spacing: 0.06em;
}
