.blog-hero {
    padding: 90px 24px 56px;
    text-align: center;
    background-color: var(--color-background);
}

.blog-hero h1 {
    font-family: var(--font-bold);
    letter-spacing: 0.05em;
}

.blog-hero-tagline {
    max-width: 560px;
    margin: 18px auto 0;
    letter-spacing: 0.06em;
    color: var(--color-text);
    opacity: 0.7;
}

.blog-listing.constrained {
    max-width: 660px;
    padding: 0 28px 80px;
}

/* A photo beside the posts needs room for both columns */
.blog-listing.constrained.has-side-image {
    max-width: 1100px;
}

/* As a page block the list is as wide as the page's other blocks (--block-width, layout.css),
   with the same 20px side gutter as their .item padding. */
.blog-listing.constrained[data-block-width] {
    max-width: calc(var(--block-width) + 40px);
    padding-left: 20px;
    padding-right: 20px;
}

.blog-list-heading {
    text-align: center;
}

.blog-list-intro {
    margin-bottom: 28px;
}

/* The "View all" button under the posts */
.blog-view-all {
    padding: 20px;
    margin-top: 20px;
}

.blog-list-media {
    align-items: start;
}

/* Photo above or below: the posts keep the full column width */
.blog-list-media.layout-top,
.blog-list-media.layout-bottom {
    align-items: stretch;
}

.blog-list-media.layout-top .media-text-content,
.blog-list-media.layout-bottom .media-text-content {
    width: 100%;
}

.post-item {
    padding: 44px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary, #FFB3C6) 35%, transparent);
}

.post-item:first-of-type {
    border-top: 1px solid color-mix(in srgb, var(--color-primary, #FFB3C6) 35%, transparent);
}

/* A post's own picture in its preview: above, below, or beside the text (post_image_position) */
.post-item.has-post-image {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item.post-image-bottom .post-image {
    order: 1;
}

.post-item.post-image-side_left,
.post-item.post-image-side_right {
    flex-direction: row;
    align-items: center;
    gap: 28px;
}

.post-item.post-image-side_right .post-image {
    order: 1;
}

.post-image {
    display: block;
    overflow: hidden;
    border-radius: var(--border-radius, 8px);
}

.post-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s var(--easing);
}

.post-image:hover img {
    transform: scale(1.03);
}

/* A post picture that doesn't load (a deleted photo, say) keeps its box as a plain tinted panel, like other
   broken pictures on the site, instead of the browser's broken-image icon. */
.post-image.is-broken {
    background: color-mix(in srgb, var(--color-border, #e5e7eb) 40%, transparent);
}

.post-image.is-broken img {
    visibility: hidden;
}

.post-item.post-image-side_left .post-image,
.post-item.post-image-side_right .post-image {
    flex: 0 0 40%;
}

.post-item.post-image-side_left .post-image img,
.post-item.post-image-side_right .post-image img {
    aspect-ratio: 4 / 3;
}

.post-text {
    min-width: 0;
    flex: 1;
}

/* Side pictures stack above the text on phones */
@media (max-width: 600px) {
    .post-item.post-image-side_left,
    .post-item.post-image-side_right {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .post-item.post-image-side_right .post-image {
        order: 0;
    }
}

.post-hero-image {
    display: block;
    width: 100%;
    margin: 28px 0 8px;
    border-radius: var(--border-radius, 8px);
}

.post-date {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-bold);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-text-secondary, rgba(0, 0, 0, 0.55));
}

/* Admin-only marker on draft posts in a Blog Stories block */
.post-draft-label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 8px;
    border: 1px dashed currentColor;
    border-radius: 4px;
    font-family: var(--font-bold);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary, rgba(0, 0, 0, 0.55));
}

.post-title {
    margin: 0;
    /* Room for the hover arrow at the end of the title, so on a title that just fits its line the arrow stays
       inside the card instead of running over its edge */
    padding-inline-end: calc(10px + 1em);
    font-family: var(--font-bold);
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.post-title a {
    position: relative;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.25s var(--easing);
}

/* The hover arrow is taken out of the flow (it sits at the end of the title, where it would have been), so a title
   that just fits its line doesn't wrap the hidden arrow onto a blank line of its own. The link is its containing
   block, so the arrow stays inside a sideways-scrolling Carousel or Preview strip rather than widening the page. */
.post-title a::after {
    content: "→";
    position: absolute;
    display: inline-block;
    margin-left: 10px;
    color: var(--color-links, var(--color-primary));
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}

.post-title a:hover {
    color: var(--color-action, var(--color-cta));
}

.post-title a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.post-excerpt {
    margin: 12px 0 0;
    max-width: 55ch;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary, var(--color-text, #6d5a60));
    opacity: 0.85;
}

.blog-empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 60px 20px;
}

.post-article.constrained {
    max-width: 680px;
    padding: 72px 28px 48px;
    display: block;
}

.blog-back {
    display: inline-block;
    margin-bottom: 44px;
    font-family: var(--font-bold);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-links, var(--color-primary));
    transition: opacity 0.25s var(--easing), color 0.25s var(--easing);
}

.blog-back:hover {
    opacity: 0.85;
    text-decoration: underline;
}

.post-article h1 {
    font-family: var(--font-bold);
    font-size: 2.2rem;
    line-height: 1.15;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.post-subheading {
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--color-text-secondary, var(--color-text, #6d5a60));
    opacity: 0.85;
    margin: 0 0 20px;
    font-weight: 500;
}

.post-article .post-date {
    margin-bottom: 0;
    padding-bottom: 30px;
    border-bottom: 1px solid color-mix(in srgb, var(--color-primary, #FFB3C6) 35%, transparent);
}

.post-body {
    margin-top: 36px;
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--color-text, #3d3236);
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin: 42px 0 12px;
    font-family: var(--font-bold);
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.post-body h2 {
    font-size: 1.4rem;
}

.post-body h3 {
    font-size: 1.15rem;
}

.post-body p {
    margin: 0 0 22px;
}

.post-body a {
    color: var(--color-links, var(--color-primary));
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.25s var(--easing);
}

.post-body a:hover {
    color: var(--color-action, var(--color-cta));
}

/* A Markdown quote ("> text") looks the same in a blog post and in a page's text, accordion or
   column block. The bar and tints use the accent: every colour scheme sets Primary to a faint tint
   of the page (the footer band), which would leave the bar and highlights all but invisible. */
.post-body blockquote,
blockquote:not([class]) {
    /* Contain a picture floated left or right inside the quote, so the shaded box wraps it
       and the next paragraph starts underneath. */
    display: flow-root;
    margin: 28px 0;
    padding: 14px 22px;
    border-left: 3px solid var(--color-accent, var(--color-cta, #FF8FAB));
    background: color-mix(in srgb, var(--color-accent, var(--color-cta, #FF8FAB)) 8%, transparent);
    border-radius: 0 var(--border-radius-sm, 4px) var(--border-radius-sm, 4px) 0;
    font-style: italic;
}

/* Even padding above and below: a page's paragraphs keep the browser's top margin, which would push
   the first line down. */
.post-body blockquote > :first-child,
blockquote:not([class]) > :first-child {
    margin-top: 0;
}

.post-body blockquote > :last-child,
blockquote:not([class]) > :last-child {
    margin-bottom: 0;
}

.post-body mark {
    background-color: color-mix(in srgb, var(--color-accent, var(--color-cta, #FF8FAB)) 25%, transparent);
    color: inherit;
    padding: 0.1em 0.35em;
    border-radius: var(--border-radius-sm, 3px);
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.88em;
    background: color-mix(in srgb, var(--color-text, #0f172a) 10%, transparent);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm, 4px);
}

.post-body hr {
    border: none;
    border-top: 1px solid color-mix(in srgb, var(--color-primary, #FFB3C6) 35%, transparent);
    margin: 36px 0;
}

.post-body ul,
.post-body ol {
    margin: 0 0 22px;
    padding-left: 26px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body strong {
    color: var(--color-text);
}

@media (max-width: 700px) {
    .blog-hero {
        padding: 64px 20px 44px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .post-item {
        padding: 34px 0;
    }

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

    .post-article {
        padding: 48px 20px 40px;
    }

    .post-article h1 {
        font-size: 1.85rem;
    }
}

/* Responsive Markdown Tables */
.post-body .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.post-body table.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 auto;
    text-align: left;
}

.post-body table.markdown-table th,
.post-body table.markdown-table td {
    padding: 10px 16px;
    border: 1px solid var(--color-table-border, var(--color-border, rgba(0, 0, 0, 0.12)));
}

.post-body table.markdown-table th {
    background-color: var(--color-table-header-bg, color-mix(in srgb, var(--color-primary, #FFB3C6) 12%, transparent));
    font-family: var(--font-bold);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-table-header-text, var(--color-text));
}

.post-body table.markdown-table tbody tr:nth-child(even) {
    background-color: var(--color-table-row-alt, color-mix(in srgb, var(--color-primary, #FFB3C6) 4%, transparent));
}

/* Legal documents (/privacy, /privacy/dpa): in-page links land below the sticky navbar. */
.legal-document .post-body [id] {
    scroll-margin-top: calc(var(--navbar-height, 48px) + 24px);
}

.legal-document .post-body ul,
.legal-document .post-body ol {
    margin: 0 0 22px;
    padding-left: 1.4em;
}

.legal-document .post-body li + li {
    margin-top: 6px;
}

/* A post's tags (components/blog_tags.html): small links to each tag's page */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.post-tags li {
    margin: 0;
    padding: 0;
}

.post-tag {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.post-tag:hover,
.post-tag:focus-visible {
    opacity: 1;
    border-color: currentColor;
}

.post-article .post-tags {
    margin: 0 0 16px;
}

/* The tag page's heading line and feed link */
.blog-tag-head {
    text-align: center;
    padding: 40px 28px 36px;
}

.blog-tag-head h1 {
    margin: 0 0 12px;
}

.blog-tag-head .blog-back {
    display: inline-block;
    margin-bottom: 12px;
}

.blog-tag-feed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.75;
}

/* A blog list block's "Subscribe" link to the feed */
.blog-feed-link {
    margin: 16px 0 0;
    text-align: center;
    font-size: 0.85rem;
}

.blog-feed-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    opacity: 0.75;
}

.blog-feed-link a:hover,
.blog-feed-link a:focus-visible {
    opacity: 1;
}
