/*
 * The Theme Kit in Cargo'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. The theme's marks on whole sections (the route over a heading, steps and milestones as stops on a
 * route, the ribs of a dark band) are in theme.css, which knows each block's type.
 *
 * The look: firm and plain, like a shipping label. Small corners, headings in large condensed letters in sentence case,
 * small labels in spaced capitals, cards that are labels (white, a fine edge and a heavy rule across the top), and one
 * signal colour, the accent, for every button and every mark: the main colour is kept for the header, the dark bands
 * and the footer.
 *
 * 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 --cargo-heading-weight and --cargo-body-strong.
 *
 * --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.25rem;
  --kit-radius-sm: 0.25rem;
  --kit-button-radius: 0.25rem;
  --kit-input-radius: 0.25rem;
  --kit-media-radius: 0.25rem;
  --kit-chip-radius: 0.1875rem;
  --kit-heading-weight: var(--cargo-heading-weight, 700);
  --kit-heading-tracking: -0.005em;
  --kit-button-weight: var(--cargo-body-strong, 600);
  --kit-button-tracking: 0.01em;
  --kit-button-transform: none;
  --kit-eyebrow-tracking: 0.14em;
  --kit-focus: var(--accent-ink, #a64404);
  --kit-star: var(--accent, #f26b1d);
  --kit-card-pad: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --kit-gap-medium: clamp(1.25rem, 2vw, 1.75rem);
  --kit-gap-large: clamp(2rem, 1.5rem + 2vw, 3rem);
  --kit-gutter: clamp(1rem, 4vw, 2.25rem);
  --kit-width-normal: 76rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.5rem, 2.5rem + 4.5vw, 7rem);
  --kit-pad-compact: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  /* One signal colour for every action: the kit's filled button, the page being shown in a list of pages, a chosen
     option. The pair accent and on-accent is one the colour contract keeps readable in every palette. A dark or accent
     band sets these again for everything inside it (kit.css), so a button there stays readable too. */
  --kit-primary: var(--accent, #f26b1d);
  --kit-primary-hover: var(--accent, #f26b1d);
  --kit-on-primary: var(--on-accent, #16191c);
  --kit-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary, #1a1e22) 8%, transparent);
  --kit-shadow-hover: 0 14px 30px -16px color-mix(in srgb, var(--text-primary, #1a1e22) 40%, transparent);
}

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

/* Headings: large condensed letters in sentence case, set close. The sizes hold an ordinary word of fourteen letters at
   320 px in every font palette (--cargo-scale, one per heading face, theme.css); 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 only in a box that clips,
   and no heading stands in one. */
.kit-heading {
  font-family: var(--font-heading, sans-serif);
  line-height: 1.08;
  text-wrap: balance;
}

.kit-heading--1 {
  font-size: calc(clamp(2.5rem, 1.5rem + 4vw, 4.75rem) * var(--cargo-scale, 1));
  line-height: 1.05;
}

.kit-heading--2 {
  font-size: calc(clamp(2.1rem, 1.45rem + 2.6vw, 3.6rem) * var(--cargo-scale, 1));
}

.kit-heading--3 {
  font-size: calc(clamp(1.45rem, 1.3rem + 0.6vw, 1.75rem) * var(--cargo-scale, 1));
  line-height: 1.15;
}

.kit-heading--4 {
  font-size: calc(1.3rem * var(--cargo-scale, 1));
  line-height: 1.2;
}

.kit-heading.kit-heading--long {
  font-size: calc(clamp(1.5rem, 1.3rem + 0.9vw, 2rem) * var(--cargo-scale, 1));
  line-height: 1.2;
}

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

/* Small labels: the body face in spaced capitals, in the accent's readable shade. */
.kit-eyebrow,
.kit-card__eyebrow {
  font-size: 0.75rem;
  font-weight: var(--cargo-body-strong, 600);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.35;
}

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

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

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

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

/* A firm rectangle with a small corner. The filled button is the signal colour with an arrow after its words that
   moves on a little when it is pointed at; the framed one is a frame in the words' colour. A label may take two lines.
   theme-chrome.test.mjs holds this corner and the shared notice's together. */
.kit-button {
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  border-width: 2px;
  font-size: 1rem;
  line-height: 1.25;
}

.kit-button--primary::after {
  content: "\2192";
  flex: none;
  font-family: var(--font-body, sans-serif);
  font-weight: 400;
  line-height: 1;
  transition: transform var(--kit-speed) ease;
}

.kit-button--primary:hover::after {
  transform: translateX(0.2rem);
}

.kit-button--small.kit-button--primary::after {
  content: none;
}

/* The hover is a ring in the words' colour: a lighter fill would bring the words' contrast under what the colour
   contract promises for the pair. */
.kit-button--primary:hover {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--kit-on-primary) 55%, transparent);
}

.kit-button--secondary {
  border-color: 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);
}

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

/* 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--small {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.9375rem;
}

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

/* A card is a label: white, a fine edge, and a heavy rule of the words' colour across its top, which turns to the
   signal colour when a card that leads somewhere is pointed at. */
.kit-card--surface,
.kit-card--outline {
  border-color: var(--kit-line);
  border-top: 0.375rem solid var(--kit-text);
}

.kit-card--surface {
  background: var(--kit-surface);
}

.kit-card--linked {
  transition: box-shadow var(--kit-speed) ease, border-color var(--kit-speed) ease, transform var(--kit-speed) var(--kit-ease);
}

.kit-card--linked:hover {
  border-top-color: var(--kit-accent);
  transform: translateY(-2px);
}

.kit-card__title {
  font-family: var(--font-heading, sans-serif);
  font-size: calc(clamp(1.4rem, 1.25rem + 0.6vw, 1.75rem) * var(--cargo-scale, 1));
  font-weight: var(--kit-heading-weight);
  letter-spacing: 0;
  line-height: 1.12;
}

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

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

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

/* Large numerals, as on a road sign. From 1200 px five statistics stand in a row of about 200 px each: the sizes hold
   "1500 m²" on one line there in every font palette. */
.kit-stat {
  gap: 0.35rem;
}

.kit-stat__value {
  font-size: calc(clamp(2.6rem, 1.6rem + 3vw, 3.6rem) * var(--cargo-scale, 1));
  letter-spacing: 0;
  line-height: 1.05;
}

.kit-stat__label {
  font-size: 0.8125rem;
  font-weight: var(--cargo-body-strong, 600);
  letter-spacing: 0.1em;
  line-height: 1.45;
  text-transform: uppercase;
}

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

.kit-accordion__title {
  font-family: var(--font-heading, sans-serif);
  font-size: calc(clamp(1.3rem, 1.2rem + 0.4vw, 1.5rem) * var(--cargo-scale, 1));
  font-weight: var(--cargo-heading-weight, 700);
  line-height: 1.2;
}

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

/* A quotation is upright: the font palettes load no slanted letters, and a browser's own slant is a fake. Its mark is a
   large opening quotation mark in the signal colour. */
.kit-quote {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.kit-quote__text {
  font-size: 1.0625rem;
  font-style: normal;
  line-height: 1.6;
}

.kit-quote__text::before {
  content: "\201C";
  display: block;
  height: 1.75rem;
  margin-bottom: 0.15rem;
  color: var(--kit-accent);
  font-family: var(--font-heading, sans-serif);
  font-size: 3.5rem;
  font-weight: var(--cargo-heading-weight, 700);
  line-height: 1;
}

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

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

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

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

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

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

/* ------------------------------------------------------------------ Chips and badges */

.kit-chip,
.kit-badge {
  font-weight: var(--cargo-body-strong, 600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
