/*
 * Island nav (class-proxybase-island-nav.php): the site header as a floating ink bar that opens downward
 * into each menu, plus the "Jump to a page" palette. Loads on every public page; carries its own token
 * fallbacks so it looks the same on pages without homepage.css (blog, shop, cart, checkout).
 */
.pbn-wrap, .pbn-pal {
  --pbn-ink: var(--color-band, oklch(19.2% 0.013 271));
  --pbn-ink-2: oklch(25.5% 0.018 268);
  --pbn-ink-3: oklch(31% 0.02 266);
  --pbn-text: oklch(96.5% 0.006 245);
  --pbn-muted: oklch(73% 0.022 262);
  --pbn-rule: oklch(100% 0 0 / 0.1);
  --pbn-accent: var(--color-accent, oklch(75.1% 0.135 247));
  --pbn-accent-ink: var(--color-accent-ink, oklch(19.2% 0.013 271));
  --pbn-sheet: var(--color-sheet, oklch(99.6% 0.002 248));
  --pbn-paper: var(--color-paper, oklch(97.2% 0.006 245));
  --pbn-paper-3: var(--color-paper-3, oklch(93% 0.012 245));
  --pbn-line: var(--color-rule, oklch(89% 0.012 248));
  --pbn-dark: var(--color-ink, oklch(19.2% 0.013 271));
  --pbn-dim: var(--color-muted, oklch(45% 0.022 264));
  --pbn-blue: var(--color-blue, oklch(54% 0.2 258));
  --pbn-body: "Red Hat Text", ui-sans-serif, system-ui, sans-serif;
  --pbn-mono: "Red Hat Mono", ui-monospace, monospace;
  --pbn-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pbn-lift: 0 1px 1px oklch(19.2% 0.013 271 / 0.1), 0 2px 4px -1px oklch(19.2% 0.013 271 / 0.1), 0 24px 44px -20px oklch(19.2% 0.013 271 / 0.42);
}

/* the bar: a sticky strip that keeps its space in the flow; only the island takes pointer events */
.pbn-wrap { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 1000; height: 72px; padding: 12px 24px 0; pointer-events: none; }
.pbn { position: relative; max-width: 1200px; margin: 0 auto; background: var(--pbn-ink); color: var(--pbn-text); border-radius: 14px; box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.06) inset, var(--pbn-lift); overflow: hidden; pointer-events: auto; font: 400 15px/1.5 var(--pbn-body); -webkit-font-smoothing: antialiased; }
.pbn *, .pbn *::before, .pbn *::after, .pbn-pal * { box-sizing: border-box; }
.pbn a { color: inherit; text-decoration: none; }
/* reset at zero specificity so each control's own rules win over it, and it still wins over the theme's button styles (loaded earlier) */
:where(.pbn, .pbn-pal) button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; margin: 0; padding: 0; min-height: 0; line-height: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; cursor: pointer; }
:where(.pbn, .pbn-pal) button:hover, :where(.pbn, .pbn-pal) button:focus { color: inherit; }
.pbn :focus-visible, .pbn-pal :focus-visible { outline: 2px solid var(--pbn-accent); outline-offset: 2px; border-radius: 6px; }
.pbn ::selection { background: var(--pbn-ink-3); color: var(--pbn-text); }
.pbn-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pbn-flag { width: 22px; height: 15px; flex: none; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.12); }

.pbn-row { display: flex; align-items: center; gap: 6px; height: 58px; padding: 0 9px 0 20px; }
.pbn-logo { display: inline-flex; flex: none; width: 132px; margin-right: 18px; color: var(--pbn-text); font-weight: 500; }
.pbn-logo img { display: block; width: 100%; height: auto; filter: invert(1); }
.pbn-nav { display: flex; gap: 2px; }
.pbn-trig { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 8px; font: 500 14.5px/1 var(--pbn-body); color: var(--pbn-muted); transition: background-color .2s var(--pbn-ease), color .2s; }
.pbn-trig:hover, .pbn-trig[aria-expanded="true"] { color: var(--pbn-text); background: oklch(100% 0 0 / 0.07); }
.pbn-trig .pbn-ico { width: 15px; height: 15px; stroke-width: 2; transition: transform .3s var(--pbn-ease); }
.pbn-trig[aria-expanded="true"] .pbn-ico { transform: rotate(180deg); }
.pbn-sp { flex: 1; }
.pbn-jump { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px; border-radius: 8px; background: var(--pbn-ink-2); box-shadow: 0 0 0 1px var(--pbn-rule) inset; font-size: 14px; color: var(--pbn-muted); transition: background-color .2s, color .2s; }
.pbn-jump:hover { background: var(--pbn-ink-3); color: var(--pbn-text); }
.pbn-jump .pbn-ico { width: 16px; height: 16px; }
.pbn-jump kbd { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--pbn-ink-3); font: 500 12px/1 var(--pbn-mono); color: var(--pbn-text); }
.pbn-key { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 18px; margin-left: 6px; border-radius: 6px; border: 1px solid oklch(65% 0.13 250 / 0.5); background: var(--pbn-accent); color: var(--pbn-accent-ink) !important; box-shadow: inset 0 1px 0 oklch(99.6% 0.002 248 / 0.32), inset 0 -1px 0 oklch(19.2% 0.013 271 / 0.1); font: 500 15px/1 var(--pbn-body); white-space: nowrap; transition: background-color .2s var(--pbn-ease), transform .2s var(--pbn-ease); }
.pbn-key:hover { background: oklch(79% 0.12 247); }
.pbn-key:active { transform: translateY(1px); }
.pbn-menu { display: none; width: 40px; height: 40px; border-radius: 8px; place-items: center; color: var(--pbn-text); }
.pbn-menu:hover { background: oklch(100% 0 0 / 0.07); }
.pbn-menu > span { display: grid; place-items: center; }
.pbn-menu .pbn-menu-close, .pbn-menu[aria-expanded="true"] .pbn-menu-open { display: none; }
.pbn-menu[aria-expanded="true"] .pbn-menu-close { display: grid; }

/* the drawer: height is set by island-nav.js and eased here */
.pbn-drawer { height: 0; overflow: hidden; transition: height .5s var(--pbn-ease); }
.pbn-drawer.is-closing { transition-duration: .3s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.pbn-panel { padding: 6px 20px 18px; border-top: 1px solid var(--pbn-rule); }
.pbn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 28px; padding-top: 14px; }
.pbn-grid--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); }
.pbn-panel.is-in .pbn-grid > *, .pbn-panel.is-in .pbn-foot { animation: pbn-in .38s var(--pbn-ease) both; }
.pbn-panel.is-in .pbn-grid > :nth-child(2) { animation-delay: .04s; }
.pbn-panel.is-in .pbn-grid > :nth-child(3) { animation-delay: .08s; }
.pbn-panel.is-in .pbn-grid > :nth-child(4) { animation-delay: .1s; }
.pbn-panel.is-in .pbn-grid > :nth-child(n+5), .pbn-panel.is-in .pbn-foot { animation-delay: .12s; }
@keyframes pbn-in { from { opacity: 0; transform: translateY(-6px); } }
.pbn-label { margin: 0 0 6px; padding: 0 10px; font: 500 12.5px/1.4 var(--pbn-body); color: var(--pbn-muted); }
.pbn-item { display: block; padding: 10px; border-radius: 9px; transition: background-color .2s var(--pbn-ease); }
.pbn-item:hover, .pbn-item:focus-visible { background: var(--pbn-ink-2); }
.pbn-item b { display: flex; align-items: center; gap: 10px; font: 500 15px/1.3 var(--pbn-body); color: var(--pbn-text); }
.pbn-item b .pbn-ico { width: 18px; height: 18px; color: var(--pbn-accent); }
.pbn-item small { display: block; margin: 4px 0 0 28px; font-size: 13.5px; line-height: 1.45; color: var(--pbn-muted); }
.pbn-flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.pbn-flag-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; font: 500 14px/1 var(--pbn-body); color: var(--pbn-text); }
.pbn-flag-link:hover, .pbn-flag-link:focus-visible { background: var(--pbn-ink-2); }
.pbn-try { align-self: start; padding: 16px; border-radius: 12px; background: var(--pbn-ink-2); box-shadow: 0 0 0 1px var(--pbn-rule) inset; }
.pbn-try p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--pbn-muted); }
.pbn-try p b { color: var(--pbn-text); font-weight: 500; }
.pbn-cmd { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 8px; background: var(--pbn-ink); }
.pbn-cmd code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; background: none; font: 400 12.5px/1.4 var(--pbn-mono); color: var(--pbn-text); }
.pbn-cmd button { flex: none; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--pbn-ink-3); font: 500 12.5px/1 var(--pbn-body); color: var(--pbn-text); }
.pbn-cmd button:hover { background: oklch(38% 0.02 266); }
.pbn-foot { display: flex; justify-content: flex-end; padding: 12px 10px 0; }
.pbn-foot a, .pbn-mob-all { display: inline-flex; align-items: center; gap: 8px; font: 500 14px/1 var(--pbn-body); color: var(--pbn-text); }
.pbn-foot .pbn-ico, .pbn-mob-all .pbn-ico { width: 16px; height: 16px; transition: transform .25s var(--pbn-ease); }
.pbn-foot a:hover .pbn-ico, .pbn-mob-all:hover .pbn-ico { transform: translateX(3px); }

/* phone and small tablet: the island opens into one scrolling list */
@media (max-width: 1023px) {
  .pbn-wrap { height: 64px; padding: 10px 10px 0; }
  .pbn-row { height: 54px; padding: 0 6px 0 16px; }
  .pbn-logo { width: 118px; }
  .pbn-nav, .pbn-row > .pbn-key, .pbn-jump span, .pbn-jump kbd { display: none; }
  .pbn-jump { width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; box-shadow: none; color: var(--pbn-text); }
  .pbn-jump .pbn-ico { width: 20px; height: 20px; }
  .pbn-menu { display: grid; }
  .pbn-panel { display: none !important; }
  .pbn-mob { max-height: calc(100dvh - 96px - var(--wp-admin--admin-bar--height, 0px)); overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 0; border-top: 1px solid var(--pbn-rule); }
  .pbn-mob .pbn-label { margin: 16px 0 2px; }
  .pbn-mob .pbn-item { padding: 9px 10px; }
  .pbn-mob .pbn-item small { display: none; }
  .pbn-mob .pbn-flags { padding: 2px 0; }
  .pbn-mob-all { margin: 6px 10px 4px; color: var(--pbn-muted); }
  .pbn-mob-key { position: sticky; bottom: 0; padding: 14px 0 12px; background: var(--pbn-ink); }
  .pbn-mob-key .pbn-key { display: flex; width: 100%; min-height: 48px; margin: 0; }
}
@media (min-width: 1024px) { .pbn-mob { display: none !important; } }
@media (min-width: 1024px) and (max-width: 1140px) { .pbn-jump span { display: none; } .pbn-logo { margin-right: 6px; } }

/* "Jump to a page" palette */
.pbn-pal { position: fixed; inset: 0; z-index: 100000; display: flex; justify-content: center; align-items: flex-start; padding: calc(96px + var(--wp-admin--admin-bar--height, 0px)) 16px 16px; background: oklch(19.2% 0.013 271 / 0.32); font: 400 15px/1.5 var(--pbn-body); color: var(--pbn-dark); animation: pbn-fade .2s ease-out both; }
.pbn-pal[hidden] { display: none; }
@keyframes pbn-fade { from { background-color: oklch(19.2% 0.013 271 / 0); } }
.pbn-dlg { width: min(600px, 100%); max-height: calc(100dvh - 140px); display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: var(--pbn-sheet); box-shadow: 0 0 0 1px var(--pbn-line), var(--pbn-lift); animation: pbn-pop .3s var(--pbn-ease) both; }
@keyframes pbn-pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.pbn-q { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--pbn-line); }
.pbn-q .pbn-ico { color: var(--pbn-dim); }
.pbn-q input, .pbn-q input:focus { flex: 1; min-width: 0; height: 56px; margin: 0; padding: 0 !important; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0; font: 400 17px/1 var(--pbn-body); color: var(--pbn-dark); caret-color: var(--pbn-blue); }
.pbn-q input::placeholder { color: var(--pbn-dim); opacity: 1; }
.pbn-pal kbd { font: 500 12px/1 var(--pbn-mono); padding: 5px 7px; border-radius: 5px; background: var(--pbn-paper-3); color: var(--pbn-dim); }
.pbn-res { overflow-y: auto; padding: 8px; }
.pbn-grp { margin: 10px 10px 4px; font: 500 12.5px/1.4 var(--pbn-body); color: var(--pbn-dim); }
.pbn-opt { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; color: var(--pbn-dark) !important; text-decoration: none !important; }
.pbn-opt[hidden] { display: none; }
.pbn-opt .pbn-ico { color: var(--pbn-dim); }
.pbn-opt .pbn-flag { box-shadow: 0 0 0 1px oklch(19.2% 0.013 271 / 0.1); }
.pbn-opt span { flex: 1; min-width: 0; font: 500 15px/1.3 var(--pbn-body); }
.pbn-opt code { padding: 0; background: none; font: 400 12px/1 var(--pbn-mono); color: var(--pbn-dim); white-space: nowrap; }
.pbn-opt[aria-selected="true"] { background: var(--pbn-paper-3); }
.pbn-opt[aria-selected="true"] .pbn-ico { color: var(--pbn-dark); }
.pbn-empty { margin: 0; padding: 28px 12px; text-align: center; color: var(--pbn-dim); }
.pbn-hint { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--pbn-line); background: var(--pbn-paper); font-size: 12.5px; color: var(--pbn-dim); }
.pbn-hint kbd { padding: 3px 5px; margin-right: 4px; border-radius: 4px; background: var(--pbn-sheet); box-shadow: 0 0 0 1px var(--pbn-line); color: var(--color-ink-2, oklch(28% 0.02 264)); font-size: 11.5px; }
@media (max-width: 1023px) { .pbn-pal { padding-top: calc(76px + var(--wp-admin--admin-bar--height, 0px)); } .pbn-hint { display: none; } }
@media (max-width: 480px) { .pbn-opt code { display: none; } }

/* GeneratePress leaves room for its own header and sticky clone; neither is printed now */
body.pb-island-nav #sticky-placeholder, body.pb-island-nav .slideout-overlay { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .pbn *, .pbn-drawer, .pbn-pal, .pbn-dlg { transition: none !important; animation: none !important; }
}
