/* Keep the site's existing 1280px content rail. A section inside that rail
   uses the full parent width rather than subtracting a second page gutter. */
body {
  --rdx-inner-gutter: var(--redico-grid-gutter, 24px);
  --rdx-inner-rail: min(var(--redico-grid-width, 1280px), calc(100% - 2 * var(--rdx-inner-gutter)));
}
@media (max-width: 768px) {
  body { --rdx-inner-gutter: var(--redico-grid-gutter, 16px); }
}

@layer redicoReadability {
  body:not(.home) :is(
    #rsc > .rsc-wrap,
    #rdx-layout > #content.rdx-wrap,
    main > .rso-enhancement,
    main.rx-service > :is(.sv-nav, .rxgr-nav, .rxpi-nav)
  ) {
    box-sizing: border-box !important;
    width: var(--rdx-inner-rail) !important;
    max-width: none !important;
    margin-inline: auto !important;
  }

  body:not(.home) :is(#rsc > .rsc-wrap, #rdx-layout > #content.rdx-wrap) {
    padding-inline: 0 !important;
  }

  body:not(.home) :is(#rsc > .rsc-wrap, #rdx-layout > #content.rdx-wrap, main.rx-wrap) > .rso-enhancement {
    width: 100% !important;
    margin-inline: 0 !important;
  }

  body:not(.home) main :is(.rso-enhancement[data-redico-service-seo], #rso-service-sources.rso-enhancement) {
    box-sizing: border-box !important;
    padding: clamp(18px, 2.3vw, 32px) !important;
  }

  /* Use the same neutral surfaces as the homepage for the header and menus. */
  html[data-rx-bento] body:not(.home) :is(header.rx-header:is(#rnt-header, .rx-header), dialog.rpm-dialog) {
    background: var(--rdx-ui-surface) !important;
    border-color: var(--rdx-ui-line) !important;
    color: var(--rdx-ui-ink) !important;
  }
  html[data-rx-bento] body:not(.home) header.rx-header:is(#rnt-header, .rx-header) .rx-logo {
    background: transparent !important;
    box-shadow: none !important;
  }
  html[data-rx-bento][data-rx-theme="dark"] body:not(.home) :is(.rnt-hero-band, .rc-theme-band) {
    background: var(--rdx-ui-surface) !important;
  }
  html[data-rx-bento][data-rx-theme="dark"] body:not(.home) header.rx-header:is(#rnt-header, .rx-header) .rx-logo img {
    filter: brightness(0) invert(1) !important;
  }
}
