/* ─────────────────────────────────────────────────────────────────────────
   FITTING THE PLUMHQ.COM CHROME AROUND THE REPORT
   ─────────────────────────────────────────────────────────────────────────
   The report's own layout (styles.css, untouched):
     #scrollrail   fixed reading-progress strip on the far left, --trk wide
     nav.toc       contents rail; pinned beside the page from 1000px
                   (body.toc-pinned), a drawer below that; steps aside over
                   the cover (body.at-cover)
     #cover        sticky, full-bleed; the report rolls up over it
   Its sticky toolbar is removed at sync — the Plum navbar takes its slot,
   and the report's sticky offsets (.row .lead at ~85px, .benchside at
   ~75px) already clear a 70px bar.

   --chrome-nav-h is measured at runtime by src/chrome/nav-script.html; the
   default here covers the first frame.
   ───────────────────────────────────────────────────────────────────────── */
:root { --chrome-nav-h: 70px; }

/* The bar sits beside the progress strip, where the report's toolbar sat,
   so the strip stays a full-height edge. */
.navbar .nav {
  left: var(--trk, 30px);
  width: calc(100% - var(--trk, 30px));
}
@media (min-width: 992px) {
  .navbar .nav-item-dropdown { width: calc(100vw - var(--trk, 30px)); }
}
/* Giving 30px to the strip leaves the bar just short on narrow desktops:
   at 1024px the logo touched "+ Product" and "Get a quote" wrapped. Between
   the chrome's breakpoint and 1200px, widen the bar's own container (not the
   dropdown containers, which share the class) and trim the item padding. */
@media (min-width: 992px) and (max-width: 1199px) {
  .navbar .nav > .nav-container-3 { width: calc(100% - 48px); }
  .navbar .nav-item-link { padding-left: 12px; padding-right: 12px; }
}
.navbar .nav-button .button-4 { white-space: nowrap; }

/* Contents rail and its resize grip start under the bar, not behind it. */
nav.toc {
  top: var(--chrome-nav-h);
  height: calc(100dvh - var(--chrome-nav-h));
}
body.toc-pinned #tocgrip { top: var(--chrome-nav-h); }

/* Contents links and deep links land below the bar. */
html { scroll-padding-top: calc(var(--chrome-nav-h) + 12px); }

/* Keyboard: desktop dropdowns open on hover only; open them on focus too. */
@media (min-width: 992px) {
  .nav-item:focus-within .nav-item-dropdown { display: block; }
  .navbar:has(.nav-item:focus-within) .nav-bg { opacity: 1; }
}

/* The site footer closes the report the way the cover opens it: full-bleed,
   with the pinned contents rail stepping aside once the footer is on screen
   (body.at-footer, set by the nav script — same motion as body.at-cover). */
body.toc-pinned .footer-section {
  margin-left: calc(-1 * var(--tocw));
  width: calc(100% + var(--tocw)); /* the chrome sets width:100% */
}
body.toc-pinned.at-footer nav.toc { transform: translateX(calc(-100% - var(--trk))); }
body.toc-pinned.at-footer #tocgrip { display: none; }

/* The report has a designed print stylesheet; the site chrome stays out of it. */
@media print {
  .navbar, .footer-section { display: none !important; }
}
