/**
 * Content-page widths: the rules Jim set on the main site (emergentskills.com, 27 Nov 2026), carried over to the
 * content pages here. Each page body brings its own styles scoped by an id (#es-dr on Home, #es-price on Pricing,
 * and so on), so these rules use !important to win over them.
 *
 * 1. Text fills its column: no narrower "reading column" for paragraphs, lists, intros and callouts.
 * 2. From 1200px screens the section column widens to the header's width, 1320px. Text keeps its design size.
 * 3. Illustrations stay at most 1040px wide, centred.
 * 4. Two-column layouts stay two columns; only the outer column widens.
 * 5. In-page links land about 32px below the pinned header (and below the admin toolbar when signed in).
 * Headings keep their own limits, and app screens (forms, results, My work) keep their layouts.
 */

/* 1. Text fills the column. The Help search box and its note keep the search box's width. */
:is(#es-dr, #es-about, #es-how, #es-checks-hub, #es-price, #es-help, #es-contact, #es-review-ai, #es-terms, #es-privacy) :is(p, ul, ol, blockquote):not(.hp-search-note),
#es-dr :is(.dr-intro, .dr-company-head, .dr-status, .dr-tour-text),
#es-about :is(.ab-intro, .ab-read),
#es-how :is(.hw-intro, .hw-tour-text),
#es-price :is(.pr-co-intro, .pr-pitch-intro),
#es-review-ai :is(.xd-faq, .xd-pullquote) { max-width: none !important; }

/* 2. Wide screens: the section column matches the header container's 1320px. */
@media (min-width: 1200px) {
  #es-dr .dr-wrap, #es-about .ab-wrap, #es-how .hw-wrap, #es-price .pr-wrap, #es-help .hp-wrap, #es-contact .ct-wrap,
  :is(#es-checks-hub, #es-review-ai) .xd-wrap,
  #es-terms :is(.tos-layout, .tos-intro-grid), #es-privacy :is(.pp-layout, .pp-intro-grid),
  .es-main--inner:has(#es-contact) .field--name-field-webform { max-width: 1320px !important; }

  /* 3. Illustrations keep their size, centred (after rule 1, which would otherwise let them fill the column). */
  #es-dr p.dr-figure, :is(#es-dr, #es-how) figure:has(img) { max-width: 1040px !important; margin-left: auto !important; margin-right: auto !important; }
  #es-dr p.dr-figure img, :is(#es-dr, #es-how) figure:has(img) img { max-width: 100%; height: auto; }
}

/* 5. In-page links land below the pinned header: 55px on phones, 135px on desktop (header plus the top bar; measured
   27 Nov 2026 after the 90px logo and .25rem navbar padding in app.css),
   plus the admin toolbar when signed in, plus 32px so the small label above a heading stays in view.
   !important: Drupal's toolbar writes its own inline scroll-padding-top (toolbar height only).
   The content pages' own scroll-margin offsets are dropped so the gap isn't counted twice. */
:root { --es-pin-h: 55px; }
@media (min-width: 992px) { :root { --es-pin-h: 135px; } }
html { scroll-padding-top: calc(var(--drupal-displace-offset-top, 0px) + var(--es-pin-h) + 32px) !important; }
:is(#es-dr, #es-about, #es-how, #es-checks-hub, #es-price, #es-help, #es-contact, #es-review-ai, #es-terms, #es-privacy) :is(*, *::before) { scroll-margin-top: 0 !important; }
