/*
 * The Theme Kit in Collage'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 lie on the page (torn bands, the cut-out headings, marker marks, taped prints)
 * is in theme.css, which may draw shapes and knows each block's type.
 *
 * The look: paper on paper. A card is a scrap of white paper laid a little crooked, with a strip of tape across its top;
 * a button is a scrap of black, white or accent paper; a small label is written on a piece of tape; an icon is cut out
 * of a square of black paper; the plan a website marks is cut from the black paper. Square corners everywhere: scissors
 * cut straight.
 *
 * 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 --collage-heading-weight and --collage-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: 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(--collage-heading-weight, 400);
  --kit-heading-tracking: -0.005em;
  --kit-button-weight: var(--collage-body-strong, 700);
  --kit-button-transform: uppercase;
  --kit-button-tracking: 0.06em;
  --kit-eyebrow-tracking: 0.08em;
  --kit-focus: var(--accent-ink, #a8260c);
  --kit-star: var(--accent-ink, #a8260c);
  --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, 2rem);
  --kit-width-normal: 74rem;
  --kit-width-narrow: 46rem;
  --kit-pad-normal: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --kit-pad-compact: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  --kit-pad-spacious: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  /* Paper lying on paper. */
  --kit-shadow: 0 1px 1px color-mix(in srgb, var(--text-primary, #1a1917) 16%, transparent), 0 10px 18px -12px color-mix(in srgb, var(--text-primary, #1a1917) 50%, transparent);
  --kit-shadow-hover: 0 2px 2px color-mix(in srgb, var(--text-primary, #1a1917) 14%, transparent), 0 18px 28px -16px color-mix(in srgb, var(--text-primary, #1a1917) 55%, transparent);
  /* Masking tape and its torn ends (theme.css defines the same; repeated here for module previews, which load only this
     file). */
  --collage-tape-kit: color-mix(in srgb, var(--accent, #ff5533) 9%, color-mix(in srgb, var(--surface-alt, #e2d1ae) 45%, var(--surface, #fffdf7)));
  --collage-tape-kit-clear: color-mix(in srgb, var(--collage-tape-kit) 84%, transparent);
  --collage-ends: polygon(0 8%, 4px 22%, 0 38%, 3px 55%, 0 71%, 4px 86%, 0 100%, 100% 100%, calc(100% - 4px) 84%, 100% 68%, calc(100% - 3px) 50%, 100% 33%, calc(100% - 4px) 16%, 100% 0, 3px 0);
}

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

/* Headings in the heading face. 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 narrow display face is set larger (--collage-display, from the layout).
   A line height under about 1.1 cuts marks in a box that clips. */
.kit-heading {
  font-family: var(--font-heading, sans-serif);
  line-height: 1.12;
  text-wrap: balance;
}

.kit-heading--1 {
  font-size: calc(clamp(2.25rem, 1.45rem + 3.4vw, 4.25rem) * var(--collage-display, 1));
  line-height: 1.1;
}

.kit-heading--2 {
  font-size: calc(clamp(1.85rem, 1.3rem + 2.3vw, 3.1rem) * var(--collage-display, 1));
  line-height: 1.14;
}

.kit-heading--3 {
  font-size: calc(clamp(1.2rem, 1.08rem + 0.5vw, 1.45rem) * var(--collage-display, 1));
  line-height: 1.22;
}

.kit-heading--4 {
  font-size: calc(1.125rem * var(--collage-display, 1));
}

.kit-heading.kit-heading--long {
  font-size: calc(clamp(1.3rem, 1.12rem + 0.8vw, 1.7rem) * var(--collage-display, 1));
  letter-spacing: normal;
  line-height: 1.3;
}

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

/* A small label is written on a piece of masking tape stuck on a little crooked, its ends torn. The ink on it is the
   page's text colour, whatever the band: the tape is a paper the colour contract keeps that colour readable on. */
.kit-eyebrow {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.85rem 0.28rem;
  background: var(--collage-tape-kit);
  color: var(--text-primary, #1a1917);
  clip-path: var(--collage-ends);
  font-family: var(--font-body, sans-serif);
  font-size: 0.75rem;
  font-weight: var(--collage-body-strong, 700);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.4;
  text-transform: uppercase;
  rotate: -2deg;
}

.kit-card__eyebrow {
  color: var(--kit-accent-text);
  font-size: 0.75rem;
  font-weight: var(--collage-body-strong, 700);
  letter-spacing: var(--kit-eyebrow-tracking);
  line-height: 1.4;
}

.kit-link {
  color: var(--kit-text);
  font-weight: var(--collage-body-strong, 700);
  text-decoration-color: var(--kit-accent-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

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

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

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

.kit-rich-text blockquote {
  border-inline-start-width: 4px;
}

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

/* A scrap of paper laid a little crooked under a straight label in typed capitals. The paper is ::before, so it can
   lean and carry a soft shadow while the label and the focus ring stay straight; its colours are the kit's roles, so a
   button on a dark band turns as the kit turns it. A framed button is white paper on any band (the page's text on the
   surface colour, a pair the colour contract keeps). On hover the scrap straightens and lifts, and the label is
   underlined. */
.kit-root .kit-button {
  --collage-fill: transparent;
  position: relative;
  isolation: isolate;
  min-height: 2.875rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  line-height: 1.3;
  transition: translate var(--kit-speed) var(--kit-ease), color var(--kit-speed) ease;
}

.kit-root .kit-button:not(.kit-button--ghost)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--collage-fill);
  box-shadow: var(--kit-shadow);
  rotate: var(--collage-tilt, -1.2deg);
  transition: rotate var(--kit-speed) var(--kit-ease), box-shadow var(--kit-speed) ease, background-color var(--kit-speed) ease;
}

.kit-root .kit-button > span {
  text-decoration: underline 2px transparent;
  text-underline-offset: 0.3em;
  transition: text-decoration-color var(--kit-speed) ease;
}

.kit-root .kit-button:hover:not(:disabled, [aria-disabled="true"]) {
  translate: 0 -2px;
}

.kit-root .kit-button:hover:not(:disabled, [aria-disabled="true"])::before {
  box-shadow: var(--kit-shadow-hover);
  rotate: 0deg;
}

.kit-root .kit-button:hover > span {
  text-decoration-color: currentColor;
}

.kit-root .kit-button--primary,
.kit-root .kit-button--primary:hover {
  --collage-fill: var(--kit-primary);
  background: transparent;
  color: var(--kit-on-primary);
}

.kit-root .kit-button--primary:hover {
  --collage-fill: var(--kit-primary-hover);
}

.kit-root .kit-button--secondary,
.kit-root .kit-button--secondary:hover,
.kit-root .kit-button--light,
.kit-root .kit-button--light:hover {
  --collage-fill: var(--surface, #fffdf7);
  --collage-tilt: 1deg;
  background: transparent;
  color: var(--text-primary, #1a1917);
}

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

.kit-root .kit-button--ghost:hover {
  background: var(--kit-soft);
}

/* Buttons side by side lean different ways. */
.kit-button-group {
  gap: 0.9rem 1.1rem;
}

.kit-button-group > .kit-button:nth-child(even) {
  --collage-tilt: 1.3deg;
}

.kit-button-group > .kit-button--secondary:nth-child(odd),
.kit-button-group > .kit-button--light:nth-child(odd) {
  --collage-tilt: -0.9deg;
}

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

/* A busy form's button keeps its spinner (the kit's ::after) above the paper. */
.kit-root .kit-button::after {
  z-index: 1;
}

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

/* A card is a scrap of white paper laid a little crooked, each in a row at its own angle, with a strip of tape across its
   top. It does not hide what overflows (the tape stands over its edge); its picture keeps its own frame. A picture on a
   card is a print glued on with a white margin. */
.kit-root .kit-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  rotate: var(--collage-tilt, 0deg);
  transition: rotate var(--kit-speed) var(--kit-ease), translate var(--kit-speed) var(--kit-ease), box-shadow var(--kit-speed) ease;
}

.kit-root .kit-card--surface,
.kit-root .kit-card--outline {
  background: var(--surface, #fffdf7);
  color: var(--text-primary, #1a1917);
  box-shadow: var(--kit-shadow);
  --kit-text: var(--text-primary, #1a1917);
  --kit-muted: var(--text-secondary-ink, var(--text-secondary, #4f4940));
  --kit-accent-text: var(--accent-ink, #a8260c);
  --kit-primary: var(--primary, #1a1917);
  --kit-primary-hover: var(--primary-alt, #38342f);
  --kit-on-primary: var(--on-primary, #fffdf7);
  --kit-line: var(--border, #cbbfa7);
  --kit-line-strong: color-mix(in srgb, var(--text-primary, #1a1917) 30%, transparent);
  --kit-surface: var(--surface, #fffdf7);
  --kit-surface-alt: var(--surface-alt, #e2d1ae);
  --kit-soft: color-mix(in srgb, var(--accent, #ff5533) 14%, transparent);
  --kit-focus: var(--accent-ink, #a8260c);
}

.kit-root .kit-card--surface::before,
.kit-root .kit-card--outline::before {
  content: "";
  position: absolute;
  top: -0.65rem;
  left: 50%;
  z-index: 3;
  width: clamp(4rem, 34%, 6.5rem);
  height: 1.35rem;
  background-image: linear-gradient(var(--collage-tape-kit-clear), var(--collage-tape-kit-clear));
  clip-path: var(--collage-ends);
  translate: -50% 0;
  rotate: -2.5deg;
  pointer-events: none;
}

.kit-grid > .kit-card:nth-child(4n + 1),
.kit-carousel__track > .kit-card:nth-child(4n + 1) { --collage-tilt: -0.9deg; }
.kit-grid > .kit-card:nth-child(4n + 2),
.kit-carousel__track > .kit-card:nth-child(4n + 2) { --collage-tilt: 0.7deg; }
.kit-grid > .kit-card:nth-child(4n + 3),
.kit-carousel__track > .kit-card:nth-child(4n + 3) { --collage-tilt: -0.4deg; }
.kit-grid > .kit-card:nth-child(4n),
.kit-carousel__track > .kit-card:nth-child(4n) { --collage-tilt: 1.1deg; }

.kit-grid > .kit-card:nth-child(4n + 2)::before { rotate: 3deg; }
.kit-grid > .kit-card:nth-child(4n + 3)::before { rotate: -1deg; left: 38%; }
.kit-grid > .kit-card:nth-child(4n)::before { rotate: 4deg; left: 60%; }

/* On a phone a card stands alone in its row and may be very tall: turned about its middle, a card of 1500 px swings out
   at its corners by half its height times the angle, and past a degree that reaches over the page's edge, so the angles
   are small there. */
@media (max-width: 39.99rem) {
  .kit-grid > .kit-card:nth-child(odd),
  .kit-carousel__track > .kit-card:nth-child(odd) { --collage-tilt: -0.35deg; }
  .kit-grid > .kit-card:nth-child(even),
  .kit-carousel__track > .kit-card:nth-child(even) { --collage-tilt: 0.3deg; }
}

/* One card alone, or a long list of them in one column (a timeline), lies almost straight. */
.kit-grid.kit-cols--1 > .kit-card { --collage-tilt: 0deg; }
.kit-grid.kit-cols--1 > .kit-card:nth-child(odd) { --collage-tilt: -0.35deg; }
.kit-grid.kit-cols--1 > .kit-card:nth-child(even) { --collage-tilt: 0.35deg; }

.kit-root .kit-card--plain {
  background: transparent;
  box-shadow: none;
}

.kit-root .kit-card--linked:hover {
  --collage-tilt: 0deg;
  translate: 0 -4px;
}

.kit-root .kit-card--linked.kit-card--surface:hover,
.kit-root .kit-card--linked.kit-card--outline:hover {
  box-shadow: var(--kit-shadow-hover);
}

.kit-root .kit-card--linked:hover .kit-card__link {
  color: inherit;
  text-decoration: underline 2px var(--kit-accent-text);
  text-underline-offset: 0.2em;
}

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

.kit-card__title {
  font-size: calc(clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem) * var(--collage-display, 1));
  letter-spacing: -0.005em;
  line-height: 1.2;
}

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

/* ------------------------------------------------------------------ Icons and steps */

/* An icon leading a feature is cut out of a square of black paper; every other one out of the accent paper. */
.kit-grid.kit-features > .kit-stack > .kit-icon:first-child {
  box-sizing: content-box;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.6rem;
  background: var(--primary, #1a1917);
  color: var(--on-primary, #fffdf7);
  rotate: -4deg;
}

.kit-grid.kit-features > .kit-stack:nth-child(even) > .kit-icon:first-child {
  background: var(--accent, #ff5533);
  color: var(--on-accent, #1a1917);
  rotate: 3deg;
}

/* A step's number on a square of black paper, large; the steps lean in turn. */
.kit-steps .kit-card__eyebrow {
  display: grid;
  place-items: center;
  width: fit-content;
  min-width: 3.1rem;
  min-height: 3.1rem;
  margin-bottom: 0.9rem;
  padding: 0.2rem 0.55rem;
  background: var(--primary, #1a1917);
  color: var(--on-primary, #fffdf7);
  box-shadow: var(--kit-shadow);
  font-family: var(--font-heading, sans-serif);
  font-size: calc(1.5rem * var(--collage-display, 1));
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: var(--collage-heading-weight, 400);
  letter-spacing: 0;
  line-height: 1.1;
  rotate: -4deg;
}

.kit-steps > .kit-card:nth-child(even) .kit-card__eyebrow {
  background: var(--accent, #ff5533);
  color: var(--on-accent, #1a1917);
  rotate: 3deg;
}

/* With an icon (the block asks for one on every step), the icon leads, cut out of a square of paper like a feature's,
   and the number is a small label over the title (the kit's rule for steps with icons). */
.kit-steps .kit-card__body > .kit-icon:first-child {
  box-sizing: content-box;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.6rem;
  background: var(--primary, #1a1917);
  color: var(--on-primary, #fffdf7);
  box-shadow: var(--kit-shadow);
  rotate: -4deg;
}

.kit-steps > .kit-card:nth-child(even) .kit-card__body > .kit-icon:first-child {
  background: var(--accent, #ff5533);
  color: var(--on-accent, #1a1917);
  rotate: 3deg;
}

/* ------------------------------------------------------------------ Figures and plans */

/* Figures (stats_counter, a plan's price). From 1200 px five statistics stand in a row of about 200 px each: the sizes
   stop where "1500 m²" still fits there. theme.css circles each in marker. */
.kit-stat__value {
  font-size: calc(clamp(1.9rem, 1.35rem + 1.6vw, 2.7rem) * var(--collage-display, 1));
  line-height: 1.12;
}

.kit-stat__label {
  font-size: 0.875rem;
  font-weight: var(--collage-body-strong, 700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The plan a website marks (a paper card among framed ones) is cut from the black paper: every colour inside it turns,
   as in a dark band, and its label is a strip of the accent paper. */
.kit-grid:has(> .kit-card--outline) > .kit-card--surface {
  background: var(--primary, #1a1917);
  color: var(--on-primary, #fffdf7);
  --collage-tilt: -1.4deg;
  --kit-text: var(--on-primary, #fffdf7);
  --kit-muted: var(--on-primary, #fffdf7);
  --kit-surface: color-mix(in srgb, var(--on-primary, #fffdf7) 9%, transparent);
  --kit-primary: var(--on-primary, #fffdf7);
  --kit-primary-hover: color-mix(in srgb, var(--on-primary, #fffdf7) 88%, var(--primary, #1a1917));
  --kit-on-primary: var(--primary, #1a1917);
  --kit-accent: var(--on-primary, #fffdf7);
  --kit-accent-text: var(--on-primary, #fffdf7);
  --kit-line: color-mix(in srgb, var(--on-primary, #fffdf7) 26%, transparent);
  --kit-line-strong: color-mix(in srgb, var(--on-primary, #fffdf7) 52%, transparent);
  --kit-focus: var(--on-primary, #fffdf7);
}

.kit-grid:has(> .kit-card--outline) > .kit-card--surface .kit-card__eyebrow {
  width: fit-content;
  padding: 0.2rem 0.6rem;
  background: var(--accent, #ff5533);
  color: var(--on-accent, #1a1917);
  rotate: -2deg;
}

.kit-price__amount {
  letter-spacing: 0;
}

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

/* ------------------------------------------------------------------ Questions, quotes, chips */

/* Questions are strips of paper, one under the other, each a little crooked. A row drawn as a shape takes its own
   padding at the sides and the list no line above (THEME_ROBUSTNESS.md, rows drawn as shapes; faq-rows.test.mjs). */
.kit-accordion {
  display: grid;
  gap: 0.75rem;
  border-top: 0;
}

.kit-accordion__item {
  padding-inline: 1.1rem;
  border-bottom: 0;
  background: var(--surface, #fffdf7);
  color: var(--text-primary, #1a1917);
  box-shadow: var(--kit-shadow);
  rotate: -0.3deg;
  --kit-text: var(--text-primary, #1a1917);
  --kit-muted: var(--text-secondary-ink, var(--text-secondary, #4f4940));
  --kit-accent-text: var(--accent-ink, #a8260c);
}

.kit-accordion__item:nth-child(even) {
  rotate: 0.3deg;
}

.kit-accordion__title {
  padding: 1.05rem 0;
  font-family: var(--font-heading, sans-serif);
  font-size: calc(clamp(1.05rem, 1rem + 0.3vw, 1.2rem) * var(--collage-display, 1));
  font-weight: var(--collage-heading-weight, 400);
  line-height: 1.3;
}

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

.kit-accordion__body {
  padding: 0 0 1.25rem;
}

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

.kit-quote__text {
  font-family: var(--font-body, sans-serif);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  font-style: normal;
  line-height: 1.7;
}

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

/* A face in a square print with a white margin. */
.kit-avatar {
  border: 3px solid var(--surface, #fffdf7);
  border-radius: 0;
  box-shadow: var(--kit-shadow);
  rotate: -3deg;
}

.kit-chip {
  border-radius: 0;
  font-weight: var(--collage-body-strong, 700);
}

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

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

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

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

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

/* ------------------------------------------------------------------ Pictures, sliders */

/* A logo or a picture shown whole stands on the paper around it, not on a box of its own. */
.kit-picture.kit-fit--contain {
  background: transparent;
}

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

/* A sliding row leaves room above and at the sides for the tape and the leaning cards, which it would cut off. */
.kit-carousel__track {
  margin: -1rem -0.5rem -0.5rem;
  padding: 1rem 0.5rem 1rem;
  scroll-padding-inline: 0.5rem;
}

.kit-carousel__button,
.kit-slideshow__button {
  border: 2px solid currentColor;
  border-radius: 0;
  rotate: -3deg;
}

.kit-carousel__button:hover:not(:disabled) {
  border-color: var(--kit-text);
  rotate: 0deg;
}

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