/* The lab site's header (site-nav.js): the Plugins menu (nbp-*, written so it can move into the
   shell as-is) and the fallback header for when the shell fails to load. Every site page and the
   content pages load this file. Moved from the plugins prototype (lab/plugins/plugins.css) on
   2026-11-06. The menu lives inside .nb-shell, which is position: sticky, so the panel's
   top: 100% sits right under the header. */

.nbp-navitem {
  align-items: center;
  display: inline-flex;
  gap: 2px;
  position: relative;
}
.nbp-navitem.is-open > a { color: var(--nb-highlight, #de5a29); }
.nbp-toggle {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  margin: 0 -6px 0 0;
  padding: 0;
  width: 26px;
}
.nbp-toggle svg { transition: transform 0.16s ease; }
.nbp-navitem.is-open .nbp-toggle svg { transform: rotate(180deg); }
.nbp-toggle:hover, .nbp-navitem.is-open .nbp-toggle { color: var(--nb-highlight, #de5a29); }
.nbp-toggle:focus-visible { outline: 2px solid var(--nb-highlight, #de5a29); outline-offset: 1px; }
/* Mouse users get a bridge across the header's padding so the panel stays open on the way down. */
.nbp-navitem.is-open::after {
  content: "";
  height: 34px;
  left: -10px;
  position: absolute;
  right: -10px;
  top: 100%;
}

.nbp-menu {
  background: rgba(10, 11, 16, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 12px 12px;
  border-top: 0;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  padding: 16px 16px 12px;
  position: absolute;
  top: 100%;
  width: 704px;
  z-index: 1;
}
.nbp-menu::before { /* the cards' ember line, along the top of the panel */
  background: linear-gradient(90deg, #de5a29, #e03636);
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.nbp-menu[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .nbp-menu:not([hidden]) { animation: nbp-in 0.14s ease-out; }
}
@keyframes nbp-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.nbp-menu__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.nbp-tile {
  aspect-ratio: 310 / 190;
  border-radius: 6px;
  color: #f5f5f5;
  display: block;
  overflow: hidden;
  position: relative;
  text-decoration: none;
}
.nbp-tile img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  width: 100%;
  filter: brightness(0.8);
}
.nbp-tile::after {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 75%);
  bottom: 0;
  content: "";
  height: 60%;
  left: 0;
  position: absolute;
  right: 0;
}
.nbp-tile span {
  bottom: 7px;
  font-size: 13.5px;
  font-weight: 900;
  left: 6px;
  line-height: 1.15;
  position: absolute;
  right: 6px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  z-index: 1;
}
.nbp-tile:hover img, .nbp-tile:focus-visible img { filter: brightness(1); transform: scale(1.06); }
.nbp-tile:hover, .nbp-tile:focus-visible { box-shadow: inset 0 -2px 0 #de5a29; }
.nbp-tile:focus-visible { outline: 2px solid #de5a29; outline-offset: 2px; }
.nbp-tile:hover span, .nbp-tile:focus-visible span { color: #fff; }

.nbp-menu__all {
  border-radius: 6px;
  color: var(--nb-highlight, #de5a29);
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-top: 10px;
  padding: 6px;
  text-align: center;
  text-decoration: none;
}
.nbp-menu__all:hover { text-decoration: underline; }
.nbp-menu__all:focus-visible { outline: 2px solid #de5a29; outline-offset: 0; }

@media (max-width: 767px) {
  .nbp-toggle { height: 32px; width: 28px; margin-right: -8px; }
}
@media (max-width: 639px) {
  .nbp-menu {
    border-radius: 0 0 12px 12px;
    left: 8px;
    max-height: calc(100svh - 120px);
    overflow-y: auto;
    right: 8px;
    width: auto;
  }
  .nbp-menu__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nbp-navitem.is-open::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nbp-tile img, .nbp-toggle svg { transition: none; }
  .nbp-tile:hover img, .nbp-tile:focus-visible img { transform: none; }
}

/* ---------- The skip link ----------
   First in the page on the site's own pages (index.html, plugins/, plugin/<id>/): out of sight
   until the keyboard reaches it, then a small tab in the top left corner over the header. */
.site-skip {
  background: #000;
  border: 2px solid var(--nb-highlight, #de5a29);
  border-radius: 0 0 6px 0;
  border-width: 0 2px 2px 0;
  color: #fff;
  font: 800 15px/1 var(--font, "Plus Jakarta Sans", system-ui, sans-serif);
  left: 0;
  padding: 14px 18px;
  position: fixed;
  text-decoration: none;
  top: 0;
  transform: translateY(-120%);
  z-index: 10100;
}
.site-skip:focus { outline: 2px solid #fff; outline-offset: -4px; transform: none; }

/* ---------- The header's background ----------
   Dali, 2026-11-10: "keep it see through but make it a bit blurry". The shell's colour stays
   (--nb-shell-bg, 92% black); what shows through it is blurred, so text scrolling under the
   header no longer reads through the links. The blur is on a layer behind the header's content,
   not on the header: a backdrop-filter on the header itself would make it the box that its
   "fixed" children are placed in, and the language list (i18n.js) is one of those. */
.nb-shell::before {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}
/* Without backdrop-filter the page stays sharp behind the header, so the header is less see-through. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nb-shell { --nb-shell-bg: rgba(0, 0, 0, 0.96); }
  .nb-shell::before { content: none; }
}

/* ---------- The menu button on phones and tablets (site-nav.js phoneMenu) ----------
   Dali, 2026-11-10: "use a hamburger menu containing all the navigation links, sign in and
   language". Under 1000px (MENU_BELOW in site-nav.js; the full row needs up to 964px, see there)
   the header is one 56px row: the owl on the left, the cart (where a page has one) and the menu
   button on the right. The links, the language button and Sign In are the header's own children;
   they are hidden until the button opens the menu, then they stack under the row in 48px lines.
   Selectors start at header.nb-shell so they win over the shell's and lab.css's phone rules
   whatever the order of the stylesheets. */
.nbm-button, .nbm-backdrop { display: none; }
@media (max-width: 999px) {
  header.nb-shell { align-items: center; flex-wrap: wrap; gap: 0 4px; min-height: 56px; padding: 6px 8px 5px 18px; }
  header.nb-shell .nb-shell__brand { margin-right: auto; }
  header.nb-shell .nb-shell__brand img { height: 44px; width: 33px; }
  header.nb-shell .nb-shell__divider, header.nb-shell .nb-shell__section { display: none; }
  header.nb-shell .lab-cart-button { margin: 0; order: 1; }
  .nbm-button {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: none;
    height: 44px;
    justify-content: center;
    order: 2;
    padding: 0;
    width: 44px;
  }
  .nbm-button:hover, .nbm-button[aria-expanded="true"] { background: rgb(255 255 255 / .08); }
  .nbm-button:focus-visible { outline: 2px solid var(--nb-highlight, #de5a29); outline-offset: -2px; }
  .nbm-button__x, .nbm-button[aria-expanded="true"] .nbm-button__bars { display: none; }
  .nbm-button[aria-expanded="true"] .nbm-button__x { display: inline; }

  /* Closed: only the row. The Plugins hover panel and its toggle are desktop things. */
  header.nb-shell .nb-shell__nav,
  header.nb-shell > .nb-lang-button,
  header.nb-shell .nb-shell__account,
  header.nb-shell .nbp-toggle,
  header.nb-shell .nbp-menu { display: none; }

  /* Open: the header leaves the flow and grows down over the page, which keeps the row's height
     free (--nbm-row, set by site-nav.js) so nothing under it moves. A menu taller than the screen
     scrolls in itself. */
  header.nb-shell.is-menu-open { background: rgb(0 0 0 / .97); left: 0; max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; position: fixed; right: var(--nbm-bar, 0px); top: 0; width: auto; }
  html.nbm-lock body::before { content: ""; display: block; height: var(--nbm-row, 56px); }
  header.nb-shell.is-menu-open .nb-shell__nav { align-items: stretch; display: flex; flex: 0 0 100%; flex-direction: column; flex-wrap: nowrap; gap: 0; margin-top: 5px; order: 10; }
  header.nb-shell.is-menu-open .nbp-navitem { display: flex; }
  header.nb-shell.is-menu-open .nbp-navitem > a { flex: 1 1 auto; }
  header.nb-shell.is-menu-open .nb-shell__nav a,
  header.nb-shell.is-menu-open > .nb-lang-button,
  header.nb-shell.is-menu-open .nb-account__signin,
  header.nb-shell.is-menu-open .nb-account__toggle {
    align-items: center;
    border-radius: 0;
    border-top: 1px solid rgb(255 255 255 / .08);
    display: flex;
    font-size: 17px;
    font-weight: 800;
    justify-content: flex-start;
    line-height: 1.2;
    margin: 0;
    max-width: none;
    min-height: 48px;
    padding: 0 6px;
    width: 100%;
  }
  header.nb-shell.is-menu-open > .nb-lang-button { flex: 0 0 100%; gap: 10px; height: auto; order: 11; }
  /* lab.css hides the language's name on a phone; in the menu it is the line's text. */
  header.nb-shell.is-menu-open > .nb-lang-button .nb-lang-button__name { clip: auto; height: auto; overflow: visible; position: static; white-space: nowrap; width: auto; }
  /* The language list opens in the menu, under its line, not as a box that could leave the screen. */
  header.nb-shell.is-menu-open > .nb-lang-menu { border-radius: 10px; box-shadow: none; flex: 0 0 100%; margin: 0 0 8px; order: 11; position: static; width: auto; }
  header.nb-shell.is-menu-open > .nb-lang-menu .nb-lang-opt { min-height: 44px; }
  /* The room under the last line is the account block's, not the header's: the header's own
     padding is the same open and closed, so closing never changes the row's height. */
  header.nb-shell.is-menu-open .nb-shell__account { display: flex; flex: 0 0 100%; flex-direction: column; align-items: stretch; margin: 0; order: 12; padding-bottom: 5px; }
  header.nb-shell.is-menu-open .nb-account__menu { margin: 0 0 8px; position: static; width: auto; }
  header.nb-shell.is-menu-open .nb-shell__nav a:focus-visible,
  header.nb-shell.is-menu-open > .nb-lang-button:focus-visible,
  header.nb-shell.is-menu-open .nb-account__signin:focus-visible,
  header.nb-shell.is-menu-open .nb-account__toggle:focus-visible { outline: 2px solid var(--nb-highlight, #de5a29); outline-offset: -2px; }
  /* The page behind the open menu does not scroll, is dimmed, and a tap on it closes the menu.
     --nbm-bar is the width of the scrollbar that goes away with the scrolling (site-nav.js
     measures it; 0 on a phone), kept free so the page does not reflow in a narrow desktop window. */
  html.nbm-lock { padding-right: var(--nbm-bar, 0px); }
  html.nbm-lock body { overflow: hidden; }
  html.nbm-lock .nbm-backdrop { background: rgb(0 0 0 / .5); display: block; inset: 0; position: fixed; touch-action: none; z-index: 9999; }
  /* The first-visit language suggestion (lab.css) hangs under the header, where the menu opens. */
  html.nbm-lock .nb-lang-suggest { display: none; }
}

.site-fallback-header { align-items: center; display: flex; gap: 24px; padding: 18px 2.5vw; }
.site-fallback-header a { color: #f5f5f5; font-weight: 700; text-decoration: none; }
.site-fallback-header nav { display: flex; gap: 18px; }
