/*
 * The Theme Kit in Hearth'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.
 *
 * Hearth is the craft bakery and the farm shop: a rustic serif for headings, cards that are labels (corners scooped out,
 * a printed rule inside the edge), buttons that are small labels too, small labels above headings that are rubber stamps
 * (their patchy ink is a mask in theme.css, because this file may hold no picture), figures in the heading face.
 *
 * 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 --hearth-heading-weight and --hearth-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.375rem;
  --kit-radius-sm: 0.375rem;
  --kit-button-radius: 0.375rem;
  --kit-input-radius: 0.375rem;
  --kit-media-radius: 0.25rem;
  --kit-heading-weight: var(--hearth-heading-weight, 700);
  --kit-heading-tracking: -0.005em;
  --kit-button-weight: var(--hearth-body-strong, 700);
  --kit-button-tracking: 0.01em;
  --kit-button-transform: none;
  --kit-eyebrow-tracking: 0.16em;
  --kit-focus: var(--accent-ink, #9c3721);
  --kit-star: var(--accent-ink, #9c3721);
  --kit-card-pad: clamp(1.35rem, 2.2vw, 1.75rem);
  --kit-gap-medium: clamp(1.25rem, 2vw, 1.75rem);
  --kit-gap-large: clamp(2rem, 4vw, 3.25rem);
  --kit-gutter: clamp(1rem, 4vw, 2.25rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 44rem;
  --kit-pad-normal: clamp(3.75rem, 2.5rem + 4.5vw, 6.5rem);
  --kit-pad-compact: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  --kit-pad-spacious: clamp(4.75rem, 3rem + 6vw, 8.5rem);
  /* Paper lies flat: no lifted shadows. A card that leads somewhere rises a little under the pointer instead. */
  --kit-shadow: none;
  --kit-shadow-hover: none;
  /* The scoop cut from each corner of a label. */
  --hearth-cut: 0.75rem;
}

/* Headings in the heading face, sentence case. 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.1rem, 1.5rem + 2.7vw, 3.6rem) * var(--hearth-scale, 1));
  line-height: 1.1;
}

.kit-heading--2 {
  font-size: calc(clamp(1.8rem, 1.35rem + 1.9vw, 2.75rem) * var(--hearth-scale, 1));
}

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

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

/* Small labels above headings are rubber stamps: small spaced capitals in the accent's readable shade inside a double
   rule, set a little askew, as if pressed by hand. Short words: a stamp is a word or three. */
.kit-eyebrow {
  display: inline-block;
  margin: 0 0 0.9rem;
  padding: 0.32em 0.8em 0.26em;
  border: 3px double currentColor;
  border-radius: 0.25rem;
  color: var(--kit-accent-text);
  font-size: 0.75rem;
  font-weight: var(--hearth-body-strong, 700);
  line-height: 1.35;
  transform: rotate(-2deg);
}

/* 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 {
  font-size: 1rem;
}

.kit-button--small {
  min-height: 2.5rem;
  font-size: 0.9375rem;
}

/* The primary button is a small label of the board's colour with a fine rule inside its edge, the accent one the same in
   stamp ink. Bands turn the kit's colours themselves, so the rule follows them. */
.kit-button--primary {
  box-shadow: inset 0 0 0 3px var(--kit-primary), inset 0 0 0 4px color-mix(in srgb, var(--kit-on-primary) 42%, transparent);
}

.kit-button--primary:hover {
  box-shadow: inset 0 0 0 3px var(--kit-primary-hover), inset 0 0 0 4px color-mix(in srgb, var(--kit-on-primary) 75%, transparent);
}

.kit-button--secondary {
  border-width: 2px;
  border-color: currentColor;
  color: var(--kit-text);
}

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

/* 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, so the figures stop at about 44 px. */
.kit-stat__value {
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: clamp(2rem, 1.4rem + 1.6vw, 2.75rem);
  font-weight: var(--hearth-heading-weight, 700);
  line-height: 1.1;
}

.kit-stat__label {
  font-size: 0.9375rem;
}

/* Cards are labels: paper with its four corners scooped out and a printed rule just inside the edge (the card's own
   outline, drawn inside it, cut where it meets a scoop). A picture at the top of a card sits inside the rule, like the
   picture printed on a label. No shadows: a card that leads somewhere rises a little and its rule takes the accent. */
.kit-card--surface {
  border-color: transparent;
  background-color: var(--kit-surface);
  outline: 1px solid color-mix(in srgb, var(--kit-text) 24%, transparent);
  outline-offset: -0.375rem;
  -webkit-mask:
    radial-gradient(circle at 0 0, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 0 0 / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 100% 0 / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 0 100% / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 100% 100% / 51% 51% no-repeat;
  mask:
    radial-gradient(circle at 0 0, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 0 0 / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 100% 0 / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 0 100% / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--hearth-cut), #000 calc(var(--hearth-cut) + 0.5px)) 100% 100% / 51% 51% no-repeat;
}

.kit-card--surface > .kit-card__media {
  margin: 0.625rem 0.625rem 0;
  border-radius: var(--kit-media-radius);
}

.kit-card--linked.kit-card--surface:hover {
  outline-color: var(--kit-accent-text);
  transform: translateY(-3px);
}

.kit-card--outline {
  border-width: 2px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--kit-text) 26%, transparent);
}

.kit-card__title {
  font-size: 1.3rem;
  line-height: 1.25;
}

/* A card's small label is a stamp too, smaller. */
.kit-card__eyebrow {
  align-self: flex-start;
  margin-bottom: 0.45rem;
  padding: 0.25em 0.65em 0.2em;
  border: 3px double currentColor;
  border-radius: 0.25rem;
  font-weight: var(--hearth-body-strong, 700);
  line-height: 1.35;
  transform: rotate(-2deg);
}

/* A step's number (process_steps, without an icon) is a round stamp: the figure in the heading face inside a double ring,
   pressed a little askew. With an icon, the kit makes the number a small label over the title, as it should. */
.kit-steps .kit-card__eyebrow {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
  padding: 0;
  border: 4px double currentColor;
  border-radius: 50%;
  font-family: var(--font-heading, serif);
  font-size: 1.15rem;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: var(--hearth-heading-weight, 700);
  letter-spacing: 0;
  text-transform: none;
  transform: rotate(-8deg);
}

/* A step's icon (the catalogue asks every step for one) stands in the round stamp instead: a double ring pressed askew,
   in the accent's readable shade. The kit turns the number into a small label over the title; the stamp's size and slant
   go with it. */
.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.6rem;
  height: 1.6rem;
  margin-bottom: 0.85rem;
  padding: 0.8rem;
  border: 4px double currentColor;
  border-radius: 50%;
  color: var(--kit-accent-text);
  transform: rotate(-8deg);
}

/* With an icon the kit turns the number into a small label over the title; the round stamp's size and slant go with it. */
.kit-steps .kit-card__content:has(> .kit-card__body > .kit-icon:first-child) > .kit-card__eyebrow {
  height: auto;
  transform: none;
}

/* Questions are rows parted by a seam of stitches, the question in the heading face. */
.kit-accordion__item {
  border-bottom: 2px dashed color-mix(in srgb, var(--kit-text) 24%, transparent);
}

.kit-accordion__title {
  font-family: var(--font-heading, serif);
  font-size: 1.15rem;
  font-weight: var(--hearth-heading-weight, 700);
}

/* A quotation: the words in the heading face, upright (no palette loads an italic), opened by a large quotation mark in
   stamp ink. The mark is the quotation's one lead mark, so the kit's line down its side is not drawn. */
.kit-quote {
  padding-inline-start: 0;
  border-inline-start: 0;
}

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

.kit-quote__text::before {
  content: "\201C";
  display: block;
  height: 0.5em;
  margin-bottom: 0.2em;
  color: var(--kit-accent-text);
  font-family: var(--font-heading, serif);
  font-size: 3.5em;
  font-weight: var(--hearth-heading-weight, 700);
  line-height: 0.9;
}

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

/* Fields: paper with a firm line, like a form at the counter. */
.kit-input,
.kit-select,
.kit-textarea {
  border-width: 1.5px;
  border-color: color-mix(in srgb, var(--kit-text) 30%, transparent);
  background-color: var(--kit-surface);
}
