/* Site identity and navigation. Article and sidenote layout lives in ox-tufte.css. */
.site-header {
    padding: 2.5rem 0 1.5rem;
}

.site-identity {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    text-decoration: none;
}

.site-logo {
    width: 80px;
    height: auto;
    flex-shrink: 0;
}

.site-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: bold;
    line-height: 1.2;
    color: var(--color-tufte-red);
}

.menu {
    width: var(--content-width);
    border-block: 1px solid var(--color-font);
}

.menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.333rem;
}

.menu li {
    margin: 0;
}

.menu a {
    display: block;
    padding: 0.8rem 0.25rem;
    text-decoration: none;
}

.menu a:hover {
    color: var(--color-tufte-red);
    text-decoration: underline;
}

a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--color-tufte-red);
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    top: -10rem;
    padding: 1rem;
    background: var(--color-background);
    z-index: 1;
}

.skip-link:focus {
    top: 0;
}

h1.title {
    margin-top: 2rem;
}

/* Links share one style throughout the article. */
article p a, article li a {
    text-decoration: underline;
    text-decoration-color: var(--color-tufte-red);
    text-underline-offset: 0.15em;
}

article a:hover {
    color: var(--color-tufte-red);
}

article a {
    overflow-wrap: anywhere;
}

.sidenote-number > sup.numeral, .sidenote > sup.numeral {
    font-size: 1.1rem;
    color: var(--color-tufte-red);
}

/* Tables should remain readable without a hover interaction. */
table {
    margin: 0;
    border-collapse: collapse;
}

th, td {
    font-family: var(--ox-tufte-font-monospace);
    font-size: 1.1rem;
    line-height: 1.4;
    padding: 0.3rem 0.5rem;
    text-align: left;
}

th {
    background: var(--color-font);
    color: var(--color-background);
}

tr:nth-child(odd) {
    background: var(--color-background-accent);
}

table.center {
    margin-inline: auto;
}

.table-caption {
    font-size: 1.1rem;
    line-height: 1.4;
}

hr {
    width: 100%;
    margin: 1rem 0;
    height: 0;
    border: 0;
    border-top: 1px solid var(--color-font);
}

#postamble {
    width: var(--content-width);
    margin-top: 2rem;
    padding-bottom: 1.5rem;
}

#postamble p {
    font-size: 1.1rem;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .site-header {
        padding-top: 1.5rem;
    }

    .site-logo {
        width: 60px;
    }

    .menu ul {
        gap: 0 0.75rem;
    }
}

/* Navigation belongs to the reading column, with no additional width rules. */
.chapter-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-block: 1.5rem;
    padding-block: 1rem;
    border-block: 1px solid var(--color-background-accent);
    font-size: 1.15rem;
    line-height: 1.5;
    clear: both;
}

.chapter-prev { grid-column: 1; }
.chapter-home { grid-column: 2; text-align: center; }
.chapter-next { grid-column: 3; text-align: right; }

.chapter-contents {
    margin-block: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.6;
}

.chapter-contents ol {
    list-style: none;
    padding-left: 1rem;
    margin-block: 0.5rem;
}

@media (max-width: 760px) {
    .chapter-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .chapter-home { grid-column: 1 / -1; grid-row: 1; }
    .chapter-prev { grid-column: 1; grid-row: 2; }
    .chapter-next { grid-column: 2; grid-row: 2; }
}
