/* ==========================================================================
   LOVIAX — site.css
   Mobile-first. Sections:
     1. Tokens        6. Cards         11. Breadcrumbs
     2. Base / reset  7. Forms         12. Icons, badges, category tiles
     3. Typography    8. Notices       13. Tool & category cards
     4. Layout        9. Header & nav  14. Page sections
     5. Buttons      10. Footer        15. Utilities
   Design system v1 (Phase 2). Change visual values in TOKENS only —
   components read tokens. Tool/quiz/result components live in tool.css.
   ========================================================================== */

/* Editorial serif for headings — self-hosted, Latin subset, variable weight.
   Newsreader © The Newsreader Project Authors, SIL Open Font License 1.1. */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  /* Color — core */
  --color-ink: #131414;          /* matches the official logo */
  --color-ink-soft: #3b3836;
  --color-muted: #665e58;        /* 5.9:1 on paper */
  --color-paper: #fbf8f5;        /* page background, warm off-white */
  --color-surface: #ffffff;
  --color-surface-tint: #f4ede7;
  --color-line: #e6ddd5;
  --color-line-strong: #b9aca1;   /* decorative lines, hover borders */
  --color-control: #968779;       /* form control borders — 3.5:1 on white */
  --color-accent: #8a3b4a;       /* deep rose, 7.9:1 with white */
  --color-accent-hover: #6f2d3a;
  --color-accent-tint: #f7ebee;
  --color-success: #2e6a4c;
  --color-success-tint: #e9f3ed;
  --color-error: #a52a22;
  --color-error-tint: #fbecea;
  --color-info-tint: #eef1f6;
  --color-focus: #131414;

  /* Color — solution categories. Soft tint backgrounds + deep text/icon
     colors (all ≥ 4.5:1 on their tint). Used sparingly: badges, icon tiles. */
  --cat-understand: #8a3b4a;       /* Understand Me — rose (brand accent) */
  --cat-understand-tint: #f7ebee;
  --cat-plan: #2f5f4a;             /* Help Me Plan — sage */
  --cat-plan-tint: #e8f0eb;
  --cat-choose: #7a4f1f;           /* Help Me Choose — sand */
  --cat-choose-tint: #f5ecdf;
  --cat-ideas: #5a4579;            /* Give Me Ideas — mauve */
  --cat-ideas-tint: #eee9f5;

  /* Type */
  --font-serif: "Newsreader", Georgia, "Times New Roman", ui-serif, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --text-3xl: clamp(2.25rem, 1.6rem + 3vw, 3.75rem);

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Shape & depth — restrained */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(19 20 20 / 0.06);
  --shadow-md: 0 6px 24px -8px rgb(19 20 20 / 0.14);

  /* Layout */
  --container: 72rem;
  --container-narrow: 42rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --header-height: 4rem;
  --tap: 44px; /* minimum touch target */

  --transition: 150ms ease;
}

/* 2. BASE / RESET ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

/* The hidden attribute always wins over component display rules */
[hidden] {
  display: none !important;
}

/* Shown only when JavaScript is unavailable (html.no-js is swapped to .js
   by the inline flag script before first paint, so there is no flash) */
.js .no-js-only {
  display: none;
}

/* Programmatic focus targets (question/result headings) — no ring on
   elements that are not interactive */
[tabindex="-1"]:focus {
  outline: none;
}

main:focus {
  outline: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--color-accent-tint);
  color: var(--color-ink);
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: #fff;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. TYPOGRAPHY ------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 560;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); font-weight: 520; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); line-height: var(--leading-snug); }

p {
  text-wrap: pretty;
}

.lead {
  font-size: var(--text-lg);
  color: var(--color-ink-soft);
  max-width: 38em;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.prose {
  max-width: 40rem;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  margin-top: 1.8em;
}

.prose h3 {
  margin-top: 1.5em;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.4em;
}

/* 4. LAYOUT ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
  padding-block: var(--space-7);
}

.section--tint {
  background: var(--color-surface-tint);
}

@media (min-width: 48rem) {
  .section {
    padding-block: var(--space-8);
  }
}

/* Vertical rhythm between children */
.stack > * + * {
  margin-top: var(--space-4);
}

.stack--lg > * + * {
  margin-top: var(--space-6);
}

/* Horizontal group that wraps */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* Fixed 1 → 2 → 4 columns for sets of four (avoids a 3 + 1 orphan) */
.grid--4 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Responsive auto grid: as many columns as fit, min card width set by --min */
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 16rem)), 1fr));
}

.section-header {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.section-header > * + * {
  margin-top: var(--space-3);
}

/* 5. BUTTONS --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0.75rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.btn--secondary:hover {
  background: var(--color-ink);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  padding-inline: var(--space-3);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.btn--ghost:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.btn--sm {
  min-height: 40px;
  padding: 0.5rem 1.125rem;
  font-size: 0.9375rem;
}

.btn--lg {
  min-height: 52px;
  padding: 0.9rem 2rem;
  font-size: 1.0625rem;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 6. CARDS ----------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

.card__eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.card__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 560;
  line-height: var(--leading-snug);
}

.card__text {
  color: var(--color-ink-soft);
}

.card__footer {
  margin-top: auto;
  padding-top: var(--space-3);
}

/* A card that is itself a link */
a.card {
  color: inherit;
  text-decoration: none;
}

/* Whole card clickable via one real link (accessible "stretched link") */
.card--link .card__link {
  color: inherit;
  text-decoration: none;
}

.card--link .card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card--link {
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card--link:hover {
  border-color: var(--color-line-strong);
  box-shadow: var(--shadow-md);
}

.card--link:focus-within {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.card--link .card__link:focus-visible {
  outline: none;
}

.card__cta {
  font-weight: 600;
  color: var(--color-accent);
}

.card--tint {
  background: var(--color-surface-tint);
  border-color: transparent;
}

/* 7. FORMS ----------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field + .field {
  margin-top: var(--space-5);
}

.label {
  font-weight: 600;
}

.hint {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.65rem 0.875rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-control);
  border-radius: var(--radius-md);
  font-size: 1rem; /* ≥16px prevents iOS zoom on focus */
  transition: border-color var(--transition);
}

.textarea {
  min-height: 8rem;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--color-ink-soft);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-ink);
}

.field--error .input,
.field--error .select,
.field--error .textarea,
.input[aria-invalid="true"] {
  border-color: var(--color-error);
}

/* Error text always carries an icon/prefix, never color alone */
.field__error {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-error);
}

.field__error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-error);
  color: #fff;
  font-size: 0.75rem;
}

/* Large tappable choice (used by quizzes). Real radio/checkbox inside a label. */
.choices {
  display: grid;
  gap: var(--space-3);
  border: 0;
  padding: 0;
}

.choices legend {
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 3.5rem;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.choice:hover {
  border-color: var(--color-line-strong);
}

.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--color-accent);
}

.choice:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-tint);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.choice input:focus-visible {
  outline: none;
}

.choice__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.choice__hint {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* 8. NOTICES --------------------------------------------------------------- */
.notice {
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-ink-soft);
  border-radius: var(--radius-sm);
  background: var(--color-info-tint);
}

.notice > * + * {
  margin-top: var(--space-2);
}

.notice__title {
  font-weight: 700;
}

.notice--success {
  border-color: var(--color-success);
  background: var(--color-success-tint);
}

.notice--error {
  border-color: var(--color-error);
  background: var(--color-error-tint);
}

.notice--accent {
  border-color: var(--color-accent);
  background: var(--color-accent-tint);
}

/* 9. HEADER & NAVIGATION --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  min-height: var(--header-height);
}

.site-header__logo {
  display: inline-flex;
  padding-block: var(--space-2);
}

.site-header__logo img {
  width: 96px;
  height: auto;
}

.site-header__toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-3);
  background: transparent;
  border: 1.5px solid var(--color-control);
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Hamburger icon drawn with borders — no icon font or image needed */
.site-header__toggle-icon,
.site-header__toggle-icon::before,
.site-header__toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.site-header__toggle-icon {
  position: relative;
}

.site-header__toggle-icon::before,
.site-header__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.site-header__toggle-icon::before { top: -6px; }
.site-header__toggle-icon::after { top: 6px; }

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon {
  background: transparent;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  list-style: none;
  padding: 0;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* Current section: underline, not color alone */
.site-nav__link[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* Header CTA marks the current section with a ring, not color alone */
.site-nav__cta[aria-current] {
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-accent);
}

/* Mobile with JS: collapsible panel below the header bar */
@media (max-width: 55.99rem) {
  .js .site-header__toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    flex-basis: 100%;
    padding-bottom: var(--space-5);
  }

  .js .site-header.is-open .site-nav {
    display: block;
  }

  .js .site-nav__list {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--color-line);
  }

  .js .site-nav__list li {
    border-bottom: 1px solid var(--color-line);
  }

  .js .site-nav__link {
    width: 100%;
    min-height: 52px;
    font-size: 1.125rem;
  }

  .site-nav__cta {
    margin-top: var(--space-4);
  }

  .js .site-nav__cta {
    display: flex;
    width: 100%;
    min-height: var(--tap);
  }

  /* No JS: nav simply wraps under the logo, always visible */
  .no-js .site-nav {
    flex-basis: 100%;
    padding-bottom: var(--space-3);
  }
}

@media (min-width: 56rem) {
  .site-header__logo img {
    width: 110px;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
  }

  .site-nav__list {
    gap: var(--space-5);
  }

  .site-nav__link {
    font-size: 0.9875rem;
  }
}

/* 10. FOOTER --------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-8);
  padding-block: var(--space-7) var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-line);
  font-size: 0.9375rem;
}

.site-footer__top {
  display: grid;
  gap: var(--space-6);
}

.site-footer__logo {
  display: inline-flex;
  padding-block: var(--space-2);
}

.site-footer__logo img {
  width: 96px;
  height: auto;
}

.site-footer__tagline {
  margin-top: var(--space-3);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
}

.site-footer__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-6) var(--space-5);
}

.site-footer__heading {
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-footer__links {
  list-style: none;
  padding: 0;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--color-ink);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.site-footer__bottom {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.site-footer__note {
  max-width: 48rem;
}

@media (min-width: 56rem) {
  .site-footer__top {
    grid-template-columns: 1fr 2fr;
  }
}

/* 11. BREADCRUMBS ---------------------------------------------------------- */
.breadcrumbs {
  padding-top: var(--space-4);
  font-size: var(--text-sm);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  color: var(--color-muted);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-inline: var(--space-2);
  color: var(--color-line-strong);
}

.breadcrumbs a {
  color: var(--color-muted);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-ink);
}

/* 12. ICONS, BADGES & CATEGORY TILES --------------------------------------- */
/* Inline SVG icons from /assets/img/icons.svg — always decorative (aria-hidden)
   and paired with visible text. */
.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.75rem; height: 1.75rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.75em;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  color: var(--color-ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Category theming: set --cat / --cat-tint once, children use them. */
.cat-understand { --cat: var(--cat-understand); --cat-tint: var(--cat-understand-tint); }
.cat-plan       { --cat: var(--cat-plan);       --cat-tint: var(--cat-plan-tint); }
.cat-choose     { --cat: var(--cat-choose);     --cat-tint: var(--cat-choose-tint); }
.cat-ideas      { --cat: var(--cat-ideas);      --cat-tint: var(--cat-ideas-tint); }

.badge--cat {
  background: var(--cat-tint);
  color: var(--cat);
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background: var(--cat-tint, var(--color-surface-tint));
  color: var(--cat, var(--color-ink));
}

/* Meta row: "2 min · 8 questions · Private" */
.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  padding: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.meta-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

/* 13. TOOL CARD & CATEGORY CARD -------------------------------------------- */
/* Tool card: the main way users enter a tool. Problem-first copy. */
.tool-card {
  gap: var(--space-4);
}

.tool-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.tool-card__problem {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-ink-soft);
}

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.card--link:hover .card__cta .icon {
  transform: translateX(3px);
}

.card__cta .icon {
  transition: transform var(--transition);
}

/* Category card: "Understand Me / Help Me Plan / …" */
.category-card {
  gap: var(--space-3);
  border-top: 3px solid var(--cat, var(--color-line));
}

.category-card__examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

/* Upcoming tool: readable but visibly not yet available */
.tool-card--soon {
  background: transparent;
  border-style: dashed;
}

.tool-card--soon .icon-tile {
  opacity: 0.7;
}

/* Soon label: text + style, never color alone */
.badge--soon {
  background: transparent;
  border: 1px dashed var(--color-line-strong);
  color: var(--color-muted);
}

/* Small print for educational / affiliate notes */
.fine-print {
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 44rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin-block: var(--space-6);
}

/* 14. PAGE SECTIONS ------------------------------------------------------- */
/* Page header: the page's H1 block */
.page-header {
  max-width: 44rem;
  padding-block: var(--space-6) var(--space-5);
}

.page-header > * + * {
  margin-top: var(--space-3);
}

@media (min-width: 48rem) {
  .page-header {
    padding-block: var(--space-7) var(--space-6);
  }
}

/* Chip: small pill link (e.g. category examples) */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3em 0.9em;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--transition), background-color var(--transition);
}

.chip:hover {
  border-color: var(--cat, var(--color-accent));
  background: var(--cat-tint, var(--color-accent-tint));
  color: var(--color-ink);
  text-decoration: none;
}

/* CTA band: one message, one action */
.cta-band {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-accent-tint);
}

.cta-band__body > * + * {
  margin-top: var(--space-2);
}

.cta-band__title {
  font-size: var(--text-2xl);
}

.cta-band__text {
  color: var(--color-ink-soft);
  max-width: 36rem;
}

@media (min-width: 48rem) {
  .cta-band {
    grid-template-columns: 1fr auto;
    padding: var(--space-7);
  }
}

/* Small uppercase label used by product-discovery blocks */
.discovery__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--cat-choose);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Homepage ------------------------------------------------------------------ */
.hero {
  padding-block: var(--space-7) var(--space-8);
}

.hero__inner {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 64rem) {
  .hero__inner {
    grid-template-columns: 3fr 2fr;
    gap: var(--space-8);
  }
}

/* Quick start: "I want to figure out…" */
.quick-start {
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.quick-start__title {
  margin-bottom: var(--space-3);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 560;
}

.quick-start__list {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.quick-start__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap);
  padding: var(--space-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-ink);
  text-decoration: none;
  transition: border-color var(--transition), background-color var(--transition);
}

.quick-start__link:hover {
  border-color: var(--cat, var(--color-accent));
  background: var(--cat-tint, var(--color-accent-tint));
  color: var(--color-ink);
  text-decoration: none;
}

.quick-start__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-weight: 600;
  line-height: 1.3;
}

.quick-start__meta {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.quick-start__arrow {
  color: var(--color-accent);
}

/* How Loviax works */
.how-steps {
  display: grid;
  gap: var(--space-5);
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .how-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .how-steps { grid-template-columns: repeat(4, 1fr); }
}

.how-steps__item > * + * {
  margin-top: var(--space-2);
}

.how-steps__number {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-accent);
  font-weight: 700;
}

.how-steps__title {
  font-size: var(--text-xl);
}

.how-steps__more {
  margin-top: var(--space-6);
}

.home-topics {
  margin-top: var(--space-6);
}

/* Product discovery band */
.discovery-band {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--cat-choose-tint);
}

@media (min-width: 56rem) {
  .discovery-band {
    grid-template-columns: 3fr 2fr;
    padding: var(--space-7);
  }
}

.discovery-band__examples {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.discovery-band__examples li {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 0.9375rem;
  color: var(--color-ink-soft);
}

.discovery-band__type {
  display: block;
  color: var(--cat-choose);
  font-weight: 700;
}

/* Checklist with check icons (icon + text, never color alone). Shared by
   tool results and articles. */
.checklist,
.prose .checklist {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.checklist .icon {
  margin-top: 0.2em;
  color: var(--color-success);
}

.prose .checklist li + li {
  margin-top: 0;
}

/* Numbered steps (tool pages and articles) */
.steps-list,
.prose .steps-list {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps-list > li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps-list > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-accent-tint);
  color: var(--color-accent);
  font-weight: 700;
}

.steps-list h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

/* Topic hubs */
.hub-questions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.hub-questions li {
  padding: 0.4em 0.9em;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  color: var(--color-ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0625rem;
}

.h3-size {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.topic-links {
  padding: 0;
  list-style: none;
}

/* Contact form */
.contact-form {
  margin-top: var(--space-5);
}

.contact-form .fine-print {
  margin-block: var(--space-5) var(--space-4);
}

/* Honeypot: off-screen for people, still present for bots */
.field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.error-summary ul {
  padding-left: 1.25em;
}

.error-summary a {
  color: var(--color-error);
  font-weight: 600;
}

.contact-direct {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.contact-direct > * + * {
  margin-top: var(--space-2);
}

.contact-after {
  margin-top: var(--space-5);
}

/* Legal and trust pages */
.page-body {
  padding-bottom: var(--space-7);
}

.page-body > h2 {
  margin-top: 1.8em;
}

.page-updated {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* Article share row */
.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
}

.article-share__text {
  font-weight: 600;
}

/* 16. ARTICLES -------------------------------------------------------------- */
.article-header {
  max-width: 46rem;
  padding-block: var(--space-6) var(--space-6);
}

.article-header > * + * {
  margin-top: var(--space-3);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

/* Let wide content (tables) scroll inside its own box instead of widening the page */
.article-layout > * {
  min-width: 0;
}

/* Contents list: a box above the body on small screens, sticky sidebar on wide */
.toc {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 0.9375rem;
}

.toc__title {
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.toc__list {
  display: grid;
  gap: var(--space-1);
  padding-left: 1.25em;
}

.toc__list li {
  padding-block: 0.3rem;
}

.toc__list a {
  display: inline;
  color: var(--color-ink-soft);
  text-decoration: none;
}

.toc__list a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

@media (min-width: 64rem) {
  .article-layout {
    grid-template-columns: 15rem minmax(0, 42rem);
    gap: var(--space-8);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
  }
}

.article-body {
  font-size: 1.125rem;
  line-height: 1.7;
}

.article-body > h2 {
  margin-top: 2.2em;
}

.article-body > h2:first-child {
  margin-top: 0;
}

.article-body > h3 {
  font-size: var(--text-lg);
}

.article-body .notice,
.article-body .tool-cta,
.article-body figure,
.article-body .table-wrap {
  margin-block: var(--space-6);
}

/* Tables: horizontally scrollable on narrow screens instead of breaking layout */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.table-wrap caption {
  padding: var(--space-3) var(--space-4) 0;
  text-align: left;
  font-weight: 700;
}

.table-wrap th,
.table-wrap td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap th {
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 700;
}

/* Small screens: each row becomes a labeled block (labels come from data-label) */
@media (max-width: 39.99rem) {
  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
  }

  .table-wrap caption {
    display: block;
    padding-bottom: var(--space-2);
  }

  .table-wrap tr {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-line);
  }

  .table-wrap tr:last-child {
    border-bottom: 0;
  }

  .table-wrap td {
    padding: var(--space-1) 0;
    border: 0;
  }

  .table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--color-muted);
    font-size: var(--text-sm);
    font-weight: 700;
  }
}

.article-body figure img {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.article-body figcaption {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* In-article tool call-to-action */
.tool-cta {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--cat-tint, var(--color-accent-tint));
}

.tool-cta .icon-tile {
  background: var(--color-surface);
}

.tool-cta__body > * + * {
  margin-top: var(--space-2);
}

.tool-cta__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 560;
  line-height: var(--leading-snug);
}

.tool-cta__meta {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.tool-cta .btn {
  justify-self: start;
}

@media (min-width: 40rem) {
  .tool-cta {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .tool-cta .btn {
    grid-column: 2;
  }
}

.article-more {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--color-line);
}

.article-more h2 {
  margin-bottom: var(--space-5);
}

.article-note {
  margin-top: var(--space-6);
}

/* 15. UTILITIES ------------------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-muted { color: var(--color-muted); }
.text-center { text-align: center; }

.link-list {
  padding-left: 1.25em;
}

.link-list li + li {
  margin-top: var(--space-2);
}

/* Article images (components/article-image.php) */
.article-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.article-header + .article-figure {
  max-width: 46rem;
  margin-bottom: var(--space-8);
}

.article-figure--portrait {
  max-width: 26rem;
  margin-inline: auto;
}

/* Placeholder shown on dev/staging until an image file exists */
.image-pending {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  padding: var(--space-4);
  border: 2px dashed var(--color-control);
  border-radius: var(--radius-md);
  background: var(--color-accent-tint);
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.article-figure--portrait .image-pending {
  aspect-ratio: 2 / 3;
}
