/* Storefront blog theme, the canvas BlogHome and BlogPost frames. "Clear Blue": slate neutrals and one blue accent; light colours come from the Branding tokens, so the Branding page restyles the site. */

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

:root {
    /* Inter for headings and UI, Source Serif 4 for reading text, JetBrains Mono for code (base.html loads them). */
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --serif: "Source Serif 4", Georgia, "Iowan Old Style", serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --wide: 71rem;
    --measure: 42.5rem;
    --column: 40rem;
    --gutter: 1.5rem;
    --bar-height: 3rem;
    --radius: 0.75rem;

    /* Canvas roles, derived from the Branding tokens. */
    --color-heading: var(--site-heading-text-on-surface, #0f172a);
    --color-text: var(--site-body-text-on-surface, #1f2937);
    --color-text-light: var(--site-muted-text-on-surface, #5b6472);
    --color-primary: var(--site-primary, #1d4ed8);
    --color-accent: var(--site-accent, #1d4ed8);
    --color-on-primary: var(--site-inverse-text-on-primary, #ffffff);
    /* Button and chip fill; the link color in light, a deeper blue than the link in dark. */
    --color-fill: var(--color-primary);
    --color-focus: #2563eb;
    --color-tile: var(--color-primary);
    --color-tile-text: var(--color-on-primary);
    --color-bg: #ffffff;
    --color-ground: var(--site-surface-tint, #f5f7fa);
    --color-subtle: color-mix(in srgb, var(--color-text-light) 9%, var(--color-bg));
    --color-code: color-mix(in srgb, var(--color-text-light) 5%, var(--color-bg));
    --color-border: #d6dce4;
    --color-line: color-mix(in srgb, var(--color-border) 60%, var(--color-bg));
    --color-field: #7b8494;
    --color-soft: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
    --color-soft-text: var(--site-accent, #1d4ed8);
    --color-cover: color-mix(in srgb, var(--color-text-light) 14%, var(--color-bg));

    /* Tokens for the shared landing skeleton in landing.css. */
    --sk-surface: var(--color-bg);
    --sk-ground: var(--color-ground);
    --sk-border: var(--color-border);
    --sk-line: var(--color-line);
    --sk-heading: var(--color-heading);
    --sk-body: var(--color-text);
    --sk-muted: var(--color-text-light);
    --sk-accent: var(--color-primary);
    --sk-bar-height: var(--bar-height);
    --sk-gutter: var(--gutter);
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-text-size-adjust: 100%;
}

/* Main grows so short pages keep the footer at the bottom edge. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-heading);
    font-family: var(--sans);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.75rem;
}

h1 {
    font-size: 2.625rem;
    line-height: 1.12;
    letter-spacing: -0.022em;
    margin-top: 0;
}

h2 { font-size: 1.75rem; }
h3 { font-size: 1.3125rem; }

p {
    margin: 0 0 1rem;
}

a {
    color: var(--color-primary);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--color-accent);
    text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 0.375rem;
    z-index: 70;
    padding: 0.625rem 1rem;
    border: 2px solid var(--color-primary);
    border-radius: 0.5rem;
    background: var(--color-bg);
    color: var(--color-heading);
    font-weight: 600;
    transform: translateY(-300%);
}

.skip-link:focus {
    transform: none;
}

/* Layout: a full-width top bar, a wide listing column and a narrow reading column. */
.site-main {
    flex: 1 0 auto;
    min-height: 60vh;
    padding: 2.125rem var(--gutter) 3.5rem;
}

/* The post list and the post page set their own widths and padding, as the frames do. */
.site-main:has(.blog-home),
.site-main:has(.blog-browse),
.site-main:has(.post) {
    padding: 0;
}

/* Region wrappers on content pages share the reading column. */
.region-header,
.region-main,
.region-sidebar,
.region-footer {
    max-width: var(--wide);
    margin: 0 auto;
}

.region-main > *,
.region-sidebar > * {
    max-width: 45rem;
}

/* Hero widget: a serif title block, not a banner. */
.widget-hero {
    margin-bottom: 2rem;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background-size: cover;
    background-position: center;
}

.widget-hero[style] {
    padding: 3rem 2rem;
    border: 0;
    border-radius: var(--radius);
}

.hero-content {
    max-width: 45rem;
}

.widget-hero h1 {
    margin-bottom: 0.5rem;
}

.hero-subheading {
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--color-text);
}

.hero-cta,
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1.125rem;
    border: 0;
    border-radius: 0.5rem;
    background: var(--color-fill);
    color: var(--color-on-primary);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.hero-cta:hover,
button[type="submit"]:hover {
    background: var(--color-accent);
    color: var(--color-on-primary);
}

/* Hero options from the live editor: a photo beside or under the text, a brand or photo background. */
.widget-hero.hero-has-image {
    display: grid;
    gap: 1.5rem;
    align-items: center;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.hero-layout-image-left.hero-has-image,
.hero-layout-image-right.hero-has-image {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-layout-image-left .hero-image {
    order: -1;
}

.hero-layout-centered {
    text-align: center;
}

.hero-layout-centered .hero-content {
    margin: 0 auto;
}

.hero-bg-brand {
    padding: 3rem 2rem;
    border: 0;
    border-radius: var(--radius);
    background-color: var(--color-primary);
    color: var(--color-on-primary);
}

.hero-bg-image[style] {
    box-shadow: inset 0 0 0 100vmax rgba(0, 0, 0, 0.5);
    color: #fff;
}

.hero-bg-brand :is(h1, h2, h3, p),
.hero-bg-image[style] :is(h1, h2, h3, p) {
    color: inherit;
}

.hero-bg-brand .hero-cta {
    background: var(--color-bg);
    color: var(--color-primary);
}

@media (max-width: 48rem) {
    .hero-layout-image-left.hero-has-image,
    .hero-layout-image-right.hero-has-image {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Content widgets */
.widget-text-block,
.widget-image-block,
.widget-card-grid,
.widget-contact-form {
    margin: 0 0 2rem;
}

.widget-text-block h2,
.widget-card-grid h2,
.widget-contact-form h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.text-content {
    font-size: 1.0625rem;
    line-height: 1.65;
}

/* Section headings inside a block's text (the Privacy page) need room above; only the block's own heading sits flush. */
.text-content h2 {
    margin: 2rem 0 0.5rem;
}

.widget-image-block img {
    border-radius: 0.625rem;
}

.widget-image-block figcaption {
    margin-top: 0.625rem;
    font-size: 0.9375rem;
    color: var(--color-text-light);
}

.grid-description {
    color: var(--color-text-light);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    overflow: hidden;
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    padding: 1rem 1.125rem;
}

.card-title {
    margin: 0 0 0.375rem;
    font-size: 1.25rem;
}

.card-description {
    margin: 0;
    color: var(--color-text);
}

/* Forms: contact form, search and newsletter share one control style. */
.form-group {
    margin-bottom: 1rem;
}

.form-group label,
.search-label-text,
.newsletter-label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--color-text);
    font-weight: 600;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.form-group input:not([type="checkbox"]),
.form-group select,
.form-group textarea,
.search-input,
.newsletter-form input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-field);
    border-radius: 0.5rem;
    background: var(--color-bg);
    color: var(--color-heading);
    font: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--color-primary);
}

.contact-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.375rem 1rem;
    margin: 1.5rem 0 0;
}

.contact-details dt {
    color: var(--color-heading);
    font-weight: 600;
}

.contact-details dd {
    margin: 0;
}

/* Search results body shared with every theme. */
.search-results {
    max-width: var(--wide);
    margin: 0 auto;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.search-label {
    flex: 1 1 16rem;
}

.search-submit {
    min-height: 2.75rem;
}

.search-results-count {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    overflow: hidden;
}

.search-result {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-line);
}

.search-result:first-child {
    border-top: 0;
}

.search-result-title {
    color: var(--color-heading);
    font-weight: 600;
}

.search-result-snippet {
    margin: 0.25rem 0 0;
}

.search-result-snippet mark {
    padding: 0 2px;
    border-radius: 3px;
    background: var(--color-soft);
    color: var(--color-soft-text);
}

/* Newsletter home: a masthead with the sign-up, then one centered column of posts. */
.blog-home,
.post,
.post-signup,
.post-pager,
.post-more,
.post-docs {
    max-width: calc(var(--column) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.blog-masthead {
    padding: 3rem 0 2.25rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.blog-masthead-name {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--sans);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.blog-masthead-name a {
    color: inherit;
    text-decoration: none;
}

.blog-masthead-pitch {
    margin: 0.75rem auto 0;
    max-width: 32rem;
    color: var(--color-text);
    font-family: var(--serif);
    font-size: 1.1875rem;
    line-height: 1.5;
}

/* Sign-up form drawn by the template on the home and after each post. */
.blog-signup {
    margin-top: 1.5rem;
}

.blog-signup-form {
    max-width: 30rem;
    margin: 0 auto;
}

.blog-signup-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.blog-signup-row {
    display: flex;
    gap: 0.5rem;
}

.blog-signup-row input {
    flex: 1;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-field);
    border-radius: 0.5rem;
    background: var(--color-bg);
    color: var(--color-heading);
    font: inherit;
}

.blog-signup-row button {
    flex: none;
}

.blog-signup-privacy {
    margin: 0.5rem 0 0;
    color: var(--color-text-light);
    font-size: 0.8125rem;
}

.blog-signup-feed {
    margin: 0.5rem 0 0;
    color: var(--color-text);
    font-size: 0.9375rem;
}

.blog-signup-feed a,
.newsletter-feed a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    font-weight: 600;
}

/* Chips on the post's "Filed under" line. */
.post-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 0.625rem;
    border-radius: 999px;
    background: var(--color-soft);
    color: var(--color-soft-text);
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

a.post-chip:hover {
    color: var(--color-soft-text);
    text-decoration: underline;
}

.post-chip-neutral,
a.post-chip-neutral:hover {
    background: var(--color-subtle);
    color: var(--color-text);
}

/* Post list: date, title and excerpt, like an archive of issues. */
.blog-posts {
    padding: 0.5rem 0 3.5rem;
}

.blog-posts-title {
    margin: 1.75rem 0 0.25rem;
    font-size: 1.75rem;
}

.blog-issues {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-issue + .blog-issue {
    border-top: 1px solid var(--color-line);
}

.blog-issue > article {
    padding: 1.5rem 0;
}

.blog-issue-date {
    margin: 0 0 0.25rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.blog-issue-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.5rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.blog-issue-title a {
    color: var(--color-heading);
    text-decoration: none;
}

.blog-issue-title a:hover {
    color: var(--color-heading);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.blog-issue-excerpt {
    margin: 0.375rem 0 0;
    color: var(--color-text);
    line-height: 1.55;
}

/* All posts and the topic and author archives: topic links over a dense list grouped by year, then numbered pages. */
.blog-browse {
    max-width: calc(var(--measure) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.blog-browse-head {
    padding: 2.5rem 0 1.5rem;
}

.blog-browse-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 2.25rem;
    line-height: 1.15;
}

.blog-browse-count {
    margin: 0.375rem 0 0;
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

.blog-topics ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.blog-topic {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0 1rem;
    border: 1px solid var(--color-field);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.blog-topic:hover {
    border-color: currentColor;
}

.blog-topic[aria-current="page"] {
    border-color: var(--color-fill);
    background: var(--color-fill);
    color: var(--color-on-primary);
}

.blog-topics ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.blog-topics li {
    flex: none;
}

.blog-year {
    margin: 2rem 0 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.blog-year:first-child {
    margin-top: 0.5rem;
}

.blog-archive {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.blog-archive-item + .blog-archive-item {
    border-top: 1px solid var(--color-line);
}

.blog-archive-item > article {
    padding: 1rem 0;
}

.blog-archive-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.25rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.blog-archive-title a {
    color: var(--color-heading);
    text-decoration: none;
}

.blog-archive-title a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* One line of excerpt keeps the list scannable. */
.blog-archive-excerpt {
    margin: 0.25rem 0 0;
    overflow: hidden;
    color: var(--color-text);
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-archive-meta {
    margin: 0.25rem 0 0;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.blog-archive-topic {
    color: var(--color-soft-text);
    font-weight: 600;
}

.blog-pages ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    padding: 1.125rem 0 0;
    border-top: 1px solid var(--color-border);
    list-style: none;
}

.blog-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid var(--color-field);
    border-radius: 0.5rem;
    color: var(--color-heading);
    font-weight: 600;
    text-decoration: none;
}

.blog-page:hover {
    border-color: currentColor;
}

.blog-page[aria-current="page"] {
    border-color: var(--color-fill);
    background: var(--color-fill);
    color: var(--color-on-primary);
}

.blog-page-gap {
    padding: 0 0.25rem;
    color: var(--color-text-light);
}

.blog-browse .blog-posts {
    padding-top: 0;
}

.blog-browse-all {
    margin-left: auto;
}

.blog-list-empty {
    margin-top: 1.75rem;
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    text-align: center;
}

.blog-list-empty p {
    margin: 0 0 0.375rem;
}

.blog-list-empty-title {
    color: var(--color-heading);
    font-weight: 600;
}

.blog-text-btn {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0 0.25rem;
    font-weight: 600;
}

.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 1.125rem;
    border-top: 1px solid var(--color-border);
}

.blog-pagination-end {
    margin: 0;
    color: var(--color-text-light);
}

.blog-btn-secondary,
.post-share-btn {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border: 1px solid var(--color-field);
    border-radius: 0.5rem;
    background: var(--color-bg);
    color: var(--color-heading);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.blog-btn-secondary:hover,
.post-share-btn:hover {
    color: var(--color-heading);
    border-color: currentColor;
}

/* Post page: the same column, a serif reading body, then the sign-up box, previous/next and related. */
.post-header {
    padding: 2.5rem 0 1.5rem;
}

.post-title {
    margin: 0 0 0.75rem;
    font-family: var(--sans);
    font-size: 2.875rem;
    line-height: 1.1;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
}

.post-lede {
    margin: 0 0 1rem;
    color: var(--color-text);
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.5;
}

.post-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

.post-byline-name a {
    color: var(--color-heading);
    font-weight: 600;
    text-decoration: none;
}

.post-byline-name a:hover {
    text-decoration: underline;
}

.post-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-share[hidden] {
    display: none;
}

.post-share-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.post-disclosure {
    padding-top: 0.625rem;
    color: var(--color-text-light);
    font-family: var(--sans);
    font-size: 0.9375rem;
}

.post-disclosure summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    cursor: pointer;
    list-style: none;
}

.post-disclosure summary::-webkit-details-marker {
    display: none;
}

.post-disclosure summary > svg {
    flex: none;
    color: var(--color-primary);
}

.post-disclosure-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-disclosure-more svg {
    transition: transform 120ms ease-out;
}

.post-disclosure[open] .post-disclosure-more svg {
    transform: rotate(180deg);
}

.post-disclosure p {
    margin: 0.5rem 0 0;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--color-line);
    border-radius: 0.625rem;
    background: var(--color-subtle);
    color: var(--color-text);
}

.post-cover {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-cover);
}

.post-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.blog-article-body {
    padding: 2rem 0 0.5rem;
    color: var(--color-text);
    font-family: var(--serif);
    font-size: 1.1875rem;
    line-height: 1.6;
}

.blog-article-body p,
.blog-article-body ul,
.blog-article-body ol {
    margin: 0 0 1.375rem;
}

.blog-article-body ul,
.blog-article-body ol {
    padding-left: 1.625rem;
}

.blog-article-body li {
    margin-bottom: 0.5rem;
}

.blog-article-body h2 {
    margin: 2.5rem 0 0.75rem;
    font-size: 1.75rem;
}

.blog-article-body h3 {
    font-size: 1.375rem;
}

/* A blockquote in a post is the frame's pull quote. */
.blog-article-body blockquote {
    margin: 2.25rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 4px solid var(--color-primary);
    color: var(--color-heading);
    font-size: 1.75rem;
    font-style: italic;
    line-height: 1.35;
}

.blog-article-body blockquote > :last-child {
    margin-bottom: 0;
}

.blog-article-body figure {
    margin: 2rem 0;
}

.blog-article-body img {
    border-radius: 0.625rem;
}

.blog-article-body figcaption {
    margin-top: 0.625rem;
    color: var(--color-text-light);
    font-family: var(--sans);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.blog-article-body code {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--color-subtle);
    font-family: var(--mono);
    font-size: 0.85em;
    overflow-wrap: anywhere;
}

.blog-article-body pre {
    margin: 0 0 1.375rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    background: var(--color-code);
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
}

.blog-article-body pre code {
    padding: 0;
    background: none;
    font-size: inherit;
    overflow-wrap: normal;
}

.blog-article-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0 0 1.375rem;
    font-family: var(--sans);
    font-size: 1rem;
}

.blog-article-body th,
.blog-article-body td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
}

.blog-article-body th {
    background: var(--color-subtle);
}

.post-footer {
    display: grid;
    gap: 1rem;
    padding: 1rem 0 2.5rem;
}

.post-filed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.post-filed-label {
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 600;
}

/* The end-of-post sign-up box. */
.post-signup {
    padding-block: 2rem;
    border-radius: var(--radius);
    background: var(--color-ground);
    text-align: center;
}

.post-signup-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.625rem;
}

.post-signup-text {
    margin: 0.5rem auto 0;
    max-width: 30rem;
    color: var(--color-text);
}

.post-more {
    margin-top: 2.5rem;
    margin-bottom: 3.5rem;
}

/* The RSS-only line after a post's actions (no newsletter widget) sits in the footer grid's gap. */
.post-footer .blog-signup,
.post-footer .blog-signup-feed {
    margin: 0;
}

/* The post footer's bottom padding already spaces the next block. */
.post + .post-pager,
.post + .post-more {
    margin-top: 0;
}

.post-more-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-more-heading {
    margin: 0;
    font-size: 1.625rem;
}

.post-more-all {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    font-weight: 600;
}

/* Newsletter widget: the sign-up card, shown in the footer on pages that do not draw their own sign-up. */
.widget-newsletter {
    padding: 1.375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
}

.newsletter-heading {
    margin: 0 0 0.375rem;
    font-size: 1.375rem;
    line-height: 1.25;
}

.newsletter-description {
    margin: 0 0 0.875rem;
    color: var(--color-text);
}

.newsletter-feed {
    margin: 0.375rem 0 0;
    color: var(--color-text);
    font-size: 0.875rem;
}

.newsletter-form button {
    width: 100%;
    margin-top: 0.75rem;
}

.newsletter-privacy {
    margin: 0.5rem 0 0;
    color: var(--color-text-light);
    font-size: 0.8125rem;
}

/* Off-screen, not display:none, so form-filling bots still see the honeypot. */
.newsletter-honeypot {
    position: absolute;
    left: -10000px;
}

.site-footer .widget-newsletter {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    max-width: 55rem;
    margin: 0 auto;
    padding: 1.625rem 1.75rem;
}

.site-footer .widget-newsletter {
    margin: 1.5rem auto;
}

.site-footer .newsletter-text {
    flex: 1;
    min-width: 0;
}

.site-footer .newsletter-heading {
    font-size: 1.5rem;
}

.site-footer .newsletter-form {
    width: 21.25rem;
    flex: none;
}

@media (max-width: 48rem) {
    :root {
        --gutter: 1rem;
    }

    h1 { font-size: 2.125rem; }

    .site-main {
        padding-top: 1.5rem;
    }

    .blog-masthead {
        padding: 2rem 0 1.75rem;
    }

    .blog-masthead-name {
        font-size: 2.125rem;
    }

    .blog-issue-title {
        font-size: 1.3125rem;
    }

    .post-header {
        padding-top: 1.5rem;
    }

    .post-title {
        font-size: 2.125rem;
    }

    .post-lede {
        font-size: 1.1875rem;
    }

    .blog-article-body blockquote {
        font-size: 1.375rem;
    }

    .site-footer .widget-newsletter {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }

    .site-footer .newsletter-form {
        width: 100%;
    }

    .site-footer .widget-newsletter {
        margin: 1rem var(--gutter);
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto;
        transition: none;
    }
}

/* Color mode switcher: .sf-color-mode is the pill around the controls; the fieldset radio group is the older release markup. */
.sf-color-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    margin: 0;
    padding: 0.125rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
}

.sf-color-mode-legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.sf-color-mode-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.sf-color-mode-option:hover {
    color: var(--color-heading);
}

/* The radio covers its label, so it stays clickable and keyboard-operable while unseen. */
.sf-color-mode-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.sf-color-mode-option:has(.sf-color-mode-input:checked) {
    background: var(--color-soft);
    color: var(--color-soft-text);
    font-weight: 600;
}

.sf-color-mode-option:has(.sf-color-mode-input:focus-visible) {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.sf-color-mode-icon {
    flex: none;
}

.sf-color-mode-icons .sf-color-mode-option {
    padding: 0;
}

.sf-color-mode-icons .sf-color-mode-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Phones: icons only (each option keeps its title and hidden text), so the switcher fits the header row. */
@media (max-width: 40rem) {
    .sf-color-mode-option {
        padding: 0;
    }

    .sf-color-mode-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Color controls (div.sf-color-mode from public/_color_mode_switcher.html): the mode button, its menu of the
   other two modes, and the high contrast toggle. The segmented rules above stay for older releases. */
.sf-color-mode-button,
.sf-color-mode-item,
.sf-contrast-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.sf-color-mode-button:hover,
.sf-color-mode-item:hover,
.sf-contrast-toggle:hover {
    background: var(--color-subtle);
    color: var(--color-heading);
}

.sf-color-mode-button[aria-expanded="true"],
.sf-contrast-toggle[aria-pressed="true"] {
    background: var(--color-soft);
    color: var(--color-soft-text);
}

.sf-contrast-toggle[aria-pressed="true"] {
    box-shadow: inset 0 0 0 1px currentColor;
}

.sf-color-mode-button:focus-visible,
.sf-color-mode-item:focus-visible,
.sf-contrast-toggle:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.sf-color-mode-menu {
    gap: 0.125rem;
    margin-top: 0.5rem;
    padding: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 1.25rem;
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18);
}

/* Blog top bar: brand left, search centered on the bar, section links, Subscribe and color controls right. */
.site-header .blog-bar {
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) minmax(12rem, 26rem) minmax(max-content, 1fr);
    gap: 0 1.25rem;
}

.blog-bar-start,
.blog-bar-end {
    display: flex;
    align-items: center;
    gap: 0 0.75rem;
    min-width: 0;
}

.blog-bar-end {
    justify-content: flex-end;
}

.blog-bar-end .site-header-tools {
    margin-left: 0;
}

.blog-search {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--color-text-light);
    pointer-events: none;
}

/* Outline style, so Subscribe stays the bar's primary action. */
.blog-search-input {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.375rem 0.75rem 0.375rem 2.375rem;
    border: 1px solid var(--color-field);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-heading);
    font: inherit;
    font-size: 0.9375rem;
}

.blog-search-input::placeholder {
    color: var(--color-text-light);
    opacity: 1;
}

.blog-search-open {
    display: none;
}

.blog-subscribe-btn {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: var(--color-fill);
    color: var(--color-on-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.blog-subscribe-btn:hover {
    background: var(--color-accent);
    color: var(--color-on-primary);
}

#subscribe {
    scroll-margin-top: 1.5rem;
}

/* Phone: brand, search icon and Subscribe on one row; links and color controls below; the field opens full width on focus. */
@media (max-width: 48rem) {
    .site-header .blog-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 0 0.5rem;
    }

    .blog-bar-end {
        display: contents;
    }

    .blog-bar-start {
        margin-right: auto;
    }

    .blog-search-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 999px;
        color: var(--color-heading);
        cursor: pointer;
    }

    .blog-search-open:hover {
        background: var(--color-subtle);
    }

    .blog-search:not(:focus-within):not(:has(.blog-search-input:not(:placeholder-shown))) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .blog-search {
        order: 2;
        width: 100%;
        padding-bottom: 0.625rem;
    }

    .blog-search-input {
        min-height: 2.75rem;
        font-size: 1rem;
    }

    .blog-subscribe-btn {
        padding: 0 0.75rem;
        font-size: 0.875rem;
    }

    /* Second row: section links, then the color controls at its end. */
    .blog-bar-end .site-nav {
        order: 3;
        flex: 1 1 auto;
        width: auto;
        margin: 0 0 0 -0.75rem;
    }

    .blog-bar-end .site-header-tools {
        order: 4;
    }
}

/* Color modes: a visitor's choice sets data-sf-color-mode on <html>; without one, the system setting decides.
   High contrast is separate: data-sf-contrast="more" on <html>, in light or dark. */

/* Dark: Clear Blue dark neutrals. Surface and text follow the Branding dark tokens; text is lifted toward white (about 16:1),
   since Storefront derives those tokens near 7:1. Links and buttons use fixed blues: 9.1:1 and 5.9:1. */
:root[data-sf-color-mode="dark"] {
    color-scheme: dark;
    --color-bg: var(--site-dark-surface, #0d1117);
    --color-ground: color-mix(in srgb, var(--color-bg) 96%, #ffffff);
    --color-heading: color-mix(in srgb, var(--site-heading-text-on-dark-surface, #f5f8fb) 15%, #ffffff);
    --color-text: color-mix(in srgb, var(--site-body-text-on-dark-surface, #e6edf3) 20%, #ffffff);
    --color-text-light: var(--site-muted-text-on-dark-surface, #9ba7b4);
    --color-primary: #7ab7ff;
    --color-accent: #a8d0ff;
    --color-fill: #4f8cff;
    --color-focus: #7ab7ff;
    --color-on-primary: #0d1117;
    --color-tile: var(--color-soft);
    --color-tile-text: var(--color-soft-text);
    --color-subtle: color-mix(in srgb, var(--color-bg) 90%, #ffffff);
    --color-code: color-mix(in srgb, var(--color-bg) 80%, #000000);
    --color-border: #30363d;
    --color-line: color-mix(in srgb, var(--color-border) 70%, var(--color-bg));
    --color-field: #6b7280;
    --color-soft: color-mix(in srgb, var(--color-fill) 20%, var(--color-bg));
    --color-soft-text: #a8d0ff;
    --color-cover: color-mix(in srgb, var(--color-bg) 88%, #ffffff);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-sf-color-mode]) {
        color-scheme: dark;
        --color-bg: var(--site-dark-surface, #0d1117);
        --color-ground: color-mix(in srgb, var(--color-bg) 96%, #ffffff);
        --color-heading: color-mix(in srgb, var(--site-heading-text-on-dark-surface, #f5f8fb) 15%, #ffffff);
        --color-text: color-mix(in srgb, var(--site-body-text-on-dark-surface, #e6edf3) 20%, #ffffff);
        --color-text-light: var(--site-muted-text-on-dark-surface, #9ba7b4);
        --color-primary: #7ab7ff;
        --color-accent: #a8d0ff;
        --color-fill: #4f8cff;
        --color-focus: #7ab7ff;
        --color-on-primary: #0d1117;
        --color-tile: var(--color-soft);
        --color-tile-text: var(--color-soft-text);
        --color-subtle: color-mix(in srgb, var(--color-bg) 90%, #ffffff);
        --color-code: color-mix(in srgb, var(--color-bg) 80%, #000000);
        --color-border: #30363d;
        --color-line: color-mix(in srgb, var(--color-border) 70%, var(--color-bg));
        --color-field: #6b7280;
        --color-soft: color-mix(in srgb, var(--color-fill) 20%, var(--color-bg));
        --color-soft-text: #a8d0ff;
        --color-cover: color-mix(in srgb, var(--color-bg) 88%, #ffffff);
    }

    /* System dark with high contrast; it outranks the light high contrast palette by specificity. */
    :root:not([data-sf-color-mode])[data-sf-contrast="more"] {
        color-scheme: dark;
        --color-bg: #000000;
        --color-ground: #000000;
        --color-heading: #ffffff;
        --color-text: #ffffff;
        --color-text-light: #e6e6e6;
        --color-primary: #a8d0ff;
        --color-accent: #ffffff;
        --color-fill: #a8d0ff;
        --color-focus: #ffffff;
        --color-on-primary: #000000;
        --color-tile: var(--color-soft);
        --color-tile-text: var(--color-soft-text);
        --color-subtle: #141414;
        --color-code: #0d0d0d;
        --color-border: #ffffff;
        --color-line: #8c8c8c;
        --color-field: #ffffff;
        --color-soft: color-mix(in srgb, var(--color-primary) 22%, #000000);
        --color-soft-text: #ffffff;
        --color-cover: #1a1a1a;
    }
}

/* High contrast, light: black on white, links and buttons in #002f8f (11.6:1), underlined links.
   data-sf-color-mode="contrast" is what releases before the contrast toggle set. */
:root[data-sf-contrast="more"],
:root[data-sf-color-mode="contrast"] {
    color-scheme: light;
    --color-bg: #ffffff;
    --color-ground: #ffffff;
    --color-heading: #000000;
    --color-text: #000000;
    --color-text-light: #2b2b2b;
    --color-primary: #002f8f;
    --color-accent: #000000;
    --color-fill: #002f8f;
    --color-focus: #000000;
    --color-on-primary: #ffffff;
    --color-tile: var(--color-soft);
    --color-tile-text: var(--color-soft-text);
    --color-subtle: #f0f0f0;
    --color-code: #f5f5f5;
    --color-border: #000000;
    --color-line: #767676;
    --color-field: #000000;
    --color-soft: #e6edf8;
    --color-soft-text: #000000;
    --color-cover: #e6e6e6;
}

:root[data-sf-contrast="more"] a,
:root[data-sf-color-mode="contrast"] a {
    text-decoration-line: underline;
}

/* High contrast, dark: white on black, links and buttons in #a8d0ff (13.1:1). */
:root[data-sf-color-mode="dark"][data-sf-contrast="more"] {
    color-scheme: dark;
    --color-bg: #000000;
    --color-ground: #000000;
    --color-heading: #ffffff;
    --color-text: #ffffff;
    --color-text-light: #e6e6e6;
    --color-primary: #a8d0ff;
    --color-accent: #ffffff;
    --color-fill: #a8d0ff;
    --color-focus: #ffffff;
    --color-on-primary: #000000;
    --color-tile: var(--color-soft);
    --color-tile-text: var(--color-soft-text);
    --color-subtle: #141414;
    --color-code: #0d0d0d;
    --color-border: #ffffff;
    --color-line: #8c8c8c;
    --color-field: #ffffff;
    --color-soft: color-mix(in srgb, var(--color-primary) 22%, #000000);
    --color-soft-text: #ffffff;
    --color-cover: #1a1a1a;
}

/* High contrast in either mode: a 3px focus ring. */
:root[data-sf-contrast="more"] :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* Blog additions: post actions, heading anchors, outline, code copy, previous/next, docs line. */
.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

a.post-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
}

.heading-anchor {
    margin-left: 0.5rem;
    color: var(--color-text-light);
    font-family: var(--sans);
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
h4:hover > .heading-anchor,
.heading-anchor:focus-visible {
    opacity: 1;
}

.blog-article-body h2,
.blog-article-body h3,
.blog-article-body h4 {
    scroll-margin-top: calc(var(--bar-height) + 1rem);
}

.post-outline {
    max-width: var(--measure);
    margin: 2rem auto 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-code);
}

.post-outline[hidden] {
    display: none;
}

.post-outline-title {
    margin: 0 0 0.5rem;
    font-family: var(--sans);
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.post-outline-list {
    display: grid;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-outline-list a {
    display: block;
    padding: 0.25rem 0;
    color: var(--color-text);
    text-decoration: none;
}

.post-outline-list a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.post-outline-list .is-sub {
    padding-left: 1rem;
    font-size: 0.9375rem;
}

.post-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
}

.post-pager-link {
    display: grid;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-heading);
    text-decoration: none;
}

.post-pager-link:hover {
    border-color: var(--color-primary);
}

.post-pager-next {
    grid-column: 2;
    text-align: right;
}

.post-pager-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

.post-pager-next .post-pager-label {
    justify-self: end;
}

.post-pager-title {
    font-family: var(--sans);
    font-weight: 700;
}

.post-docs {
    margin-top: 0;
    margin-bottom: 3rem;
    color: var(--color-text-light);
}

.post-docs a {
    color: var(--color-primary);
    font-weight: 600;
}

@media (max-width: 48rem) {
    .post-pager {
        grid-template-columns: 1fr;
    }

    .post-pager-next {
        grid-column: 1;
    }

}

/* A newsletter widget left in the footer (no slot on the page) takes its own row above the footer columns. */
.site-footer-inner > .widget-newsletter {
    order: 0;
    flex-basis: 100%;
}

/* Print: the post as plain black-on-white reading text, without site chrome or sign-up. */
@media print {
    :root,
    :root[data-sf-color-mode],
    :root:not([data-sf-color-mode]),
    :root[data-sf-color-mode][data-sf-contrast],
    :root:not([data-sf-color-mode])[data-sf-contrast] {
        color-scheme: light;
        --color-bg: #ffffff;
        --color-heading: #000000;
        --color-text: #111111;
        --color-text-light: #333333;
    }

    .site-header,
    .site-footer,
    .skip-link,
    .post-signup,
    .post-pager,
    .post-more,
    .post-actions,
    .post-footer .blog-signup,
    .post-outline,
    .heading-anchor,
    .post-docs {
        display: none;
    }

    .blog-article-body {
        font-size: 12pt;
    }

    .blog-article-body a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        overflow-wrap: anywhere;
    }

    .blog-article-body :is(pre, figure, blockquote, table, img) {
        break-inside: avoid;
    }

    .blog-article-body :is(h2, h3, h4) {
        break-after: avoid;
    }
}

/* Blog home past page 1: say which page this is. */
.blog-posts > .blog-page-number {
    margin: 1.5rem 0 0;
}
