/*
 | The Blog starter's stylesheet (#127). Plain CSS, served at /site.css.
 | The brand colour comes from /brand.css when the company has one, linked
 | after this file; these are the standard look. System fonts by default;
 | a site's own fonts come from its media library (README, Templates:
 | Fonts). A site loads nothing from another host. The post page's hero,
 | share row, previous and next, and its sidebar that sticks on wide
 | screens with CSS only (#145) are at the end.
 */
:root {
    --site-brand: #0f172a;
    --site-brand-text: #ffffff;
    --site-brand-hover: #334155;
    --blog-text: #1e293b;
    --blog-muted: #64748b;
    --blog-line: #e2e8f0;
    --blog-soft: #f8fafc;
    --blog-danger: #b91c1c;
}

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

body {
    margin: 0;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: #ffffff;
    color: var(--blog-text);
    font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.blog-wrap {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.blog-header {
    border-bottom: 1px solid var(--blog-line);
}

.blog-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.blog-brand {
    display: flex;
    height: 2.5rem;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.blog-brand img {
    height: 100%;
    width: auto;
    max-width: 14rem;
    object-fit: contain;
}

.blog-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.blog-nav a {
    text-decoration: none;
}

.blog-nav a:hover,
.blog-nav a[aria-current='page'] {
    color: var(--site-brand);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.blog-main {
    flex: 1;
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.blog-footer {
    border-top: 1px solid var(--blog-line);
    background: var(--blog-soft);
    font-size: 0.875rem;
    color: var(--blog-muted);
}

.blog-footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.blog-footer-compiled::before {
    content: 'Last compiled ';
}

.blog-footer-reading::before {
    content: '\00b7  ';
}

.blog-footer-reading::after {
    content: ' minutes of reading';
}

.blog-page,
.blog-post {
    max-width: 44rem;
}

.blog-title {
    margin: 1rem 0 0;
    font-size: 2.5rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--site-brand);
}

.blog-muted {
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-eyebrow {
    margin: 0;
    color: var(--blog-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-crumbs li + li::before {
    content: '\203A';
    margin-right: 0.5rem;
}

.blog-crumbs a {
    text-decoration: none;
}

.blog-crumbs a:hover {
    text-decoration: underline;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.blog-meta-author::before {
    content: 'By ';
}

.blog-meta-updated::before {
    content: 'Updated ';
}

.blog-meta-reading::after {
    content: ' min read';
}

.blog-meta-photo {
    width: 2.5rem;
    aspect-ratio: 1;
    border-radius: 999px;
    object-fit: cover;
}

.blog-tag {
    border-radius: 999px;
    background: var(--blog-soft);
    border: 1px solid var(--blog-line);
    padding: 0.125rem 0.625rem;
    color: var(--site-brand);
    font-weight: 500;
    text-decoration: none;
}

.blog-prose {
    margin-top: 2rem;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.blog-prose > * + * {
    margin-top: 1.1rem;
}

.blog-prose h2 {
    margin-top: 2.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.blog-prose h3 {
    margin-top: 1.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

.blog-prose ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.blog-prose ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.blog-prose a {
    color: var(--site-brand);
    text-decoration: underline;
}

.blog-prose blockquote {
    margin-left: 0;
    border-left: 3px solid var(--site-brand);
    padding-left: 1rem;
    color: #475569;
}

.blog-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

/* The body's table of contents and article blocks (#143). */
.blog-toc {
    margin-top: 2rem;
    border: 1px solid var(--blog-line);
    border-radius: 0.5rem;
    background: var(--blog-soft);
    padding: 1rem 1.25rem;
}

.blog-toc .forge-toc-label {
    margin: 0;
    color: var(--blog-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-toc ol {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.blog-toc li + li {
    margin-top: 0.25rem;
}

.blog-toc a {
    color: var(--site-brand);
    text-decoration: none;
}

.blog-toc a:hover {
    text-decoration: underline;
}

.blog-prose .forge-tldr {
    border-left: 4px solid var(--site-brand);
    border-radius: 0.25rem;
    background: var(--blog-soft);
    padding: 1rem 1.25rem;
}

.blog-prose .forge-tldr-label,
.blog-prose .forge-cta-label,
.blog-prose .forge-faq-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-prose .forge-tldr-label,
.blog-prose .forge-faq-label {
    color: var(--blog-muted);
}

.blog-prose .forge-tldr > * + *,
.blog-prose .forge-cta-box > * + * {
    margin-top: 0.5rem;
}

.blog-prose .forge-cta-box {
    border-radius: 0.5rem;
    background: var(--site-brand);
    padding: 1.5rem;
    color: var(--site-brand-text);
    text-align: center;
}

.blog-prose .forge-cta-box a {
    color: inherit;
}

.blog-prose .forge-cta-box p > a:only-child {
    display: inline-block;
    border-radius: 0.5rem;
    background: var(--site-brand-text);
    padding: 0.625rem 1.25rem;
    color: var(--site-brand);
    font-weight: 600;
    text-decoration: none;
}

.blog-prose .forge-faq-item {
    border-top: 1px solid var(--blog-line);
    padding-top: 1rem;
}

.blog-prose .forge-faq-item + .forge-faq-item {
    margin-top: 1rem;
}

.blog-prose .forge-faq-question {
    margin-top: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.blog-prose .forge-faq-answer {
    margin-top: 0.5rem;
}

.blog-prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.blog-prose th,
.blog-prose td {
    border: 1px solid var(--blog-line);
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.blog-prose th {
    background: var(--blog-soft);
    font-weight: 600;
}

.blog-prose dt {
    font-weight: 600;
}

.blog-prose dd {
    margin: 0.25rem 0 0 1.5rem;
}

.blog-prose dd + dt {
    margin-top: 0.75rem;
}

.blog-intro {
    max-width: 44rem;
    color: #475569;
}

.blog-button,
.forge-button {
    display: inline-block;
    border: 0;
    border-radius: 0.5rem;
    background: var(--site-brand);
    padding: 0.75rem 1.25rem;
    color: var(--site-brand-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.blog-button:hover,
.forge-button:hover {
    background: var(--site-brand-hover);
}

.blog-cta {
    margin-top: 2.5rem;
}

.blog-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.blog-chips a {
    border: 1px solid var(--blog-line);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    text-decoration: none;
}

.blog-chips a[aria-current='page'] {
    border-color: var(--site-brand);
    background: var(--site-brand);
    color: var(--site-brand-text);
}

.blog-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 28rem;
    margin-top: 1.5rem;
}

.blog-search .forge-search-label {
    flex: 1;
}

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

.blog-search .forge-input {
    margin-top: 0;
}

.blog-card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    object-fit: cover;
}

.blog-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--blog-line);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.blog-card .blog-meta {
    margin-top: 0;
    font-size: 0.75rem;
}

.blog-card-title {
    margin: 0.75rem 0 0;
    font-size: 1.25rem;
    line-height: 1.35;
}

.blog-card-title a {
    text-decoration: none;
}

.blog-card-title a:hover {
    text-decoration: underline;
}

.blog-card-excerpt {
    flex: 1;
    color: #475569;
    font-size: 0.9375rem;
}

.blog-card-more a {
    color: var(--site-brand);
    font-size: 0.875rem;
    font-weight: 600;
}

.blog-empty {
    margin-top: 2.5rem;
}

.blog-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    font-size: 0.875rem;
}

.blog-pagination a,
.blog-pagination span {
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    text-decoration: none;
}

.blog-pagination [aria-current='page'] {
    border-color: var(--site-brand);
    background: var(--site-brand);
    color: var(--site-brand-text);
}

.blog-author {
    margin-top: 3rem;
    border: 1px solid var(--blog-line);
    border-radius: 0.75rem;
    background: var(--blog-soft);
    padding: 1.5rem;
}

.blog-author-photo {
    display: block;
    width: 6rem;
    aspect-ratio: 1;
    margin-bottom: 1rem;
    border-radius: 999px;
    object-fit: cover;
}

.blog-author-name {
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.blog-author .blog-muted {
    margin: 0;
}

.blog-author-bio {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
}

.blog-related {
    max-width: 44rem;
    margin: 4rem 0 0;
    border-top: 1px solid var(--blog-line);
    padding: 2.5rem 0 0;
    list-style: none;
}

.blog-related::before {
    content: 'More in this category';
    display: block;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.blog-related li + li {
    margin-top: 1rem;
}

.blog-related-link {
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.blog-related-link:hover {
    text-decoration: underline;
}

.blog-related .blog-muted {
    margin: 0;
}

/* The contact form, the forge-contact-form part's markup. */
.blog-contact {
    max-width: 44rem;
    margin-top: 4rem;
    border-top: 1px solid var(--blog-line);
    padding-top: 2.5rem;
}

.forge-form-heading {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.forge-form-note {
    margin-top: 0.5rem;
    color: var(--blog-muted);
    font-size: 0.875rem;
}

.forge-alert {
    margin-top: 1rem;
    border-radius: 0.375rem;
    background: #fef2f2;
    padding: 0.75rem 1rem;
    color: #991b1b;
    font-size: 0.875rem;
}

.forge-form {
    margin-top: 1.5rem;
}

.forge-field + .forge-field,
.forge-form .forge-button {
    margin-top: 1.25rem;
}

.forge-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
}

.forge-input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font: inherit;
}

.forge-input:focus-visible {
    outline: 2px solid var(--site-brand);
    outline-offset: 2px;
}

.forge-error {
    margin-top: 0.25rem;
    color: var(--blog-danger);
    font-size: 0.875rem;
}

@media (max-width: 30rem) {
    .blog-title {
        font-size: 1.875rem;
    }

    .blog-cards {
        grid-template-columns: 1fr;
    }
}

/* Menus from pages (#142): a page's children as a group under its link, and the footer's menu. */
.forge-nav-group {
    position: relative;
}

.forge-nav-group-items {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    min-width: 12rem;
    padding: 0.5rem 0;
    border: 1px solid var(--blog-line);
    background: var(--blog-soft);
}

.forge-nav-group:hover .forge-nav-group-items,
.forge-nav-group:focus-within .forge-nav-group-items {
    display: grid;
}

/* Closed with Escape (/assets/menu.js, #226) until the pointer or the focus leaves the group. */
.forge-nav-group[data-menu-closed] .forge-nav-group-items {
    display: none;
}

.forge-nav-group-items a {
    padding: 0.375rem 1rem;
}

.blog-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* The Landing layout (#142): a page without the contact form. */
.blog-landing .blog-crumbs {
    margin-bottom: 1rem;
}

/* The post page (#145): the hero, the share row, previous and next, and a sidebar that sticks on wide screens. */
.blog-hero-category {
    display: inline-block;
    margin-top: 1rem;
}

.blog-hero-image {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 1.5rem;
    border-radius: 0.75rem;
}

/* A post without a featured image (#209): its card opens with a band in the brand colour, and its hero ends with a rule. */
.blog-card:not(:has(.blog-card-image)) {
    border-top: 0.25rem solid var(--site-brand);
}

.blog-hero:not(:has(.blog-hero-image)) {
    border-bottom: 1px solid var(--blog-line);
    padding-bottom: 1.5rem;
}

.blog-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    border-top: 1px solid var(--blog-line);
    padding-top: 1.5rem;
    font-size: 0.875rem;
}

.blog-share .forge-share-label {
    color: var(--blog-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-share .forge-share-link {
    border: 1px solid var(--blog-line);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    color: var(--site-brand);
    text-decoration: none;
}

.blog-share .forge-share-link:hover {
    background: var(--blog-soft);
}

.blog-share .forge-share-url {
    color: var(--blog-muted);
    word-break: break-all;
    user-select: all;
}

.blog-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
}

.blog-post-nav-item {
    border: 1px solid var(--blog-line);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
}

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

.blog-post-nav-link {
    display: block;
    margin-top: 0.25rem;
    color: var(--site-brand);
    font-weight: 600;
    text-decoration: none;
}

.blog-post-nav-link:hover {
    text-decoration: underline;
}

.blog-post-nav:not(:has(*)) {
    display: none;
}

.blog-sidebar {
    display: none;
}

.blog-sidebar .blog-toc {
    margin-top: 0;
}

.blog-sidebar-box {
    margin-top: 1.5rem;
    border: 1px solid var(--blog-line);
    border-radius: 0.75rem;
    background: var(--blog-soft);
    padding: 1.25rem;
}

.blog-sidebar-box .blog-button {
    margin-top: 0.75rem;
}

.blog-sidebar-box:not(:has(a)) {
    display: none;
}

@media (min-width: 64rem) {
    .blog-post-layout {
        display: grid;
        grid-template-columns: minmax(0, 44rem) 16rem;
        gap: 3rem;
        align-items: start;
    }

    .blog-sidebar {
        display: block;
        position: sticky;
        top: 1.5rem;
        max-height: calc(100vh - 3rem);
        overflow-y: auto;
        margin-top: 2rem;
    }

    .blog-toc-inline {
        display: none;
    }
}

@media (max-width: 30rem) {
    .blog-post-nav {
        grid-template-columns: 1fr;
    }

    .blog-post-nav-next {
        grid-column: auto;
    }
}

/* The glossary (#148): a marked term, the post's terms panel, the index and a term's page. */
dfn.forge-term {
    font-style: normal;
}

dfn.forge-term a {
    color: var(--site-brand);
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
}

.blog-terms {
    margin-top: 2.5rem;
    border: 1px solid var(--blog-line);
    border-left: 4px solid var(--site-brand);
    border-radius: 0.25rem;
    background: var(--blog-soft);
    padding: 1rem 1.25rem;
}

.blog-terms .forge-terms-label,
.forge-term-related-label {
    margin: 0;
    color: var(--blog-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-terms dl {
    margin: 0.75rem 0 0;
}

.blog-terms dt,
.forge-glossary dt {
    font-weight: 600;
}

.blog-terms dt + dd,
.forge-glossary dt + dd {
    margin: 0.25rem 0 0.75rem;
    color: var(--blog-muted);
}

.blog-terms a,
.forge-glossary a,
.forge-term-related a {
    color: var(--site-brand);
}

.blog-terms .forge-term-more {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.forge-glossary {
    margin: 0;
}

.forge-glossary dt {
    margin-top: 1.25rem;
    font-size: 1.125rem;
}

.forge-term-lead {
    font-size: 1.25rem;
    line-height: 1.6;
}

.forge-term-note {
    margin-top: 2rem;
    border-radius: 0.5rem;
    background: var(--blog-soft);
    padding: 1rem 1.25rem;
}

.forge-term-note h2 {
    margin-top: 0;
}

.forge-term-related {
    margin-top: 2rem;
    border-top: 1px solid var(--blog-line);
    padding-top: 1.25rem;
}

.forge-term-related ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.forge-term-related li a {
    display: inline-block;
    border: 1px solid var(--blog-line);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    text-decoration: none;
}
