body.ssn #main {
    --ss-caption-sans: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.ssn #main[data-template="article"] :is(.ssn-feature, .ss-article-hero, .ssn-article-content figure:has(> img, > a > img), .ssn-article-content .wp-caption) > :is(figcaption, .wp-caption-text),
body.ssn #main[data-template="gallery"] .ssn-gallery figure > figcaption,
body.ssn #main[data-template="game"] figure:has(> img, > a > img) > figcaption {
    margin-block: .5rem 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #434d57;
    font-family: var(--ss-caption-sans);
    font-size: .875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.45;
    text-align: start;
    overflow-wrap: anywhere;
}

body.ssn #main[data-template="article"] :is(.ssn-feature, .ss-article-hero) > figcaption {
    box-sizing: border-box;
    inline-size: var(--ss-caption-photo-width, 100%);
    max-inline-size: 100%;
    margin-inline: auto;
}

@media (max-width: 760px) {
    body.ssn #main[data-template="article"] :is(.ssn-feature, .ss-article-hero) > figcaption {
        max-inline-size: calc(100% - 2rem);
    }
}

body.ssn #main[data-template] .ssn-photo-caption > .ss-caption-description {
    max-inline-size: 78ch;
}

body.ssn #main[data-template] .ssn-photo-caption > .ss-caption-credit,
body.ssn #main[data-template="home"] .ssn-home-gallery .ssn-gallery-credit {
    display: block;
    color: #606a75;
    font-family: var(--ss-caption-sans);
    font-size: .75rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.ssn #main[data-template] .ssn-photo-caption > .ss-caption-description + .ss-caption-credit {
    margin-block-start: .25rem;
}

body.ssn #main[data-template] .ssn-photo-caption p {
    margin: 0;
    font: inherit;
}

body.ssn #main[data-template] .ssn-photo-caption a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .15em;
}

body.ssn #main[data-template="home"] .ssn-home-gallery .ssn-gallery-caption {
    color: #434d57;
    font-family: var(--ss-caption-sans);
    font-size: .875rem;
    font-style: normal;
    line-height: 1.45;
}

/* Keep captions below photos in WordPress Gallery blocks embedded in stories. */
body.ssn #main[data-template="article"] .ssn-article-content .wp-block-gallery.has-nested-images figure.wp-block-image > figcaption {
    position: static;
    inset: auto;
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
    text-shadow: none;
    will-change: auto;
}

body.ssn #main[data-template="article"] .ssn-article-content .wp-block-gallery.has-nested-images figure.wp-block-image:has(> figcaption)::before {
    content: none;
}
