/*------------------------------
  header
------------------------------*/
:root {
  --header-height: 55px;
}

@media (min-width: 768px) {
  :root {
    --header-height: 81px;
  }
}

body {
  padding-top: var(--header-height);
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  border-bottom: 1px solid var(--line-color);
  background-color: var(--white-color);
}

section[id] {
  scroll-margin-top: calc(var(--header-height, 0px) + 12px);
}

.header-inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-title {
  line-height: 1;
  padding: 16px 10px;
}

.site-brand-link {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-logo {
  display: block;
  width: 400px;
  height: auto;
}

.menu-toggle {
  position: relative;
  align-self: stretch;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 60px;
  height: auto;
  padding: 16px;
  background-color: var(--primary-color);
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--white-color);
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  min-height: calc(100dvh - 60px);
  overflow-y: auto;
  background-color: var(--primary-color);
  padding: 30px 10px;
  z-index: 30;
}

.header-nav.is-open {
  display: block;
}

.menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.menu-list li {
  width: 100%;
  border-bottom: 1px solid var(--line-color);
  padding-bottom: 10px;
  padding-left: 10px;
}

.header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 14px;
}

.header-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  height: 52px;
  padding: 0 14px;
  font-size: 0.93rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--white-color);
  background-color: var(--primary-color);
  border: 1px solid var(--white-color);
  border-radius: 999px;
  transition: background-color 0.25s ease;
}

.header-action-button::after {
  content: "";
  width: 14px;
  height: 14px;
  background-image: url("../img/common/icon_open.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

.menu-list a {
  display: block;
  width: 100%;
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--white-color);
  padding: 10px 0;
  border-bottom: none;
  transition: color 0.25s ease;
}

@media (min-width: 769px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 20px;
  }

  .header-top {
    width: auto;
  }

  .site-title {
    line-height: 1;
  }

  .site-brand-link {
    gap: 10px;
  }

  .menu-toggle {
    display: none;
  }

  .header-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 16px;
    width: auto;
    min-height: 0;
    overflow-y: visible;
    white-space: nowrap;
    background-color: transparent;
    padding: 20px 0;
  }

  .menu-list {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    width: auto;
    padding-bottom: 0;
    border-bottom: none;
  }

  .menu-list li {
    width: auto;
    border-bottom: none;
    padding-bottom: 0;
    padding-left: 0;
  }

  .header-actions {
    justify-content: flex-start;
    width: auto;
    margin-top: 0;
    margin-left: 8px;
  }

  .header-action-button {
    height: 40px;
    padding: 0 14px;
    font-size: 0.75rem;
  }

  .menu-list a {
    display: inline-block;
    width: auto;
    padding: 0;
    font-size: 0.93rem;
    white-space: nowrap;
    color: var(--primary-color);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  .header-top {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-height: calc(100dvh - 60px);
    overflow-y: auto;
    background-color: var(--primary-color);
    padding: 30px 10px;
  }

  .header-nav.is-open {
    display: block;
  }

  .menu-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }

  .menu-list li {
    width: 100%;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 10px;
    padding-left: 10px;
  }

  .header-actions {
    justify-content: center;
    width: 100%;
    margin-top: 14px;
    margin-left: 0;
  }

  .header-action-button {
    height: 52px;
    font-size: 0.93rem;
  }

  .menu-list a {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 1.12rem;
    font-weight: 500;
    color: var(--white-color);
    white-space: normal;
    border-bottom: none;
    transition: color 0.25s ease;
  }
}

@media (hover: hover) and (pointer: fine) {
  .menu-list a:hover {
    color: var(--text-link-color);
  }

  .header-action-button:hover {
    background-color: var(--text-link-color);
  }
}