/*
 * Long-form pages: about us, the blog, blog posts and the legal texts.
 * They use the same two columns as the news page: the rail (dates, photos,
 * post details) on the left, the text column next to it.
 */

.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 7vw, 5rem) var(--page-gutter) clamp(4rem, 8vw, 7rem);
}

.page-header {
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.page-title {
    margin: 0;
    color: var(--color-ink);
    font-size: clamp(2.25rem, 1.2rem + 3.6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.page-intro {
    max-width: 36rem;
    margin: 1.25rem 0 0;
    color: var(--color-muted);
    font-size: 1.125rem;
}

.page-grid {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--rail-gap);
}

.page-rail {
    grid-column: 1;
}

.page-main {
    grid-column: 2;
    min-width: 0;
    max-width: 40rem;
}

@media (max-width: 59.99rem) {
    .page-grid {
        display: block;
    }
}

/* About us */

.person + .person {
    margin-top: clamp(3.5rem, 8vw, 6rem);
}

.person-photo {
    display: block;
    width: 12.5rem;
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
}

.person-name {
    margin: 0 0 1.25rem;
    color: var(--color-ink);
    font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.person-bio p {
    margin: 0 0 0.9em;
    font-size: 1.0625rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.person-bio .person-role {
    margin-top: 1.5rem;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.person-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.person-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

.person-links a:hover {
    color: var(--color-accent);
}

@media (max-width: 59.99rem) {
    .person-photo {
        width: 7rem;
        margin-bottom: 1.5rem;
    }
}

/* Blog index */

.post-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-rule);
}

/* The title link covers the whole row, so every entry is one large click target. */
.post-item {
    position: relative;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--color-rule);
}

.post-item-date {
    display: block;
    padding-top: 0.25rem;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.post-item-title {
    margin: 0;
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.post-item-title a {
    color: var(--color-ink);
    text-decoration: none;
}

.post-item-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.post-item:hover .post-item-title a {
    color: var(--color-accent);
}

.post-item-teaser {
    margin: 0.5rem 0 0;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.55;
    text-wrap: pretty;
}

@media (max-width: 59.99rem) {
    .post-item-date {
        margin-bottom: 0.375rem;
        padding-top: 0;
    }
}

/* Blog post: back link and date stay in the rail while reading */

.post-meta {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-top: 0.5rem;
    color: var(--color-muted);
    font-size: 0.875rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover {
    color: var(--color-accent);
}

@media (max-width: 59.99rem) {
    .post-meta {
        position: static;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 2rem;
        padding-top: 0;
    }
}

/* Prose: the text of blog posts and legal pages */

.prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    text-wrap: pretty;
    hyphens: auto;
}

/* Older pages space their sections with a bare <br/> between blocks; the margins below already do that. */
.prose > br {
    display: none;
}

.prose h1 {
    margin: 0 0 2rem;
    color: var(--color-ink);
    font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.prose h2,
.prose h3,
.prose h4 {
    margin: 2.25em 0 0.6em;
    color: var(--color-ink);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.prose h2 {
    font-size: 1.5em;
}

.prose h3 {
    font-size: 1.25em;
}

.prose h4 {
    font-size: 1.05em;
}

.prose p,
.prose ul,
.prose ol {
    margin: 0 0 1.1em;
}

.prose ul,
.prose ol {
    padding-left: 1.25em;
}

.prose li {
    margin-bottom: 0.4em;
}

.prose li > p {
    margin-bottom: 0.4em;
}

.prose li::marker {
    color: var(--color-muted);
}

.prose a {
    color: var(--color-accent);
    text-decoration-thickness: 1px;
}

.prose a:hover {
    text-decoration-thickness: 2px;
}

.prose strong,
.prose b {
    color: var(--color-ink);
    font-weight: 600;
}

.prose img {
    border-radius: var(--radius);
}

.prose code {
    padding: 0.1em 0.35em;
    border-radius: 3px;
    background: var(--color-surface);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* Code blocks. The older posts write snippets as a bare <code> next to paragraphs, so those count too. */
.prose pre,
.prose > code,
.prose li > code {
    display: block;
    margin: 0 0 1.25rem;
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.prose pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.prose .post-subtitle {
    margin: -1rem 0 2rem;
    color: var(--color-muted);
    font-size: 1.25em;
    line-height: 1.35;
}

.prose .post-note {
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--color-rule);
    border-radius: var(--radius);
    color: var(--color-muted);
    font-size: 0.9375rem;
}
