/* Typography — Libre Baskerville type scale with vertical rhythm */

/* Self-hosted fonts — avoids sending visitor IPs to Google (GDPR) */
@font-face {
    font-family: 'Libre Baskerville';
    src: url('../fonts/libre-baskerville-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Baskerville';
    src: url('../fonts/libre-baskerville-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Libre Baskerville';
    src: url('../fonts/libre-baskerville-italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/source-sans-pro-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/source-sans-pro-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/source-sans-pro-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-sans: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --text-xs: 0.8125rem;    /* 13px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1.125rem;   /* 18px */
    --text-lg: 1.25rem;      /* 20px */
    --text-xl: 1.5rem;       /* 24px */
    --text-2xl: 2rem;        /* 32px */
    --text-3xl: 2.5rem;      /* 40px */

    --line-height-body: 1.65;
    --line-height-heading: 1.25;
    --line-height-sidenote: 1.5;

    --color-text: #1a1a1a;
    --color-text-muted: #555;
    --color-text-light: #767676;
    --color-link: #1a5276;
    --color-link-hover: #0e3a5c;
    --color-accent: #8b0000;
    --color-bg: #fffff8;
    --color-border: #ddd;
    --color-code-bg: #f5f5f0;
}

body {
    font-family: var(--font-serif);
    font-size: var(--text-base);
    line-height: var(--line-height-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: var(--line-height-heading);
    color: var(--color-text);
}

h1 { font-size: var(--text-3xl); font-weight: 700; margin-bottom: 0.5em; }
h2 { font-size: var(--text-2xl); margin-top: 1.5em; margin-bottom: 0.4em; }
h3 { font-size: var(--text-xl); margin-top: 1.3em; margin-bottom: 0.3em; }
h4 { font-size: var(--text-lg); margin-top: 1.2em; margin-bottom: 0.3em; }

/* Body copy */
p {
    margin-bottom: 1em;
}

/* Links */
a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--color-link-hover);
}
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Lists */
ol, ul {
    margin-bottom: 1em;
    padding-left: 1.5em;
}
li {
    margin-bottom: 0.3em;
}

/* Blockquote */
blockquote {
    margin: 1.5em 0;
    padding-left: 1.5em;
    border-left: 3px solid var(--color-border);
    font-style: italic;
    color: var(--color-text-muted);
}

/* Code */
code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

pre {
    margin: 1.5em 0;
    padding: 1em;
    background: var(--color-code-bg);
    border-radius: 4px;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2em 0;
}

/* Post metadata */
.post-meta {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: 1.5em;
}

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

.post-meta a:hover {
    color: var(--color-text);
}
