@charset 'utf-8';

.l-header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 4;
  background-image: url('../../img/common/header_menu_bg.webp');
  background-repeat: no-repeat;
  background-position: top 0 center;
  background-size: cover;

  .l-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    height: 77px;
    box-sizing: border-box;
  }

  .l-header__logo {
    display: inline-block;
  }

  .l-header__menu {
    display: flex;
    align-items: center;
    gap: 40px;

    .l-header__nav {
      .l-header__nav-list {
        display: flex;
        gap: 30px;

        .l-header__nav-item {
          .l-header__nav-link {
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all .1s linear;

            .l-header__nav-link-text {
              font-size: 1.6rem;
              color: var(--color-primary-01);
              position: relative;
              display: inline-block;

              &::before {
                content: '';
                position: absolute;
                width: 0;
                height: 2px;
                background-color: var(--color-primary-01);
                bottom: -7px;
                left: 0;
                transition: all .1s linear;
              }
            }
          }

          .l-header-nav-sub {
            position: relative;

            .l-header-nav-sub__title {
              display: flex;
              gap: 5px;
              align-items: center;
              cursor: pointer;

              .l-header-nav-sub__title-text {
                font-size: 1.6rem;
                color: var(--color-primary-01);
                position: relative;
                display: inline-block;

                &::before {
                  content: '';
                  position: absolute;
                  width: 0;
                  height: 2px;
                  background-color: var(--color-primary-01);
                  bottom: -7px;
                  left: 0;
                  transition: all .1s linear;
                }
              }

              .l-header-nav-sub__title-icon {
                transition: all .1s linear;
                display: inline-block;
              }
            }

            .l-header-nav-sub-list-wrap {
              background-color: #fff;
              border-radius: 10px;
              padding: 30px;
              position: absolute;
              top: calc(13px + 12px);
              left: 0;
              display: none;

              .l-header-nav-sub-list {
                display: grid;
                gap: 20px;

                .l-header-nav-sub-list__item {
                  .l-header-nav-sub-list__link {
                    color: var(--color-font-01);
                    font-size: 1.6rem;
                    white-space: nowrap;
                    text-decoration: none;
                  }
                }
              }
            }
          }

          .l-header-nav-sub--active {
            .l-header-nav-sub__title {
              .l-header-nav-sub__title-icon {
                transform: rotate(45deg);
              }
            }

            .l-header-nav-sub-list-wrap {
              display: block;
            }
          }
        }
      }
    }

    .l-header__contact-button {
      display: inline-block;
      padding: 10px 20px;
      background-color: var(--color-primary-01);
      color: var(--color-font-03);
      border-radius: 55px;
      text-decoration: none;
      font-size: 1.6rem;
      font-weight: 700;
      letter-spacing: 1.6px;
      transition: all .3s linear;
      border: 1px solid var(--color-primary-01);
      box-sizing: border-box;
    }
  }

  .l-header-menu-trigger {
    display: none;
  }

  .l-header-nav-sp {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .l-header {
    .l-header__menu {
      .l-header__nav {
        .l-header__nav-list {
          .l-header__nav-item {
            .l-header__nav-link {
              &:hover {
                .l-header__nav-link-text {
                  &::before {
                    width: 100%;
                  }
                }
              }
            }
  
            .l-header-nav-sub {
              .l-header-nav-sub__title {
                &:hover {
                  .l-header-nav-sub__title-text {
                    &::before {
                      width: 100%;
                    }
                  }
                }
              }
  
              .l-header-nav-sub-list-wrap {
                .l-header-nav-sub-list {
                  .l-header-nav-sub-list__item {
                    .l-header-nav-sub-list__link {
                      &:hover {
                        color: var(--color-primary-01);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
  
      .l-header__contact-button {
        &:hover {
          background-color: var(--color-font-03);
          color: var(--color-primary-01);
        }
      }
    }
  }
}

/* SP + TAB */
@media screen and (max-width: 1024px) {
  .l-header {  
    background-image: url('../../img/common/header_menu_bg_sp.webp');

    .l-header__inner {
      height: 60px;
      padding: 15px 20px;
    }

    .l-header__logo {
      width: 104px;
    }

    .l-header__menu {
      gap: 20px;

      .l-header__nav {
        display: none;
      }

      .l-header__contact-button {
        font-size: 1.4rem;
        letter-spacing: 1.4px;
      }
    }

    .l-header-menu-trigger {
      display: inline-block;
      width: 24px;
      height: 24px;
      position: relative;
      cursor: pointer;

      .l-header-menu-trigger__line {
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: var(--color-primary-01);
        left: 0;
        transition: all .1s linear;

        &:first-child {
          top: 6px;
        }

        &:last-child {
          top: 16px;
        }
      }
    }

    .l-header-menu-trigger--active {
      .l-header-menu-trigger__line {
        &:first-child, 
        &:last-child {
          top: 50%;
        }

        &:first-child {
          transform: rotate(135deg);
        }

        &:last-child {
          transform: rotate(-135deg);
        }
      }
    }

    .l-header-nav-sp {
      height: calc(100vh - 60px);
      padding: 50px 50px 100px 50px;
      box-sizing: border-box;
      flex-direction: column;
      justify-content: space-between;
      overflow-y: scroll;

      .l-header-nav-sp__list {
        display: grid;
        gap: 28px;

        .l-header-nav-sp__item {

          .l-header-nav-sp__link {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            text-decoration: none;

            .l-header-nav-sp__link-text {
              color: #003C6F;
              font-size: 1.8rem;
              font-weight: 700;
              letter-spacing: 0.9px;
            }  
          }


          .l-header-nav-sp__sub {
            display: grid;
            gap: 30px;

            .l-header-nav-sp__sub-title {
              display: flex;
              align-items: center;
              justify-content: space-between;
              cursor: pointer;

              .l-header-nav-sp__sub-title-text {
                color: #003C6F;
                font-size: 1.8rem;
                font-weight: 700;
                letter-spacing: 0.9px;    
              }

              .l-header-nav-sp__sub-title-icon {
                display: inline-block;
                transition: all .1s linear;
              }
            }

            .l-header-nav-sp__sub-title--active {
              .l-header-nav-sp__sub-title-icon {
                transform: rotate(45deg);
              }
            }

            .l-header-nav-sp__sub-list-wrap {
              display: none;
              padding-left: 20px;

              .l-header-nav-sp__list-sub-list {
                display: grid;
                gap: 30px;

                .l-header-nav-sp__list-sub-item {
                  .l-header-nav-sp__list-sub-link {
                    color: #003C6F;
                    font-size: 1.8rem;
                    letter-spacing: 0.9px;
                    text-decoration: none;
                  }
                }
              }
            }
          }
        }
      }

      .l-header-nav-sp__contact {
        .l-header-nav-sp__contact-button {
          display: block;
          text-align: center;
          box-sizing: border-box;
          padding: 15px;
          background-color: var(--color-primary-01);
          color: var(--color-font-03);
          border-radius: 55px;
          text-decoration: none;
          font-size: 1.6rem;
          font-weight: 700;
          letter-spacing: 1.6px;
        }
      }
    }

    .l-header-nav-sp--active {
      display: flex;
    }
  }
}