/* ============================================================================
   The draft nav's desktop menus as full-width sheets (Tanja, Nov 13: "full page width, not below the header.
   I want it to be bold, and cool", after Square, Listen Labs and Audienceful). Linked from partials/nav-3.html
   itself, so every page with that nav gets it: the drafts and flero-5. Desktop only (901px and up); the phone
   menu (.nav-mobile) keeps its own markup and look.

   How it works, with no script of its own (js/nav-v3.js still opens on hover or focus and closes on Escape):
   - while a menu is open, the header bar turns brand blue and the sheet hangs from its bottom edge in the same
     blue, edge to edge, so the header and the menu read as one surface;
   - the sheet unrolls downward from the header (clip-path), and the page under it dims and blurs;
   - inside: the menu's name big on the left with its "see all" links, then three columns, each (no rule above it since Nov 16, Tanja),
     a label, and big names with their one line under them. Hovering a name dims the others and shows its arrow.

   Why the row of menu names is re-centred here: brand.css centres it with a transform, and a transformed box
   becomes the frame its children are placed in, so a menu could never be wider than that row. Centred with
   auto margins instead, the row spans the bar's full height, and each menu name stretches to that height too,
   so the pointer never leaves the menu on its way down from the name into the sheet.
   ========================================================================== */
@media (min-width:901px){
  .v3 .nav .nav-menu{top:0; bottom:0; left:0; right:0; width:max-content; margin-inline:auto; transform:none; align-items:stretch;}
  .v3 .nav .nav-menu > .mlabel{align-self:center;}            /* any plain link in the row (since Nov 14, Integrations and Docs are menus too) */
  .v3 .nav .mitem{display:flex; align-items:center;}
  /* no gap between the menus: the 6px moves into each item's padding, so the pointer never falls between two
     menus on its way from one label to the next (Tanja, Nov 16: the sheet should stay in place) */
  .v3 .nav .nav-menu{gap:0;}
  .v3 .nav .nav-menu > :is(.mitem, .mlabel){padding-inline:3px;}
  /* switching from one open menu to another (js/nav-menu-3.js sets .mm-swap): nothing rolls. One shared blue
     backdrop (.mm-bg, under the sheets' words, over the page's dim) stands in for both sheets' own blue and glides
     between their heights; the words cross-fade; the old sheet stays (.mm-leaving) while its words fade out. */
  .mm-bg{display:none; position:absolute; z-index:1; left:0; right:0; top:calc(100% - 1px); height:0; background:var(--blue);
    border-radius:0 0 32px 32px; pointer-events:none;}
  .v3 .nav.mm-swap .mm-bg{display:block;}
  .v3 .nav.mm-swap .mm{background:transparent !important;}
  .v3 .nav.mm-swap .panel, .v3 .nav.mm-swap .mm, .v3 .nav.mm-swap .panel::before{transition:none !important;}
  .v3 .nav .mitem.mm-leaving .panel{visibility:visible !important;}
  .v3 .nav .mitem.mm-leaving .mm{clip-path:inset(-1px 0 0 0);}
  .v3 .nav .mitem.mm-leaving .panel::before{opacity:0 !important;}

  /* the sheet: full width, hanging from the header's bottom edge */
  .v3 .nav .panel{top:100%; left:50%; width:100vw; margin-left:-50vw; padding:0; opacity:1; transform:none;
    visibility:hidden; transition:visibility 0s linear .3s;}   /* stays up while the sheet rolls back */
  .v3 .nav .mitem:is(:hover, :focus-within) .panel{visibility:visible; transition-delay:0s; transform:none;}
  .v3 .nav .mitem.menu-dismissed .panel{transform:none !important; visibility:hidden !important; transition:none !important;}   /* Escape: hidden properly, so focus leaves it too */

  /* the page under the sheet dims and blurs (the header's own blur is switched off while a menu is open, below,
     because a blur inside another blur does not work) */
  /* it starts 2px down, under the solid sheet: starting at the sheet's own top edge, it showed through that edge's
     half-painted pixel row as a thin dark line under the header (Tanja, Nov 14) */
  .v3 .nav .panel::before{content:""; position:absolute; left:0; right:0; top:2px; height:100vh; background:rgba(10,10,10,.42);
    -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); opacity:0; transition:opacity .35s var(--ease); pointer-events:none;}
  .v3 .nav .mitem:is(:hover, :focus-within) .panel::before{opacity:1;}

  .mm{position:relative; z-index:1; max-height:calc(100vh - 72px); overflow-y:auto; overscroll-behavior:contain; background:var(--blue); color:#fff; border-radius:0 0 32px 32px;
    clip-path:inset(0 0 100% 0); transition:clip-path .3s var(--ease);}            /* rolls back up as fast as the header fades back */
  .v3 .nav .mitem:is(:hover, :focus-within) .mm{clip-path:inset(-1px 0 0 0); transition-duration:.45s;}   /* unrolls a little slower. -1px: the clip edge sits
     above the sheet, so the sheet's top row is painted whole (the sheet starts at a fraction of a pixel, and clip edges are soft) */

  .mm-in{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,3fr); gap:clamp(32px,4vw,64px); padding:clamp(36px,4vw,56px) 28px clamp(44px,4.6vw,68px);}

  /* the lead column: the menu's name, a line, the "see all" links */
  .v3 .mm-h{margin:0; max-width:none; font-family:var(--serif); font-weight:600; font-size:clamp(40px,4vw,60px); line-height:1; letter-spacing:-.03em; color:#fff;}
  .v3 .mm-p{margin:18px 0 0; max-width:26ch; font-size:16px; line-height:1.5; color:rgba(255,255,255,.88);}
  .v3 .mm-more{display:flex; flex-direction:column; align-items:flex-start; gap:10px; margin:28px 0 0; max-width:none;}
  .mm-more a{display:inline-flex; align-items:center; gap:8px; font-size:15px; font-weight:500; color:#fff; text-decoration:none;}
  .v3 .mm-more .ic{width:16px; height:16px; color:#fff; transition:transform .25s var(--ease);}
  .mm-more a:hover .ic{transform:translateX(4px);}
  .mm-more a:hover{text-decoration:underline; text-underline-offset:4px;}

  /* the columns */
  .mm-cols{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(24px,3vw,48px); align-content:start;}
  /* a column that needs more room (Solutions "By industry", five pages, Nov 17): it takes two of the three
     columns and lays its links out in two, under one heading */
  .mm-col.span2{grid-column:span 2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:clamp(24px,3vw,48px); align-content:start;}
  .mm-col.span2 .mm-k{grid-column:1 / -1;}
  .v3 .mm-k{margin:0 0 14px; max-width:none; padding-top:14px; font-size:14px; font-weight:500; line-height:1.3; color:rgba(255,255,255,.78);}
  .mm-k b{margin-right:8px; font-weight:500; color:rgba(255,255,255,.5); font-variant-numeric:tabular-nums;}
  .mm-a{display:block; padding:12px 0; color:#fff;   /* Nov 17 (Tanja): more air between menu items (was 7px) */ text-decoration:none; outline:none; transition:opacity .2s;}
  .mm-n{display:inline-flex; align-items:center; gap:10px; font-family:var(--serif); font-weight:600; font-size:clamp(24px,2vw,30px); line-height:1.15; letter-spacing:-.02em;}
  .mm-n{position:relative;}
  .v3 .mm-n .ic{position:absolute; left:100%; top:50%; margin:-11px 0 0 10px; width:22px; height:22px; color:#fff; opacity:0; transform:translateX(-8px); transition:opacity .2s, transform .3s var(--ease);}   /* pinned after the name, so the hidden arrow never pushes a long name onto two lines (Nov 17, "Property management") */
  .mm-a:is(:hover, :focus-visible) .mm-n .ic{opacity:1; transform:none;}
  .mm-d{display:block; margin-top:3px; max-width:none; font-size:15px; line-height:1.45; color:rgba(255,255,255,.9);}
  .mm-cols:has(.mm-a:hover, .mm-a:focus-visible) .mm-a:not(:hover):not(:focus-visible){opacity:.42;}
  .mm-a:focus-visible .mm-n{text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:6px;}
  .mm-vh{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;}

  /* Integrations: white tool tiles around the Flero mark (Tanja, Nov 14). One step = a tile plus the gap.
     Closed, every tile waits behind the mark (pulled back --x/--y steps, small, see-through). Open, each slides out
     to its place, the inner ring first (--r), and settles with a slight overshoot. On close the tiles fade at once
     and only jump back behind the mark after the sheet has rolled up (.3s), so they never fly backwards. */
  /* the tiles share the column's width, like the other menus' columns (capped, so they stay tile-sized on big
     screens). A step is measured in the tile's own size: translate(-100%) moves a tile by its own width, and the
     tiles are square, so the same works up and down. */
  .ig{--tg:clamp(10px,1.1vw,16px); display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); gap:var(--tg); max-width:1000px; align-content:start; text-decoration:none; outline:none;}
  .ig-t{position:relative; display:flex; align-items:center; justify-content:center; aspect-ratio:1; border-radius:20px; background:#fff; box-shadow:0 10px 24px rgba(0,16,110,.22);
    opacity:0; transform:translate(calc(var(--x) * (-100% - var(--tg))), calc(var(--y) * (-100% - var(--tg)))) scale(.4);
    transition:opacity .15s, transform 0s linear .3s;}
  .ig-t img{width:46%; height:46%; object-fit:contain;}
  .ig-hub{z-index:1; border-radius:50%; color:var(--blue); box-shadow:0 14px 34px rgba(0,16,110,.3);}   /* the mark sits above, so the tiles come out from behind it */
  .ig-hub svg{width:52%; height:auto;}
  .v3 .nav .mitem:is(:hover, :focus-within) .ig-t{opacity:1; transform:none;
    transition:opacity .3s var(--ease), transform .65s cubic-bezier(.2,.9,.25,1.12); transition-delay:calc(.12s + var(--r) * .07s);}
  .v3 .nav .mitem:is(:hover, :focus-within) .ig-hub{transition-delay:.05s;}
  .ig:hover .ig-t:not(.ig-hub){box-shadow:0 14px 30px rgba(0,16,110,.3);}

  /* the header while a menu is open: the same blue, white type, the white button (as over a blue band) */
  /* no fade on the way in (Tanja: the header turned blue a beat after the sheet). CSS takes the transition from the
     state being entered, so the header still fades back over .3s when the menu closes, in step with the sheet. */
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)){background:var(--blue) !important; -webkit-backdrop-filter:none !important; backdrop-filter:none !important; border-bottom-color:transparent !important; transition:none !important;}
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)) :is(.brand, .mlabel, .navcta){transition:none !important;}
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)) .brand{color:#fff !important;}
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)) .mlabel{color:rgba(255,255,255,.86) !important;}
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)) :is(.mitem:hover .mlabel, .mitem:focus-within .mlabel, .mlabel:hover){color:#fff !important; background:rgba(0,0,0,.16) !important;}
  .v3 .nav:has(.mitem:is(:hover, :focus-within):not(.menu-dismissed)) .navcta{color:var(--blue) !important; background:#fff !important; border-color:#fff !important;}
}
/* smaller laptops: a narrower lead column and smaller names */
@media (min-width:901px) and (max-width:1180px){
  .mm-in{grid-template-columns:minmax(0,200px) minmax(0,1fr);}
  .v3 .mm-h{font-size:36px;}
  .mm-n{font-size:22px;}
  .mm-d{font-size:14px;}
}
/* motion off: the sheet and the dim appear at once */
@media (min-width:901px) and (prefers-reduced-motion: reduce){
  .mm, .v3 .nav .panel::before, .mm-a, .mm-n .ic, .ig-t{transition:none !important;}
}
.still .mm, .still .v3 .nav .panel::before, .still .mm-a, .still .mm-n .ic, .still .ig-t{transition:none !important;}
