/**
 * Site chrome overrides — loaded AFTER WordPress theme CSS on every page.
 * Fixes footer widget area (#2a4840 green from theme-style.min.css) to brand maroon #350309.
 * Elementor kit primary (yellow) is remapped in elementor-brand.css (loaded after page CSS).
 */
#colophon.site-footer.pbmit-bg-color-custom::before,
#colophon .pbmit-footer-section::before,
#colophon .pbmit-footer-widget-area::before,
#colophon .pbmit-footer-widget-area.pbmit-bg-color-custom::before,
#colophon .pbmit-footer-widget-area.pbmit-bg-color-transparent::before {
  background-color: #350309 !important;
  background-image: none !important;
}

/* btn-primary / btn-outline — unlayered override beats WordPress theme's
   `button { background-color: #222 }` rule (which wins over @layer components). */
.btn-primary {
  background-color: #a7192e !important;
  color: #ffffff !important;
  border: none !important;
}
.btn-primary:hover {
  background-color: #8a1325 !important;
}
.btn-outline {
  background-color: transparent !important;
  color: #a7192e !important;
  border: 1px solid #a7192e !important;
}
.btn-outline:hover {
  background-color: #a7192e !important;
  color: #ffffff !important;
}

/* App page dark sections — WordPress theme forces charcoal on h1/p inside main */
main.pbmit-app-page section.app-on-dark {
  color: #ffffff !important;
}

main.pbmit-app-page section.app-on-dark :is(h1, h2, h3, h4, h5, h6, blockquote) {
  color: #ffffff !important;
}

main.pbmit-app-page section.app-on-dark p:not([class*='text-brand-']) {
  color: inherit !important;
}

main.pbmit-app-page section.app-on-dark a:not([class*='text-brand-']):not([class*='btn-']) {
  color: inherit !important;
}

main.pbmit-app-page section.app-on-dark .text-white {
  color: #ffffff !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/90 {
  color: rgb(255 255 255 / 0.9) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/68 {
  color: rgb(255 255 255 / 0.68) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/60 {
  color: rgb(255 255 255 / 0.6) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/58 {
  color: rgb(255 255 255 / 0.58) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/50 {
  color: rgb(255 255 255 / 0.5) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/48 {
  color: rgb(255 255 255 / 0.48) !important;
}

main.pbmit-app-page section.app-on-dark .text-white\/38 {
  color: rgb(255 255 255 / 0.38) !important;
}

/* ── Academy / dropdown nav — responsive ─────────────────────────────── */

/* Desktop & large tablet: hover + keyboard focus open the dropdown */
@media (min-width: 1201px) {
  body:not(.pbmit-max-mega-menu-override) .pbmit-navbar ul > li:focus-within > ul.sub-menu {
    visibility: visible;
    opacity: 1;
    clip: inherit;
  }

  .pbmit-navbar .sub-menu-toggle {
    display: none !important;
  }
}

/* Mobile / tablet drawer (burger menu ≤1200px)
   Theme sets `.sub-menu { display: none }` and only shows `.sub-menu.show`. */
@media (max-width: 1200px) {
  .pbmit-navbar li.menu-item-has-children {
    position: relative;
  }

  .pbmit-navbar li.menu-item-has-children > a {
    display: inline-block;
    max-width: calc(100% - 52px);
    padding-right: 8px;
  }

  .pbmit-navbar .sub-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .pbmit-navbar .sub-menu-toggle:hover,
  .pbmit-navbar .sub-menu-toggle:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--pbmit-xcoach-global-color, #a7192e);
  }

  .pbmit-navbar .sub-menu-toggle:focus-visible {
    outline: 2px solid var(--pbmit-xcoach-global-color, #a7192e);
    outline-offset: 2px;
  }

  .pbmit-navbar .sub-menu-chevron {
    display: block;
    transition: transform 0.2s ease;
  }

  .pbmit-navbar .sub-menu-toggle.is-open .sub-menu-chevron {
    transform: rotate(180deg);
  }

  .menu-header-menu-container.active .pbmit-navbar ul > li > ul.sub-menu.show,
  .menu-header-menu-container.active .pbmit-navbar ul > li.pbmit-submenu-open > ul.sub-menu {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    clip: auto !important;
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
    min-width: 0 !important;
    width: 100% !important;
    border-top: none !important;
    padding: 0 0 10px 18px !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .menu-header-menu-container.active .pbmit-navbar ul > li > ul.sub-menu:not(.show) {
    display: none !important;
  }

  .menu-header-menu-container.active .pbmit-navbar ul > li > ul.sub-menu > li > a {
    display: block;
    padding: 12px 8px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0.02em;
  }
}
