/* Shared alignment contract. The outer .container stays at its existing 80rem
   maximum with responsive side gutters. Text alignment and track placement
   are separate: centred reading tracks still contain start-aligned prose. */
:where(.section-overview,.market-page,.media-library,.library-page,.company-page,.academy-page,.publication-submission,.global-search){min-width:0}

/* Browsing pages start on the same left-hand axis as their results. */
.section-overview .overview-header{width:100%;max-width:none;margin:1.5rem 0 3rem;text-align:start}
.section-overview .overview-header>p{max-width:65ch}
:is(.market-header,.library-header,.media-heading,.knowledge-directory-heading,.academy-header,.company-header){text-align:start}

/* Individual profiles, programme details and forms share the 960px detail
   track. Their facts and prose remain left aligned; split layouts stay split. */
.market-page:has(.market-provider-detail),
.market-page:has(.market-study-detail),
.company-page-profile,
.publication-submission,
main>.page-heading:has(+.inhouse-enquiry),
main>.inhouse-enquiry,
main>.inhouse-enquiry+p{width:100%;max-width:var(--detail-wide-max);margin-inline:auto}
.market-page:has(.market-provider-detail)>.market-header,
.market-page:has(.market-study-detail)>.market-header,
.company-page-profile>.company-header{max-width:none}

/* Institutional reading pages use the established 900px prose track. */
.company-page-about,.company-page-legal{width:100%;max-width:var(--reading-max);margin-inline:auto}
.academy-page-certification>.academy-header{width:100%;max-width:var(--reading-max);margin-inline:auto}
.global-search{width:100%;max-width:65rem;margin-inline:auto}

/* Centred article/book/seminar titles and their existing 704/900px prose
   measures are owned by reading.css. Do not expand them to directory width. */
@media(max-width:48rem){.section-overview .overview-header{margin-block:1rem 2.5rem}}

/* Avoid stacking heading padding, title margin and intro margin on older directories. */
.knowledge-page-heading:has(+.generic-content>.content-intro){padding-bottom:0}
.knowledge-page-heading:has(+.generic-content>.content-intro) h1{margin-bottom:0}
.knowledge-page-heading+.generic-content:has(>.content-intro){margin-top:1.25rem}

/* Shared dialog shell: content types keep their appropriate maximum width,
   while gutters, backdrop and corner treatment use a single contract. */
dialog.knowledge-image-viewer{--dialog-max-width:90rem}
dialog.article-saved-dialog{--dialog-max-width:44rem}
:is(dialog.knowledge-image-viewer,dialog.media-dialog,dialog.visitor-dialog,dialog.article-saved-dialog){width:min(var(--dialog-max-width,70rem),calc(100% - 2 * var(--dialog-gutter)));max-width:none;max-height:calc(100dvh - 2 * var(--dialog-gutter));border-radius:var(--dialog-radius)}
:is(dialog.knowledge-image-viewer,dialog.media-dialog,dialog.visitor-dialog,dialog.article-saved-dialog)::backdrop{background:var(--dialog-backdrop)}
:is(dialog.knowledge-image-viewer,dialog.media-dialog,dialog.visitor-dialog,dialog.article-saved-dialog) :is(.knowledge-image-viewer__close,.media-dialog__close,.visitor-close,.article-saved-dialog__close):focus-visible{outline:0;box-shadow:none;background:var(--color-focus-surface);border-radius:50%}
/* Video geometry follows the same shell instead of assuming viewport width. */
dialog.media-dialog{--media-dialog-width:min(70rem,calc(100vw - 2 * var(--dialog-gutter)))}
