/* Single post only (loaded by inc/post.php). Tokens come from style.css. */

/* Header */
.post-head .entry-title { padding-top: 0; overflow-wrap: anywhere; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--lg-line); font-size: 15px; }
.byline .note { display: inline-flex; padding: 4px 10px; border-radius: var(--lg-r-sm); background: var(--lg-surface); box-shadow: inset 0 0 0 1px var(--lg-line); font-size: var(--lg-text-sm); }

/* Grid: centered column; the two gutters exist only when the viewer gets ad slots, and only from 1280px */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); max-width: calc(var(--lg-read) + 2 * var(--lg-pad)); margin-inline: auto; padding-inline: var(--lg-pad); }
.post-col { min-width: 0; }
.lg-ad--gutter-left, .lg-ad--gutter-right { display: none; }
@media (min-width: 1280px) {
	.post-grid.has-gutters { grid-template-columns: var(--lg-ad-gutter) minmax(0, var(--lg-read)) var(--lg-ad-gutter); column-gap: var(--lg-ad-gap); max-width: none; justify-content: center; }
	.has-gutters .post-col { grid-column: 2; grid-row: 1; }
	.has-gutters .lg-ad--gutter-left { display: block; grid-column: 1; grid-row: 1; padding-top: var(--lg-ad-top); }
	.has-gutters .lg-ad--gutter-right { display: block; grid-column: 3; grid-row: 1; padding-top: var(--lg-ad-top); }
	.lg-ad--gutter-left .lg-ad__in, .lg-ad--gutter-right .lg-ad__in { position: sticky; top: var(--lg-ad-top); }
}

/* Ad slots: label above, fixed box below (reserved height, no layout shift); nothing ever overlays the text */
.lg-ad__l { display: block; height: 20px; font-size: 12px; line-height: 20px; font-weight: 600; color: var(--lg-muted); }
.lg-ad__box { overflow: hidden; height: var(--lg-ad-inline-h); }
.lg-ad--gutter-left .lg-ad__box, .lg-ad--gutter-right .lg-ad__box { height: var(--lg-ad-gutter-h); width: var(--lg-ad-gutter); }
.prose .lg-ad--after-intro, .prose .lg-ad--mid-article { margin-block: 40px; }
@media (max-width: 639px) { .lg-ad--after-intro .lg-ad__box, .lg-ad--mid-article .lg-ad__box { height: 250px; } }
.lg-ad ins { display: block; width: 100%; height: 100%; }
.lg-ad ins[data-ad-status="unfilled"] { display: none; }
.lg-ad:has(ins[data-ad-status="unfilled"]) .lg-ad__l { visibility: hidden; }
.lg-ad.is-preview .lg-ad__box { display: grid; place-items: center; background: var(--lg-ad-ground); border: 1px dashed #8A8880; border-radius: var(--lg-r-sm); color: var(--lg-muted); font-size: 13px; text-align: center; padding: 8px; }

/* Body content */
.prose { padding-block: 8px 24px; }
.prose h2, .prose h3 { scroll-margin-top: 24px; }
.prose img, .prose iframe, .prose video { max-width: 100%; }
.prose figure[class], .prose figure { display: block; max-width: 100%; } /* core makes aligned figures display:table, which sizes to the inline image width */
.prose img { height: auto !important; } /* the block editor writes fixed width/height inline; scale instead of overflowing */
.prose pre { overflow-x: auto; max-width: 100%; }
.prose .wp-block-table { margin-inline: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--lg-line); border-radius: var(--lg-r-md); background: var(--lg-surface); }
.table-wrap:focus-visible { outline-offset: 3px; }
.table-wrap table { display: table; width: 100%; overflow: visible; }
.table-wrap th, .table-wrap td { min-width: 7em; }
.table-wrap tbody tr:last-child th, .table-wrap tbody tr:last-child td { border-bottom: 0; }

.toc { border: 1px solid var(--lg-line); border-radius: var(--lg-r-md); background: var(--lg-surface); }
.toc summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 17px; }
.toc ol { margin: 0; padding: 0 20px 18px 42px; font-size: 17px; line-height: 1.5; }
.toc ol ol { padding: 6px 0 0 20px; font-size: 16px; }
.toc li + li { margin-top: 6px; }
.toc a { text-decoration: none; overflow-wrap: anywhere; }
.toc a:hover { text-decoration: underline; }

.legal-note { margin-top: 8px; font-size: 15px; color: var(--lg-muted); padding-left: 18px; border-left: 3px double var(--lg-ink); }

/* Author box and related reading */
.author { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 24px; margin-top: 40px; border-radius: var(--lg-r-lg); background: var(--lg-surface); box-shadow: inset 0 0 0 1px var(--lg-line); }
.author .av { width: 56px; height: 56px; border-radius: 50%; background: var(--lg-ink); color: var(--lg-paper); display: grid; place-items: center; font: 600 24px var(--lg-font-display); }
.author h2 { font-size: 20px; letter-spacing: -.01em; }
.author p { font-size: var(--lg-text-ui); margin-top: 6px; }
.author .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 15px; font-weight: 600; }
.related { padding-block: 56px 72px; }
.related > h2 { font-size: var(--lg-text-h3); }
.rel-grid { display: grid; margin-top: 24px; border-top: 1.5px solid var(--lg-ink); }
.rel-grid a { display: block; padding: 20px 0; border-bottom: 1px solid var(--lg-line); text-decoration: none; }
.rel-grid h3 { font-size: var(--lg-text-h4); margin-top: 6px; overflow-wrap: anywhere; }
.rel-grid a:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (min-width: 900px) { .rel-grid { grid-template-columns: repeat(3, 1fr); column-gap: 32px; } }

/* core Button block in posts (e.g. converted Spectra download buttons): same look as .btn */
.prose .wp-block-button__link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: var(--lg-r-md); background: var(--lg-accent); color: var(--lg-accent-text); font-weight: 600; font-size: var(--lg-text-ui); text-decoration: none; }
.prose .wp-block-button__link:hover { background: var(--lg-accent-hover); color: var(--lg-accent-text); }
