/* Generic page — editorial prose + "On this page" TOC. The `#pg-*` responsive rules govern the
   stacked layout. Enqueued on pages using this template. */

/* prose (the_content) styling */
:is(#pg-prose, .twm-id--pg-prose) > *:first-child, :is(#pg-prose, .twm-id--pg-prose) > h2.wp-block-heading:first-child { margin-top: 0; }
:is(#pg-prose, .twm-id--pg-prose) h2, :is(#pg-prose, .twm-id--pg-prose) h2.wp-block-heading { margin: 44px 0 0; scroll-margin-top: 110px; font-family: var(--font-headline); font-style: italic; font-weight: 400; font-size: 30px; line-height: 40px; letter-spacing: 1px; color: var(--text-body); }
:is(#pg-prose, .twm-id--pg-prose) h3, :is(#pg-prose, .twm-id--pg-prose) h3.wp-block-heading { margin: 32px 0 0; font-family: var(--font-headline); font-weight: 400; font-size: 22px; line-height: 30px; letter-spacing: 0.5px; }
:is(#pg-prose, .twm-id--pg-prose) p { margin: 20px 0 0; font-family: var(--font-soft); font-weight: 400; font-size: 16px; line-height: 24px; letter-spacing: 0.2px; text-wrap: pretty; }
:is(#pg-prose, .twm-id--pg-prose) a { color: var(--text-body); text-decoration: underline; text-underline-offset: 3px; }
/* pull-quote → border-top italic call-out */
:is(#pg-prose, .twm-id--pg-prose) blockquote, :is(#pg-prose, .twm-id--pg-prose) .wp-block-quote { margin: 44px 0 0; border: 0; border-top: 1px solid var(--twm-ink); padding: 26px 0 0; }
:is(#pg-prose, .twm-id--pg-prose) blockquote p { margin: 0; max-width: 600px; font-family: var(--font-headline); font-style: italic; font-weight: 400; font-size: 30px; line-height: 40px; letter-spacing: 1px; text-wrap: pretty; }
:is(#pg-prose, .twm-id--pg-prose) ul, :is(#pg-prose, .twm-id--pg-prose) ol { margin: 22px 0 0; padding: 0 0 0 1.1em; font-family: var(--font-soft); font-size: 16px; line-height: 24px; letter-spacing: 0.2px; display: flex; flex-direction: column; gap: 14px; }
:is(#pg-prose, .twm-id--pg-prose) img { max-width: 100%; height: auto; }

/* TOC links */
:is(#pg-toc, .twm-anchor--pg-toc) a { padding: 11px 0; border-top: 1px solid var(--twm-hairline); font-family: var(--font-headline); font-weight: 400; font-size: 22px; line-height: 30px; letter-spacing: 0.5px; color: var(--text-body); text-decoration: none; transition: opacity .2s ease; }
:is(#pg-toc, .twm-anchor--pg-toc) a:hover { opacity: 0.55; }

@media (max-width: 1024px) {
	:is(#pg-head, .twm-anchor--pg-head), :is(#pg-body, .twm-anchor--pg-body) { padding-left: 24px !important; padding-right: 24px !important; max-width: none !important; }
	:is(#pg-head, .twm-anchor--pg-head) { padding-top: 150px !important; }
	:is(#pg-title, .twm-id--pg-title) { font-size: 30px !important; line-height: 40px !important; letter-spacing: 1px !important; }
	:is(#pg-body, .twm-anchor--pg-body) { grid-template-columns: 1fr !important; gap: 40px !important; padding-top: 48px !important; }
	/* the "On this page" TOC sits ABOVE the prose when the layout stacks (tablet/mobile);
	   order:-1 lifts it from its source-order position below. */
	:is(#pg-aside, .twm-anchor--pg-aside) { position: static !important; width: auto !important; max-width: 640px !important; order: -1 !important; }
	:is(#pg-aside, .twm-anchor--pg-aside) nav { flex-direction: row !important; flex-wrap: wrap !important; gap: 10px 28px !important; margin-top: 12px !important; }
	:is(#pg-aside, .twm-anchor--pg-aside) nav a { padding: 0 !important; border-top: 0 !important; border-bottom: 1px solid var(--twm-hairline) !important; font-size: 12px !important; line-height: 16.8px !important; letter-spacing: 2px !important; text-transform: uppercase !important; }
	:is(#pg-prose, .twm-id--pg-prose) { max-width: 640px !important; }
}
@media (max-width: 640px) {
	:is(#pg-head, .twm-anchor--pg-head), :is(#pg-body, .twm-anchor--pg-body) { padding-left: 18px !important; padding-right: 18px !important; }
	:is(#pg-head, .twm-anchor--pg-head) { padding-top: 128px !important; }
	:is(#pg-title, .twm-id--pg-title) { font-size: 22px !important; line-height: 30px !important; letter-spacing: 0.5px !important; }
	:is(#pg-body, .twm-anchor--pg-body) { padding-top: 44px !important; }
	:is(#pg-prose, .twm-id--pg-prose) { max-width: none !important; }
	:is(#pg-prose, .twm-id--pg-prose) h2 { font-size: 22px !important; line-height: 30px !important; letter-spacing: 0.5px !important; }
}

/* ---- base geometry (core-block build) ---- */
:is(#pg-head, .twm-anchor--pg-head) { max-width: 1360px; box-sizing: border-box; margin: 0 auto; padding: 206px 80px 0; }
.pg-crumb { display: flex; align-items: baseline; gap: 8px; font-family: 'proxima-nova', var(--font-sans); font-weight: 400; font-size: 12px; line-height: 16.8px; letter-spacing: 2px; text-transform: uppercase; color: var(--twm-secondary); }
.pg-crumb :is(p, h1) { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.pg-crumb a { color: var(--twm-secondary); text-decoration: none; }
.pg-crumb .twm-slash { opacity: 0.6; }
.pg-crumb .pg-crumb-here { color: var(--text-body); }
:is(#pg-title, .twm-id--pg-title) { margin: 22px 0 0; max-width: 900px; font-family: var(--font-headline); font-weight: 400; font-size: 48px; line-height: 60px; letter-spacing: 1.5px; text-wrap: pretty; }
.pg-stand, .pg-stand p { margin: 0; max-width: 680px; font-family: var(--font-soft); font-weight: 400; font-size: 16px; line-height: 24px; letter-spacing: 0.2px; color: var(--twm-secondary); text-wrap: pretty; }
.pg-stand { margin-top: 26px; }
:is(#pg-body, .twm-anchor--pg-body) { max-width: 1360px; box-sizing: border-box; margin: 0 auto; padding: 80px 80px 0; display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 80px; align-items: start; }
:is(#pg-prose, .twm-id--pg-prose) { max-width: 720px; margin: 0; display: block; }
:is(#pg-aside, .twm-anchor--pg-aside) { position: sticky; top: 110px; width: 280px; margin: 0; }
.pg-aside-label { margin: 0; font-family: 'proxima-nova', var(--font-sans); font-weight: 400; font-size: 12px; line-height: 16.8px; letter-spacing: 2px; text-transform: uppercase; color: var(--twm-secondary); }
:is(#pg-toc, .twm-anchor--pg-toc) { margin-top: 14px; display: flex; flex-direction: column; }
