/* ======================================================================
   Maritime Passport — Partner Portal PUBLIC NAV layer (MAR-1815).

   The fixed marketing header the two public partner pages (landing +
   apply) share via the partner_public partials: the lockup, corporate's
   three-item nav, the two right-hand actions, and the CSS-only checkbox
   menu they collapse into. It left portal.shell.css in MAR-1815, joining
   the footer that left in MAR-937 — the two halves of the public chrome
   now sit beside the shell rather than inside it.

   WHY ITS OWN SHEET. `portal.shell.css` was 15,729 bytes against the
   16,384-byte `SHEET_SIZE_CEILING` — 655 bytes of headroom, with the
   sidebar-drawer sibling still to land in it. The ceiling's own failure
   message says what to do: "A sheet at the ceiling is the signal to START
   A NEW ONE, not to raise this number." The block moved out is 6,775
   bytes, so shell is back to comfortable headroom.

   Those two figures are quoted and the RESULT is not, deliberately: 655
   and 6,775 are properties of commit d8fffdae and of the moved block, and
   no later edit changes either. The resulting headroom is a byte count of
   a file that these very notes live in, so writing it down invalidates it
   — it carried three different values inside one review (~6.7 KB, 6,505,
   6,368) purely because the sentence stating it kept growing. Derive it if
   you need it; do not record it.

   The 748 bytes quoted in MAR-1782's comments and in the ticket is the
   figure from BEFORE MAR-1814, which this sheet is stacked on and which
   edited the block being moved. Both numbers are right about their own
   tree; this one is right about the tree this sheet landed on. Same shape as
   MAR-937's footer split and MAR-1782's account family: a new sheet plus a
   `<link>` in `partner/_head.html` plus an entry in
   `tests.unit.partner_css`'s `SHARED_SHEETS` — three edits in lockstep, or
   CI fails.

   HOW THE ENTANGLEMENT WAS CLEARED. portal.shell.css's head note said for
   two tickets that this family could NOT be split, and the reason was real:
   its top-offset rule was `.pp-page:has(.pp-public-nav)`, naming `.pp-page`
   — which portal.shell.css owns — in one selector with the nav, so
   `test_no_class_is_defined_in_two_files` failed whichever side of the
   split that rule landed on. MAR-1815 replaced it with the
   `.pp-page--public` MODIFIER, a class this sheet owns outright, and the
   two public pages set it. See the rule itself below for what that costs.

   The `:root:has(.pp-public-nav)` half STAYS as it is: `:root` is not a
   `.pp-*` class, so it is invisible to the duplicate guard, and converting
   it would mean putting a class on `<html>` — a wider change for no gain.

   SHARED rather than per-screen, and the block's own comment says why: the
   split tests require a class two screens use to live in the shared layer,
   and landing and apply already have their own screen sheets. Two screen
   sheets declaring these classes would trip the duplicate guard instead.

   POSITION, and a claim about it that did NOT survive measurement. This
   sheet is linked at cascade index 2, immediately after portal.shell.css
   and before portal.public-footer.css. MAR-1815 first recorded that as
   load-bearing, reasoning from the ≤700px block's own comment — its pill
   rims are "qualified by the bar to outrank the base rim, since
   portal.primitives.css is linked after this sheet" — and concluded that
   moving this sheet past primitives would silently invert which rule wins.

   That is wrong, and it is written down because the wrong version is the
   intuitive one. Measured two ways: moving this sheet to LAST in
   SHARED_SHEETS and in _head.html renders all five partner_public pages
   byte-identically at 1280/700/400px; and only two elements in the nav
   carry both a `pp-btn*` class and a `pp-public-nav__*` one (the CTA and
   Contact anchors), between which there is no same-element,
   equal-specificity, same-property collision with portal.primitives.css at
   all. `.pp-public-nav .pp-public-nav__cta` is two classes and beats
   primitives' one-class rules on SPECIFICITY, which is order-independent —
   so the qualification is precisely what makes the position not matter.

   Read the original comment correctly: "since primitives is linked after
   this sheet" is why the author QUALIFIED the selector, not a dependency on
   where the sheet sits. So the position is free on today's evidence, like
   the footer's, and this sheet sits beside shell because that is where the
   public chrome belongs (the MAR-937 precedent) rather than because the
   cascade demands it. Re-measure before relying on either claim.

   Tokens come from portal.css, linked ahead of this file.
   ====================================================================== */

/* ── public-page header (MAR-795, epic MAR-646; corporate nav MAR-937) —
      the fixed header the two public partner pages (landing + apply) share
      via the partner_public partials. Shared layer by construction: both
      screens render these classes, and the split tests require a class two
      screens use to live here. White surface ground, warm hairline, the
      lockup at 44px (36px small, never below the MAR-777 32px floor),
      fixed to the viewport top; since MAR-937 it carries the marketing
      site's three-item nav and two actions, collapsing to a CSS-only
      checkbox menu at 1024px. The height is
      declared once as a custom property and consumed twice: the top offset
      on the page wrapper and the document's scroll-padding, both scoped
      via has() to pages that actually render the nav, so the signed-in
      portal (which also links this file) is untouched. ── */
:root {
  --pp-public-nav-h: 89px;   /* 22px rhythm + 44px lockup + 1px hairline */
  /* the rim, declared once: the collapsed panel lines its links up with the
     lockup above them at every width */
  --pp-public-nav-x: 56px;
}

/* MAR-937: three zones, not space-between — the lockup and the actions group
   are different widths, so space-between would centre the nav in the leftover
   space, not in the bar. The toggle takes no track — it is display:none here
   and out of flow once the collapse block below turns it back on. */
.pp-public-nav { position:fixed; top:0; left:0; right:0; z-index:50;
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  gap:16px;
  height:var(--pp-public-nav-h); padding:0 var(--pp-public-nav-x);
  background:var(--bg-surface); border-bottom:1px solid var(--mp-rule-light); }
.pp-public-nav__home { display:inline-flex; border-radius:var(--r-sm);
  justify-self:start; }
.pp-public-nav__home:focus-visible { outline:2px solid var(--mp-navy);
  outline-offset:3px; }
.pp-public-logo { display:block; height:44px; width:auto; }

/* the marketing nav — the footer links' hover treatment, so the two chrome
   surfaces read as one site */
.pp-public-nav__links { display:flex; align-items:center; gap:32px; }
.pp-public-nav__link { font-size:15px; font-weight:500; color:var(--ink-2);
  text-decoration:none; white-space:nowrap; }
.pp-public-nav__link:hover { color:var(--ink); text-decoration:underline;
  text-underline-offset:3px; }
.pp-public-nav__link:focus-visible { outline:2px solid var(--mp-navy);
  outline-offset:3px; border-radius:var(--r-sm); }

/* the actions zone — a nav-local class, NOT the shared pp-acts primitive: a
   qualifying rule here would declare that class in this sheet while
   portal.primitives.css owns it, and no pp-* class may live in two partner
   sheets. Same reason Contact owns its nowrap rather than qualifying the
   glass modifier. */
.pp-public-nav__acts { display:flex; align-items:center; gap:10px;
  flex-wrap:nowrap; justify-self:end; }
.pp-public-nav__cta { flex:none; white-space:nowrap; }
.pp-public-nav__contact { flex:none; white-space:nowrap; }
/* the CSS-only label swap: full label by default, the short one is
   presentational and appears only where the full label cannot fit */
.pp-public-nav__cta-short { display:none; }
.pp-public-nav__contact-short { display:none; }

/* the burger and its state exist only below the collapse breakpoint — above
   it the nav is inline, so neither is in the tab order */
.pp-public-nav__toggle { display:none; }
.pp-public-nav__burger { display:none; }

/* the fixed header needs compensating: the page wrapper adds the nav
   height to its top rim, and anchor/keyboard scrolls stop short of it.

   The wrapper half is a MODIFIER the two public pages set, not
   `.pp-page:has(.pp-public-nav)` (MAR-1815): that selector named
   `.pp-page`, which portal.shell.css owns, and no pp-* class may be
   defined in two partner sheets — it is what made this family
   unsplittable. The :root half names only the public class, so it stays.

   WHAT THIS COSTS, because it is not free: `:has()` was self-maintaining,
   and `.pp-page--public` is not. A future public page that includes
   _public_nav.html and forgets the modifier renders with the fixed header
   over its first ~89px. So the replacement is pinned from both sides in
   test_partner_public_chrome.py — positively over the two pages that
   render the nav, negatively over the three outcome pages that do not and
   must not acquire a phantom rim. Do not delete either guard. */
:root:has(.pp-public-nav) { scroll-padding-top:var(--pp-public-nav-h); }
.pp-page--public {
  padding-top:calc(var(--pp-public-nav-h) + var(--page-pad)); }

/* the collapse at corporate's lg breakpoint — our bar carries two right-hand
   actions where corporate carries one, so it needs the wider point. The panel
   is absolute inside the FIXED header, so the bar does not grow when the menu
   opens and the nav-height property's two consumers are untouched. */
@media (max-width:1023px) {
  .pp-public-nav { display:flex; justify-content:space-between; }
  /* visually hidden but focusable — display:none would take the only control
     out of the tab order and off the focus ring below */
  .pp-public-nav__toggle { display:block; position:absolute; opacity:0;
    width:1px; height:1px; margin:0; pointer-events:none; }
  .pp-public-nav__burger { display:inline-flex; align-items:center;
    justify-content:center; width:44px; height:44px; flex:none;
    border-radius:var(--r-md); color:var(--ink-2); cursor:pointer; }
  .pp-public-nav__burger:hover { background:var(--tint-hover);
    color:var(--ink); }
  .pp-public-nav__toggle:focus-visible ~ .pp-public-nav__acts
    .pp-public-nav__burger { outline:2px solid var(--mp-navy);
    outline-offset:2px; }
  .pp-public-nav__links { position:absolute; top:100%; left:0; right:0;
    display:none; flex-direction:column; align-items:stretch; gap:0;
    padding:6px var(--pp-public-nav-x) 14px; background:var(--bg-surface);
    border-bottom:1px solid var(--mp-rule-light); }
  .pp-public-nav__toggle:checked ~ .pp-public-nav__links { display:flex; }
  .pp-public-nav__link { padding:12px 0; }
}

/* MAR-1814 folded the old 640px block in here — both set --pp-public-nav-x,
   so merged rather than renumbered. Real delta 641–700px; see portal.css. */
@media (max-width:700px) {
  :root { --pp-public-nav-h: 69px;    /* 16px rhythm + 36px lockup + 1px */
          --pp-public-nav-x: 16px; }
  .pp-public-logo { height:36px; }
  /* two pills and a burger where there was one pill: the label swap alone
     does not buy the room, so the bar's rhythm and the pills' rims tighten
     too. The rims are nav-local — the 45px step, both pigments and the shared
     button kit are untouched — and qualified by the bar to outrank the base
     rim, since portal.primitives.css is linked after this sheet. */
  .pp-public-nav { gap:8px; }
  .pp-public-nav__acts { flex:none; gap:8px; }
  .pp-public-nav .pp-public-nav__cta,
  .pp-public-nav .pp-public-nav__contact { padding:0 12px; }
  .pp-public-nav__cta-full { display:none; }
  .pp-public-nav__cta-short { display:inline; }
  .pp-public-nav__contact-full { display:none; }
  .pp-public-nav__contact-short { display:inline; }
  /* under ~350px the four items outgrow the bar whatever the rim. The lockup
     is what gives, cropping from the right, so the burger and both actions
     stay reachable: a menu control clipped off the edge is a functional
     failure, a cropped wordmark a cosmetic one. */
  .pp-public-nav__home { min-width:0; overflow:hidden; }
}
