/* Site-wide editorial primitives. All selectors stay inside editorial scope. */
.phc-editorial {
  min-inline-size: 0;
}

.phc-editorial__header {
  display: grid;
  gap: var(--phc-space-2);
  padding-block: var(--phc-space-3) var(--phc-space-2);
}

.phc-editorial__breadcrumbs { min-inline-size: 0; }
.phc-editorial__breadcrumbs .phc-breadcrumbs { margin: 0; }
.phc-editorial__header h1 { margin: 0; font-size: var(--phc-type-page-title-size); line-height: var(--phc-type-heading-line-height); }
.phc-editorial__meta,
.phc-plain-page-header__meta { margin: 0; color: var(--phc-pattern-text-secondary); font-size: var(--phc-type-meta-size); }
.phc-editorial__layout {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(0, var(--phc-layout-reading-width));
  gap: var(--phc-layout-editorial-section-gap);
  align-items: start;
  padding-block: var(--phc-space-2) var(--phc-layout-editorial-section-gap);
}
.phc-editorial__toc { min-inline-size: 0; }
.phc-editorial__toc-desktop { position: sticky; inset-block-start: calc(var(--phc-layout-fixed-header-offset) + var(--phc-space-2)); }
.phc-editorial__toc-title { display: block; margin-block-end: var(--phc-space-2); font-weight: var(--phc-font-weight-semibold); }
.phc-editorial__toc ol { margin: 0; padding: 0 0 0 var(--phc-space-2); border-inline-start: 2px solid var(--phc-brand-orange, #ff6d00); list-style: none; }
.phc-editorial__toc-item + .phc-editorial__toc-item { margin-block-start: var(--phc-space-1); }
.phc-editorial__toc-item--level-3 { padding-inline-start: var(--phc-space-2); }
.phc-editorial__toc a { color: var(--phc-text-secondary); font-size: var(--phc-type-meta-size); text-decoration: none; }
.phc-editorial__toc a:hover, .phc-editorial__toc a:focus-visible { color: var(--phc-link-hover); text-decoration: underline; }
.phc-editorial__toc a[aria-current="location"] { color: var(--phc-text-primary); font-weight: var(--phc-font-weight-semibold); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.phc-editorial__toc-mobile { display: none; }
.phc-editorial__prose {
  min-inline-size: 0;
  max-inline-size: var(--phc-layout-reading-width);
  color: var(--phc-text-secondary);
  font-size: var(--phc-type-body-size);
  line-height: var(--phc-type-body-line-height);
}
.phc-editorial__prose > * { max-inline-size: 100%; }
.phc-editorial__prose h2,
.phc-editorial__prose h3 { scroll-margin-block-start: calc(var(--phc-layout-fixed-header-offset) + var(--phc-space-2)); color: var(--phc-text-primary); line-height: var(--phc-type-heading-line-height); }
.phc-editorial__prose h2 { margin: var(--phc-layout-editorial-section-gap) 0 var(--phc-layout-editorial-heading-gap); font-size: var(--phc-type-section-title-size); }
.phc-editorial__prose h2:first-child { margin-block-start: 0; }
.phc-editorial__prose h3 { margin: var(--phc-layout-editorial-subsection-gap) 0 var(--phc-space-1); font-size: var(--phc-type-subsection-title-size); }
.phc-editorial__prose p { margin: 0 0 var(--phc-layout-editorial-flow); }
.phc-editorial__prose ul, .phc-editorial__prose ol { margin: 0 0 var(--phc-layout-editorial-flow); padding-inline-start: 1.35em; }
.phc-editorial__prose li + li { margin-block-start: var(--phc-space-1); }
.phc-editorial__prose > :last-child { margin-block-end: 0; }
.phc-editorial__prose a { color: var(--phc-link-color); overflow-wrap: anywhere; }
.phc-editorial__section { margin-block: var(--phc-layout-editorial-section-gap); }
.phc-editorial__note { max-inline-size: var(--phc-layout-reading-width); }

/* Legal documents use the editorial composition without changing their text. */
.phc-editorial--legal {
  padding: var(--phc-space-3);
  background: var(--phc-bg-cream);
}
.phc-editorial--legal .phc-editorial__document {
  padding: var(--phc-space-4);
  background: var(--phc-bg-white);
  border: 1px solid var(--phc-pattern-border, #e3ded4);
  border-radius: var(--phc-radius-md, 12px);
}
.phc-editorial--legal .phc-editorial__related {
  margin-block-start: var(--phc-layout-editorial-section-gap);
}
.phc-editorial--legal .phc-editorial__related h2 { margin: 0 0 var(--phc-layout-editorial-heading-gap); font-size: var(--phc-type-section-title-size); }
.phc-editorial--legal .phc-editorial__related ul { margin: 0; padding-inline-start: 1.35em; }
.phc-editorial--legal .phc-editorial__related li + li { margin-block-start: var(--phc-space-1); }

@media print {
  .phc-editorial--legal { padding: 0; background: transparent; }
  .phc-editorial--legal .phc-editorial__breadcrumbs,
  .phc-editorial--legal .phc-editorial__toc,
  .phc-editorial--legal .phc-editorial__related,
  .phc-site-header,
  .phc-site-footer { display: none !important; }
  .phc-editorial--legal .phc-editorial__document { padding: 0; border: 0; border-radius: 0; }
  .phc-editorial--legal .phc-editorial__prose h2,
  .phc-editorial--legal .phc-editorial__prose h3 { break-after: avoid; }
  .phc-editorial--legal .phc-editorial__prose a { color: inherit; text-decoration: underline; }
}

/* Semantic aliases for service-description; its established layout rules remain authoritative. */
.phc-editorial--service-description .phc-editorial__prose h3,
.phc-editorial--service-description .phc-editorial__prose h4 { scroll-margin-block-start: calc(var(--phc-layout-fixed-header-offset) + var(--phc-space-2)); }
.phc-editorial--service-description .phc-editorial__header { display: block; gap: 0; padding: 0; }

@media (max-width: 1023.98px) {
  .phc-editorial__layout { grid-template-columns: 1fr; gap: var(--phc-space-3); }
  .phc-editorial__toc-desktop { display: none; }
  .phc-editorial__toc-mobile { display: block; }
  .phc-editorial__toc-mobile summary { cursor: pointer; font-weight: var(--phc-font-weight-semibold); }
  .phc-editorial__toc-mobile ol { margin-block-start: var(--phc-space-2); }
}

@media (max-width: 767.98px) {
  .phc-editorial__prose { font-size: var(--phc-font-size-base); line-height: var(--phc-line-height-relaxed); }
}
