/* The blog: a listing at /blog and long-form posts at /blog/<slug>.
   Reading scale after moxby.com/blog (18px body on a 32px line, 780px measure,
   a 280px sticky "On this page" rail), in ShowShot's own tokens. The post body
   reads on the light chapter (.lite) between a dark hero and the dark close. */

/* ---------- listing ---------- */
.blog-hero { padding: clamp(4rem, 8vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem); position: relative; overflow: clip; }
.blog-hero::after { content: ""; position: absolute; right: -10%; top: -20%; width: 46rem; height: 46rem; border-radius: 50%; border: 1px solid var(--line); opacity: .6; pointer-events: none; }
.blog-hero h1 { font-size: clamp(3rem, 7.4vw, 6.2rem); line-height: .96; letter-spacing: -.04em; font-weight: 600; max-width: 14ch; }
.blog-hero h1 em { font-style: normal; color: var(--accent); }
.blog-hero .lede { margin-top: 1.4rem; max-width: 46ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: var(--t-label); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-lift); margin-bottom: 1.2rem; }
.eyebrow i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(255,67,56,.7); }

.featured { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(2rem, 4vw, 3.5rem) 0; }
.featured__media { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-2); background: var(--ink-1); box-shadow: 0 2.5rem 5rem -2.5rem rgba(0,0,0,.9); }
.featured__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.featured__copy h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); line-height: 1.04; letter-spacing: -.03em; font-weight: 600; margin-top: .4rem; }
.featured__copy h2 a { color: inherit; text-decoration: none; }
.featured__copy h2 a:hover { color: var(--accent-lift); }
.featured__copy p { margin-top: 1rem; color: var(--fg-2); font-size: 1.05rem; line-height: 1.6; max-width: 48ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: 1.1rem; font-size: var(--t-small); color: var(--fg-3); }
.post-meta b { color: var(--fg-2); font-weight: 500; }
.read-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.3rem; font-weight: 600; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: .15rem; }
.read-more:hover { color: var(--accent-lift); }

.blog-list { padding: clamp(3rem, 6vw, 5rem) 0 clamp(3rem, 5vw, 5rem); }
.blog-list .hd { display: flex; align-items: end; justify-content: space-between; gap: 1rem; max-width: none; flex-wrap: wrap; }
.blog-list .hd h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.03em; }
.cats { display: flex; gap: .4rem; flex-wrap: wrap; }
.cats button, .cats a { font: inherit; font-size: .8rem; font-weight: 600; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); cursor: pointer; text-decoration: none; }
.cats [aria-pressed="true"], .cats [aria-current] { background: var(--fg); color: var(--ink-0); border-color: var(--fg); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.post-grid > [data-instatic-loop] { display: contents; } /* the CMS wraps a loop's cards in one div; the cards must be the grid's items */
/* the listing reads two across with larger titles (the related-posts grid below a post stays three across) */
.blog-list .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 27rem), 1fr)); gap: 1.5rem; margin-top: 2.25rem; }
.blog-list .post-card__body { padding: 1.5rem 1.6rem 1.6rem; }
.blog-list .post-card h3 { font-size: clamp(1.4rem, 1.9vw, 1.75rem); line-height: 1.12; letter-spacing: -.025em; }
.blog-list .post-card p { font-size: 1rem; line-height: 1.6; margin-top: .75rem; }
.post-card { display: flex; flex-direction: column; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--ink-1); overflow: hidden; transition: border-color .2s, transform .2s; }
.post-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ink-2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.post-card .cat { font-family: var(--mono); font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-lift); }
.post-card h3 { margin-top: .6rem; font-size: 1.28rem; line-height: 1.25; letter-spacing: -.02em; font-weight: 600; }
.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a:hover { color: var(--accent-lift); }
.post-card p { margin-top: .6rem; color: var(--fg-3); font-size: .95rem; line-height: 1.55; }
.post-card .post-meta { margin-top: auto; padding-top: 1rem; }
.post-card .read-more { margin-top: .9rem; align-self: flex-start; font-size: .9rem; }
.post-card[hidden] { display: none; }

/* ---------- post ---------- */
.post-hero { padding: clamp(3rem, 6vw, 5rem) 0 0; text-align: center; }
.post-hero .back { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--t-small); color: var(--fg-3); text-decoration: none; margin-bottom: 1.6rem; }
.post-hero .back:hover { color: var(--fg); }
.post-hero .eyebrow { justify-content: center; display: flex; }
.post-hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: .98; letter-spacing: -.04em; font-weight: 600; max-width: 20ch; margin: 0 auto; }
.post-hero .dek { margin: 1.4rem auto 0; max-width: 56ch; font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--fg-2); }
.post-hero .post-meta { justify-content: center; margin-top: 1.5rem; }
.post-hero .post-meta .avatar { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); display: inline-grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; margin-right: .5rem; vertical-align: middle; }
.post-cover { margin: clamp(2rem, 4vw, 3.5rem) auto 0; max-width: 62rem; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 3rem 6rem -3rem rgba(0,0,0,.9); transform: translateY(clamp(1.5rem, 4vw, 3.5rem)); position: relative; z-index: 2; }
.post-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.post-body-sec { padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17.5rem; gap: clamp(2rem, 6vw, 6rem); align-items: start; max-width: 70rem; margin: 0 auto; }
.post-rail { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: 1.1rem; }
.toc { border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.1rem 1.2rem; background: var(--ink-1); }
.toc h4 { font-family: var(--mono); font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: .75rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.toc a { display: block; padding: .35rem .6rem; border-radius: .45rem; font-size: .86rem; line-height: 1.35; color: var(--fg-2); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { color: var(--fg); background: var(--glass); }
.toc a.is-on { color: var(--fg); border-left-color: var(--accent); background: var(--glass); }
.toc a.lvl3 { padding-left: 1.3rem; font-size: .8rem; }
.rail-cta { border-radius: var(--r-l); padding: 1.2rem 1.25rem 1.3rem; background: var(--ink-0); color: var(--fg); border: 1px solid var(--line); }
.lite .rail-cta { background: #151110; color: #f8f4ef; border-color: transparent; }
.rail-cta b { display: block; font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; }
.rail-cta p { margin-top: .5rem; font-size: .86rem; line-height: 1.5; color: #b3aba4; }
.rail-cta .btn { margin-top: .9rem; width: 100%; }
.rail-share { display: flex; gap: .5rem; flex-wrap: wrap; }
.rail-share a, .rail-share button { font: inherit; font-size: .8rem; font-weight: 600; padding: .5rem .8rem; border-radius: .6rem; border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); cursor: pointer; text-decoration: none; }
.rail-share a:hover, .rail-share button:hover { color: var(--fg); border-color: var(--fg-3); }

.prose { max-width: 48rem; font-size: 1.08rem; line-height: 1.78; color: var(--fg-2); }
.lite .prose { color: #2b2734; }
.prose > * + *, .prose :where([data-instatic-content-region]) > * + * { margin-top: 1.45rem; } /* the CMS wraps the body in its own main; :where keeps the heading margins below winning */
.prose h2 { font-size: clamp(1.75rem, 2.9vw, 2.6rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; color: var(--fg); margin-top: 3.6rem; margin-bottom: 1.3rem; scroll-margin-top: 6rem; }
.prose h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; color: var(--fg); margin-top: 2.6rem; margin-bottom: 1rem; scroll-margin-top: 6rem; }
.prose h4 { font-size: 1.15rem; font-weight: 600; color: var(--fg); margin-top: 2rem; }
.prose p strong, .prose li strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .18em; }
.prose a:hover { color: var(--accent-lift); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 2.2rem 0; padding: .4rem 0 .4rem 1.6rem; border-left: 3px solid var(--accent); font-size: 1.25rem; line-height: 1.7; color: var(--fg); }
.prose blockquote p + p { margin-top: 1rem; }
.prose blockquote cite { display: block; margin-top: .8rem; font-size: .9rem; font-style: normal; color: var(--fg-3); }
.prose blockquote cite::before { content: "\2014\00a0"; }
.prose figure { margin: 2.4rem 0; }
.prose figure img, .prose figure video { display: block; width: 100%; height: auto; border-radius: var(--r-l); border: 1px solid var(--line-2); }
.prose figure.wide { margin-inline: calc(-1 * clamp(0rem, 4vw, 4rem)); }
.prose figcaption { margin-top: .7rem; font-size: .82rem; line-height: 1.55; color: var(--fg-3); }
.prose .video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.prose .video iframe, .prose .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 3rem 0; }
.prose code { font-family: var(--mono); font-size: .86em; padding: .1em .4em; border-radius: .35em; background: var(--glass-2); color: var(--fg); }
.prose pre { font-family: var(--mono); font-size: .86rem; line-height: 1.6; padding: 1.1rem 1.25rem; border-radius: var(--r-l); background: #151110; color: #e9e2db; overflow: auto; border: 1px solid rgba(255,255,255,.08); }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.prose th { font-weight: 600; color: var(--fg); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
/* a table written for the CMS: div.tbl > div.tr > span cells (the CMS strips real tables) */
.prose .tbl { margin: 2rem 0; font-size: .95rem; line-height: 1.5; overflow-x: auto; }
.prose .tbl .tr { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line-2); }
.prose .tbl .tr > span { padding: .7rem .8rem; vertical-align: top; }
.prose .tbl .th > span { font-weight: 600; color: var(--fg); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.prose .callout { padding: 1.2rem 1.4rem; border-radius: var(--r-l); background: var(--ink-2); border: 1px solid var(--line); font-size: 1rem; }
.prose .callout b { color: var(--fg); }
.prose .lead { font-size: 1.3rem; line-height: 1.6; color: var(--fg); }
.post-foot { max-width: 48.75rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-2); display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: var(--t-small); color: var(--fg-3); }
.post-foot .tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.post-foot .tags span { padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line-2); }

.more-posts { padding: clamp(3rem, 6vw, 5rem) 0 0; }
.more-posts .hd { max-width: none; }
.more-posts .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }

@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .post-rail { position: static; order: -1; }
  .toc { display: none; }
  .rail-cta { display: none; }
  .prose figure.wide { margin-inline: 0; }
}
@media (max-width: 600px) {
  .blog-hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .post-hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }
  .prose { font-size: 1.05rem; line-height: 1.7; }
  .post-cover { transform: translateY(1rem); border-radius: .8rem; }
}
