/*
 * Base — resets, element defaults, typography foundation.
 */

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

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

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

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* ── Headings ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

/* ── Body copy ── */
p {
    margin-bottom: var(--space-4);
}

/* Editorial body — used inside .entry-content */
.entry-content {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
    margin-bottom: var(--space-6);
}

.entry-content ul,
.entry-content ol {
    padding-left: var(--space-6);
}

.entry-content li {
    margin-bottom: var(--space-2);
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-4) var(--space-6);
    background: var(--color-bg-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--color-bg-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.entry-content pre {
    background: var(--color-bg-dark);
    color: var(--color-text-inverse);
    padding: var(--space-6);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-6);
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.entry-content img {
    border-radius: var(--radius-md);
    margin: var(--space-8) 0;
}

.entry-content a {
    font-weight: var(--weight-medium);
}

/* ── Lists (outside content) ── */
ul, ol {
    list-style: none;
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
}

/* ── Forms baseline ── */
button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ── Focus visible ── */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Screen reader only ── */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    clip: auto;
    clip-path: none;
    display: block;
    height: auto;
    width: auto;
    position: fixed;
    top: 5px;
    left: 5px;
    z-index: 100000;
    background: var(--color-bg);
    color: var(--color-text);
    padding: var(--space-4);
    font-size: var(--text-base);
    box-shadow: var(--shadow-lg);
}
