$basic: all 0.2s ease-in-out;
$bounce: all 0.6s cubic-bezier(0.5, 1.65, 0.4, 0.8);
$bounce-curve: cubic-bezier(0.5, 1.65, 0.4, 0.8);

$slow: all 0.5s cubic-bezier(0.57, 0.2, 0.21, 0.89);
$slow-curve: cubic-bezier(0.57, 0.2, 0.21, 0.89);

@mixin size($width, $height: $width) {
  width: $width;
  height: $height;
}

@mixin maxSize($width, $height: $width) {
  max-width: $width;
  max-height: $height;
}

// Breakpoints
$mobile: 768px;
$mobile-min: 767px;
$desktop: 1176px;
// Global mixins
@mixin phone {
  @media (max-width: #{$mobile-min}) {
    @content;
  }
}
/* Tablet and wider */
@mixin tablet {
  @media (min-width: #{$mobile}) {
    @content;
  }
}

/* Desktop and wider */
@mixin desktop {
  @media (min-width: #{$desktop}) {
    @content;
  }
}

/* utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hidden-search {
  display: none;
}
@media (min-width: 768px) {
  .mobile-icons,
  .search-close {
    display: none !important;
  }
}

/* MAIN MENU */
.cagov-nav.mobile-search {
  margin-top: var(--s-2, 1rem);
}

.cagov-nav.menu-trigger {
  margin-top: 1rem;
  padding: var(--s-1, 0.5rem) var(--s-2, 1rem) var(--s-1, 0.5rem) 0;
  transition: 0.3s;
  transform-origin: top left;
  display: inline-block;
  cursor: pointer;
  position: relative;

  display: flex;
  align-items: center;

  .is-fixed {
    position: fixed;
  }
  right: 0;
  transition: 0.3s;
  transform-origin: center center;
  @include phone {
    z-index: 2000;
  }

  @include tablet {
    z-index: 2000;
  }
}

cagov-site-navigation {
  .container {
    padding: 0;
    margin: 0;

    .search-container {
      padding-top: var(--s-2, 1rem);
      padding-bottom: var(--s-2, 1rem);
    }
  }
}

/* EXPANDED MENU SYTLES */
cagov-site-navigation {
  border-bottom: 1px solid var(--gray-200, #d4d4d7);
  background-color: var(--white, #ffffff);
  a.expanded-menu-section-header-link {
    /* jbum - this is to override the inherited text-decoration from .interior_page a */
    text-decoration: none;
  }

  &.display-menu {
    .expanded-menu {
      display: block;
    }
  }

  .mobile-icons {
    display: block;
    margin-left: auto;
    display: flex;

    .search-btn {
      display: flex;
      align-items: center;
      svg {
        margin-right: var(--s-1, 0.5rem);
      }
    }
    .search-btn,
    .menu-btn {
      border: none;
      background: transparent;
      overflow: visible;
      padding: 10px 10px;
      margin-right: 10px;

      &:hover {
        color: var(--primary-900, #003588);

        .blue {
          fill: var(--primary-900, #003588);
        }
      }
      &:focus {
        color: var(--primary-900, #003588);
        outline: 2px solid var(--accent2-500, #ac8226);
      }

      svg {
        position: relative;
        top: 1px;
      }
    }
  }
  @include tablet {
    display: block;
    .mobile-icons {
      display: none;
    }
  }

  .expanded-menu {
    display: none;
    max-width: calc(var(--w-lg, "1176px") + 32px);
    margin: 0 auto;
    @include tablet {
      display: block;
      padding: 0 16px;
    }
    &-grid {
      margin: 0 auto;
      @include tablet {
        display: flex;
        justify-content: flex-start;
        column-gap: var(--s-1, 0.5rem);
        align-content: flex-start;
        align-items: stretch;
      }
    }
    &-col {
      text-align: left;
    }
    &-section {
      text-align: left;

      &.expanded {
        @include tablet {
          z-index: 3;
        }
        .expanded-menu-dropdown {
          max-height: none;
          top: 2.35rem;
        }
      }
      @include tablet {
        padding: 0;
        margin-bottom: 1rem;
        position: relative;
        &:last-of-type {
          margin-bottom: 0;
        }
      }
      &.mobile-only {
        @include tablet {
          display: none;
        }
      }
      @include tablet {
        .expanded-menu-dropdown {
          position: absolute;
          top: 0;
          left: 0;
          width: auto;
          min-width: 17rem;
          background: #fff;
          padding: 0;
          border: none;
        }
      }
      @include tablet {
        .expanded-menu-section-header {
          padding-right: 0;
          margin-right: 0;
        }
      }
      @include phone {
        border-top: solid 1px var(--gray-200, #d4d4d7);
      }

      &.expanded {
        @include phone {
          .expanded-menu-dropdown {
            max-height: 100rem;
          }
        }
        @include tablet {
          .expanded-menu-dropdown {
            max-height: none;
            top: 59px;
            padding: var(--s-1, 0.5rem) var(--s-2, 1rem) var(--s-2, 1rem) var(--s-2, 1rem);
            border: solid 1px var(--gray-200, #d4d4d7);
            box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
          }
        }
        .expanded-menu-section-header-arrow-svg {
          transform: rotate(180deg);
        }
      }
      &-header {
        &-link {
          display: flex !important;
          column-gap: var(--s-1, 0.5rem);
          align-items: center;
          justify-content: space-between;
          font-weight: var(--font-weight-4, 400);
          font-size: var(--font-size-2, 1.125rem);
          cursor: pointer !important;
          width: 100%;
          text-transform: none;
          display: block;
          text-align: left;
          border: none;
          padding-top: var(--s-2, 1rem);
          padding-bottom: var(--s-2, 1rem);
          padding-left: var(--s-2, 1rem);
          padding-right: var(--s-2, 1rem);
          color: var(--primary-700, #165ac2);
          outline-offset: -2px;
          &:active {
            background: transparent;
          }
          &:hover {
            text-decoration: underline;
            color: var(--primary-900, #003588);
          }

          @include tablet {
            justify-content: flex-start;
          }
        }
        &-arrow {
          @include maxSize(1rem, 1rem);
          transform: translateY(-50%);
          display: block;
          transition: $slow;
          @include tablet {
            transform: none;
          }
          &-svg {
            width: 100%;
            display: inline-block;
            transition: $bounce;
            @include tablet {
              display: block;
            }
          }
        }
      }
    }
    &-dropdown {
      max-height: 0px;
      overflow: hidden;
      transition: max-height 0.5s $slow-curve;

      &-link {
        font-weight: var(--font-weight-4, 400);
        font-size: var(--font-size-2, 1.125rem);
        padding: var(--s-1, 0.5rem) var(--s-sm, 0.25rem);
        margin: 0.15rem 0 0.15rem 2px;
        display: table;
        transition: color 0.3s $slow-curve;
        text-decoration: none;
        width: 100%;
        &:hover {
          text-decoration: underline;
        }
        &.current-page-highlight {
          font-weight: var(--font-weight-7, 700);
        }
        @include tablet {
          padding: var(--s-1, 0.5rem) 0;
          line-height: var(--font-lineheight-6, 2rem);
        }
        @include phone {
          padding: var(--s-1, 0.5rem) var(--s-sm, 0.25rem) var(--s-1, 0.5rem) var(--s-2, 1rem);
          outline-offset: -4px;
          &:first-child {
            padding-top: var(--s-2, 1rem);
          }
          &:last-child {
            padding-bottom: var(--s-2, 1rem);
          }
        }
      }
    }
    &-grouping {
      &:not(:first-child) {
        margin-top: var(--s-1, 0.5rem);
      }
    }
  }
}
cagov-site-navigation.display-menu {
  overflow: hidden;
  .expanded-menu {
    transform: translateX(0);
    visibility: visible;
    @include tablet {
      @include size(100vw, 100vh);
      opacity: 1;
      visibility: visible;
    }
    &:focus {
      outline: none;
    }
  }
  .expanded-menu {
    @include phone {
      margin-left: 0;
      border-bottom: solid 1px var(--gray-200, #d4d4d7);
    }
    &-col,
    &-search {
      @include tablet {
        transition: all 0.6s $bounce-curve;
        opacity: 1;
        transform: translateY(0);
      }
    }
    &-col {
      @include tablet {
        &.section-get-help {
          transition-delay: 0.15s !important;
        }
        &.section-health-info {
          transition-delay: 0.3s !important;
        }
        &.section-working-living-safely {
          transition-delay: 0.45s !important;
        }
        &.section-you-help {
          transition-delay: 0.6s !important;
        }
      }
    }
  }
}
cagov-site-navigation {
  .expanded-menu-close-mobile {
    &-svg {
      width: var(--s-2, 1rem);
      transform: rotate(180deg);
    }
  }
}

.expanded-menu-section-header-arrow-svg {
  max-width: 20px;
}
