/* The same heading alignment applies in page, card and dialog layouts. The
   layer keeps it consistent with legacy page styles that use !important. */
@layer heading-alignment {
    :where(h1, h2, h3, h4, h5, h6, [role="heading"], .product-section-label) {
        text-align: center !important;
    }
}

/* A section link gets its own line so the title stays on the true center. */
body.home-page .home-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 4px;
}
body.home-page .home-preorder-copy h3 { align-self: stretch; }
body.home-page .home-news-card,
body.home-page .home-news-copy,
body.home-page .home-news-copy p,
body.home-page .home-news .home-empty { text-align: center; }
body.home-page .home-news-date { justify-content: center; }
body.home-page .home-news-image { margin-inline: auto; object-position: center; }

/* Each row is centered, including an odd last card or the empty state. */
.news-page #content .post-list {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: stretch;
    text-align: center;
}
.news-page #content .post-card {
    flex: 0 1 calc((100% - 28px) / 2);
    max-width: 600px;
    text-align: center;
}
.news-page #content .post-card:only-child { flex-basis: 100%; max-width: 720px; }
.news-page .post-card :is(p, .post-meta) { text-align: center; }
.news-page .post-card .post-img { display: block; margin-inline: auto; object-position: center; }
.news-page .post-card > p { max-width: 64ch; margin-inline: auto; }

/* Keep dialog titles centered while allowing room for the close control. */
body :is(.status-modal-header, .modal-header) > :is(h2, h3) { flex: 1 1 auto; min-width: 0; }
@media (max-width: 760px) {
    .news-page #content .post-card { flex-basis: 100%; }
}
