/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
@import "colors";
@import "media";

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: white;
  justify-content: flex-start;
  border-bottom: solid 1px map-get($colors, very-light-pink);
  z-index: 32;
  padding: 30px 60px;

  &__menu-container {
    flex-grow: 1;
  }

  &__menu-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    padding-left: 88px;
  }

  &__links-container {
    display: flex;
  }

  &__text-link {
    @extend .bodytext__medium--greyish-brown;
    margin-right: 30px;
    position: relative;
    width: fit-content;

    &::before, &::after {
      content: "";
      position: absolute;
      top: 100%;
      width: 0;
      right: 0;
      height: 2px;
      background-color: map-get($colors, cerulean-blue);
      transition: 0.2s ease-out;
    }

    &:hover, &.active {
      color: map-get($colors, greyish-brown);
      &::before, &::after {
        width: 100%;
        left: 0;
      }
    }
  }

  &--box-shadow {
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .12);
  }
}

@media (max-width: $tablet) {
  .navbar {
    padding: 20px;

    &__icon-container svg {
      width: 93px;
      height: auto;
    }

    &__menu-content {
      flex-direction: column;
      align-items: flex-start;
      padding-left: 0;
      padding-top: 0;
    }

    &__drawer-container {
      display: flex;
      flex-grow: 1;
      justify-content: flex-end;
    }

    &__toggle-button {
      border: none;
      background: none;
      padding: 0;
      position: relative;
      width: 26px;
      height: 20px;

      &--icon {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        visibility: hidden;
        opacity: 0;
        transition: 0.2s ease-out;

        &.visible {
          visibility: visible;
          opacity: 1;
        }
      }
    }

    &__drawer {
      position: fixed;
      //top: 77px;
      top: 117px; // TEMP - accommodate Airflow Summit banner (77 + 40)
      left: 0;
      width: 100%;
      height: calc(100% - 77px);
      background-color: white;
      transform: translateX(100%);
      transition: 0.2s ease-out;
      padding: 40px 40px 30px;

      &--open {
        transform: translateX(0);
      }
    }

    &__links-container {
      flex-direction: column;
    }

    &__text-link {
      margin-right: 0;
      margin-bottom: 10px;

      &:last-child {
        margin-bottom: 20px;
      }
    }
  }
}
