/* The blog's own pieces, on the website's tokens (assets/site.css). Everything else is the website's styles. */

/* WordPress's labels for screen readers only (such as "Posts pagination") */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The bar above the cards: how many insights, and search */
.blog-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.blog-bar .quiet { margin: 0; color: var(--slate); font-weight: 600; }
.blog-find { position: relative; flex: 0 1 360px; }
.blog-find input { font: 500 1rem/1.4 var(--font); color: var(--ink); background: var(--paper); border: 1.5px solid var(--hair); border-radius: 999px; min-height: 52px; width: 100%; padding: 12px 56px 12px 22px; }
.blog-find input::placeholder { color: var(--slate); }
.blog-find input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 45%, transparent); }
:root[data-theme="dark"] .blog-find input:focus { border-color: var(--gold); }
.blog-find button { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--navy); color: var(--gold); display: grid; place-items: center; cursor: pointer; }
:root[data-theme="dark"] .blog-find button { background: var(--gold); color: var(--navy); }
@media (max-width: 560px) { .blog-find { flex-basis: 100%; } }

/* Post cards: the site's client-story cards (.story-big); only the grid fill and summary length are the blog's */
.post-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.post-grid .story-big-head h2 { text-wrap: pretty; margin-top: 0; }
.post-grid .story-big-body > p:first-child { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.blog-empty .lead { margin-bottom: 14px; }
.blog-empty .text-link { display: inline-block; margin-top: 8px; }

/* The back link: a full-height tap target */
.story-hero .back { min-height: 44px; margin-bottom: 10px; }

/* Pagination */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--hair); color: var(--ink); font-weight: 700; text-decoration: none; }
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--gold); }
:root[data-theme="dark"] .pagination .page-numbers.current { background: var(--navy-raise); border-color: var(--gold); }

/* One post: the article column (about 75 characters a line) with "On this page" beside it on wide screens */
.post-hero .display { max-width: 24ch; }
.post-hero .lead { margin-top: 18px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 40rem); gap: 0 64px; }
.post-layout.has-toc { grid-template-areas: "article toc"; grid-template-columns: minmax(0, 40rem) minmax(200px, 17rem); }
.post-layout.has-toc .post-prose { grid-area: article; }
.post-toc { grid-area: toc; align-self: start; position: sticky; top: 104px; }
.post-toc summary { list-style: none; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 12px; }
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--hair); display: grid; gap: 10px; }
.post-toc a { display: block; font-size: .9375rem; line-height: 1.4; color: var(--slate); text-decoration: none; }
.post-toc a:hover { color: var(--ink); }
@media (min-width: 961px) { .post-toc summary { pointer-events: none; } }
@media (max-width: 960px) {
  .post-layout.has-toc { grid-template-areas: "toc" "article"; grid-template-columns: minmax(0, 1fr); }
  .post-toc { position: static; margin-bottom: 36px; padding: 18px 20px; border-radius: var(--r-md); background: var(--mist); }
  .post-toc summary { cursor: pointer; margin: 0; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
  .post-toc summary::after { content: "+"; font-size: 1.25rem; font-weight: 600; }
  .post-toc details[open] summary { margin-bottom: 14px; }
  .post-toc details[open] summary::after { content: "–"; }
}
.post-prose h2, .post-prose h3 { scroll-margin-top: 110px; }
.post-section { padding-top: clamp(48px, 6vw, 72px); }

/* The article text: posts come from the editor as plain HTML (headings, lists, tables, images) */
.post-prose { max-width: none; font-size: 1.0625rem; }
.post-prose > :first-child { margin-top: 0; }
.post-prose h2 { font-size: clamp(1.375rem, 2.4vw, 1.625rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin: 48px 0 14px; }
.post-prose h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin: 34px 0 10px; }
.post-prose h4 { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.35; margin: 28px 0 8px; }
.post-prose h5, .post-prose h6 { font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; margin: 26px 0 8px; color: var(--gold-ink); }
.post-prose p, .post-prose li { color: var(--slate); line-height: 1.7; }
.post-prose p { margin: 0 0 18px; }
.post-prose b, .post-prose strong { color: var(--ink); font-weight: 700; }
.post-prose ul, .post-prose ol { margin: 0 0 22px; padding-left: 1.4em; list-style: disc; }
.post-prose ol { list-style: decimal; }
.post-prose ul ul { list-style: circle; margin: 8px 0 0; }
.post-prose li { margin: 0 0 8px; }
.post-prose li::marker { color: var(--gold-ink); }
.post-prose a { color: var(--ink); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post-prose img { height: auto; border-radius: var(--r-sm); margin: 28px auto; }
.post-prose figure { margin: 28px 0; }
.post-prose figcaption, .post-prose .wp-caption-text { font-size: .875rem; color: var(--slate); text-align: center; margin-top: 8px; }
.post-prose blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold); color: var(--ink); font-size: 1.125rem; }
.post-prose table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: .9375rem; display: block; overflow-x: auto; }
.post-prose th, .post-prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hair); color: var(--slate); vertical-align: top; }
.post-prose tr:first-child td, .post-prose th { color: var(--ink); font-weight: 700; background: var(--mist); }
.post-prose hr { border: 0; border-top: 1px solid var(--hair); margin: 40px 0; }
.post-prose code { font-size: .9em; background: var(--mist); padding: 2px 6px; border-radius: 6px; }
.post-prose pre { background: var(--mist); padding: 18px; border-radius: var(--r-sm); overflow-x: auto; }

/* Three facts on a post (published, read time, author); the 404 page's button */
.post-hero .fact-row { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 860px; }
@media (max-width: 560px) { .post-hero .fact-row { grid-template-columns: 1fr 1fr; } }
.blog-hero .btn { margin-top: 28px; }
