/*
 * The Theme Kit in Ledger'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. How whole sections are set on the page (the heading at the left over its rule, the key figures as
 * a row of totals, the timeline as a ledger) is in theme.css, which knows each block's type (includes/stitch.php).
 *
 * The look: a firm's annual report on ivory paper. Headings in a serif, figures in the same serif with lining figures of
 * one width, so columns of numbers line up digit under digit. Cards are flat sheets of paper under a hairline, a sheet
 * that leads somewhere carries a rule of ink along its top. A total stands over a double rule, as an accountant closes a
 * column. Buttons are plain, firm and only just rounded.
 *
 * 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 --ledger-heading-weight, --ledger-heading-light and
 * --ledger-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.1875rem;
  --kit-button-radius: 0.1875rem;
  --kit-input-radius: 0.1875rem;
  --kit-media-radius: 0.1875rem;
  --kit-chip-radius: 0.1875rem;
  --kit-heading-weight: var(--ledger-heading-weight, 600);
  --kit-heading-tracking: -0.012em;
  --kit-button-weight: var(--ledger-body-strong, 600);
  --kit-button-tracking: 0.01em;
  --kit-button-transform: none;
  --kit-eyebrow-tracking: 0.13em;
  --kit-focus: var(--accent-ink, #9a3128);
  --kit-star: var(--accent-ink, #9a3128);
  --kit-shadow: none;
  --kit-shadow-hover: 0 14px 30px -22px color-mix(in srgb, var(--text-primary, #172030) 45%, transparent);
  --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, 4.5vw, 2.5rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --kit-pad-compact: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --kit-measure: 66ch;
}

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

/* Headings: the serif at the heading weight, set a little tight. Sizes are chosen for ordinary words at 320 px (a word
   of fourteen letters fits the first heading there); 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.14;
  text-wrap: balance;
}

/* A page's first heading is set in the serif's lighter weight, large, like the title on a report's cover (the theme's
   own openings do the same). */
.kit-heading--1 {
  font-size: clamp(2.1rem, 1.35rem + 3.2vw, 4rem);
  font-weight: var(--ledger-heading-light, 400);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kit-heading--2 {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  letter-spacing: -0.016em;
  line-height: 1.14;
}

.kit-heading--3 {
  font-size: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  letter-spacing: -0.008em;
  line-height: 1.25;
}

.kit-heading--4 {
  font-size: 1.125rem;
  line-height: 1.3;
}

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

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

/* Small labels: the body face in small spaced capitals, in the accent's readable shade, the way a report heads its
   columns. Only a few short words stand here. */
.kit-eyebrow,
.kit-card__eyebrow {
  color: var(--kit-accent-text);
  font-size: 0.75rem;
  font-weight: var(--ledger-body-strong, 600);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.45;
  text-transform: uppercase;
}

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

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

/* A blockquote in written text stands on the ledger's margin: two fine lines in the accent colour. */
.kit-rich-text blockquote {
  margin-inline: 0;
  padding-inline-start: 1.25rem;
  border-inline-start: 3px double var(--kit-accent);
  font-family: var(--font-heading, serif);
  font-size: 1.125rem;
  font-weight: var(--ledger-heading-light, 400);
}

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

/* Plain, firm buttons: the main one in ink, the other framed by a fine line of the text colour. A label may take two
   lines; it never runs out of the button. theme-chrome.test.mjs holds this shape and the shared notice's together. */
.kit-button {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.25;
}

.kit-button--primary {
  border-color: var(--kit-primary);
}

.kit-button--primary:hover {
  border-color: var(--kit-primary-hover);
}

.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) 7%, transparent);
  color: var(--kit-text);
}

.kit-button--ghost {
  color: var(--kit-text);
  text-decoration: underline;
  text-decoration-color: var(--kit-accent-text);
  text-decoration-thickness: 1px;
  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.875rem;
}

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

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

/* A card is a flat sheet of paper under a hairline, square but for a breath of rounding. */
.kit-card--surface {
  border-color: var(--kit-line);
  box-shadow: none;
}

.kit-card--outline {
  border-color: var(--kit-line);
}

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

.kit-card__meta {
  font-size: 0.8125rem;
  font-variant-numeric: lining-nums tabular-nums;
}

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

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

.kit-card--linked:hover .kit-card__link {
  color: var(--kit-text);
  text-decoration: underline;
  text-decoration-color: var(--kit-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

/* The picture on a card keeps still: a sheet does not zoom. */
.kit-card--linked:hover .kit-card__media img {
  transform: none;
}

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

/* Steps: entries in a book. Each starts under a fine rule with its number in the serif, large and in the accent's shade;
   with an icon the kit makes the number a small label (one lead mark), and the rule stays. */
.kit-grid.kit-steps > .kit-card {
  border: 0;
  border-top: 1px solid var(--kit-text);
  border-radius: 0;
}

.kit-grid.kit-steps .kit-card__content {
  padding: 1.25rem 0.25rem 0 0;
}

.kit-grid.kit-steps .kit-card__content > .kit-card__eyebrow {
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: clamp(1.9rem, 1.6rem + 1vw, 2.5rem);
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: var(--ledger-heading-light, 400);
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-transform: none;
}

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

/* A figure is set in the serif's lighter weight, with lining figures of one width: in a row of figures the digits stand
   in columns. From 1200 px five figures share a row of about 200 px each, so the size stops at about 46 px, where
   "1500 m²" still stands on one line (theme.css sets the row of totals). */
.kit-stat {
  gap: 0.35rem;
}

.kit-stat__value {
  font-size: clamp(2rem, 1.35rem + 2vw, 2.875rem);
  font-weight: var(--ledger-heading-light, 400);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

.kit-stat__label {
  font-size: 0.875rem;
  line-height: 1.45;
}

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

/* Ticks in a list: the accent's shade, a little smaller than the words. */
.kit-list--check .kit-list-item__icon {
  color: var(--kit-accent-text);
}

/* A price list is a statement: rows under fine lines, the label at the left and the amount at the right in the serif,
   digit under digit. No leader of dots (a menu has those); the hairline between rows leads the eye instead. The label
   keeps flex-wrap and its min-content basis from the kit: a long word moves the price under it instead of breaking. */
.kit-list--menu {
  gap: 0;
}

.kit-list--menu > .kit-list-item {
  padding-block: 0.8rem;
  border-top: 1px solid var(--kit-line);
}

.kit-list--menu > .kit-list-item:first-child {
  border-top-color: var(--kit-text);
}

.kit-list--menu > .kit-list-item:last-child {
  /* The rule an accountant draws under a total: two fine lines. */
  border-bottom: 3px double var(--kit-text);
}

.kit-list--menu .kit-list-item__line:has(.kit-list-item__meta)::after {
  background: none;
}

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

.kit-list--menu .kit-list-item__meta {
  color: var(--kit-text);
  font-family: var(--font-heading, serif);
  font-size: 1.125rem;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: var(--ledger-heading-weight, 600);
  line-height: 1.35;
}

/* Questions: a ruled list in the serif, each opened by a plus in the accent's shade. */
.kit-accordion {
  border-top-color: var(--kit-text);
}

.kit-accordion__title {
  padding: 1.2rem 0;
  font-family: var(--font-heading, serif);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  font-weight: var(--ledger-heading-weight, 600);
  letter-spacing: -0.006em;
  line-height: 1.32;
}

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

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

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

/* What somebody said: the serif, in its own italic where the font palette loads one (html.ledger-italic, written by the
   layout). Without one it stays upright: a slant the browser makes up is a fake. It stands on the ledger's margin. */
.kit-quote {
  padding-inline-start: 1.1rem;
  border-inline-start: 3px double var(--kit-accent);
}

.kit-quote__text {
  font-family: var(--font-heading, serif);
  font-size: clamp(1.1rem, 1.04rem + 0.3vw, 1.3rem);
  font-style: normal;
  font-weight: var(--ledger-heading-light, 400);
  line-height: 1.5;
}

html.ledger-italic .kit-quote__text {
  font-style: italic;
}

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

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

.kit-field__label {
  font-size: 0.8125rem;
  font-weight: var(--ledger-body-strong, 600);
  letter-spacing: 0.01em;
}

.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-card__media,
.kit-picture.kit-rounded {
  border-radius: var(--kit-media-radius);
}

.kit-carousel__button,
.kit-slideshow__button {
  border-radius: var(--kit-button-radius);
}

.kit-avatar {
  border-radius: 50%;
}

.kit-chip {
  font-variant-numeric: lining-nums tabular-nums;
}
