/* Menu unico di professorbyte.it (generato da scripts/site_nav.py). Classi con prefisso pbnav- per non toccare lo stile delle pagine. */
.pbnav {
  --pbnav-bg: rgba(11, 15, 25, 0.92);
  --pbnav-menu: #111827;
  --pbnav-text: #e2e8f0;
  --pbnav-muted: #94a3b8;
  --pbnav-border: rgba(255, 255, 255, 0.09);
  --pbnav-hover: rgba(148, 163, 184, 0.12);
  --pbnav-accent: #0ea5e9;
  --pbnav-accent-2: #14b8a6;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--pbnav-bg);
  border-bottom: 1px solid var(--pbnav-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--pbnav-text);
}
:root[data-theme="light"] .pbnav {
  --pbnav-bg: rgba(255, 255, 255, 0.94);
  --pbnav-menu: #ffffff;
  --pbnav-text: #0f172a;
  --pbnav-muted: #475569;
  --pbnav-border: #e2e8f0;
  --pbnav-hover: #f1f5f9;
  --pbnav-accent: #0284c7;
  --pbnav-accent-2: #0f766e;
}
.pbnav *, .pbnav *::before, .pbnav *::after { box-sizing: border-box; }
.pbnav a { text-decoration: none; }
.pbnav-bar { max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 1em; }

.pbnav-brand { display: flex; align-items: center; gap: 0.6em; color: var(--pbnav-text); flex-shrink: 0; }
.pbnav-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 0.95em; color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9); box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35); }
.pbnav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.pbnav-brand-text strong { font-size: 1.02em; font-weight: 800; }
.pbnav-brand-text small { font-size: 0.72em; color: var(--pbnav-muted); }

.pbnav-panel { display: flex; align-items: center; gap: 0.25em; }
.pbnav-top, .pbnav-dd-btn, .pbnav-theme {
  font: inherit; font-weight: 600; font-size: 0.92em; color: var(--pbnav-text); background: none; border: 1px solid transparent;
  border-radius: 9px; padding: 0.5em 0.75em; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35em; white-space: nowrap;
}
.pbnav-top:hover, .pbnav-dd-btn:hover, .pbnav-theme:hover, .pbnav-dd.pbnav-open .pbnav-dd-btn { background: var(--pbnav-hover); }
.pbnav-top[aria-current="page"], .pbnav-dd-btn.pbnav-current { color: var(--pbnav-accent); background: var(--pbnav-hover); }
.pbnav-cta { color: var(--pbnav-accent); border-color: color-mix(in srgb, var(--pbnav-accent) 40%, transparent); margin-left: 0.35em; }
.pbnav-theme { border-color: var(--pbnav-border); padding: 0.45em 0.65em; margin-left: 0.25em; }
.pbnav-theme-text { display: none; }
.pbnav-caret { font-size: 0.75em; opacity: 0.7; transition: transform 0.2s; }
.pbnav-dd.pbnav-open .pbnav-caret { transform: rotate(180deg); }

.pbnav-dd { position: relative; }
.pbnav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-height: calc(100vh - 90px); overflow-y: auto;
  background: var(--pbnav-menu); border: 1px solid var(--pbnav-border); border-radius: 14px; padding: 0.6em;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.5); display: none;
}
.pbnav-dd.pbnav-open .pbnav-menu { display: block; }
.pbnav-group + .pbnav-group { border-top: 1px solid var(--pbnav-border); margin-top: 0.35em; padding-top: 0.35em; }
.pbnav-group-title { font-size: 0.72em; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pbnav-accent-2); padding: 0.45em 0.6em 0.3em; }
.pbnav-link { display: flex; align-items: center; gap: 0.65em; padding: 0.5em 0.6em; border-radius: 8px; color: var(--pbnav-text); font-size: 0.9em; }
.pbnav-link:hover, .pbnav-link:focus-visible { background: var(--pbnav-hover); }
.pbnav-link[aria-current="page"] { background: var(--pbnav-hover); color: var(--pbnav-accent); font-weight: 700; }
.pbnav-badge { flex-shrink: 0; min-width: 2.6em; text-align: center; font-size: 0.7em; font-weight: 800; padding: 0.15em 0.35em; border-radius: 6px;
  color: var(--pbnav-accent-2); background: color-mix(in srgb, var(--pbnav-accent-2) 14%, transparent); }
.pbnav-menu-foot { display: block; margin-top: 0.35em; padding: 0.6em; border-top: 1px solid var(--pbnav-border); font-weight: 700; font-size: 0.9em; color: var(--pbnav-accent); border-radius: 0 0 8px 8px; }
.pbnav-menu-foot:hover { background: var(--pbnav-hover); }

.pbnav-burger { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--pbnav-border); background: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.pbnav-burger span { width: 20px; height: 2px; border-radius: 2px; background: var(--pbnav-text); transition: transform 0.2s, opacity 0.2s; }
.pbnav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pbnav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pbnav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.pbnav :focus-visible { outline: 2px solid var(--pbnav-accent); outline-offset: 2px; }

/* Smartphone e tablet: menu a pannello */
@media (max-width: 960px) {
  .pbnav-burger { display: flex; }
  .pbnav-panel {
    display: none; position: absolute; top: 62px; left: 0; right: 0; max-height: calc(100vh - 62px); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 0.2em; padding: 0.75em 16px 1.25em;
    background: var(--pbnav-menu); border-bottom: 1px solid var(--pbnav-border); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
  }
  .pbnav.pbnav-mobile-open .pbnav-panel { display: flex; }
  .pbnav-top, .pbnav-dd-btn, .pbnav-theme { width: 100%; justify-content: flex-start; padding: 0.75em 0.8em; font-size: 1em; }
  .pbnav-dd-btn { justify-content: space-between; }
  .pbnav-cta, .pbnav-theme { margin-left: 0; }
  .pbnav-theme-text { display: inline; }
  .pbnav-menu { position: static; width: auto; max-height: none; box-shadow: none; border: none; border-left: 2px solid var(--pbnav-border);
    border-radius: 0; margin: 0 0 0.4em 0.8em; padding: 0 0 0 0.4em; background: transparent; }
}
@media (max-width: 420px) { .pbnav-brand-text small { display: none; } }
@media print { .pbnav { display: none; } }
@media (prefers-reduced-motion: reduce) { .pbnav-caret, .pbnav-burger span { transition: none; } }

/* Playground incorporato nelle lezioni: niente menu */
body.pg-embed .pbnav { display: none; }
