/* ========================================================================
 * CodeLinSoft Nova 4.9.5 — bbPress responsive local navigation
 * - Desktop keeps inline Index / Topic recenti tabs.
 * - Mobile uses a compact, content-height dropdown (not a full-height drawer).
 * - The toolbar follows exactly the forum content width.
 * ======================================================================== */

body.cls-bbpress .bbp-hub-toolbar {
  width: 100% !important;
  box-sizing: border-box !important;
}

body.cls-bbpress .bbp-hub-toolbar__left {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

body.cls-bbpress .bbp-hub-toolbar__left .bbp-tabs-bar {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.cls-bbpress .bbp-tabs-mobile-toggle {
  display: none !important;
}

@media (max-width: 767px) {
  body.cls-bbpress .bbp-hub-shell {
    width: 100% !important;
    max-width: none !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  body.cls-bbpress .bbp-hub-toolbar {
    display: block !important;
    width: 100% !important;
    margin: 0 0 22px !important;
    padding: 0 0 16px !important;
  }

  body.cls-bbpress .bbp-hub-toolbar__left {
    display: block !important;
    width: 100% !important;
  }

  /* The archive sidebar toggle is already hidden on mobile; remove the empty row. */
  body.cls-bbpress .bbp-hub-toolbar__right {
    display: none !important;
  }

  body.cls-bbpress .bbp-tabs-bar {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 7px !important;
    border: 1px solid #dbe7ef !important;
    border-radius: 15px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(6, 45, 70, .06) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 13px !important;
    border: 1px solid #d7e5ee !important;
    border-radius: 11px !important;
    background: #f8fbfd !important;
    color: #12344e !important;
    font-family: "Cantarell", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle:hover,
  body.cls-bbpress .bbp-tabs-mobile-toggle:focus-visible,
  body.cls-bbpress .bbp-tabs-mobile-toggle[aria-expanded="true"] {
    border-color: #8fd3f7 !important;
    background: #eef8ff !important;
    color: #0878c9 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(7, 135, 249, .09) !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle__icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle__caret {
    font-size: 11px !important;
    transition: transform .18s ease !important;
  }

  body.cls-bbpress .bbp-tabs-bar.is-tabs-open .bbp-tabs-mobile-toggle__caret {
    transform: rotate(180deg) !important;
  }

  /* Compact popup: only two rows, never full-height. */
  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner {
    display: none !important;
    position: absolute !important;
    left: 7px !important;
    top: calc(100% + 8px) !important;
    z-index: 10020 !important;
    width: min(270px, calc(100vw - 48px)) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px !important;
    border: 1px solid #d8e6ef !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 18px 42px rgba(5, 47, 75, .18) !important;
    overflow: visible !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    box-sizing: border-box !important;
  }

  body.cls-bbpress .bbp-tabs-bar.is-tabs-open .bbp-tabs--inner {
    display: flex !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner .bbp-tab {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    border-radius: 9px !important;
    color: #173b53 !important;
    font-family: "Cantarell", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner .bbp-tab::after {
    display: none !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner .bbp-tab:hover,
  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner .bbp-tab:focus-visible {
    background: #eef8ff !important;
    color: #0878c9 !important;
    outline: none !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-tabs--inner .bbp-tab.is-active {
    background: linear-gradient(135deg, #eef8ff, #f7fcff) !important;
    color: #0878c9 !important;
    box-shadow: inset 3px 0 0 #168ff0 !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle {
    max-width: min(210px, 52vw) !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-name {
    max-width: 122px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-menu {
    right: 0 !important;
    left: auto !important;
    width: min(340px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
  }

  /* Every forum section follows the same width contract, logged in or out. */
  body.cls-bbpress .bbp-hub-page,
  body.cls-bbpress .bbp-hub-hero,
  body.cls-bbpress .bbp-hub-content,
  body.cls-bbpress .bbp-hub-forum-grid {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 380px) {
  body.cls-bbpress .bbp-tabs-mobile-toggle__label {
    display: none !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle {
    padding-inline: 12px !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle {
    max-width: 64vw !important;
  }
}

/* ========================================================================
   Nova 4.9.16 — identical mobile forum/account controls on every bbPress view.
   Keep the bbPress Display Page intact; only normalize the compact nav skin.
   ======================================================================== */
@media (max-width: 767px) {
  body.cls-bbpress .bbp-tabs-mobile-toggle,
  body.cls-bbp-unified .bbp-tabs-mobile-toggle,
  body.cls-bbp-forum-home .bbp-tabs-mobile-toggle {
    min-height: 44px !important;
    padding: 8px 14px !important;
    border: 1px solid #087ff0 !important;
    border-radius: 11px !important;
    background: linear-gradient(180deg, #1498ff 0%, #067be8 100%) !important;
    color: #fff !important;
    box-shadow: 0 5px 13px rgba(7, 135, 249, .22) !important;
  }

  body.cls-bbpress .bbp-tabs-mobile-toggle:hover,
  body.cls-bbpress .bbp-tabs-mobile-toggle:focus-visible,
  body.cls-bbpress .bbp-tabs-mobile-toggle[aria-expanded="true"],
  body.cls-bbp-unified .bbp-tabs-mobile-toggle:hover,
  body.cls-bbp-unified .bbp-tabs-mobile-toggle:focus-visible,
  body.cls-bbp-unified .bbp-tabs-mobile-toggle[aria-expanded="true"],
  body.cls-bbp-forum-home .bbp-tabs-mobile-toggle:hover,
  body.cls-bbp-forum-home .bbp-tabs-mobile-toggle:focus-visible,
  body.cls-bbp-forum-home .bbp-tabs-mobile-toggle[aria-expanded="true"] {
    border-color: #0674d9 !important;
    background: linear-gradient(180deg, #0d8ef8 0%, #066ed5 100%) !important;
    color: #fff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(7, 135, 249, .10), 0 5px 13px rgba(7, 135, 249, .22) !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle,
  body.cls-bbp-unified .bbp-tabs-bar .bbp-account-toggle,
  body.cls-bbp-forum-home .bbp-tabs-bar .bbp-account-toggle {
    min-height: 34px !important;
    padding: 3px 4px !important;
    border: 1px solid #d7e5ee !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #173d5b !important;
    box-shadow: none !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle:hover,
  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle:focus-visible,
  body.cls-bbpress .bbp-tabs-bar .bbp-account-toggle[aria-expanded="true"],
  body.cls-bbp-unified .bbp-tabs-bar .bbp-account-toggle:hover,
  body.cls-bbp-unified .bbp-tabs-bar .bbp-account-toggle:focus-visible,
  body.cls-bbp-unified .bbp-tabs-bar .bbp-account-toggle[aria-expanded="true"],
  body.cls-bbp-forum-home .bbp-tabs-bar .bbp-account-toggle:hover,
  body.cls-bbp-forum-home .bbp-tabs-bar .bbp-account-toggle:focus-visible,
  body.cls-bbp-forum-home .bbp-tabs-bar .bbp-account-toggle[aria-expanded="true"] {
    border-color: #bdd7e7 !important;
    background: #f7fbfd !important;
    color: #0a6fae !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(7, 135, 249, .08) !important;
  }

  body.cls-bbpress .bbp-tabs-bar .bbp-account-caret,
  body.cls-bbpress .bbp-tabs-mobile-toggle__caret,
  body.cls-bbp-unified .bbp-tabs-bar .bbp-account-caret,
  body.cls-bbp-unified .bbp-tabs-mobile-toggle__caret,
  body.cls-bbp-forum-home .bbp-tabs-bar .bbp-account-caret,
  body.cls-bbp-forum-home .bbp-tabs-mobile-toggle__caret {
    color: currentColor !important;
    opacity: .9 !important;
  }
}
