/* ── Blog: post list (/blog/, categories, tags, search) and single posts ──
   Markup is shared by the prototype (prototype/blog/) and the WordPress templates
   (template-parts/content/blog.php, single-post.php). */

/* Hero search */
.blog-search { display: flex; align-items: center; gap: 8px; width: min(100%, 560px); margin-top: 30px; padding: 6px 6px 6px 20px; border: 1px solid rgb(255 255 255 / .18); border-radius: var(--msp-radius-pill); background: rgb(255 255 255 / .06); }
.blog-search:focus-within { border-color: var(--msp-primary); }
.blog-search .icon { width: 20px; height: 20px; color: var(--msp-on-dark-muted); flex: none; }
.blog-search input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none; font-size: 16px; color: #fff; }
.blog-search input::placeholder { color: var(--msp-on-dark-muted); }

/* Category pills */
.blog { padding-block: clamp(40px, 5vw, 72px) var(--srv-y); background: var(--msp-surface); }
.blog-cats { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.blog-cats a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-pill); background: #fff; font-size: 14.5px; font-weight: 500; color: var(--msp-secondary); transition: background-color .2s, color .2s, border-color .2s; }
.blog-cats a:hover { border-color: var(--msp-secondary); }
.blog-cats a[aria-current="page"] { border-color: var(--msp-secondary); background: var(--msp-secondary); color: #fff; }
.blog-cats span { font-size: 12.5px; opacity: .65; }
.blog__heading { margin-top: clamp(28px, 3vw, 40px); font-size: var(--msp-fs-h4); }

/* Shared post bits */
.post-cat { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--msp-radius-pill); background: rgb(155 213 5 / .2); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--msp-accent); }
.post-cat:hover { background: var(--msp-primary); color: var(--msp-secondary); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13.5px; color: var(--msp-muted); }
.post-meta > * + *::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 14px; border-radius: 50%; background: currentColor; opacity: .5; vertical-align: middle; }
.post-thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; background-color: var(--msp-secondary); background-image: linear-gradient(rgb(255 255 255 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .07) 1px, transparent 1px); background-size: 28px 28px; }
.post-thumb-fallback img, .post-feature__media .post-thumb-fallback img, .post-card__media .post-thumb-fallback img { width: 46%; max-width: 260px; height: auto; object-fit: contain; transform: none; }

/* Featured post */
.post-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px); margin-top: 28px; padding: 14px; border-radius: var(--msp-radius-lg); background: #fff; }
.post-feature__media { display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--msp-radius-md); background: var(--msp-surface-2); }
.post-feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--msp-ease-out); }
.post-feature:hover .post-feature__media img { transform: scale(1.04); }
.post-feature__body { padding: clamp(8px, 2vw, 24px) clamp(8px, 2vw, 28px) clamp(8px, 2vw, 24px) 0; }
.post-feature__label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--msp-muted); }
.post-feature__title { margin: 16px 0 14px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.12; }
.post-feature__title a:hover, .post-card__title a:hover { color: var(--msp-accent); }
.post-feature__excerpt { font-size: 16.5px; line-height: 1.6; }
.post-feature .post-meta { margin-top: 18px; }
.post-feature .srv-link { margin-top: 22px; }

/* Card grid */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.post-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 12px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-lg); background: #fff; transition: border-color .3s, box-shadow .3s, transform .45s var(--msp-ease-out); }
.post-card:hover { border-color: rgb(8 17 25 / .16); box-shadow: 0 30px 50px -32px rgb(8 17 25 / .4); transform: translateY(-4px); }
.post-card__media { display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--msp-radius-md); background: var(--msp-surface-2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--msp-ease-out); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 18px 8px 8px; }
.post-card__title { margin: 12px 0 10px; font-size: 20px; line-height: 1.25; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card clickable */
.post-card .post-cat { position: relative; z-index: 1; align-self: flex-start; }
.post-card__excerpt { font-size: 15px; line-height: 1.55; }
.post-card .post-meta { margin-top: auto; padding-top: 16px; }

/* Pagination (WordPress the_posts_pagination markup) */
.blog .navigation.pagination { margin-top: 40px; }
.blog .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; }
.blog .page-numbers { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 14px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-pill); background: #fff; font-size: 15px; font-weight: 500; color: var(--msp-secondary); transition: background-color .2s, color .2s, border-color .2s; }
.blog a.page-numbers:hover { border-color: var(--msp-secondary); }
.blog .page-numbers.current { border-color: var(--msp-secondary); background: var(--msp-secondary); color: #fff; }
.blog .page-numbers.dots { border: 0; background: none; }
.blog__empty { margin-top: 32px; padding: 40px; border-radius: var(--msp-radius-lg); background: #fff; text-align: center; }
.blog__empty h2 { font-size: var(--msp-fs-h4); }
.blog__empty p { margin: 10px auto 22px; max-width: 46ch; }
.blog .svc__note { margin-top: 40px; }

/* ── Single post ── */
/* Hero: featured image behind a navy overlay; same width as the article layout so the title lines up with the text. */
.post-hero { padding-bottom: clamp(56px, 7vw, 110px); }
.post-hero .prj-hub-hero__inner { max-width: calc(1180px + 2 * var(--msp-gutter)); }
.post-hero__bg { position: absolute; inset: 0; z-index: -2; }
.post-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.post-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(8 17 25 / .94) 0%, rgb(8 17 25 / .82) 45%, rgb(8 17 25 / .55) 100%), linear-gradient(180deg, rgb(8 17 25 / .5) 0%, rgb(8 17 25 / 0) 30%, rgb(8 17 25 / .6) 100%); }
.post-hero--image .srv-hero__grid { opacity: .5; }
.post-hero__title, .post-hero .srv-hero__lead { max-width: 920px; }
.post-hero__title { margin: 18px 0 18px; font-size: clamp(2.2rem, 1.2rem + 3.4vw, 4rem); font-weight: 400; line-height: 1.06; letter-spacing: -.01em; color: #fff; }
.post-hero .srv-hero__lead { max-width: 64ch; }
.post-hero .post-cat { margin-top: 24px; background: var(--msp-primary); color: var(--msp-secondary); }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .14); }
.post-byline__who { display: flex; align-items: center; gap: 12px; }
.post-byline__avatar { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 50%; background: #fff; }
.post-byline__avatar img { width: 34px; height: 34px; object-fit: contain; }
.post-byline__who strong { display: block; font-size: 15px; font-weight: 500; color: #fff; }
.post-byline__who span { display: block; font-size: 13px; color: var(--msp-on-dark-muted); }
.post-hero .post-meta { color: var(--msp-on-dark-muted); }
.post-cover { position: relative; z-index: 2; margin: calc(-1 * clamp(110px, 12vw, 190px)) auto 0; max-width: calc(1180px + 2 * var(--msp-gutter)); padding-inline: var(--msp-gutter); }
.post-cover img { width: 100%; aspect-ratio: 21 / 10; object-fit: cover; border-radius: var(--msp-radius-lg); box-shadow: var(--msp-shadow-lg); }
.post-cover figcaption { margin-top: 10px; font-size: 13px; color: var(--msp-muted); text-align: center; }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: clamp(32px, 5vw, 80px); max-width: calc(1180px + 2 * var(--msp-gutter)); padding-block: clamp(48px, 6vw, 88px); }
.post-main { min-width: 0; max-width: 740px; }
.post-side { position: sticky; top: calc(var(--msp-header-h) + 24px); display: grid; gap: 18px; }
.post-toc { padding: 22px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-md); }
.post-toc__title { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--msp-muted); }
.post-toc ol { display: grid; gap: 2px; margin-top: 12px; counter-reset: toc; }
.post-toc a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14.5px; line-height: 1.4; color: var(--msp-secondary); transition: background-color .2s; }
.post-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-size: 12px; font-weight: 600; color: var(--msp-accent); padding-top: 2px; }
.post-toc a:hover { background: var(--msp-surface); }
.post-toc a.is-active { background: var(--msp-surface); font-weight: 500; }
.post-toc--inline { display: none; }
.post-cta { padding: 24px; border-radius: var(--msp-radius-md); background: var(--msp-secondary); color: var(--msp-on-dark-muted); }
.post-cta h2 { margin-top: 12px; font-size: 22px; line-height: 1.2; color: #fff; }
.post-cta p { margin: 10px 0 18px; font-size: 14.5px; line-height: 1.55; }
.post-share { display: flex; align-items: center; gap: 8px; }
.post-share__label { margin-right: 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--msp-muted); }
.post-share a, .post-share button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--msp-divider); border-radius: 50%; color: var(--msp-secondary); transition: background-color .2s, color .2s, border-color .2s; }
.post-share a:hover, .post-share button:hover { border-color: var(--msp-secondary); background: var(--msp-secondary); color: var(--msp-primary); }
.post-share .icon { width: 17px; height: 17px; }
.post-share button.is-copied { background: var(--msp-primary); border-color: var(--msp-primary); }

/* Article typography (also styles Gutenberg blocks) */
.post-body { font-size: 17.5px; line-height: 1.78; color: #3E4851; }
.post-body > * + * { margin-top: 1.15em; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { margin-top: 2em; font-size: clamp(1.5rem, 1.25rem + .8vw, 2rem); line-height: 1.2; scroll-margin-top: calc(var(--msp-header-h) + 24px); }
.post-body h3 { margin-top: 1.6em; font-size: 1.25rem; line-height: 1.3; scroll-margin-top: calc(var(--msp-header-h) + 24px); }
.post-body h2 + *, .post-body h3 + * { margin-top: .6em; }
.post-body strong { font-weight: 600; color: var(--msp-secondary); }
.post-body a { color: var(--msp-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol { display: grid; gap: .45em; padding-left: 0; }
.post-body ul > li { position: relative; padding-left: 1.6em; }
.post-body ul > li::before { content: ""; position: absolute; left: .25em; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--msp-primary); box-shadow: 0 0 0 3px rgb(155 213 5 / .22); }
.post-body ol { counter-reset: li; }
.post-body ol > li { position: relative; padding-left: 2.2em; counter-increment: li; }
.post-body ol > li::before { content: counter(li); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--msp-secondary); font-size: .78em; font-weight: 600; color: var(--msp-primary); }
.post-body blockquote, .post-body .wp-block-quote { margin-inline: 0; padding: 20px 24px; border-left: 4px solid var(--msp-primary); border-radius: 0 var(--msp-radius-sm) var(--msp-radius-sm) 0; background: var(--msp-surface); font-size: 1.05em; color: var(--msp-secondary); }
.post-body blockquote cite { display: block; margin-top: 8px; font-size: .8em; font-style: normal; color: var(--msp-muted); }
.post-body figure { margin-inline: 0; }
.post-body img { border-radius: var(--msp-radius-md); }
.post-body figcaption { margin-top: 8px; font-size: 14px; color: var(--msp-muted); text-align: center; }
.post-body table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; line-height: 1.5; }
.post-body .wp-block-table, .post-body .table-wrap { overflow-x: auto; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-md); }
.post-body th, .post-body td { padding: 12px 16px; border-bottom: 1px solid var(--msp-divider); text-align: left; vertical-align: top; }
.post-body thead th { background: var(--msp-secondary); color: #fff; font-weight: 600; }
.post-body tr:last-child > td { border-bottom: 0; }
.post-body hr { height: 1px; border: 0; background: var(--msp-divider); margin-block: 2em; }
.post-body code { padding: 2px 6px; border-radius: 6px; background: var(--msp-surface-2); font-size: .9em; }
.post-body .post-callout, .post-body .wp-block-pullquote { padding: 22px 24px; border-radius: var(--msp-radius-md); background: var(--msp-secondary); color: var(--msp-on-dark-muted); }
.post-body .post-callout strong { color: #fff; }
.post-body .alignwide { margin-inline: calc(-1 * min(80px, 6vw)); }

.post-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--msp-divider); display: grid; gap: 24px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { padding: 6px 12px; border-radius: var(--msp-radius-pill); background: var(--msp-surface); font-size: 13.5px; color: var(--msp-secondary); }
.post-tags a:hover { background: var(--msp-primary); }
.post-author { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 24px; border-radius: var(--msp-radius-md); background: var(--msp-surface); }
.post-author__avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; }
.post-author__avatar img { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; }
.post-author strong { display: block; font-size: 17px; font-weight: 500; color: var(--msp-secondary); }
.post-author p { margin-top: 6px; font-size: 15px; line-height: 1.6; }
.post-related { padding-block: var(--srv-y); background: var(--msp-surface); }
.post-related .post-grid { margin-top: 28px; }

@media (max-width: 1099px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; }
  .post-side .post-toc { display: none; }
  .post-toc--inline { display: block; margin-bottom: 32px; }
  .post-feature { grid-template-columns: 1fr; }
  .post-feature__body { padding: 8px 10px 14px; }
}
@media (max-width: 899px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) {
  .post-grid { grid-template-columns: 1fr; }
  .blog-cats { flex-wrap: nowrap; margin-inline: calc(-1 * var(--msp-gutter)); padding: 2px var(--msp-gutter) 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .blog-cats::-webkit-scrollbar { display: none; }
  .blog-cats a { flex: none; }
  .post-cover img { aspect-ratio: 16 / 10; }
  .post-body { font-size: 16.5px; }
  .post-author { grid-template-columns: 1fr; }
}

/* WordPress screen-reader text (pagination headings etc.) */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Article components (used by the shipped articles; also usable in the editor via Custom HTML) */
.post-body .post-answer { position: relative; padding: 22px 24px 22px 26px; border-radius: var(--msp-radius-md); background: var(--msp-secondary); color: rgb(255 255 255 / .86); }
.post-body .post-answer::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--msp-primary); }
.post-body .post-answer strong { color: var(--msp-primary); }
.post-body .post-answer p { margin: 0; }
.post-body .post-takeaways { padding: 22px 24px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-md); background: #fff; }
.post-body .post-takeaways__title { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--msp-accent); }
.post-body .post-takeaways ul { gap: .35em; }
.post-body .post-checklist { padding: 0; }
.post-body .post-checklist > li { padding-left: 2em; }
.post-body .post-checklist > li::before { width: 1.3em; height: 1.3em; top: .25em; left: 0; box-shadow: none; background: var(--msp-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23081119' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 70% no-repeat; }
.post-body .post-note { padding: 16px 20px; border-radius: var(--msp-radius-sm); background: #FFF8E6; color: #5C4400; font-size: .95em; }
.post-body .post-note strong { color: #5C4400; }
.post-body .post-series { padding: 24px; border-radius: var(--msp-radius-md); background: var(--msp-surface); }
.post-body .post-series h2 { margin-top: 0; font-size: 1.3rem; }
.post-body .post-series ul { margin-top: 12px; }
.post-body .post-sources { font-size: 14.5px; color: var(--msp-muted); }
.post-body .post-sources a { color: var(--msp-muted); }
.post-body figure.post-figure { margin-block: 1.6em; padding: 16px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-md); background: #fff; }
.post-body figure.post-figure img { width: 100%; height: auto; border-radius: 8px; }