/* ---- Box model ---- */
* {
    box-sizing: border-box;
}

/* ---- Palette: light ---- */
:root {
    --bg: #f4f1ea;
    --text: #222;
    --text-secondary: #555;
    --link: #0033aa;
    --link-visited: #551a8b;
    --link-hover: #cc0000;
    --border-light: #ccc;
    --border-medium: #999;
    --accolade-border: #b8a06a;
    --accolade-bg: #faf6ec;
    --image-bg: #fff;
    --image-border: #ccc;
}

/* ---- Palette: dark ---- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1917;
        --text: #e5e2dc;
        --text-secondary: #a8a49c;
        --link: #8ab4f8;
        --link-visited: #b39ddb;
        --link-hover: #f28b82;
        --border-light: #3a3a3a;
        --border-medium: #555;
        --accolade-border: #c8b078;
        --accolade-bg: #252220;
        --image-bg: #2a2a28;
        --image-border: #3a3a3a;
    }
}

/* ---- Base ---- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-medium);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    display: inline;
}

nav li + li::before {
    content: " | ";
    color: var(--text-secondary);
}

body {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    max-width: 45rem;
    margin: 0 auto;
    padding: 1.25rem;
}

.error-page main {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Links ---- */
a         { color: var(--link); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:hover   { color: var(--link-hover); }

/* ---- Header ---- */
header {
    text-align: center;
    border-bottom: 2px solid var(--border-medium);
    padding-bottom: 0.625rem;
    margin-bottom: 1.875rem;
}
header h1 {
    font-size: 2rem;
    margin: 0;
}
.tagline {
    font-style: italic;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.75rem;
}
nav       { font-size: 0.95rem; }
nav a     { margin: 0 0.25rem; }

/* ---- Headings ---- */
h2 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.25rem;
}
h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

/* ---- Homepage portrait ---- */
.portrait-figure {
    float: right;
    max-width: 200px;
    margin: 0 0 1rem 1.25rem;
}

.portrait-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--image-border);
    padding: 3px;
    background: var(--image-bg);
}

.portrait-figure figcaption {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: right;
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* ---- Homepage ---- */
.latest-book {
    overflow: hidden;
    margin-bottom: 2rem;
}

.latest-cover {
    float: left;
    width: 100px;
    height: auto;
    margin: 0 1rem 0.5rem 0;
    border: 1px solid var(--image-border);
    padding: 2px;
    background: var(--image-bg);
}

.newslist {
    list-style: none;
    padding-left: 0;
    margin: 0 0 2rem;
}

.newslist li {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.newslist .date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- Books ---- */
.booklist {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.book {
    margin-bottom: 2.5rem;
    overflow: hidden;
}

.cover {
    float: left;
    width: 100px;
    height: auto;
    margin: 0 1rem 0.5rem 0;
    border: 1px solid var(--image-border);
    background: var(--image-bg);
    padding: 2px;
}

.book h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 0.75rem;
}

.book p {
    margin: 0 0 0.75rem;
}

/* ---- Accolades ---- */
.accolades {
    list-style: none;
    padding: 0.5rem 0.75rem;
    margin: 0 0 0.75rem;
    border-left: 3px solid var(--accolade-border);
    background-color: var(--accolade-bg);
    font-size: 0.9rem;
    color: var(--text);
}

.accolades li {
    margin: 0 0 0.25rem;
}

.accolades li:last-child {
    margin-bottom: 0;
}

/* ---- Media page ---- */
.medialist {
    list-style: none;
    padding-left: 0;
    margin: 0 0 2rem;
}

.medialist li {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    text-indent: -1rem;
    line-height: 1.5;
}

/* ---- Press page ---- */
.press-photo {
    display: block;
    max-width: 300px;
    height: auto;
    margin: 0 0 0.5rem;
    border: 1px solid var(--image-border);
    padding: 3px;
    background: var(--image-bg);
}

figure {
    margin: 0 0 1.5rem;
}

figcaption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 300px;
}

.coverlist {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.coverlist li {
    width: 120px;
}

.press-cover {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--image-border);
    margin-bottom: 0.25rem;
}

/* ---- Links page ---- */

.linklist {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.linklist li {
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

.linklist li::before {
    content: "→ ";
    color: #999;
    margin-right: 0.25rem;
}

/* ---- Footer ---- */
footer {
    margin-top: 2.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ---- Narrow screens ---- */
@media (max-width: 40rem) {
    .portrait-figure {
        float: none;
        display: block;
        margin: 0 auto 1rem;
        max-width: 60%;
    }
    
    .portrait-figure figcaption {
        text-align: center;
    }
    
    .latest-cover {
        float: none;
        display: block;
        margin: 0 auto 0.75rem;
        max-width: 120px;
    }
    
    .cover {
        float: none;
        display: block;
        width: 60%;
        max-width: 160px;
        margin: 0 auto 0.75rem;
    }
    .book > p:not(.meta) {
    border-left: 3px solid var(--border-light);
    padding-left: 0.75rem;
    }
    .press-photo, figcaption {
        max-width: 100%;
    }
}

/* ---- Print ---- */
@media print {
    :root {
        --bg: #fff;
        --text: #000;
        --text-secondary: #333;
        --link: #000;
        --link-visited: #000;
        --border-light: #000;
        --border-medium: #000;
    }
    
    body {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 11pt;
    }
    
    nav,
    footer {
        display: none;
    }
    
    header {
        border-bottom: 1px solid #000;
        text-align: left;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    header h1 { font-size: 18pt; }
    .tagline { font-size: 11pt; color: #000; }
    
    h2 {
        font-size: 14pt;
        border-bottom: 1px solid #000;
        page-break-after: avoid;
        break-after: avoid;
    }
    
    .newslist li {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .portrait-figure figcaption {
        color: #333;
    }
    
    .latest-cover {
        display: none;
    }

    .cover {
        display: none;
    }
    
    .book {
        margin-bottom: 1.25rem;
        overflow: visible;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .book h3 { font-size: 13pt; margin-bottom: 0.15rem; }
    .meta { font-size: 10pt; }
    
    .accolades {
        background: none;
        border-left: 2px solid #000;
        font-size: 10pt;
        padding: 0 0 0 0.5rem;
        margin: 0.3rem 0 0.5rem;
     }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    .medialist {
        margin-bottom: 1.5rem;
    }
    
    .medialist li {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .medialist a {
        color: #000;
        text-decoration: none;
    }
    
    .medialist a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        font-style: italic;
        color: #333;
        word-break: break-all;
    }
    
    .press-photo {
        max-width: 200px;
    }
    
    .coverlist {
        display: block;
    }
    
    .coverlist li {
        width: auto;
        margin-bottom: 0.5rem;
    }
    
    .press-cover {
        display: none;
    }
    
    figcaption {
        max-width: none;
    }
    
    .linklist li {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .linklist a::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        font-style: italic;
        color: #333;
        word-break: break-all;
    }
    
    .linklist li::before {
        content: none;
    }
}