/* Sidebar menu para o Colóquio
 * Unificado visualmente com o header: mesmas cores de borda, sombra suave e altura padrão do header (70px).
 */
.capua-menu-sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: var(--capua-menu-width,280px); background: #f8fafc; border-right: 1px solid #e5e7eb; padding: 24px 12px 20px; box-sizing: border-box; z-index: 1000; overflow-y: auto; font-family: var(--capua-font, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif); box-shadow: 0 4px 14px rgba(0,0,0,.05); }
/* Garante largura consistente quando a classe global está presente */
body.has-capua-menu { --capua-menu-width: 300px; }
/* Quando header presente, desloca abaixo dele (fallback altura 70px para evitar variação entre páginas) */
.has-capua-header.has-capua-menu .capua-menu-sidebar { top: calc(var(--capua-header-sticky-top,0px) + var(--capua-header-height,70px)); height: calc(100vh - (var(--capua-header-sticky-top,0px) + var(--capua-header-height,70px))); }
/* Respeita a barra de admin do WP */
body.admin-bar .capua-menu-sidebar { top: 32px; height: calc(100vh - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .capua-menu-sidebar { top: 46px; height: calc(100vh - 46px); }
}
.capua-menu-sidebar .capua-menu-nav { margin: 0; padding: 0; }
.capua-menu-list { list-style: none; margin: 0; padding: 0 4px; display: flex; flex-direction: column; gap: 8px; }
.capua-menu-item { margin: 0; }
/* Botão de item do menu
 * Ajuste: font-weight 400 para consistência entre navegadores e páginas; hover consistente.
 */
.capua-menu-btn { display: flex; width: 100%; box-sizing: border-box; text-align: left; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.2; cursor: default; font-weight: 400; color: #556270; align-items: center; gap: 10px; text-decoration: none; margin: 0; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.capua-menu-btn .capua-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; flex: 0 0 20px; }
.capua-menu-btn .capua-icon svg { width: 20px; height: 20px; display: block; fill: #6b7b8a; fill-opacity: .85; }
/* Label do item: impedir quebra em múltiplas linhas para preservar altura consistente */
.capua-menu-btn .capua-menu-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.capua-menu-btn { min-height: 40px; }
/* Acessibilidade: focus visível */
.capua-menu-btn:focus-visible { outline: 2px solid #94a3b8; outline-offset: 2px; }
.capua-menu-btn.is-active { background: #e2e8f0; border-color: #cbd5e1; color: #334155; }
.capua-menu-btn:hover { color: #334155; background: #f1f5f9; border-color: #cbd5e1; }
.capua-menu-btn:hover .capua-icon svg { fill: #334155; fill-opacity: 1; }
.capua-menu-btn:active { background: #e2e8f0; }
.capua-menu-btn[disabled] { opacity: .85; }

/* Space for site content so it is not hidden under the fixed sidebar */
body.has-capua-menu { margin-left: var(--capua-menu-width,280px); }
.has-capua-header.has-capua-menu body.has-capua-menu { margin-top: 0; }

/* Botão hamburger – oculto em desktop */
.capua-menu-toggle { display: none; }

@media (max-width: 800px) {
  body.has-capua-menu { margin-left: 0; }
  .capua-menu-sidebar {
    position: fixed;
    top: calc(var(--capua-header-sticky-top, 0px) + var(--capua-header-height, 70px));
    left: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--capua-header-sticky-top, 0px) - var(--capua-header-height, 70px));
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px 14px;
    z-index: 10019;
    background: #f8fafc;
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-110%);
    transition: transform .25s ease, opacity .2s ease;
    opacity: 0;
    pointer-events: none;
  }
  /* Admin bar mobile compat */
  body.admin-bar .capua-menu-sidebar {
    top: calc(46px + var(--capua-header-height, 70px));
    max-height: calc(100vh - 46px - var(--capua-header-height, 70px));
  }
  /* Estado aberto (toggled via JS) */
  .capua-menu-sidebar.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .capua-menu-list { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
  .capua-menu-btn { flex: none; width: 100%; font-size: 15px; padding: 12px 14px; }
  /* Botão hamburger visível em mobile */
  .capua-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 10025;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--edu-blue, #263A54);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .capua-menu-toggle:active { transform: scale(.92); }
  .capua-menu-toggle svg { width: 24px; height: 24px; fill: currentColor; }
  .capua-menu-toggle[aria-expanded="true"] { background: #475569; }
  /* Backdrop escurecido */
  .capua-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10018;
    background: rgba(0,0,0,.25);
  }
  .capua-menu-backdrop.is-visible { display: block; }
}
