/* Internal reading pages share the site container; the front page is unchanged. */
.site-main:not(.site-main--front) { max-width: none; }
.site-main:not(.site-main--front) .page-heading,
.site-main:not(.site-main--front) .single-heading,
.site-main:not(.site-main--front) .archive-heading,
.site-main:not(.site-main--front) .archive-heading__description,
.site-main:not(.site-main--front) .single-heading__title,
.site-main:not(.site-main--front) .page-heading__title,
.site-main:not(.site-main--front) .archive-heading__title,
.site-main:not(.site-main--front) .page-article,
.site-main:not(.site-main--front) .single-article,
.site-main:not(.site-main--front) .entry-content,
.site-main:not(.site-main--front) .comments-wrap {
  width: 100%;
  max-width: none;
}
.site-main--single > .content-layout { display: block; }
.site-main:not(.site-main--front) .entry-content > .alignwide,
.site-main:not(.site-main--front) .entry-content .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
.site-main--single .site-sidebar { margin-top: 3rem; padding-top: 0; }
.site-main--single .site-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.site-main--single .site-sidebar .widget { margin: 0; }
.mg-page-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 0 2rem;
  border-block: 1px solid var(--mg-line);
  background: var(--mg-paper);
}
.mg-page-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: .75rem .25rem;
  color: var(--mg-forest);
  cursor: pointer;
  list-style: none;
  font-size: .9rem;
  font-weight: 700;
}
.mg-page-nav summary::-webkit-details-marker { display: none; }
.mg-page-nav summary > span:first-child { flex-shrink: 0; white-space: nowrap; }
.mg-page-nav__current { flex: 1; min-width: 0; margin-left: auto; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mg-page-nav summary::after { content: "+"; font-size: 1.25rem; line-height: 1; }
.mg-page-nav details[open] summary::after { content: "−"; }
.mg-page-nav__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem 1.25rem;
  max-height: 50vh;
  margin: 0;
  padding: 0 0 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.mg-page-nav__links li { min-width: 0; margin: 0; }
.mg-page-nav__links a { display: flex; align-items: center; min-height: 2.75rem; padding: .5rem .75rem; border-radius: var(--mg-radius); color: var(--mg-ink); font-size: .92rem; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.mg-page-nav__links a:hover,
.mg-page-nav__links a[aria-current="location"] { background: var(--mg-forest); color: var(--mg-white); }
.mg-page-nav__links li[data-level="3"] a { padding-left: 1.5rem; font-size: .86rem; }
.mg-page-nav summary:focus-visible,
.mg-page-nav a:focus-visible { outline: 3px solid var(--mg-sun); outline-offset: -3px; }
.mg-page-section { scroll-margin-top: 4.25rem; }
.mg-page-section:focus-visible { outline: 3px solid var(--mg-sun); outline-offset: 4px; }
@media (max-width: 760px) {
  .site-main--single .site-sidebar,
  .mg-page-nav__links { grid-template-columns: minmax(0, 1fr); }
  .mg-page-nav__links { max-height: 45vh; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .mg-page-nav { display: none; } }
