/* ==========================================================================
   Resources menu: header mega menu, mobile accordion, footer column.
   Builds on the existing Services mega menu (.nav-item--mega / .mega-menu)
   and only styles the Resources-specific parts. Scoped to .site-chrome so it
   applies to both template families and nothing else.
   ========================================================================== */

/* --- Header trigger: link to the hub + caret toggle ---------------------- */

.site-chrome .nav-res__head {
  position: relative;
  /* Sit above the panel's hover bridge (.mega-menu::before) so the hub link
     and the toggle stay clickable while the panel is open (panel z-index is
     100 on new pages, 1031 on legacy pages). */
  z-index: 1032;
  display: inline-flex;
  align-items: center;
}

.site-chrome .nav-primary .nav-res__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin-left: 2px;
  color: var(--color-pure, #fff);
}

.site-chrome .nav-res__toggle .nav-caret {
  margin-left: 0;
}

.site-chrome .nav-res__toggle:hover,
.site-chrome .nav-res__toggle:focus-visible,
.site-chrome .nav-item--resources.is-active .nav-res__link,
.site-chrome .nav-item--resources.is-active .nav-res__toggle {
  color: var(--color-lime, #c7ff2e);
}

.site-chrome .nav-res__toggle:focus-visible,
.site-chrome .mobile-nav__res-toggle:focus-visible {
  outline: 2px solid var(--color-lime, #c7ff2e);
  outline-offset: 3px;
}

/* Click/keyboard open state (hover and focus-within already open it). */
.site-chrome .nav-item--mega.nav-item--resources.is-open .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.site-chrome .nav-item--mega.nav-item--resources.is-open .nav-caret {
  transform: rotate(225deg) translate(-2px, -2px);
}

/* Esc / toggle-close wins over :hover and :focus-within until the pointer or
   focus leaves the item. */
.site-chrome .nav-item--mega.nav-item--resources.is-closed .mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
}

.site-chrome .nav-item--mega.nav-item--resources.is-closed .nav-caret {
  transform: rotate(45deg) translate(-1px, -1px);
}

/* --- Mega panel content -------------------------------------------------- */

.site-chrome .nav-res__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-24, 24px);
  margin-bottom: 14px;
}

.site-chrome .nav-res__top .mega-menu__title {
  margin: 0;
}

.site-chrome .nav-res__all {
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--color-lime, #c7ff2e);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration, 0.25s) var(--ease, ease);
}

.site-chrome .nav-res__all::after {
  content: " \2192";
}

.site-chrome .nav-res__all:hover,
.site-chrome .nav-res__all:focus-visible {
  border-bottom-color: currentColor;
}

.site-chrome .nav-res__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-chrome .nav-res__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  padding: 12px;
  border: 1px solid transparent;
  color: var(--color-white, #f5f5f0);
  text-decoration: none;
  transition:
    border-color var(--duration, 0.25s) var(--ease, ease),
    background-color var(--duration, 0.25s) var(--ease, ease);
}

.site-chrome .nav-res__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border-card, #363636);
  color: var(--color-lime, #c7ff2e);
  transition: border-color var(--duration, 0.25s) var(--ease, ease);
}

.site-chrome .nav-res__icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
}

/* Line icons: keep them outlined even where page CSS fills SVG shapes. */
.site-chrome .nav-res__icon svg * {
  fill: none;
}

.site-chrome .nav-res__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-chrome .nav-res__label {
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-pure, #fff);
  transition: color var(--duration, 0.25s) var(--ease, ease);
}

.site-chrome .nav-res__desc {
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--color-white, #f5f5f0);
  opacity: 0.65;
}

.site-chrome .nav-res__item:hover,
.site-chrome .nav-res__item:focus-visible,
.site-chrome .nav-res__item.is-current {
  border-color: var(--color-border-card, #363636);
  background-color: rgba(199, 255, 46, 0.05);
  outline: none;
}

.site-chrome .nav-res__item:focus-visible {
  border-color: var(--color-lime, #c7ff2e);
}

.site-chrome .nav-res__item:hover .nav-res__icon,
.site-chrome .nav-res__item:focus-visible .nav-res__icon {
  border-color: var(--color-lime, #c7ff2e);
}

.site-chrome .nav-res__item:hover .nav-res__label,
.site-chrome .nav-res__item:focus-visible .nav-res__label,
.site-chrome .nav-res__item.is-current .nav-res__label {
  color: var(--color-lime, #c7ff2e);
}

@media (max-width: 1199.98px) {
  .site-chrome .nav-res__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-chrome .nav-res__desc {
    display: none;
  }

  .site-chrome .nav-res__item {
    align-items: center;
  }
}

/* --- Mobile offcanvas: Resources accordion ------------------------------- */

.mobile-nav.site-chrome .mobile-nav__res-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12, 12px);
}

.mobile-nav.site-chrome .mobile-nav__res-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border-card, #363636);
  background: none;
  color: var(--color-pure, #fff);
  cursor: pointer;
}

.mobile-nav.site-chrome .mobile-nav__res-toggle .nav-caret {
  margin-left: 0;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform var(--duration, 0.25s) var(--ease, ease);
}

.mobile-nav.site-chrome .mobile-nav__res-toggle:not(.collapsed) {
  border-color: var(--color-lime, #c7ff2e);
  color: var(--color-lime, #c7ff2e);
}

.mobile-nav.site-chrome .mobile-nav__res-toggle:not(.collapsed) .nav-caret {
  transform: rotate(225deg) translate(-2px, -2px);
}

.mobile-nav.site-chrome .mobile-nav__res.is-active .mobile-nav__res-link,
.mobile-nav.site-chrome .mobile-nav__res-list a[aria-current="page"] {
  color: var(--color-lime, #c7ff2e);
  opacity: 1;
}

.mobile-nav.site-chrome .mobile-nav__res-list {
  gap: var(--space-14, 14px);
  margin: var(--space-16, 16px) 0 0;
  padding: 0 0 0 var(--space-16, 16px);
  list-style: none;
  border-left: 1px solid var(--color-border-card, #363636);
}

/* Legacy pages give .mobile-nav__list display:flex at higher specificity
   than Bootstrap's .collapse rule, so restate the collapsed state. */
.mobile-nav.site-chrome .mobile-nav__res-list.collapse:not(.show) {
  display: none;
}

/* --- Footer column ------------------------------------------------------- */

.site-chrome .footer-col--resources {
  min-width: 148px;
}

/* Four link columns: tighten the gap on desktop, and below 1200px stack the
   brand above the columns and let the columns wrap instead of overflowing. */
@media (min-width: 1200px) {
  .site-chrome .footer-nav {
    gap: var(--space-56, 56px);
  }
}

@media (max-width: 1199.98px) {
  .site-chrome .footer-main {
    flex-direction: column;
    gap: var(--space-48, 48px);
  }

  .site-chrome .footer-nav {
    flex-wrap: wrap;
    gap: var(--space-40, 40px);
  }
}
