@layer custom {
    .theme-editorial-section {
        --theme-editorial-gap: clamp(2rem, 5vw, 5rem);
        padding-block-start: clamp(2rem, 5vw, 4.5rem);
    }
    .theme-article-heading,
    .theme-listing-heading {
        margin-block-end: clamp(2rem, 4vw, 3.5rem);
        text-align: center;
    }
    .theme-article-heading h1,
    .theme-listing-heading h1 {
        max-inline-size: 24ch;
        margin-inline: auto;
        margin-block: 0 var(--bs-spacer-4);
        text-wrap: balance;
    }
    .theme-article-heading .theme-lead,
    .theme-listing-heading .theme-lead {
        max-inline-size: 58ch;
        margin-inline: auto;
    }
    .theme-breadcrumbs {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: var(--bs-spacer-2);
        margin-block-end: var(--bs-spacer-4);
        color: var(--bs-fg-3);
        font-size: var(--bs-font-size-sm);
    }
    .theme-breadcrumbs a {
        color: inherit;
        text-underline-offset: 0.2em;
    }
    .theme-breadcrumbs i {
        flex-shrink: 0;
    }
    .theme-featured-media {
        margin: 0 0 var(--theme-editorial-gap);
        border-radius: var(--theme-media-radius);
        overflow: hidden;
        background: var(--bs-bg-2);
    }
    .theme-featured-media img {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
    }
    .theme-post-cover,
    .theme-page-cover {
        aspect-ratio: 3 / 2;
    }
    .theme-editorial-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--theme-editorial-gap);
        align-items: start;
    }
    .theme-article-main,
    .theme-listing-main,
    .theme-editorial-sidebar {
        min-inline-size: 0;
    }
    .theme-reading {
        --cms-reading-measure: 96ch;
        max-inline-size: var(--cms-reading-measure, 68ch);
        margin-inline: auto;
    }
    .theme-article-prose {
        --bs-font-size-4xl: var(--bs-font-size-2xl);
        --bs-font-size-6xl: var(--bs-font-size-3xl);
        max-inline-size: var(--cms-reading-measure, 68ch);
    }
    .theme-single-post .theme-article-prose {
        --cms-reading-measure: none;
    }
    .website-theme .theme-article-prose {
        display: block;
    }
    .theme-prose-wide {
        --cms-reading-measure: none;
    }
    .website-theme .prose {
        line-height: var(--bs-body-line-height);
        overflow-wrap: anywhere;
    }
    .website-theme .prose > * + * {
        margin-block-start: var(--bs-spacer-4);
    }
    .website-theme .theme-article-prose :where(h2, h3, h4) {
        margin-block-start: 1.25em;
        margin-block-end: 0.5em;
        text-wrap: balance;
    }
    .website-theme .theme-article-prose > :first-child {
        margin-block-start: 0;
    }
    .website-theme .prose :where(img, video, iframe) {
        max-inline-size: 100%;
    }
    .website-theme .prose :where(pre, table) {
        display: block;
        overflow-x: auto;
    }
    .website-theme .prose blockquote {
        padding-inline-start: var(--bs-spacer-4);
        border-inline-start: 3px solid var(--bs-primary-border);
        color: var(--bs-fg-3);
    }
    .website-theme
        .prose
        a:not(
            :where(.btn-solid, .btn-outline, .btn-subtle, .btn-text, .btn-icon)
        ) {
        color: var(--bs-primary-fg-emphasis);
    }
    .website-theme .prose .contains-task-list {
        list-style: none;
    }
    .theme-meta {
        color: var(--bs-fg-3);
        font-size: var(--bs-font-size-sm);
    }
    .theme-post-meta,
    .theme-author-byline,
    .theme-read-time {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--bs-spacer-2);
    }
    .theme-post-meta {
        gap: var(--bs-spacer-2) var(--bs-spacer-4);
    }
    .theme-post-heading .theme-post-meta {
        justify-content: center;
        margin-block-start: var(--bs-spacer-4);
    }
    .theme-author-byline {
        text-decoration: none;
        color: var(--bs-fg-body);
    }
    .theme-avatar {
        border-radius: var(--bs-radius-pill);
        flex-shrink: 0;
        object-fit: cover;
    }
    .theme-post-meta .theme-avatar {
        inline-size: 40px;
        block-size: 40px;
    }
    .theme-post-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--theme-grid-gap);
    }
    .theme-post-card {
        min-inline-size: 0;
        display: flex;
        flex-direction: column;
        gap: var(--bs-spacer-4);
    }
    .theme-post-media {
        display: block;
        aspect-ratio: 3 / 2;
        overflow: hidden;
        border-radius: var(--theme-media-radius);
        background: var(--bs-bg-2);
    }
    .theme-post-media img {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
        transition: scale var(--cms-motion-duration-long) ease;
    }
    .theme-post-media:hover img {
        scale: 1.03;
    }
    .theme-post-card-body {
        flex: 1;
        min-inline-size: 0;
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: var(--bs-spacer-3);
    }
    .theme-post-card-body > * {
        margin-block: 0;
    }
    .theme-story-category {
        display: flex;
        flex-wrap: wrap;
        gap: var(--bs-spacer-2) var(--bs-spacer-3);
        font-size: var(--bs-font-size-sm);
        font-weight: var(--bs-font-weight-medium);
    }
    .theme-story-title {
        text-wrap: balance;
    }
    .theme-story-title a,
    .theme-related-story a {
        color: inherit;
        text-decoration: none;
    }
    .theme-story-title a:hover,
    .theme-related-story a:hover {
        text-decoration: underline;
        text-underline-offset: 0.15em;
    }
    .theme-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .theme-read-link {
        display: inline-flex;
        align-items: center;
        gap: var(--bs-spacer-2);
        min-block-size: 44px;
        text-underline-offset: 0.25em;
        font-weight: var(--bs-font-weight-medium);
    }
    .theme-post-card-body > .theme-read-link {
        margin-block-start: auto;
    }
    .theme-listing-summary {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--bs-spacer-2);
        padding-block-end: var(--bs-spacer-3);
        border-block-end: 1px solid var(--bs-border-color);
    }
    .theme-post-row {
        padding-block: var(--bs-spacer-5);
        border-block-end: 1px solid var(--bs-border-color);
    }
    .theme-empty {
        padding-block: var(--bs-spacer-5);
    }
    .theme-editorial-sidebar {
        display: grid;
        gap: var(--bs-spacer-5);
    }
    .theme-sidebar-section {
        padding-block-start: var(--bs-spacer-4);
        border-block-start: 1px solid var(--bs-border-color);
    }
    .theme-sidebar-section .theme-search-form {
        margin-block-start: var(--bs-spacer-4);
    }
    .theme-sidebar-section h2 {
        margin-block-end: var(--bs-spacer-4);
    }
    .theme-related-list {
        display: grid;
        gap: var(--bs-spacer-4);
    }
    .theme-related-story {
        display: flex;
        align-items: start;
        gap: var(--bs-spacer-3);
    }
    .theme-related-story > div {
        min-inline-size: 0;
    }
    .theme-related-story h3 {
        margin-block: 0 var(--bs-spacer-2);
        line-height: var(--bs-body-line-height);
    }
    .theme-related-thumbnail {
        flex: 0 0 5rem;
        aspect-ratio: 1;
        overflow: hidden;
        border-radius: var(--theme-media-radius);
    }
    .theme-related-thumbnail img {
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
    }
    .theme-author-heading,
    .theme-author-card {
        display: flex;
        align-items: start;
        gap: var(--bs-spacer-4);
        text-align: start;
    }
    .theme-author-heading {
        flex-direction: column;
        padding-block-end: var(--bs-spacer-5);
        border-block-end: 1px solid var(--bs-border-color);
    }
    .theme-author-heading h1,
    .theme-author-heading .theme-lead {
        margin-inline: 0;
    }
    .theme-author-heading > div {
        max-inline-size: var(--cms-reading-measure, 68ch);
        min-inline-size: 0;
    }
    .theme-author-heading > .theme-avatar {
        inline-size: 112px;
        block-size: 112px;
    }
    .theme-author-links {
        display: flex;
        flex-wrap: wrap;
        gap: var(--bs-spacer-3);
    }
    .theme-author-links a {
        display: inline-flex;
        align-items: center;
        gap: var(--bs-spacer-1);
        min-block-size: 44px;
    }
    .theme-author-card {
        border-block: 1px solid var(--bs-border-color);
        padding-block: var(--bs-spacer-5);
        margin-block: var(--bs-spacer-5);
    }
    .theme-author-card h2,
    .theme-author-card p {
        margin-block-end: var(--bs-spacer-2);
    }
    .theme-tags {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: var(--bs-spacer-2);
        margin-block-start: var(--bs-spacer-5);
    }
    .theme-tags a {
        min-block-size: 44px;
        display: inline-flex;
        align-items: center;
    }
    .theme-adjacent-posts {
        display: grid;
        gap: var(--bs-spacer-4);
        margin-block: var(--bs-spacer-5);
    }
    .theme-adjacent-posts a {
        display: grid;
        align-content: start;
        gap: var(--bs-spacer-3);
        text-decoration: none;
        padding-block: var(--bs-spacer-3);
    }
    .theme-related {
        padding-block-start: var(--theme-section-space);
    }
    .theme-search-heading-form {
        max-inline-size: 40rem;
        margin-inline: auto;
    }
    .theme-search-query {
        overflow-wrap: anywhere;
    }
    @media (min-width: 768px) {
        .theme-post-cover,
        .theme-page-cover {
            aspect-ratio: 21 / 9;
        }
        .theme-post-grid,
        .theme-adjacent-posts {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .theme-author-heading {
            flex-direction: row;
            align-items: center;
            gap: var(--bs-spacer-5);
        }
        .theme-author-heading > .theme-avatar {
            inline-size: 144px;
            block-size: 144px;
        }
        .theme-post-row {
            display: grid;
            grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.5fr);
            align-items: start;
        }
        .theme-post-row.theme-post-card-text {
            grid-template-columns: minmax(0, 1fr);
        }
        .theme-post-row .theme-post-media {
            aspect-ratio: 4 / 3;
        }
    }
    @media (min-width: 1024px) {
        .theme-editorial-grid {
            grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
        }
        .theme-editorial-sidebar {
            position: sticky;
            inset-block-start: calc(
                var(--theme-header-height) +
                    var(--cms-preview-banner-height, 0px) + 2rem
            );
        }
        .theme-post-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }
    }
    @media (prefers-reduced-motion: reduce) {
        .theme-post-media img,
        .theme-post-media:hover img {
            transition: none;
            scale: none;
        }
    }
    .theme-motion-none .theme-post-media:hover img {
        scale: none;
    }
    @media print {
        .theme-editorial-grid {
            display: block;
        }
        .theme-editorial-sidebar {
            display: none;
        }
    }
}
