/**
 * Tieu Hao Pro typography system.
 *
 * Scope: document text hierarchy and readable text measure.
 * Component-specific typography belongs to component CSS.
 */

body {
    font-size: var(--thp-font-size-md);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--thp-color-text);
    font-family: var(--thp-font-base);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.25rem, 5vw, var(--thp-font-size-xl));
    letter-spacing: -0.025em;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    letter-spacing: -0.02em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: 1.375rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    max-width: 70ch;
    margin: 0;
    color: var(--thp-color-text-secondary);
}

ul,
ol {
    max-width: 70ch;
    margin: 0;
    padding-inline-start: 1.5rem;
}

li + li {
    margin-top: var(--thp-space-2);
}

strong,
b {
    color: var(--thp-color-text);
    font-weight: 700;
}

small {
    font-size: var(--thp-font-size-sm);
}

a {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

blockquote {
    max-width: 70ch;
    margin: 0;
    padding-inline-start: var(--thp-space-6);
    border-inline-start: 4px solid var(--thp-color-brand);
    color: var(--thp-color-text-secondary);
}

code,
kbd,
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code,
kbd {
    font-size: 0.9em;
}

pre {
    max-width: 100%;
    overflow-x: auto;
    padding: var(--thp-space-4);
    border: 1px solid var(--thp-color-border);
    border-radius: var(--thp-radius-md);
    background: var(--thp-color-surface-subtle);
}

@media (max-width: 767px) {
    h1 {
        letter-spacing: -0.02em;
    }

    h2 {
        letter-spacing: -0.015em;
    }

    p,
    ul,
    ol,
    blockquote {
        max-width: 100%;
    }
}
