/* Page composition: parent-owned gaps; Layout retains the horizontal rail. */
.theme-scope .content-page { --content-gap: var(--rhythm-section); display: grid; gap: var(--content-gap); min-width: 0; width: 100%; }
.theme-scope .content-page--block { --content-gap: var(--rhythm-block); }
.theme-scope .content-page--subsection { --content-gap: var(--rhythm-subsection); }
.theme-scope .content-page--text { max-width: var(--text); margin-inline: auto; }
.theme-scope .content-page > * { min-width: 0; margin-block: 0; }

.theme-scope .content-section { display: grid; gap: var(--rhythm-body); min-width: 0; margin: 0; }
.theme-scope .content-section-heading > :is(h1,h2,h3) { margin: 0; padding: 0; border: 0; line-height: 1.2; }
.theme-scope .content-section-body { display: grid; gap: var(--rhythm-body); min-width: 0; }
.theme-scope .content-section-body > * { margin-block: 0; }

.theme-scope .page-header { display: grid; gap: var(--rhythm-block); min-width: 0; width: 100%; }
.theme-scope .page-header > .page-header-rail { min-width: 0;  }
.theme-scope .page-header > .page-header-intro { display: grid; gap: var(--rhythm-tight); min-width: 0; }
.theme-scope .page-header .page-header-intro > :is(h1,p) { margin: 0; padding: 0; }
.theme-scope .page-header .page-header-intro > h1 { line-height: 1.12; }
.theme-scope .page-header .page-header-sections > nav { display: flex; flex-wrap: wrap; gap: var(--rhythm-tight) var(--rhythm-body); margin: 0; font-size: var(--type-meta); }
.theme-scope .page-header .page-header-sections > nav > a { display: inline-flex; align-items: center; min-height: 2rem; }
.theme-scope .page-header :is(.page-header-metadata, .page-header-description) { display: grid; gap: var(--rhythm-tight); min-width: 0; }
.theme-scope .page-header :is(.page-header-metadata, .page-header-description) > * { margin-block: 0; }

.theme-scope .record-back { font-size: var(--type-meta); }
.theme-scope .record-content { display: grid; gap: var(--rhythm-block); min-width: 0; overflow-wrap: anywhere; }
.theme-scope .record-content > * { min-width: 0; margin-block: 0; }
.theme-scope .record-content > :is(section, .record-actions) { display: grid; gap: var(--rhythm-body); }
.theme-scope .record-content > section > * { margin-block: 0; }
.theme-scope .record-content > .rich-text > :first-child { margin-block-start: 0; }
.theme-scope .record-content > .rich-text > :last-child { margin-block-end: 0; }
.theme-scope .record-content > dl { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(0, 3fr); gap: var(--rhythm-tight) var(--rhythm-body); }
.theme-scope .record-content > dl > dt { font-weight: 600; }
.theme-scope .record-content > dl > dd { margin: 0; }
.theme-scope .record-tags { display: flex; flex-wrap: wrap; gap: var(--rhythm-tight); }
@media (max-width: 30rem) {
  .theme-scope .record-content > dl { grid-template-columns: 1fr; }
  .theme-scope .record-content > dl > dd + dt { margin-block-start: var(--rhythm-tight); }
}

/* A surface and its control palette are one explicit composition choice. */
.theme-scope .content-page--article { width: 100%; max-width: var(--article-width); margin-inline: auto; }
.theme-scope .content-page--wide { width: 100%; max-width: var(--wide); margin-inline: auto; }
.theme-scope .content-surface { padding: var(--surface-inset); }
.theme-scope .content-surface.control-surface-boxed { background: var(--surface-paper); }
.theme-scope .content-surface.control-surface-page { background: transparent; }
.theme-scope .content-surface :is(.listing-list, .issue-list) { margin-bottom: 0; }
.theme-scope .content-surface .listing-list { gap: var(--rhythm-subsection); }

.theme-scope .pd-accordion-stack { display: grid; gap: .5rem; min-width: 0; }
.theme-scope details.pd-accordion { padding: 0; margin: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-primary); box-shadow: inset 0 0 0 1px var(--color-border); min-width: 0; }
.theme-scope .pd-accordion > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; padding: .625rem .875rem; margin: 0; list-style: none; cursor: pointer; font: inherit; font-weight: 600; line-height: 1.4; color: var(--color-text-primary); background: var(--color-interaction-selected); border-radius: inherit; box-shadow: inset 0 0 0 1px var(--color-border); }
.theme-scope .pd-accordion > summary::-webkit-details-marker { display: none; }
.theme-scope .pd-accordion > summary::after { content: none; }
.theme-scope .pd-accordion > summary:hover { background: var(--color-interaction-hover); }
.theme-scope .pd-accordion > summary:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }
.theme-scope .pd-accordion > summary svg { width: 1rem; height: 1rem; flex: 0 0 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-scope .pd-accordion[open] > summary { box-shadow: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.theme-scope .pd-accordion[open] > summary svg { transform: rotate(180deg); }
.theme-scope .pd-accordion-body { padding: .875rem; overflow-wrap: anywhere; }
.theme-scope .pd-accordion-body > :first-child { margin-top: 0; }
.theme-scope .pd-accordion-body > :last-child { margin-bottom: 0; }

/* Ruled-record variant: the surrounding record owns the outer border. */
.theme-scope details.pd-accordion-lined { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.theme-scope .pd-accordion-lined > summary { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: var(--space-gap-md); font-size: var(--type-supporting); }
.theme-scope .pd-accordion-lined[open] > summary { border-bottom: 1px solid var(--color-grid-rule); }
.theme-scope .pd-accordion-lined > .pd-accordion-body { padding: var(--space-gap-md); }


  .source-credits { min-width: 0; overflow-wrap: anywhere; }
  .source-credits a { color: inherit; font-size: inherit; }
  .source-separator { margin-inline: .5rem; }
  .theme-scope .source-credits a.source-with-arrow { display: inline-flex; align-items: baseline; gap: .25em; text-decoration: none; }
  .source-with-arrow .source-label { text-decoration: underline 1px var(--color-link-underline); text-underline-offset: .2em; }
  .source-with-arrow:hover .source-label { text-decoration-thickness: 2px; }
