/*
 * LONG READING: the "on this page" list, a post and the blog's index
 * (docs/design/05-public-face.md, D6 and D7). One sheet for the platform's
 * site and every shop's storefront, loaded only by the pages that read long:
 * the features page and the blog. It uses the tokens both surfaces define -
 * text, muted, surface, border, the spacing scale and the glass radius - and
 * takes its accent from whichever the surface has: a shop's primary colour,
 * else the platform's gold.
 */
:root {
    --reading-accent: var(--primary, var(--gold-2));
    --reading-mark: var(--primary, var(--gold));
    /* Clear of the bar on both surfaces: the public site's is --bar-h. */
    --reading-top: calc(var(--bar-h, 4rem) + var(--space-6));
}

/* ---------- on this page ----------
   A fold above the text on a phone; from 1024px a column beside it that
   stays in view, the section being read marked (js/contents.js). */
.with-contents { display: grid; gap: var(--space-7); }
.contents-body { min-width: 0; }
.contents-panel { border: 1px solid var(--border); border-radius: var(--glass-radius); background: var(--surface); }
.contents-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); font-weight: 700; cursor: pointer; list-style: none; }
.contents-panel > summary::-webkit-details-marker { display: none; }
.contents-panel[open] > summary .icon { transform: rotate(180deg); }
.contents-list { display: grid; gap: var(--space-1); margin: 0; padding: 0 var(--space-3) var(--space-4); list-style: none; }
.contents-list a { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; }
.contents-list .is-sub a { padding-inline-start: var(--space-6); font-size: .95em; }
.contents-list a:hover { color: var(--text); background: var(--surface-2); }
.contents-list a[aria-current] { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--reading-mark); }
@media (min-width: 1024px) {
    .with-contents { grid-template-columns: 14rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
    .contents { position: sticky; top: var(--reading-top); }
    .contents-panel { border: 0; background: none; }
    .contents-panel > summary { padding: 0 var(--space-3) var(--space-3); cursor: default; }
    .contents-panel > summary .icon { display: none; }
    .contents-list { padding: 0; }
}

/* ---------- a post ----------
   The answer first and on its own, a line of who and when, the picture at
   its own size, then the body beside its contents, the questions, where to
   go next and the posts beside it. */
.post { padding-block: var(--space-6) var(--space-8); }
.post-head { display: grid; gap: var(--space-4); max-width: 46rem; margin-bottom: var(--space-6); }
.post-head h1 { margin: 0; }
.post-answer { margin: 0; font-size: 1.125rem; line-height: 1.6; }
.post-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; color: var(--muted); font-size: .95rem; }
.post-hero { display: block; width: 100%; height: auto; margin-bottom: var(--space-7); border-radius: var(--glass-radius); }
.post-body { max-width: 46rem; color: var(--text); }
.post-body h2, .post-body h3 { scroll-margin-top: var(--reading-top); }
.post-body h2 { margin: var(--space-7) 0 var(--space-3); }
.post-body h3 { margin: var(--space-6) 0 var(--space-2); }
/* A post's lists keep their marks: "steps 3 and 4" needs the numbers. */
.post-body :is(ul, ol) { margin: 0 0 var(--space-3); padding-inline-start: var(--space-5); list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: var(--space-1); }
.heading-anchor { margin-inline-start: var(--space-1); color: var(--muted); font-weight: 400; text-decoration: none; opacity: .55; }
.heading-anchor:hover, .heading-anchor:focus-visible { color: var(--reading-accent); opacity: 1; }
.post-section { max-width: 46rem; margin-top: var(--space-8); }
.post-section > h2 { margin: 0 0 var(--space-4); }
.post-about { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--glass-radius); background: var(--surface); }
.post-about p { flex: 1 1 16rem; margin: 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-6) 0 0; padding: 0; list-style: none; }

/* ---------- the index ----------
   A search, the categories and tags as chips, then the posts as cards, and
   a pager; every one of them an address, so a filtered page can be shared. */
.blog-head { display: grid; gap: var(--space-3); max-width: 46rem; margin-bottom: var(--space-6); }
.blog-head h1, .blog-head p { margin: 0; }
.blog-filters { display: grid; gap: var(--space-4); margin-bottom: var(--space-7); }
.blog-search { display: flex; gap: var(--gap-inline); max-width: 32rem; }
.blog-search input { flex: 1; min-width: 0; height: var(--field-height); padding: 0 var(--space-4); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; }
.blog-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.blog-chip { display: inline-flex; align-items: center; min-height: 2.25rem; padding: var(--space-1) var(--space-3); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.blog-chip:hover { color: var(--text); background: var(--surface-2); }
.blog-chip[aria-current] { color: var(--text); border-color: var(--reading-mark); }
.blog-group-label { margin: var(--space-3) 0 var(--space-2); color: var(--muted); font-size: .85rem; font-weight: 600; }
.blog-list { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.blog-card { display: grid; gap: var(--space-2); align-content: start; height: 100%; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--glass-radius); background: var(--surface); color: var(--text); text-decoration: none; }
.blog-card:hover { border-color: var(--reading-mark); }
.blog-card h2, .blog-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.blog-card p { margin: 0; color: var(--muted); }
.blog-empty { color: var(--muted); }
.blog-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-7); }
.blog-pager p { margin: 0; color: var(--muted); }

/* Words for a screen reader only, like the search box's label. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
