/* /css/usr/default/Header-51.css */

.header_wrapper {
  width: 100%;
  background: var(--background);
  color: #191919;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--primaryColor);
  padding: 20px 120px;
}

.header_inner {
  width: 100%;
  max-width:1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header_logo_wrapper{
  display: flex;
  align-items: center;
  gap:10px;
}

.header_logo {
  display: block;
  position: relative;
  z-index: 1100;
  width: 150px;
  height: auto;
}

.header_logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.header_logo{
    img:first-child{
       display:block;
    }
    img:nth-child(2){
       display:none;
   }
}
.header_nav {
  display: flex;
  align-items: center;
  gap: 20px;
  /* removing rel position to allow mega menu to position from wrapper */
}

.header_nav_list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 40px;
  /* text-body-small = 16px / weight 500、leading-[120%] で上書き → 120% */
  font-size: var(--font-16);
  line-height: 120%;
  font-weight: 500;
}

.header_nav_link {
  text-decoration: none;
  color: #191919;
  cursor: pointer;
}

/* 採用情報リンクだけ flex（icon付き） */
.header_nav_link_has-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* hover-underline-animation はglobals.cssのutilityで処理
   以下はheader独自のフォールバック（globals削除後に使用） */
.header_nav_link_text {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease-out;
}

.header_nav_link_text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: var(--primaryColor);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease-out;
}

.header_nav_link:hover .header_nav_link_text {
  color: var(--primaryColor);
}

.header_nav_link:hover .header_nav_link_text::after {
  transform: scaleX(1);
}

.header_nav_link_icon {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-15);
  color: #191919;
}

.header_menu_toggle {
  display: none;
}

.header_mobile_menu {
  display: none;
}

/* Mega Menu Styles */
.header_nav_item--has-mega-menu {
  position: static;
}

.header_mega_menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  /* opacity: 1;
  visibility: visible; */
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  z-index: 1050;
  cursor: default;
}

.header_mega_menu::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: 40px;
  background: transparent;
}

.header_mega_menu_box {
  position: relative;
  width: 80%;
  background: #fff;
  margin: 0 120px;
  padding: 50px 60px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  top: 20px;
  transition: opacity 0.3s ease-in-out;
  max-height: calc(100Vh - 20%);
  overflow-y: auto;
}

body.menu_open {
  overflow: hidden;
}

.header_nav_item--has-mega-menu:hover .header_mega_menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease-in-out;
  pointer-events: auto;
}

.header_nav_item--has-mega-menu:hover .header_mega_menu.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transition: opacity 0.5s ease-in-out, visibility 0s linear 0.5s;
}

.header_nav_item--has-mega-menu:hover .header_mega_menu_box {
  /* animation or movement removed as requested */
}

.header_mega_menu_inner {
  display: flex;
  gap: 40px;
}

.header_mega_menu_main_title {
  font-size: var(--font-24);
  font-weight: bold;
  color: #333;
  width: 160px; /* fixed width for the left title area */
  flex-shrink: 0;
  margin: 0;
  line-height: 1.4;
}

.header_mega_menu_grid {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  flex-grow: 1;
}

.header_mega_menu_col {
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex: 1;
}

.header_mega_menu_section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

a.header_mega_menu_title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  padding-bottom: 8px;
  border-bottom: solid 1px var(--textColor);
  cursor: pointer;
}

a.header_mega_menu_title h3 {
  font-size: var(--font-20);
  font-weight: bold;
  color: #333;
  margin: 0;
}

a.header_mega_menu_title span {
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a.header_mega_menu_title:hover span {
  color: var(--primaryColor);
  border-bottom-color: var(--primaryColor);
}

.header_mega_menu_list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left:1rem;
}

.header_mega_menu_list li{
  text-decoration: none;
  font-size: var(--font-14);
  color: #333;
  font-weight: normal;
  position: relative;
  padding-left: 25px;

  &::before{
    content: "―";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
  }
}

.header_mega_menu_list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  font-size: var(--font-14);
  color: #333;
  font-weight: normal;
  transition: color 0.2s ease;
}

.header_mega_menu_list li a span {
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease;
}

.header_mega_menu_list li a:hover span {
  color: var(--primaryColor);
  border-bottom: 1px solid var(--primaryColor);
}

/* .header_mega_menu_list li a:hover .secondary-btn_wrapper {
  background-color: var(--background);
    border-color: var(--primaryColor);
} */

/* primaryBtn style */

.primary-btn_wrapper {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    width: 280px;
    height: 56px;
    padding: 10px 60px;
    border-radius: 100px;
    background-color: #ffcf4a;
    color: #191919;
    text-decoration: none;
    line-height: 120%;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
    transition: background-color 0.25s ease;
}

.primary-btn_wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 100px;
    padding: 2px;
    background: linear-gradient(260deg, #ffcf4a 0%, #f8aa23 50%, #f28900 100%);
    background-size: 200% 200%;
    background-position: 100% 100%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition:
        opacity 0.3s ease,
        background-position 0.6s ease;
    pointer-events: none;
}

.primary-btn_wrapper:hover {
    background-color: var(--background);
}

.primary-btn_wrapper:hover::before {
    opacity: 1;
    background-position: 0% 0%;
}

.primary-btn_wrapper:active::before {
    opacity: 1;
    background-position: 0% 0%;
}

.primary-btn_wrapper:focus::before {
    background: var(--textColor);
}

.primary-btn_link {
    text-decoration: none;
}

.primary-btn_icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.primary-btn_text {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: var(--font-20);
    line-height: 160%;
    font-weight: 500;
}

.header_menu_toggle {
  display: none;
}

body.menu_closed .header_nav_item--has-mega-menu .header_mega_menu {
  opacity: 0 !important;
}

@media (max-width: 1280px) {
  .header_wrapper {
    padding: 20px 30px;
  }

  .primary-btn_wrapper {
    width: 240px;
    padding: 10px 45px;
    line-height: 100%;
  }

  .primary-btn_text {
    font-size: var(--font-18);
  }
}

@media (max-width: 768px) {
  .header_wrapper {
    padding: 14px 20px;
  }

  .header_nav {
    gap: 0;
  }

  .header_nav_list {
    display: none;
  }

  .header_menu_toggle {
    display: inline-flex;
    position: relative;
    z-index: 1100;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    cursor: pointer;
  }

  .header_menu_toggle_line {
    width: 30px;
    height: 4px;
    border-radius: 1px;
    background: var(--primaryColor);
    transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.25s ease;
  }

  .header_menu_toggle.is-open .header_menu_toggle_line {
    background: #fff;
  }

  .header_menu_toggle.is-open .header_menu_toggle_line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }

  .header_menu_toggle.is-open .header_menu_toggle_line:nth-child(2) {
    opacity: 0;
  }

  .header_menu_toggle.is-open .header_menu_toggle_line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }

  .header_logo {
    width: 120px;
    z-index: 1100;
 
    img:first-child{
       display:block;
    }
    img:nth-child(2){
       display:none;
   }
  }
  body.header-menu-open .header_logo {
       /*filter: brightness(0) invert(1); ロゴを白くする場合。画像なら */
       img:first-child{
           display:none;
       }
       img:nth-child(2){
           display:block;
       }
  }

  .header_mobile_menu {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 84px 0 0;
    background: var(--primaryColor);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    display: flex;
    flex-direction: column;
    z-index: 1050;
  }

  .header_mobile_menu_inner {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .header_mobile_menu.is-open {
    height: 100svh;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
  }

  .header_mobile_nav_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .header_mobile_nav_item {
    border-bottom: 1px solid #fff;
  }

  .header_mobile_nav_item:first-child {
    border-top: 1px solid #fff;
  }

  .header_mobile_nav_link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px;
    color: #fff;
    text-decoration: none;
    font-size: var(--font-16);
    line-height: 1;
    font-weight: bold;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
  }

  .header_mobile_submenu_toggle {
    position: relative;
  }

  .header_mobile_submenu_toggle_text {
    text-align: center;
  }

  .header_mobile_submenu_icon {
    display: inline-flex;
    align-items: center;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: none !important;
  }

  .header_mobile_nav_link[aria-expanded="true"] .header_mobile_submenu_icon {
    transform: translateY(-50%) scaleY(-1);
  }

  .header_mobile_submenu_wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
  }

  .header_mobile_nav_link[aria-expanded="true"] + .header_mobile_submenu_wrapper {
    grid-template-rows: 1fr;
  }

  .header_mobile_submenu {
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
  }

  .header_mobile_submenu_inner {
    padding: 10px 0 20px;
  }

  .header_mobile_submenu_item {
    border-top: 1px dashed rgba(255, 255, 255, 0.5);
  }

  .header_mobile_submenu_item:first-child {
    border-top: none;
  }

  .header_mobile_submenu_link {
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    color: #fff;
    text-decoration: none;
    font-size: var(--font-14);
    font-weight: normal;
  }

  .header_mobile_contact_area {
    padding: 40px 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .header_mobile_contact_text {
    color: #fff;
    font-size: var(--font-14);
    margin-bottom: 20px;
    text-align: center;
  }

  .mobile_contact_btn {
    box-sizing: border-box;
    width: 100%;
    max-width: 340px;
    height: 48px;
    margin-top: 0;
    padding: 0 24px;
    justify-content: center;
  }

  body.header-menu-open {
    overflow: hidden;
  }
}

@media screen and (max-width: 480px) {
  .header_wrapper {
    padding: 12px 15px;
  }

  .header_logo {
    width: 100px;
  }
}