/* ==========================================================================
   Cross Kashmir — Typography
   Roles: display, page heading, section heading, article heading, body,
   lead, metadata, navigation, button, caption.
   Requires tokens.css + base.css.

   Each role exists as a class so any element can take any role
   (e.g. an <h2> styled as .text-page-title). Plain h1–h6 get sensible defaults.
   ========================================================================== */

/* ---- Heading element defaults -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-page); }
h2 { font-size: var(--fs-section); }
h3 { font-size: var(--fs-sub); }
h4, h5, h6 {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
}

p {
  text-wrap: pretty;
}

/* ---- Role classes --------------------------------------------------------- */
.text-display {                      /* lead-story / hero headline */
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-display);
  text-wrap: balance;
}

.text-article-title {                /* h1 of an article page */
  font-size: var(--fs-article);
  font-weight: var(--fw-bold);
  line-height: var(--lh-display);
  text-wrap: balance;
}

.text-page-title {                   /* h1 of a non-article page */
  font-size: var(--fs-page);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}

.text-section-title {                /* h2 section headings */
  font-size: var(--fs-section);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}

.text-sub-title {                    /* h3, card titles */
  font-size: var(--fs-sub);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}

.text-body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.text-lead {                         /* standfirst / summary */
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--color-text);
}

.text-meta {                         /* author, date, category, read time */
  font-size: var(--fs-meta);
  line-height: var(--lh-ui);
  color: var(--color-text-muted);
}

.text-caption {                      /* image captions, footnotes */
  font-size: var(--fs-caption);
  line-height: var(--lh-ui);
  color: var(--color-text-muted);
}

.text-nav {
  font-size: var(--fs-nav);
  font-weight: var(--fw-medium);
  line-height: var(--lh-ui);
}

.text-button {
  font-size: var(--fs-button);
  font-weight: var(--fw-medium);
  line-height: var(--lh-ui);
}

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

/* ---- Metadata row: items separated by a middle dot, wraps safely ---------- */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
  font-size: var(--fs-meta);
  line-height: var(--lh-ui);
  color: var(--color-text-muted);
}

.meta > * + *::before {
  content: "·";
  margin-inline-end: var(--space-2);
}

/* ---- Long-form text rhythm (future article bodies) ------------------------ */
.prose > * + * {
  margin-block-start: var(--space-4);
}

.prose > h2,
.prose > h3 {
  margin-block-start: var(--space-8);
}

.prose ul,
.prose ol {
  padding-inline-start: var(--space-6);
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li {
  margin-block-start: var(--space-2);
}

.prose blockquote {
  padding-inline-start: var(--space-4);
  border-inline-start: 3px solid var(--color-accent);
  color: var(--color-text);
  font-size: var(--fs-lead);
}

.prose figcaption {
  margin-block-start: var(--space-2);
  font-size: var(--fs-caption);
  line-height: var(--lh-ui);
  color: var(--color-text-muted);
}
