/**
 * Blog post body: the text inside a single post (the "Post Content" widget,
 * .story.blog-post in single template 4210).
 *
 * The theme's components.css and our custom-base.css style .story for every
 * page that uses it: system-font headings, no space above an h2 that sits
 * straight after a paragraph, hard black table borders and the kit's giant
 * condensed blockquote. This file only targets .story.blog-post, so other
 * .story pages keep their look.
 *
 * Headings follow the site rule: Blackbird Narrow 800 uppercase (the
 * condensed italic face is for page titles only). Tables follow the landing
 * page data tables (separate rounded rows on a well, small muted column
 * labels, no borders), in light greys because posts sit on white.
 */

.story.blog-post {
    --post-ink: #100f1a; /* Grey 900 */
    --post-text: #323232;
    --post-muted: #868f98; /* Grey 400 */
    --post-well: #f2f2f4;
    --post-row: #ffffff;
    --post-row-hover: #e8e8ec;
    --post-radius: 8px;
    --post-heading-font: "Blackbird Narrow", arial, sans-serif;
    --post-body-font: "Blackbird Regular", arial, sans-serif;
}

/* Text ------------------------------------------------------------------ */

.story.blog-post p,
.story.blog-post li {
    font-family: var(--post-body-font);
    line-height: 1.6;
    color: var(--post-text);
}

.story.blog-post p {
    margin: 0 0 20px;
}

.story.blog-post ul,
.story.blog-post ol {
    margin: 0 0 24px;
    padding-left: 22px;
}

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

.story.blog-post li:last-child {
    margin-bottom: 0;
}

/* Headings -------------------------------------------------------------- */

/* custom-base.css sets margin-top: 0 !important on any h2 that is a direct
   child of the widget, which is every h2 in a post. This selector is more
   specific, so it wins. */
.story.blog-post h2,
.story.blog-post .elementor-widget-container > h2 {
    margin: 48px 0 16px !important;
    font-family: var(--post-heading-font);
    font-size: 32px;
    font-weight: 800;
    font-style: normal;
    line-height: 1.1;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--post-ink);
}

.story.blog-post h3,
.story.blog-post .elementor-widget-container > h3 {
    margin: 32px 0 12px !important;
    font-family: var(--post-heading-font);
    font-size: 22px;
    font-weight: 800;
    font-style: normal;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--post-ink);
}

.story.blog-post h4 {
    margin: 24px 0 8px;
    font-family: var(--post-heading-font);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--post-ink);
}

/* No gap above a heading that opens the post or follows another heading. */
.story.blog-post .elementor-widget-container > :is(h2, h3):first-child,
.story.blog-post :is(h2, h3) + :is(h2, h3) {
    margin-top: 0 !important;
}

/* Quotes ---------------------------------------------------------------- */

/* A grey panel with a large red opening quote mark, upright text and an
   attribution row. The attribution can start with an img (a 48px round
   photo) followed by a span holding the name in <strong> and a role line. */
.story.blog-post blockquote,
.story.blog-post .wp-block-quote {
    margin: 40px 0;
    padding: 28px 36px 32px;
    border: 0;
    border-radius: var(--post-radius);
    background: var(--post-well);
    text-align: left; /* the kit centres blockquotes */
}

.story.blog-post blockquote::before {
    content: "\201C";
    display: block;
    height: 40px;
    margin-bottom: 4px;
    font: 800 88px/1 "Blackbird Narrow", arial, sans-serif;
    color: var(--e-global-color-primary, #ff2614);
}

.story.blog-post blockquote p,
.story.blog-post .wp-block-quote p {
    margin: 0 0 16px;
    font-family: var(--post-body-font);
    font-size: 22px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    color: var(--post-ink);
}

.story.blog-post blockquote p:last-of-type {
    margin-bottom: 0;
}

.story.blog-post blockquote cite,
.story.blog-post .wp-block-quote cite {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    font-family: var(--post-body-font);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    color: var(--post-muted);
}

/* base.css puts an em dash before every cite. */
.story.blog-post blockquote cite::before {
    content: none;
}

.story.blog-post blockquote cite img {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

.story.blog-post blockquote cite strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--post-ink);
}

/* Tables ---------------------------------------------------------------- */

.story.blog-post .wp-block-table,
.story.blog-post figure.wp-block-table {
    margin: 0 0 28px;
    overflow-x: auto;
}

.story.blog-post table {
    width: 100%;
    padding: 6px;
    border: 0;
    border-collapse: separate;
    border-spacing: 0 6px;
    border-radius: var(--post-radius);
    background: var(--post-well);
    font-size: 15px;
}

.story.blog-post th,
.story.blog-post td,
.story.blog-post td:not(:last-child),
.story.blog-post td:last-child {
    border: 0;
}

.story.blog-post thead th {
    padding: 4px 12px 0;
    background: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: left;
    text-transform: uppercase;
    color: var(--post-muted);
}

.story.blog-post td {
    padding: 10px 12px;
    background: var(--post-row);
    font-family: var(--post-body-font);
    font-size: 15px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    color: var(--post-text);
}

/* In two-column tables (name and value), fix the value column's width so
   tables stacked under each other line up. */
.story.blog-post tr > :last-child:nth-child(2) {
    width: 30%;
}

.story.blog-post td:first-child {
    border-radius: 4px 0 0 4px;
    font-weight: 700;
    color: var(--post-ink);
}

.story.blog-post td:last-child {
    border-radius: 0 4px 4px 0;
}

.story.blog-post td:only-child {
    border-radius: 4px;
}

.story.blog-post tbody tr:hover td {
    background: var(--post-row-hover);
}

.story.blog-post td a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(16, 15, 26, 0.25);
    text-underline-offset: 3px;
}

.story.blog-post td a:hover {
    color: inherit;
    text-decoration-color: currentColor;
}

/* Phones ---------------------------------------------------------------- */

@media (max-width: 767px) {
    .story.blog-post h2,
    .story.blog-post .elementor-widget-container > h2 {
        margin-top: 40px !important;
        font-size: 24px;
    }

    .story.blog-post h3,
    .story.blog-post .elementor-widget-container > h3 {
        margin-top: 28px !important;
        font-size: 19px;
    }

    .story.blog-post blockquote,
    .story.blog-post .wp-block-quote {
        padding: 20px 20px 24px;
    }

    .story.blog-post blockquote::before {
        height: 32px;
        font-size: 64px;
    }

    .story.blog-post blockquote p,
    .story.blog-post .wp-block-quote p {
        font-size: 19px;
    }

    .story.blog-post td {
        padding: 9px 10px;
        font-size: 14px;
    }
}
