/* assets/css/02-typography.css
 *
 * Typography styles for headings, paragraphs, and lists.
 */

/* TYPE primitive tokens
*  Generated with Utopia Fluid Type
* @link https://utopia.fyi/type/calculator?c=320,16,1.2,1240,20,1.25,4,1,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,NaN
*/
:root {
  --step--1: clamp(0.83rem, calc(0.78rem + 0.29vw), 1rem);
  --step-0: clamp(1rem, calc(0.91rem + 0.43vw), 1.25rem);
  --step-1: clamp(1.2rem, calc(1.07rem + 0.63vw), 1.56rem);
  --step-2: clamp(1.44rem, calc(1.26rem + 0.89vw), 1.95rem);
  --step-3: clamp(1.73rem, calc(1.48rem + 1.24vw), 2.44rem);
  --step-4: clamp(2.07rem, calc(1.73rem + 1.7vw), 3.05rem);
}

body {
  font-family: var(--font-family-body);
}

h1 {
  font-size: 2.25rem;
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

h4,
h5,
h6 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 1.5rem 0 0.5rem;
}

/* The first heading in a header/article shouldn't inherit that extra
   top margin. It's already the first thing on the page. */
article > header :first-child,
.hero :first-child {
  margin-top: 0;
}

p {
  margin: 0 0 1.25rem;
  line-height: 1.7;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Inline links in prose need a cue beyond color (WCAG 1.4.1). Links with a
   class are styled components (tags, nav, buttons) and keep their own rules. */
p a:not([class]) {
  text-decoration: underline;
}

.e-content ul,
.e-content ol {
  margin: 0 0 1.25rem;
  line-height: 1.7;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 0 1rem;
  border-left: 3px solid var(--color-lightGrey);
  line-height: 1.6;
}

blockquote p {
  margin: 0;
}

/* Code blocks and inline code - uses monospace font from site.js */
code,
pre,
kbd,
samp {
  font-family: var(--font-family-mono);
}

pre {
  background: var(--bg-secondary-color);
  padding: 1rem;
  overflow-x: auto;
}

code {
  background: var(--bg-secondary-color);
  padding: 0.2rem 0.4rem;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  font-size: 1em;
}

kbd {
  background: var(--bg-secondary-color);
  border: 1px solid var(--color-lightGrey);
  padding: 0.2rem 0.4rem;
  font-size: 0.9em;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
}

th,
td {
  border: 1px solid var(--color-lightGrey);
  padding: 0.75rem 1rem;
  text-align: left;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

th {
  background: var(--bg-secondary-color);
  font-weight: 600;
}

tr:nth-child(even) {
  background: var(--bg-secondary-color);
}

@media (prefers-color-scheme: dark) {
  th,
  td {
    border-color: var(--color-darkGrey);
  }

  th {
    background: var(--bg-secondary-color);
  }

  tr:nth-child(even) {
    background: var(--bg-secondary-color);
  }
}
