/* tabares.eu — one serif, one accent, no requests beyond this file. */

:root {
    --bg: #FCFCFA;
    --ink: #1D2630;
    --secondary: #5B6670;
    --rule: #DCE0E3;
    --accent: #0E6B55;
    --s1: .5rem;
    --s2: 1rem;
    --s3: 1.5rem;
    --s4: 2.5rem;
    --s5: 4rem;
    --measure: 40rem;
    --year-col: 4rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141A1F;
        --ink: #E6E9EC;
        --secondary: #9AA5AE;
        --rule: #2A333B;
        --accent: #7FBFA6;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
    margin: 0 auto;
    max-width: var(--measure);
    padding: var(--s5) var(--s3);
    background: var(--bg);
    color: var(--ink);
    font-family: Charter, "Iowan Old Style", "Palatino Linotype", Cambria, Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.6;
}

h1 {
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 var(--s2);
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 var(--s2);
}

h3 {
    font-size: 1.125rem;
    font-weight: 400;
    margin: 0;
}

p, ul, ol { margin: 0 0 var(--s2); }

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

/* Identity */
.site-header { margin-bottom: var(--s5); }
.intro { margin-bottom: var(--s2); }
.identity {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1) var(--s3);
}

section { margin-bottom: var(--s4); }

/* Ledger: the work list, year in the margin */
.ledger {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}
.entry {
    display: grid;
    grid-template-columns: var(--year-col) minmax(0, 1fr);
    column-gap: var(--s2);
    align-items: start;
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--rule);
}
.entry-year {
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}
.entry-title, .entry-summary, .entry-links { grid-column: 2; }
.entry-title a {
    color: var(--ink);
    text-decoration-color: var(--secondary);
    text-underline-offset: .2em;
}
.entry-title a:hover { color: var(--accent); text-decoration-color: currentColor; }
.entry-summary { margin: var(--s1) 0 0; }
.entry-links {
    margin: var(--s1) 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1) var(--s2);
}
/* Touch targets: enlarge the tappable box of short links without moving the text. */
.entry-links a, .identity a {
    display: inline-block;
    padding: var(--s1) 0;
    margin: calc(-1 * var(--s1)) 0;
}
@media (min-width: 52rem) {
    .ledger { margin-left: calc(-1 * (var(--year-col) + var(--s2))); }
}
@media (max-width: 39.99rem) {
    .entry { grid-template-columns: minmax(0, 1fr); }
    .entry-year, .entry-title, .entry-summary, .entry-links { grid-column: 1; }
    .entry-year { margin-bottom: var(--s1); }
}

.plain-list { list-style: none; padding: 0; }
.plain-list li { margin-bottom: var(--s1); }

/* Posts */
.post-header { margin-bottom: var(--s4); }
.home-link { margin-bottom: var(--s4); }
.home-link a { color: var(--secondary); text-decoration-color: var(--secondary); }
.home-link a:hover { color: var(--accent); text-decoration-color: currentColor; }
/* Post titles run to two or three lines; a step below the home h1 keeps them readable. */
article h1 { font-size: 1.75rem; line-height: 1.25; }
.byline { color: var(--secondary); }
article h2 { margin-top: var(--s4); }
article ul { padding-left: 1.25rem; }
article li { margin-bottom: var(--s1); }
article blockquote {
    border-left: 2px solid var(--rule);
    margin: 0 0 var(--s2);
    padding: 0 var(--s2);
    color: var(--secondary);
}
article figure { margin: var(--s3) 0; }
article figure img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--rule);
}
article figcaption {
    color: var(--secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-top: var(--s1);
}

/* Focus and print (the site has no motion to reduce) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media print {
    /* Paper is white whatever the OS colour scheme: redefine the tokens, not the selectors. */
    :root { --bg: #FFFFFF; --ink: #000000; --secondary: #444444; --rule: #BBBBBB; --accent: #000000; }
    body { max-width: 75ch; padding: 0; }
    .entry-title a, .home-link a { color: var(--ink); text-decoration-color: var(--ink); }
    a[href]::after { content: none; }
    .ledger { margin-left: 0; }
}
