/* KreateMind components. Hover lightens, press deepens and scales. */

/* Astra underlines links inside `.ast-single-post .entry-content` (0,2,1); buttons and link-cards never underline. */
.km-btn,
a.km-card,
body .entry-content :is(a.km-btn, a.km-card) { text-decoration: none; }

/* ---- Button ---- */
.km-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 14px 26px;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 1.0625rem;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--km-violet);
  color: var(--text-on-brand);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.km-btn:hover { background: var(--state-hover-brand); color: var(--text-on-brand); }
.km-btn:active { background: var(--state-active-brand); transform: var(--press-scale); }

.km-btn--sunny { background: var(--km-amber); color: var(--text-on-sunny); box-shadow: var(--shadow-inset-sunny); }
.km-btn--sunny:hover { background: var(--state-hover-sunny); color: var(--text-on-sunny); }
.km-btn--sunny:active { background: var(--state-active-sunny); }

.km-btn--outline { background: transparent; color: var(--km-violet); border-color: var(--km-violet); }
.km-btn--ghost { background: transparent; color: var(--km-violet); }
.km-btn--outline:hover, .km-btn--ghost:hover { background: var(--km-violet-soft); color: var(--km-violet); }
.km-btn--outline:active, .km-btn--ghost:active { background: color-mix(in srgb, var(--km-violet-soft), var(--km-violet) 14%); color: var(--km-violet); }

.km-btn--sm { font-size: 0.9375rem; padding: 10px 18px; }
.km-btn--lg { font-size: 1.25rem; padding: 18px 34px; }
.km-btn--full { display: flex; width: 100%; }

/* Button rows (hero, story, final CTA, FAQ, 404). On phones they stack full width: one clear column of
   equal targets instead of ragged pills. */
.km-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.km-actions--center { justify-content: center; }
@media (max-width: 599px) {
  .km-actions { flex-direction: column; align-items: stretch; }
  .km-actions > .km-btn { width: 100%; box-sizing: border-box; justify-content: center; text-align: center; }
}

.km-btn[disabled], .km-btn[aria-disabled="true"] {
  background: var(--surface-sunken);
  color: var(--text-muted);
  border-color: transparent;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* ---- Eyebrow and section heading ---- */
/* Brand pink #fd558b is ~3:1 on paper/cream; eyebrows are small text (AA 4.5:1), so text uses a derived
   deeper pink (~5.1:1 on cream, 5.2:1 on paper). Pink as a fill/accent is unchanged. */
:root { --km-pink-text: #c8235f; }
.km-eyebrow {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--km-pink-text);
}
.km-section-heading { max-width: 720px; }
.km-section-heading--center { margin-inline: auto; text-align: center; }
.km-section-heading .km-section-heading__title { margin: 0; text-wrap: balance; }
.km-section-heading__intro { margin: var(--space-4) 0 0; font-size: var(--text-md); text-wrap: pretty; }

.km-on-brand { background: var(--surface-brand); color: var(--km-sky-pale); }
.km-on-brand .km-eyebrow { color: var(--km-amber); }
body .km-on-brand :is(h1, h2, h3) { color: var(--text-on-brand); }

/* ---- Card ---- */
.km-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface-card);
  color: var(--text-body);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  font-size: var(--text-sm);
}
.km-card--soft { background: var(--surface-brand-soft); border-color: transparent; box-shadow: none; }
.km-card--cream { background: var(--surface-page-warm); border-color: transparent; box-shadow: none; }
.km-card--brand { background: var(--surface-brand); color: var(--km-sky-pale); border-color: transparent; box-shadow: none; }
body .km-card .km-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  line-height: 1.2;
  text-transform: none;
  color: var(--text-heading);
}
body .km-card--brand .km-card__title { color: var(--text-on-brand); }

a.km-card, .km-card--interactive {
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
a.km-card:hover, .km-card--interactive:hover { transform: var(--hover-lift); box-shadow: var(--shadow-lift); }

/* ---- Honest placeholder chip ---- */
.km-required {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border: 1px dashed var(--km-violet);
  border-radius: var(--radius-pill);
  background: var(--km-violet-soft);
  color: var(--km-violet);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.km-required__label { font-weight: var(--weight-regular); letter-spacing: 0; text-transform: none; }

/* ---- Grid ---- */
.km-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .km-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .km-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Link-wrapped components never underline (see note at top). */
a.km-pack-card, a.km-media-tile,
body .entry-content :is(a.km-pack-card, a.km-media-tile) { text-decoration: none; }

/* ---- Badge ---- */
.km-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--km-violet);
  color: var(--text-on-brand);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  line-height: 1;
}
.km-badge--learn { background: var(--accent-learn); color: var(--km-violet); }
.km-badge--imagine { background: var(--accent-imagine); color: var(--km-violet); }
.km-badge--play { background: var(--accent-play); }
.km-badge--build { background: var(--accent-build); }
.km-badge--grow { background: var(--accent-grow); }

/* ---- Media tile (honest photo placeholder) ---- */
.km-media-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: var(--km-violet-soft);
}
.km-media-tile--4x3 { aspect-ratio: 4 / 3; }
.km-media-tile--4x5 { aspect-ratio: 4 / 5; }
.km-media-tile--9x16 { aspect-ratio: 9 / 16; }
.km-media-tile--sky { background: var(--km-sky-pale); }
.km-media-tile--cream { background: var(--km-cream); }
.km-media-tile--mint { background: var(--km-mint); }
.km-media-tile__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--km-violet);
}
.km-media-tile__need { max-width: 32ch; font-weight: var(--weight-regular); letter-spacing: 0; text-transform: none; }
.km-media-tile__caption {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--km-violet);
  color: var(--text-on-brand);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
}
a.km-media-tile { transition: transform var(--dur-base) var(--ease-out); }
a.km-media-tile:hover { transform: var(--hover-lift); }
a.km-media-tile:active { transform: var(--press-scale); transition-duration: var(--dur-fast); }
.km-media-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- Pack card ---- */
.km-pack-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-card);
  color: var(--text-body);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
a.km-pack-card:hover { transform: var(--hover-lift); box-shadow: var(--shadow-lift); color: var(--text-body); }
a.km-pack-card:active { transform: var(--press-scale); box-shadow: var(--shadow-soft); transition-duration: var(--dur-fast); }
.km-pack-card__media { position: relative; display: block; }
.km-pack-card__media .km-media-tile { border-radius: 0; }
.km-pack-card__flag { position: absolute; top: var(--space-3); left: var(--space-3); }
.km-pack-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-5); }
.km-pack-card__name {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-lg);
  line-height: 1.1;
  color: var(--text-heading);
}
.km-pack-card__pieces { font-size: var(--text-sm); color: var(--text-muted); }
.km-pack-card__price { margin-top: var(--space-2); }

/* ---- Trust card ---- */
.km-trust-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.km-trust-card__label {
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}
.km-trust-card__value { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-md); line-height: 1.3; }

/* ---- Step flow: the one place all five accents appear together ---- */
.km-step-flow { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0; padding: 0; list-style: none; font-family: var(--font-display); }
.km-step-flow__item { display: flex; align-items: center; gap: var(--space-3); }
.km-step-flow__step {
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  color: var(--text-on-brand);
  font-weight: var(--weight-extrabold);
  /* 19px extrabold counts as WCAG "large text" (3:1); white on orange/pink/green is only ~3:1,
     so those chips carry ink text (3.5-3.8:1). */
  font-size: 1.1875rem;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.km-step-flow__item:nth-child(5n+1) .km-step-flow__step { background: var(--accent-imagine); color: var(--km-violet); }
.km-step-flow__item:nth-child(5n+2) .km-step-flow__step { background: var(--accent-learn); color: var(--km-violet); }
.km-step-flow__item:nth-child(5n+3) .km-step-flow__step { background: var(--accent-build); color: var(--km-ink); }
.km-step-flow__item:nth-child(5n+4) .km-step-flow__step { background: var(--accent-play); color: var(--km-ink); }
.km-step-flow__item:nth-child(5n+5) .km-step-flow__step { background: var(--accent-grow); color: var(--km-ink); }
.km-step-flow__arrow { color: var(--km-violet); font-size: 1.125rem; font-weight: var(--weight-bold); }
.km-step-flow__arrow::before { content: "\2192"; }
@media (max-width: 767px) {
  /* One column of equal pills aligned with the heading, arrows centred between them (not beside them). */
  .km-step-flow { flex-direction: column; align-items: stretch; gap: 0; max-width: 280px; }
  .km-step-flow__item { flex-direction: column; gap: 0; }
  .km-step-flow__step { width: 100%; box-sizing: border-box; padding: 16px 20px; text-align: center; }
  .km-step-flow__arrow { display: block; padding: 6px 0; line-height: 1; text-align: center; }
  .km-step-flow__arrow::before { content: "\2193"; }
}

/* ---- Accordion (<details>): + rotates to x; no JS ---- */
.km-accordion { border-bottom: 1px solid var(--border-soft); }
.km-accordion:first-child { border-top: 1px solid var(--border-soft); }
.km-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
  padding: var(--space-4) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  color: var(--text-heading);
}
.km-accordion__summary::-webkit-details-marker { display: none; }
.km-accordion__summary::after {
  content: "+";
  flex: 0 0 24px;
  text-align: center;
  font-size: 1.375rem;
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-out);
}
.km-accordion[open] > .km-accordion__summary::after { transform: rotate(45deg); }
.km-accordion__body { max-width: 620px; padding: 0 0 var(--space-5); font-size: var(--text-sm); }
.km-facts, body .entry-content .km-facts { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.km-facts strong { display: inline-block; min-width: 130px; font-family: var(--font-display); color: var(--text-heading); }

/* ---- Form fields (contact) ---- */
.km-field { display: flex; flex-direction: column; gap: var(--space-2); margin: 0 0 var(--space-4); }
.km-field label { font-weight: var(--weight-bold); font-size: var(--text-sm); color: var(--text-heading); }
.km-field input, .km-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  font: inherit;
  color: var(--text-body);
}
.km-field input:focus, .km-field textarea:focus { border-color: var(--km-violet); }
.km-field--trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.km-contact-form__notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--km-violet-soft); color: var(--text-heading); font-weight: var(--weight-bold); }
.km-contact-form__notice--error { background: var(--km-cream); color: var(--km-ink); border: 1px solid var(--km-pink-text); }
.km-contact-form__notice { display: flex; align-items: center; gap: var(--space-3); }

/* ---- Character kit ----
   Four supplied figures (friendly star, playful pink, curious green, positive cloud) placed by km_character() /
   [km_character]. Transparent WebP, never stretched (height fixed, width auto), never boxed, never recoloured.
   One violet-tinted drop shadow seats them on flat grounds; the only motion is a slow float, off under
   prefers-reduced-motion. Decorative: alt="" and pointer-events off, so they never compete with controls. */
.km-character {
  --km-character-h: 140px;
  display: block;
  max-width: 100%;
  margin: 0;
  filter: drop-shadow(0 8px 16px rgba(75, 47, 189, .14));
  pointer-events: none;
  user-select: none;
}
/* Treatments set the height through the variable; this one rule applies it with enough specificity to beat
   WooCommerce's `.woocommerce img { height: auto }` on the shop, cart and order pages. */
body img.km-character, .woocommerce img.km-character, .woocommerce-page img.km-character { width: auto; height: var(--km-character-h); }
@keyframes km-float { 50% { transform: translateY(-3px); } }
.km-character--peek, .km-character--figure { animation: km-float 4s var(--ease-out) infinite alternate; }
@media (prefers-reduced-motion: reduce) { .km-character { animation: none; } }

/* peek: tucked into the bottom-left corner of a media tile. Phones keep it inside the gutter with a small
   overhang below; desktop lets it straddle the tile's corner into the grid gap. */
.km-character-host { position: relative; }
.km-character-host--peek { margin-bottom: var(--space-4); }
.km-character--peek { --km-character-h: 96px; position: absolute; left: 12px; bottom: -16px; z-index: 1; }
@media (min-width: 900px) {
  .km-character-host--peek { margin-bottom: 0; }
  .km-character--peek { --km-character-h: 140px; left: -32px; bottom: -24px; }
}

/* companion: beside a section heading. Above the eyebrow on phones, bottom-aligned to the right on desktop. */
.km-companion { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.km-companion > .km-section-heading { flex: 1 1 auto; }
.km-companion > .km-character { order: -1; }
.km-character--companion { --km-character-h: 80px; }
@media (min-width: 900px) {
  .km-companion { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
  .km-companion > .km-character { order: 0; }
  .km-character--companion { --km-character-h: 120px; }
}

/* figure: standalone above the text of an empty state or confirmation. */
.km-character--figure { --km-character-h: 140px; margin: 0 0 var(--space-5); }
@media (min-width: 900px) { .km-character--figure { --km-character-h: 180px; } }
.km-character--center { margin-inline: auto; }

/* inline: inside a notice, before the text. */
.km-character--inline { --km-character-h: 48px; flex: none; }
