/* ================================
   Header Layout
   サイトヘッダーとナビゲーションのレイアウト
================================ */

/* ----- Header Container ----- */
.header__common {
  /* Positioning */
  position: sticky;
  top: 0;
  z-index: 99999;

  /* Border & Background */
  background: var(--color-bg);
}

/* ----- Header Inner ----- */
.header__inner {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: 100%;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  overflow: visible;
}

/* ----- Logo ----- */
.logo {
  /* Display & Box Model */
  flex: 0 0 auto;
}

.logo img {
  /* Display & Box Model */
  display: block;
  width: auto;
  height: var(--space-lg);
}

/* ----- Header Menu ----- */
.header__menu {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  overflow: visible;
}

/* ----- Global Navigation ----- */
.global-nav {
  /* Positioning */
  position: relative;
  z-index: 10000;
}

.global-nav .nav-list {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.global-nav .nav-list a {
  /* Display & Box Model */
  display: inline-block;
  padding: var(--space-xs);

  /* Typography */
  font-size: var(--fz-rg);
  font-weight: 600;
  color: var(--color-text);

  /* Other */
  transition: color 0.2s ease;
}

.global-nav .nav-list a:hover,
.global-nav .nav-list a:focus {
  color: var(--color-primary);
}

.global-nav .current-menu-item>a,
.global-nav .current_page_item>a {
  font-weight: 700;
  color: var(--color-primary);
}

/* ----- Sub Menu ----- */
.global-nav .nav-list .sub-menu {
  /* Positioning */
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10001;

  /* Display & Box Model */
  display: none;
  min-width: 300px;
  margin: 0;
  padding: 0;
  list-style: none;

  /* Border & Background */
  background: var(--color-bg);
  box-shadow: var(--shadow-md);
}

.global-nav .nav-list li.menu-item-has-children:hover>.sub-menu {
  display: block;
}

.global-nav .nav-list .sub-menu a {
  /* Display & Box Model */
  display: block;
  padding: var(--space-sm) var(--space-md);

  /* Typography */
  font-size: var(--fz-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;

  /* Other */
  transition: background-color 0.2s ease, color 0.2s ease;
}

.global-nav .nav-list .sub-menu a:hover,
.global-nav .nav-list .sub-menu a:focus-visible {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.global-nav .nav-list .sub-menu .sub-menu {
  /* Positioning */
  top: 0;
  left: 100%;

  /* Display & Box Model */
  margin-left: 1px;
}

/* ----- Menu Items with Children ----- */
.global-nav .nav-list>li.menu-item-has-children>a {
  /* Positioning */
  position: relative;

  /* Display & Box Model */
  padding-right: 1.8em;
}

.global-nav .nav-list>li.menu-item-has-children>a::after {
  /* Positioning */
  position: absolute;
  top: 50%;
  right: var(--space-xxs);

  /* Display & Box Model */
  width: 13px;
  height: 13px;

  /* Border & Background */
  background: url("../../images/icons/arrows/arrow_thin.svg") no-repeat center;
  background-size: 100% auto;

  /* Other */
  content: "";
  transform: translateY(-50%);
  opacity: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.global-nav .nav-list>li.menu-item-has-children:hover>a::after {
  transform: translateY(-50%) rotate(180deg);
}

.global-nav .nav-list .sub-menu>li>a {
  position: relative;
  padding-right: var(--space-sm);
}

.global-nav .nav-list .sub-menu>li>a::after {
  /* Positioning */
  position: absolute;
  top: 50%;
  right: var(--space-sm);

  /* Display & Box Model */
  width: 8px;
  height: 8px;

  /* Border & Background */
  background: url("../../images/icons/arrows/arrow_thin_right.svg") no-repeat center;
  background-size: 100% auto;

  /* Other */
  content: "";
  transform: translateY(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.global-nav .nav-list .sub-menu>li>a:hover::after,
.global-nav .nav-list .sub-menu>li>a:focus-visible::after {
  transform: translateY(-50%) translateX(3px);
  opacity: 1;
}

.global-nav .nav-list>li.menu-item-has-children>a.is-parent-nolink {
  cursor: default;
}

/* ----- Header CTA ----- */
.header__cta {
  /* Positioning */
  position: relative;
  z-index: 1;

  /* Display & Box Model */
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header__cta .btn {
  /* Display & Box Model */
  display: flex;
  justify-content: center;
  min-width: 140px;
  padding: var(--space-sm) var(--space-sm);

  /* Border & Background */
  border-radius: var(--radius-pill);

  /* Typography */
  font-weight: 600;
  line-height: 1;
}

/* ----- Hamburger Menu ----- */
.hamburger {
  /* Positioning */
  position: fixed;
  top: 8px;
  right: var(--space-md);
  z-index: 999999;

  /* Display & Box Model */
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;

  /* Border & Background */
  background: transparent;
  border: 0;

  /* Other */
  cursor: pointer;
}

.hamburger__bar {
  /* Positioning */
  position: absolute;
  left: 50%;

  /* Display & Box Model */
  width: 24px;
  height: 2px;

  /* Border & Background */
  background: var(--color-text);
  border-radius: var(--radius-xs);

  /* Other */
  transform: translateX(-50%);
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.hamburger__bar:nth-child(1) {
  top: 14px;
}

.hamburger__bar:nth-child(2) {
  top: 21px;
}

.hamburger__bar:nth-child(3) {
  top: 28px;
}

.hamburger.is-active .hamburger__bar:nth-child(1) {
  top: 21px;
  transform: translateX(-50%) rotate(45deg);
}

.hamburger.is-active .hamburger__bar:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger__bar:nth-child(3) {
  top: 21px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ----- Mobile Navigation ----- */
.mobile-nav {
  /* Positioning */
  position: fixed;
  inset: 0;
  z-index: 99998;

  /* Display & Box Model */
  display: none;
}

body.nav-open .mobile-nav {
  display: block;
}

.mobile-nav__panel {
  /* Positioning */
  position: absolute;
  inset: 0;

  /* Display & Box Model */
  display: flex;
  flex-direction: column;
  padding: 100px var(--space-xl) var(--space-xl);

  /* Border & Background */
  background: rgba(14, 22, 33, 0.92);

  /* Other */
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

body.nav-open .mobile-nav__panel {
  transform: translateX(0);
}

.mobile-nav__list {
  margin: 0;
  padding: 0;
  color: var(--color-bg);
  list-style: none;
}

.mobile-nav__list>li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav__list>li>a {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: var(--space-md) 6px;

  /* Typography */
  font-size: var(--fz-md);
  font-weight: 700;
  color: var(--color-bg);
  text-decoration: none;
}

.mobile-nav__list>li.menu-item-has-children>a::after {
  /* Display & Box Model */
  width: 14px;
  height: 28px;

  /* Border & Background */
  background: url("../../images/icons/arrows/arrow_thin.svg") no-repeat center;
  background-size: 100% auto;

  /* Other */
  content: "";
  opacity: 1;
  transition: transform 0.25s ease;
}

.mobile-nav__list>li.is-open>a::after {
  transform: rotate(180deg);
}

.mobile-nav .sub-menu {
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  transition: max-height 0.25s ease;
}

.mobile-nav .sub-menu li a {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 10px var(--space-lg);

  /* Typography */
  font-size: var(--fz-rg);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.mobile-nav .sub-menu li a::after {
  /* Display & Box Model */
  width: 6px;
  height: 12px;
  flex-shrink: 0;

  /* Border & Background */
  background: url("../../images/icons/arrows/arrow_thin_right.svg") no-repeat center;
  background-size: 100% auto;

  /* Other */
  content: "";
}

.mobile-nav__list>li.is-open>.sub-menu {
  max-height: 1000px;
}

.mobile-nav__cta {
  /* Display & Box Model */
  display: grid;
  gap: 10px;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

.mobile-nav__cta .btn {
  /* Display & Box Model */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);

  /* Border & Background */
  border-radius: var(--radius-pill);

  /* Typography */
  font-size: var(--fz-md);
  font-weight: 700;
  text-decoration: none;
}

.mobile-nav__cta .btn.btn--primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.mobile-nav__cta .btn.btn--secondary {
  /* Border & Background */
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);

  /* Typography */
  color: var(--color-bg);
}

/* ================================
   Responsive Styles
================================ */

@media (max-width: 767px) {
  .header__inner {
    padding: var(--space-md) var(--space-md);
    border-bottom: 1px solid var(--color-border);
  }

  .logo img {
    height: 25px;
  }

  .hamburger {
    display: inline-block;
  }

  .global-nav {
    display: none !important;
  }

  .header__cta__contact {
    display: none;
  }

  .header__cta {
    margin-right: 60px;
    margin-left: auto;
  }

  .header__cta .btn {
    min-width: auto;
    padding: var(--space-sm) var(--space-sm);
    font-size: var(--fz-xs);
    display: none;
  }

  body.nav-open {
    overflow: hidden;
  }
}