/* Shocase blog — posts, listings and the 404 page.
   Built on the Paperwork tokens and components in site.css. */

.blog-page { padding-bottom: 0; }
.blog-page :focus-visible { outline: 2px solid var(--sc-sel); outline-offset: 3px; }
.blog-skip { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 12px; background: var(--sc-surface); transform: translateY(-150%); }
.blog-skip:focus { transform: none; }
.blog-page h1, .blog-page h2, .blog-page h3 { font-family: var(--sc-display); font-weight: 600; color: var(--sc-ink); }
.blog-page .eyebrow { color: var(--sc-ink-2); }

/* ---------- Breadcrumb ---------- */
.post-breadcrumb { padding-top: clamp(28px, 4vw, 44px); }
.post-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.post-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--sc-ink-3); }
.post-breadcrumb a { color: var(--sc-ink-2); }
.post-breadcrumb a:hover { color: var(--sc-ink); }

/* ---------- Post header ---------- */
.post-status { margin: 24px 0 0; padding: 10px 14px; border: 1px solid var(--sc-work); border-radius: var(--sc-r-2); color: var(--sc-work); font-size: 13px; font-weight: 500; }
.post-header { max-width: 820px; padding: 18px 0 30px; }
.post-header h1 { margin: 0; font-size: clamp(32px, 5.2vw, 52px); line-height: 1.06; letter-spacing: -0.03em; text-wrap: balance; }
.post-dek { max-width: 680px; margin: 18px 0 0; font-size: clamp(16px, 2vw, 18px); line-height: 1.6; color: var(--sc-ink-2); text-wrap: pretty; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 20px 0 0; font-size: 13px; color: var(--sc-ink-2); }
.post-meta span + span::before { content: "·"; margin-right: 10px; }
.post-meta a { color: var(--sc-ink-2); font-weight: 500; }

.post-hero { margin: 0; }
.post-hero img { display: block; width: 100%; height: auto; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-inset); }

/* ---------- Article + sidebar ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: clamp(28px, 4vw, 44px); }
.post-article { min-width: 0; max-width: 680px; }
.post-aside { display: none; }

.post-toc ol, .post-toc-mobile ol { margin: 0; padding: 0; list-style: none; }
.post-toc .eyebrow { margin: 0 0 12px; }
.post-toc li { border-left: 1px solid var(--sc-rule); }
.post-toc a { display: block; padding: 5px 0 5px 12px; font-size: 13px; line-height: 1.45; color: var(--sc-ink-2); }
.post-toc a:hover { color: var(--sc-ink); text-decoration: none; }
.post-toc .toc-level-3 a { padding-left: 24px; font-size: 12.5px; color: var(--sc-ink-2); }

.post-toc-mobile { margin: 0 0 28px; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-surface); }
.post-toc-mobile summary { padding: 13px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.post-toc-mobile ol { padding: 0 16px 10px; }
.post-toc-mobile a { display: block; padding: 8px 0; border-top: 1px solid var(--sc-rule); font-size: 14px; color: var(--sc-ink-2); }
.post-toc-mobile .toc-level-3 a { padding-left: 14px; font-size: 13px; }

.post-aside-cta { padding: 16px; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-inset); }
.post-aside-cta p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--sc-ink-2); }

@media (min-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 56px; }
  .post-aside { display: block; }
  .post-aside-inner { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 22px; max-height: calc(100vh - 110px); overflow: auto; }
  .post-toc-mobile { display: none; }
}

/* ---------- Key takeaways ---------- */
.post-takeaways { margin: 0 0 32px; padding: 20px 22px; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-inset); }
.post-takeaways h2 { margin: 0 0 10px; font-family: var(--sc-ui); font-size: 10px; font-weight: 600; line-height: 1.2; letter-spacing: .14em; text-transform: uppercase; color: var(--sc-ink-2); }
.post-takeaways ul { margin: 0; padding-left: 18px; }
.post-takeaways li { margin: 6px 0; font-size: 15px; line-height: 1.55; color: var(--sc-ink); }

/* ---------- Article typography ---------- */
.prose { font-size: 16.5px; line-height: 1.75; color: var(--sc-ink-2); }
@supports (color: color-mix(in srgb, red, blue)) {
  .prose { color: color-mix(in srgb, var(--sc-ink) 84%, var(--sc-paper)); }
}
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose .table-wrap { margin: 0 0 22px; }
.prose h2 { margin: 48px 0 14px; font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; scroll-margin-top: 84px; }
.prose h3 { margin: 32px 0 10px; font-size: 20px; line-height: 1.25; letter-spacing: -0.012em; scroll-margin-top: 84px; }
.prose h4 { margin: 26px 0 8px; font-family: var(--sc-ui); font-size: 16px; font-weight: 600; color: var(--sc-ink); scroll-margin-top: 84px; }
.prose a { color: var(--sc-sel); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; color: var(--sc-ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose blockquote { padding: 2px 0 2px 18px; border-left: 2px solid var(--sc-rule-2); color: var(--sc-ink-2); }
.prose hr { margin: 40px 0; border: 0; border-top: 1px solid var(--sc-rule); }
.prose code { padding: 2px 5px; border-radius: var(--sc-r-1); background: var(--sc-inset); font-family: var(--sc-mono); font-size: .88em; }
.prose pre { overflow-x: auto; padding: 16px 18px; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-2); background: var(--sc-inset); font-size: 13.5px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose img { display: block; max-width: 100%; height: auto; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-2); background: var(--sc-inset); }
.prose figure { margin: 30px 0; }
.prose figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--sc-ink-2); }

/* Tables: ```table blocks and Markdown tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.table-wrap th, .table-wrap td { min-width: 120px; padding: 11px 14px; border-bottom: 1px solid var(--sc-rule); text-align: left; vertical-align: top; }
.table-wrap th + th, .table-wrap td + td { border-left: 1px solid var(--sc-rule); }
.table-wrap th { background: var(--sc-inset); font-weight: 600; color: var(--sc-ink); }
.table-wrap td:first-child { font-weight: 600; color: var(--sc-ink); }
.table-wrap tr:last-child td { border-bottom: 0; }

/* YouTube: a thumbnail link until someone presses play (see blog.js) */
.video-embed { margin: 30px 0; }
.video-embed-link, .video-embed iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 0; border-radius: var(--sc-r-3); background: #000; }
.video-embed-link img { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; opacity: .9; transition: opacity var(--sc-base) var(--sc-ease); }
.video-embed-link:hover img { opacity: 1; }
.video-embed-play { position: absolute; top: 50%; left: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(0, 0, 0, .78); transition: background var(--sc-fast) var(--sc-ease); }
.video-embed-play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -9px 0 0 -6px; border-style: solid; border-width: 9px 0 9px 16px; border-color: transparent transparent transparent #fff; }
.video-embed-link:hover .video-embed-play { background: #000; }

/* ---------- FAQ, author, CTA, related ---------- */
.post-faq { margin-top: 48px; border-top: 1px solid var(--sc-rule); }
.post-faq h3 { margin: 28px 0 8px; font-size: 18px; }

.post-author { display: flex; gap: 16px; align-items: flex-start; margin-top: 44px; padding: 20px; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-surface); }
.post-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.post-author p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--sc-ink-2); }
.post-author .post-author-name { margin: 0; font-weight: 600; }
.post-author-name a { color: var(--sc-ink); }
.post-author-name span { margin-left: 8px; font-weight: 400; color: var(--sc-ink-2); }

.post-cta { margin-top: clamp(48px, 7vw, 72px); padding: clamp(24px, 4vw, 40px); border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-inset); }
.post-cta h2 { max-width: 620px; margin: 0; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.1; letter-spacing: -0.02em; }
.post-cta p { max-width: 600px; margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--sc-ink-2); }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.post-related { margin-top: clamp(48px, 7vw, 72px); }
.post-related h2 { margin: 0 0 20px; font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; }

/* ---------- Listings ---------- */
.blog-header { max-width: 760px; padding: clamp(40px, 6vw, 68px) 0 30px; }
.post-breadcrumb + .blog-header { padding-top: 18px; }
.blog-header h1 { margin: 14px 0 0; font-size: clamp(34px, 5.4vw, 54px); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.blog-header p:not(.eyebrow) { max-width: 620px; margin: 16px 0 0; font-size: 16.5px; line-height: 1.6; color: var(--sc-ink-2); text-wrap: pretty; }
.blog-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.blog-categories a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--sc-rule); border-radius: var(--sc-pill); background: var(--sc-surface); font-size: 12.5px; font-weight: 500; color: var(--sc-ink-2); }
.blog-categories a:hover { border-color: var(--sc-rule-2); color: var(--sc-ink); text-decoration: none; }
.blog-categories a[aria-current="page"] { border-color: var(--sc-sel); background: var(--sc-sel-soft); color: var(--sc-sel); }

.blog-author { display: flex; gap: 20px; align-items: flex-start; }
.blog-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.blog-author .blog-author-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }

.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.post-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sc-rule); border-radius: var(--sc-r-3); background: var(--sc-surface); box-shadow: var(--sc-lift); transition: border-color var(--sc-base) var(--sc-ease); }
.post-card:hover { border-color: var(--sc-rule-2); }
.post-card-image { display: block; aspect-ratio: 1200 / 630; overflow: hidden; border-bottom: 1px solid var(--sc-rule); background: var(--sc-inset); }
.post-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.post-card-category { position: relative; z-index: 1; align-self: flex-start; color: var(--sc-ink-2); }
.post-card-title { margin: 2px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
.post-card-title a { color: var(--sc-ink); }
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card-title a { text-decoration: underline; text-underline-offset: 3px; }
.post-card-body p { display: -webkit-box; margin: 0; overflow: hidden; font-size: 13.5px; line-height: 1.55; color: var(--sc-ink-2); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.post-card time { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--sc-ink-2); }

@media (min-width: 600px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .post-card-featured { grid-column: 1 / -1; flex-direction: row; }
  .post-card-featured .post-card-image { flex: 0 0 55%; border-right: 1px solid var(--sc-rule); border-bottom: 0; }
  .post-card-featured .post-card-body { justify-content: center; padding: 28px 32px; }
  .post-card-featured .post-card-title { font-size: clamp(24px, 3vw, 32px); }
}
@media (min-width: 900px) {
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.blog-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--sc-rule); font-size: 13.5px; color: var(--sc-ink-2); }
.blog-pagination a { font-weight: 500; }

/* ---------- 404 ---------- */
.blog-missing { padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(24px, 4vw, 40px); }
.blog-missing h1 { margin: 14px 0 0; font-size: clamp(34px, 5.4vw, 54px); line-height: 1.05; letter-spacing: -0.03em; }
.blog-missing > p:not(.eyebrow) { margin: 14px 0 0; font-size: 16.5px; color: var(--sc-ink-2); }

/* ---------- Footer ---------- */
.blog-footer { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: clamp(48px, 7vw, 72px); padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--sc-rule); font-size: 12.5px; color: var(--sc-ink-2); }
.blog-footer span { margin-right: auto; }
.blog-footer a { color: var(--sc-ink-2); }
.blog-footer a:hover { color: var(--sc-ink); }

@media (max-width: 640px) {
  .blog-page .nav-right { gap: 12px; }
  .blog-footer span { flex-basis: 100%; }
  .prose { font-size: 16px; }
  .post-header { padding-bottom: 22px; }
  .post-cta-actions { flex-direction: column; align-items: stretch; }
}
