/* The blog (blog.php): an article is a .guide column from site.css with the parts below added, and
   the list of articles is a grid of cards. Sizes follow site.css: nothing under 1rem, and every
   font-size is max(size, --mobile-text-min) so that phones never go below their minimum. */

/* The article */
.blog-post .blog-picture {
    display: block;
    width: 100%;
    height: auto;
    margin: 20px 0 24px;
    border-radius: 12px;
}

.blog-post .blog-draft {
    padding: 12px 16px;
    border-radius: 8px;
    color: #7a3a12;
    background: #fde7c8;
    font-weight: 700;
}

/* "In short": the answer before the article. */
.blog-short {
    margin: 26px 0;
    padding: 22px 26px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(24, 56, 58, .07);
}

.guide .blog-short h2,
.guide .blog-contents h2 {
    margin: 0 0 10px;
    font-size: max(1.3rem, var(--mobile-text-min));
}

.guide .blog-short ul {
    margin-bottom: 0;
}

.guide .blog-short li:last-child,
.guide .blog-contents li:last-child {
    margin-bottom: 0;
}

/* The table of contents. */
.blog-contents {
    margin: 26px 0 8px;
    padding: 22px 26px;
    border: 1px solid rgba(24, 56, 58, .14);
    border-radius: 12px;
}

.guide .blog-contents ol {
    margin: 0;
    padding-inline-start: 24px;
}

.guide .blog-contents li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.guide .blog-contents a {
    font-weight: 600;
}

/* A heading reached from the table of contents stops a little below the top of the screen. */
.blog-body h2 {
    scroll-margin-top: 20px;
}

.guide ol {
    margin: 0 0 16px;
    padding-inline-start: 26px;
}

.blog-body strong {
    font-weight: 700;
}

.blog-body a {
    font-weight: 600;
}

.blog-body blockquote {
    margin: 22px 0;
    padding: 6px 20px;
    border-inline-start: 4px solid var(--coral);
}

.guide .blog-body blockquote p {
    margin: 8px 0;
    font-size: max(1.25rem, var(--mobile-text-min));
    font-weight: 600;
}

.blog-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 22px auto;
    border-radius: 12px;
}

/* A table wider than a phone scrolls sideways inside its frame, and the page does not. */
.blog-table {
    margin: 22px 0;
    overflow-x: auto;
}

.blog-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.blog-table th,
.blog-table td {
    padding: 12px 14px;
    border: 1px solid rgba(24, 56, 58, .16);
    font-size: max(1.05rem, var(--mobile-text-min));
    line-height: 1.5;
    text-align: start;
    vertical-align: top;
}

.blog-table th {
    color: var(--white);
    background: var(--teal-dark);
    font-weight: 700;
}

/* The short start button in the middle of a long article. */
.blog-invite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 22px;
    margin: 34px 0;
    padding: 20px 24px;
    border-radius: 12px;
    background: rgba(233, 135, 111, .16);
}

.guide .blog-invite p {
    flex: 1 1 300px;
    margin: 0;
    font-weight: 600;
}

.blog-invite .landing-cta {
    margin-top: 0;
    color: var(--white);
}

/* The list of articles */
.blog-list {
    padding: 36px 0 20px;
}

.blog-list > h1 {
    max-width: 860px;
    margin: 12px 0;
    font-size: max(clamp(1.9rem, 3.6vw, 2.8rem), var(--mobile-text-min));
    line-height: 1.15;
    text-wrap: balance;
}

.blog-list .guide-trail {
    color: var(--muted);
    font-size: max(1rem, var(--mobile-text-min));
}

.blog-list .guide-trail a {
    color: var(--teal-dark);
}

.blog-list .guide-lead {
    max-width: 760px;
    margin: 0 0 30px;
    font-size: max(1.3rem, var(--mobile-text-min));
    line-height: 1.7;
}

.blog-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 0 22px 20px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(24, 56, 58, .07);
}

.blog-card:not(:has(img)) {
    padding-top: 22px;
}

.blog-card img {
    display: block;
    width: calc(100% + 44px);
    max-width: none;
    height: auto;
    margin: 0 -22px 18px;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

.blog-card-category {
    margin: 0 0 6px;
    color: #b4543c;
    font-size: max(1rem, var(--mobile-text-min));
    font-weight: 700;
}

.blog-card h2 {
    margin: 0 0 10px;
    font-size: max(1.35rem, var(--mobile-text-min));
    line-height: 1.3;
}

.blog-card h2 a {
    color: var(--teal-dark);
    text-decoration: none;
}

.blog-card h2 a:hover,
.blog-card h2 a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-card p {
    margin: 0 0 14px;
    font-size: max(1.08rem, var(--mobile-text-min));
    line-height: 1.6;
}

.blog-card .blog-card-meta {
    margin: auto 0 0;
    color: var(--muted);
    font-size: max(1rem, var(--mobile-text-min));
}

.blog-list .guide-cta {
    max-width: 760px;
}

.blog-list .guide-cta h2 {
    margin: 0 0 12px;
    color: var(--teal-dark);
    font-size: max(1.55rem, var(--mobile-text-min));
}

.blog-list .guide-cta p {
    margin: 0 0 16px;
    font-size: max(1.15rem, var(--mobile-text-min));
    line-height: 1.75;
}

@media (max-width: 700px) {
    .blog-short,
    .blog-contents,
    .blog-invite {
        padding: 18px;
    }

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

    /* The global phone rule makes every h2 26px; a card's title is one step under a page heading. */
    .blog-card h2 {
        font-size: 23px !important;
    }

    .guide .blog-short h2,
    .guide .blog-contents h2 {
        font-size: 23px !important;
    }
}

@media print {
    .blog-invite,
    .blog-contents {
        display: none;
    }
}
