/*
 * The Theme Kit in Heirloom'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 needlework laid on the parts (the ornament over a section's heading, a card's hem, the
 * seams between questions, the sash under a photograph) is in theme.css, because each mark is drawn by a small picture
 * and this file may load none.
 *
 * The look: linen and wool. Cards are flat pieces of bleached linen with a fine edge and no shadow, tinted bands are
 * unbleached linen, a band of the main colour is woven in a fine twill, buttons are firm tabs with a darker selvedge at
 * their foot, steps stand in woven diamonds, headings are a warm book serif and small labels its italic.
 *
 * 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 --heirloom-heading-weight and --heirloom-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.5rem;
  --kit-radius-sm: 0.375rem;
  --kit-button-radius: 0.375rem;
  --kit-input-radius: 0.375rem;
  --kit-media-radius: 0.5rem;
  --kit-chip-radius: 999px;
  --kit-heading-weight: var(--heirloom-heading-weight, 600);
  --kit-heading-tracking: -0.008em;
  --kit-button-weight: var(--heirloom-body-strong, 500);
  --kit-button-transform: none;
  --kit-eyebrow-tracking: 0.01em;
  --kit-focus: var(--accent-ink, #962b25);
  --kit-star: var(--accent-ink, #962b25);
  --kit-shadow: none;
  --kit-shadow-hover: 0 14px 30px -18px color-mix(in srgb, var(--text-primary, #2a211b) 38%, transparent);
  --kit-card-pad: clamp(1.3rem, 1.1rem + 0.8vw, 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: 72rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.75rem, 2.75rem + 4vw, 6.5rem);
  --kit-pad-compact: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8rem);
}

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

/* A tinted band is unbleached linen: the same fine weave as the page, a shade darker. */
.kit-section--muted {
  background-image:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--text-primary, #2a211b) 3.6%, transparent) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text-primary, #2a211b) 3%, transparent) 0 1px, transparent 1px 4px);
}

/* A band of the main colour or of the accent is woven in a fine twill: diagonal threads, barely lighter. */
.kit-section--inverse,
.kit-section--accent {
  background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--kit-section-fg) 6%, transparent) 0 1px, transparent 1px 4px);
}

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

/* Headings: a warm book serif. 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;
}

.kit-heading--1 {
  font-size: clamp(2.125rem, 1.45rem + 2.9vw, 3.75rem);
  letter-spacing: -0.012em;
  line-height: 1.1;
}

.kit-heading--2 {
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);
  letter-spacing: -0.01em;
}

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

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

.kit-heading.kit-heading--long {
  font-size: clamp(1.35rem, 1.2rem + 0.7vw, 1.75rem);
  line-height: 1.28;
}

.kit-text--lead {
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  line-height: 1.55;
}

/* The body face runs small for its size, so plain text is set a step larger than the kit's. */
.kit-text-block:not(.kit-text--small, .kit-text--lead),
.kit-rich-text {
  font-size: 1.0625rem;
}

.kit-text--small {
  font-size: 0.9375rem;
}

/* Small labels: the heading face, in its italic where the font palette loads one, in the thread's colour, never in
   capitals (capitals make long Lithuanian words much wider). theme.css puts a stitched diamond before them. */
.kit-eyebrow,
.kit-card__eyebrow {
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: 1.0625rem;
  font-weight: var(--heirloom-heading-weight, 600);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.35;
  text-transform: none;
}

html.heirloom-italic .kit-eyebrow,
html.heirloom-italic .kit-card__eyebrow {
  font-style: italic;
}

/* A step's number stands upright in its diamond. */
html.heirloom-italic .kit-steps .kit-card__content:not(:has(> .kit-card__body > .kit-icon:first-child)) > .kit-card__eyebrow {
  font-style: normal;
}

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

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

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

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

/* A firm tab of cloth with a darker selvedge along its foot. 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.4rem 0.8rem;
  font-size: 1rem;
  line-height: 1.25;
}

.kit-button--primary {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, #000 24%, transparent);
}

.kit-button--secondary {
  border-width: 1.5px;
  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-underline-offset: 0.3em;
}

/* 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.05rem 0.6rem;
  font-size: 0.9375rem;
}

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

/* A card is a flat piece of bleached linen with a fine edge. theme.css sews its hem. */
.kit-card--surface {
  border-color: var(--kit-line);
  background: var(--kit-surface);
}

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

.kit-card__title {
  font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.45rem);
  line-height: 1.24;
}

.kit-card__body {
  font-size: 1.0625rem;
}

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

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

/* An icon leads a card, a feature and a step in the thread's colour. */
.kit-card__body > .kit-icon:first-child,
.kit-features .kit-icon {
  color: var(--kit-accent-text);
}

/* Steps: each number stands in a woven diamond of the accent colour, the words beside a step read under it. The
   diamond is drawn behind the number (::before), so a step with an icon (the kit then sets its number as a small label)
   only has to lose the diamond. */
.kit-steps .kit-card__eyebrow {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 0 0.85rem;
  color: var(--kit-on-accent);
  font-family: var(--font-heading, serif);
  font-size: 1.0625rem;
  font-style: normal;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0;
  line-height: 1;
}

.kit-steps .kit-card__eyebrow::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.48rem;
  border-radius: 0.2rem;
  background: var(--kit-accent);
  box-shadow: 0 0 0 2px var(--kit-surface), 0 0 0 3.5px var(--kit-accent);
  transform: rotate(45deg);
}

.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__eyebrow::before {
  content: none;
}

.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__eyebrow {
  font-family: var(--font-heading, serif);
}

/* A step with an icon (the catalogue asks every step for one) leads with its icon set in the same woven diamond, in
   the on-accent colour; its number stays the small label over the title. The diamond is the icon's own box, cut to a
   diamond, so nothing is added beside the icon. */
.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__body > .kit-icon:first-child {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.65rem;
  padding: 0.95rem;
  background: var(--kit-accent);
  color: var(--kit-on-accent);
  stroke-width: 1.75;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

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

/* A statistic in the heading face, the thread's colour. From 1200 px five statistics stand in a row of about 200 px
   each: the size stops at about 46 px so "1500 m²" stays on one line there. */
.kit-stat__value {
  color: var(--kit-accent-text);
  font-size: clamp(2rem, 1.35rem + 1.9vw, 2.875rem);
  line-height: 1.1;
}

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

.kit-stat__label {
  color: var(--kit-text);
  font-size: 1rem;
}

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

.kit-accordion__title {
  padding: 1.15rem 0;
  font-family: var(--font-heading, serif);
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  font-weight: var(--heirloom-heading-weight, 600);
  line-height: 1.3;
}

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

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

.kit-accordion__body {
  font-size: 1.0625rem;
}

/* A quotation: the heading face, in its italic where the font palette loads one, upright otherwise (a browser's own slant
   is a fake). No bar at its side; the card it stands in frames it. */
.kit-quote {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.kit-quote__text {
  font-family: var(--font-heading, serif);
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
  font-style: normal;
  line-height: 1.45;
}

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

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

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

.kit-list--check .kit-icon {
  color: var(--kit-accent-text);
}

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

.kit-field__label {
  font-size: 0.9375rem;
  font-weight: var(--heirloom-body-strong, 500);
}

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

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

/* ------------------------------------------------------------------ Pictures */

.kit-picture.kit-rounded,
.kit-frame,
.kit-video,
.kit-compare__frame {
  border-radius: var(--kit-media-radius);
}

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