/* kitchen-menu.css — the menus Tools and Recipes in the banner, and the trail and category
   links of a tool's page (ticket 0209), in the new look (tokens: css/kitchen.css).
   The banner: a button per menu, in the place of the bar's two links; it opens a card that hangs under the whole
   banner (.top is position: relative): on the left what the menu is, its All … button and the small links, then
   one column per category or job. The links are in the page's HTML from the start (scripts/menu.mjs); opening
   only shows or hides the card (site/mega-menu.js).
   Under 760 px the bar has no room: the two menus move into the menu (site/mega-menu.js puts #top-nav there) and
   each opens there as a list, a category's tools on a tap on the category. */

/* ── the two buttons in the bar ─────────────────────────────────────────────────────────────────────────────── */
.top-nav .mm-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--k-ink); font: 650 .98rem/1 var(--k-body);
  padding: 10px 10px 10px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer; transition: background-color .15s; }
.mm-chev { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--k-calm); }
.top-nav .mm-btn[aria-expanded="true"] { background: var(--k-butter); }
.mm-btn[aria-expanded="true"] .mm-chev { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .top-nav .mm-btn:hover { background: var(--k-butter); } }

/* ── the card ───────────────────────────────────────────────────────────────────────────────────────────────── */
.mm-panel { position: absolute; top: calc(100% + 6px); left: 50%; translate: -50% 0; width: min(1320px, calc(100vw - 32px)); z-index: var(--k-layer-banner, 10);
  display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 14px 30px; padding: 24px 26px 22px; box-sizing: border-box;
  max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--k-card); color: var(--k-ink); border: 2px solid var(--k-line); border-radius: var(--k-r-lg); box-shadow: var(--k-shadow); text-align: left; }
.mm-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .top > .top-nav .mm-panel:not([hidden]) { animation: k-mm .24s var(--k-calm); transform-origin: top center; } @keyframes k-mm { from { opacity: 0; transform: translateY(-6px); } } }
.mm-panel ul { list-style: none; margin: 0; padding: 0; }
.mm-panel a { color: var(--k-ink); }
/* the left: what this menu is, the button to all of it, the small links */
.mm-lead { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 26px; border-right: 2px solid var(--k-faint); }
.mm-title { margin: 0; font: 800 1.55rem/1.05 var(--k-display); letter-spacing: -.025em; }
.mm-line { margin: 0 0 10px; color: var(--k-muted); font-size: .95rem; line-height: 1.4; }
.mm-lead .mm-all { padding: 11px 16px; font-size: 1rem; box-shadow: var(--k-shadow-sm); margin-bottom: 12px; }
.mm-sub { margin: 4px 0 2px; font: 700 .76rem/1.2 var(--k-body); letter-spacing: .07em; text-transform: uppercase; color: var(--k-muted); }
.mm-more { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-more a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 2px solid var(--k-faint); border-radius: 999px; font: 650 .88rem/1.2 var(--k-body); text-decoration: none; background: var(--k-card); }
@media (hover: hover) and (pointer: fine) { .mm-more a:hover { border-color: var(--k-ink); background: var(--k-butter); } }
/* the columns. Each column is a heading and a list; the columns of one row share their rows (subgrid), so the lines
   under the headings stand at one height even where a heading takes two lines. The Tools menu has eight columns:
   two rows of four, under the line of the left part's title */
.mm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 22px; align-content: start; }
#mm-tools .mm-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#mm-recipes .mm-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* (six jobs: two rows of three, the recipes' long names need the width) */
.mm-col { display: grid; grid-template-rows: subgrid; grid-row: span 2; align-content: start; padding-bottom: 18px; }
.mm-col-h { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin: 0 0 8px; padding: 4px 0 8px; border-bottom: 2px solid var(--k-faint); font: 800 1.02rem/1.25 var(--k-display); letter-spacing: -.01em; }
.mm-col-h a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.mm-amp { margin: 0 2px; }
/* a job's heading in the Recipes menu: its icon and name, as a category's in the Tools menu (not a link: no page) */
.mm-job { display: inline-flex; align-items: center; gap: 7px; }
/* a category's icon (scripts/menu.mjs catIcon): in the category's colour (style.css --cat-N), else the text's */
.cat-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--sec-color, currentColor); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cat-ic[data-c="0"] { --sec-color: var(--cat-0); } .cat-ic[data-c="1"] { --sec-color: var(--cat-1); } .cat-ic[data-c="2"] { --sec-color: var(--cat-2); }
.cat-ic[data-c="3"] { --sec-color: var(--cat-3); } .cat-ic[data-c="4"] { --sec-color: var(--cat-4); } .cat-ic[data-c="5"] { --sec-color: var(--cat-5); }
.cat-ic[data-c="6"] { --sec-color: var(--cat-6); } .cat-ic[data-c="7"] { --sec-color: var(--cat-7); } .cat-ic[data-c="8"] { --sec-color: var(--cat-8); }
.cat-ic[data-c="9"] { --sec-color: var(--cat-9); } .cat-ic[data-c="10"] { --sec-color: var(--cat-10); } .cat-ic[data-c="11"] { --sec-color: var(--cat-11); }
@media (hover: hover) and (pointer: fine) { .mm-col-h a:hover > span:not(.mm-go) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; } }
/* a column's heading leads to its category's page: the number of tools there and an arrow say so (ticket 0243) */
/* (inline, so a long name that takes two lines keeps the number and the arrow right after its last word) */
.mm-col-h a.mm-head { display: inline; }
.mm-head .cat-ic { display: inline-block; vertical-align: -3px; margin-right: 7px; }
.mm-go { white-space: nowrap; }
.mm-head .mm-n { display: inline-block; margin-left: 7px; padding: 3px 7px; vertical-align: 1px; border-radius: 999px; background: var(--k-faint); color: var(--k-ink); font: 700 .75rem/1 var(--k-body); letter-spacing: 0; }
.mm-arrow { display: inline-block; vertical-align: -3px; width: 16px; height: 16px; margin-left: 5px; fill: none; stroke: var(--k-muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .mm-head:hover .mm-arrow { stroke: var(--k-ink); translate: 3px 0; } }
@media (prefers-reduced-motion: no-preference) { .mm-arrow { transition: translate .2s var(--k-calm); } }
.mm-col ul { display: grid; gap: 1px; align-content: start; }
.mm-col li a { display: block; margin-left: -8px; padding: 6px 8px; border-radius: 10px; font: 550 .93rem/1.3 var(--k-body); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .mm-col li a:hover { background: var(--k-butter); } }
.mm-panel a:focus-visible { outline: 3px solid var(--k-plum); outline-offset: 1px; }
.mm-more .cat-ic { width: 16px; height: 16px; }
/* (a category's own list opens on a tap only in the menu on a phone; elsewhere these buttons are not there) */
.mm-fold { display: none; }
/* For companies, once it opens a menu (an approved sector page): the yellow button of the bar, as a button */
.top:has(.mm-biz) > .top-biz { display: none; }
.top-nav .mm-biz .mm-btn { background: var(--k-yolk); color: var(--k-on-color); border: 2px solid var(--k-line); border-radius: 12px; box-shadow: var(--k-shadow-sm); font: 700 .95rem/1 var(--k-display); margin-left: 6px; }

/* narrower bars: the card as wide as the bar, the left part on top (so the four columns keep their width) */
@media (max-width: 1180px) {
  .mm-panel { grid-template-columns: minmax(0, 1fr); width: calc(100vw - 24px); }
  .mm-lead { grid-row: auto; padding: 0 0 14px; border-right: 0; border-bottom: 2px solid var(--k-faint); }
  /* (in rows, not stacked: the title and its line, then the button and the small links, so the columns under it
     fit on a laptop's screen; ticket 0242) */
  :not(.menu-panel) > .top-nav .mm-lead { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  :not(.menu-panel) > .top-nav .mm-lead .mm-line { flex: 1 1 320px; margin: 0; }
  :not(.menu-panel) > .top-nav .mm-lead .mm-all { margin: 0 6px 0 0; }
  :not(.menu-panel) > .top-nav .mm-lead .mm-sub { display: none; } /* (the small links say what they are) */
}
@media (max-width: 900px) { #mm-tools .mm-cols { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } #mm-recipes .mm-cols { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

/* ── in the menu, on a phone ────────────────────────────────────────────────────────────────────────────────── */
.menu-panel > .top-nav { display: block; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--k-faint); }
.menu-panel:has(> .top-nav) { width: min(380px, calc(100vw - 24px)); box-sizing: border-box; }
/* (All tools and All recipes are the first thing each of the two lists shows) */
.menu-panel:has(> .top-nav) > #tools-link, .menu-panel:has(> .top-nav) > #recipes-link { display: none; }
.menu-panel .mm-btn { display: flex; width: 100%; box-sizing: border-box; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 12px;
  border: 0; border-radius: 12px; background: none; color: var(--k-ink); font: 650 1rem/1.2 var(--k-body); cursor: pointer; }
.menu-panel .mm-btn[aria-expanded="true"] { background: var(--k-butter); }
.menu-panel .mm-panel { position: static; translate: none; width: auto; display: block; max-height: none; overflow: visible; padding: 6px 4px 10px 12px; border: 0; border-radius: 0; box-shadow: none; background: none; animation: none; }
.menu-panel .mm-panel[hidden] { display: none; }
.menu-panel .mm-lead { padding: 0 0 8px; border: 0; gap: 8px; }
.menu-panel .mm-title, .menu-panel .mm-line { display: none; }
.menu-panel .mm-lead .mm-all { margin: 0; }
.menu-panel .mm-more a { padding: 9px 12px; }
.menu-panel .mm-cols { display: block; }
.menu-panel .mm-col { display: block; padding: 0; border-top: 2px solid var(--k-faint); }
.menu-panel .mm-col-h { margin: 0; padding: 0; border: 0; min-height: 44px; display: flex; align-items: center; gap: 4px; font-size: 1rem; }
.menu-panel .mm-col-h a { padding: 10px 2px; }
.menu-panel .mm-fold { display: grid; place-items: center; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--k-ink); cursor: pointer; }
.menu-panel .mm-fold[aria-expanded="true"] { background: var(--k-butter); }
.menu-panel .mm-fold[aria-expanded="true"] .mm-chev { transform: rotate(180deg); }
.menu-panel .mm-col:not(.open) > ul { display: none; }
.menu-panel .mm-col > ul { padding: 0 0 8px; }
.menu-panel .mm-col li a { margin: 0; padding: 11px 10px; font-size: 1rem; }

/* ── the page behind an open menu: out of focus ─────────────────────────────────────────────────────────────────
   A veil under the banner while the card of Tools or Recipes is open (or, on a phone, the menu that holds them):
   the page behind blurs and dims a little, as behind the tool's window (style.css dialog.bench). It catches the
   click that shuts the menu, so that click does not also land on the page. Nothing changes for the banner itself. */
:is(.chrome, .lg-top)::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; visibility: hidden;
  background: rgb(28 36 40 / .14); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* (the app's banner stays put at the top: its veil starts under it, so the banner itself stays sharp) */
.chrome::before { position: absolute; inset: 100% 0 auto; height: 100vh; height: 100dvh; }
:is(.chrome, .lg-top):has(.top-nav .mm-panel:not([hidden]), .menu-panel:not([hidden]) > .top-nav)::before { opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: no-preference) { :is(.chrome, .lg-top)::before { transition: opacity .2s var(--k-calm), visibility .2s; } }
:root[data-theme="dark"] :is(.chrome, .lg-top)::before { background: rgb(0 0 0 / .32); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.chrome, .lg-top)::before { background: rgb(0 0 0 / .32); } }

/* ── a tool's page ──────────────────────────────────────────────────────────────────────────────────────────── */
/* its text stands first in <main> for search engines, and shows where it always did, under the home page, until
   the app moves it into the tool's window (scripts/build_pages.mjs `first`) */
#tools-view:has(> .tool-about:first-child) { display: flex; flex-direction: column; }
#tools-view > .tool-about:first-child { order: 1; }
/* the trail over its heading: home › category › tool. In the tool's window its own path stands over the tool. */
.tb-crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; font: 600 .875rem/1.5 var(--k-body); color: var(--k-muted); }
.tb-crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--k-muted); }
.tb-crumbs a { color: inherit; text-underline-offset: 3px; }
.pane .tb-crumbs { display: none; }
/* more tools of the category: the related tools' cards, wrapping (never a column of eight) */
.tool-cat ul { flex-direction: row; flex-wrap: wrap; align-items: flex-start; } /* (after style.css, which stacks .tool-rel under 860 px) */
.tool-cat .rel-card { white-space: normal; }
.tool-cat-all { margin: 14px 0 0; font-weight: 650; }
.tool-cat-all a { color: var(--k-ink); text-underline-offset: 3px; }
.tool-cat-all a::after { content: " →"; }
