/**
 * Layout - Header
 * 共通ヘッダー
 */

.l-header {
  width: 100%;
  padding-top: 1.5rem;
  padding-inline: 4rem;
  min-height: 106px;
  background: linear-gradient(
    180deg,
    rgba(38, 38, 38, 0.9) 30%,
    rgba(27, 24, 6, 0) 100%
  );
  backdrop-filter: blur(2px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;

  @media screen and (max-width: 1279px) {
    min-height: 64px;
    padding-block: 0;
    padding-inline: 1rem;
    display: flex;
    align-items: center;
  }

  /* TOP以外：白背景 */
  &.is-inner {
    background: #fff;
    backdrop-filter: none;
    padding-bottom: 12px;
    min-height: auto;
    @media screen and (max-width: 1279px) {
      padding-bottom: 0;
      min-height: 64px;
    }

    .l-headerMenuItem {
      color: var(--color-text-main);
    }

    .l-headerMenuItem.--dropdown::after {
      background-image: url("../../images/icon_arrow_bottom_black.svg");
    }

    .l-headerMenuButton .l-headerMenuButtonLine,
    .l-headerMenuButton .l-headerMenuButtonLine::before,
    .l-headerMenuButton .l-headerMenuButtonLine::after {
      @media screen and (max-width: 1279px) {
        background-color: var(--color-bg-black);
      }
    }
    .l-headerMenuButton {
      &.is-active {
        .l-headerMenuButtonLine {
          @media screen and (max-width: 1279px) {
            background-color: transparent;
          }
        }
      }
    }
  }
}

.l-headerOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9; /* ヘッダー(z-index:10)より下 */
  transition: opacity 0.3s ease;

  @media screen and (max-width: 1279px) {
    display: block;
    opacity: 0;
    pointer-events: none;
  }
}

body.is-menuOpen .l-headerOverlay {
  @media screen and (max-width: 1279px) {
    opacity: 1;
    pointer-events: auto;
  }
}

body.is-menuOpen {
  overflow: hidden;
}

.l-headerContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;

  @media screen and (max-width: 1279px) {
    width: 100%;
  }
}

.l-headerMenuButton {
  display: none;
  width: 64px;
  height: 64px;
  background-color: transparent;
  border: none;
  appearance: none;
  position: absolute;
  top: -12px;
  right: 0;

  @media screen and (max-width: 1279px) {
    display: block;
  }

  &.is-active {
    .l-headerMenuButtonLine {
      background-color: transparent;

      &::before,
      &::after {
        @media screen and (max-width: 1279px) {
          top: 50%;
          right: 50%;
          translate: 50% -50%;
        }
      }
      &::before {
        @media screen and (max-width: 1279px) {
          rotate: 45deg;
        }
      }
      &::after {
        @media screen and (max-width: 1279px) {
          rotate: -45deg;
          width: 100%;
        }
      }
    }
  }
}
.l-headerMenuButtonLine {
  display: inline-block;
  width: 32px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--color-bg-white);
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -59% -50%;
  transition: var(--hover);

  &::before,
  &::after {
    content: "";
    display: inline-block;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background-color: var(--color-bg-white);
    position: absolute;
    right: 0;
    transition: var(--hover);
  }
  &::before {
    top: -8px;
  }
  &::after {
    top: 8px;
    width: 60%;
  }
}

.l-headerNavWrapper {
  @media screen and (max-width: 1279px) {
    width: 90%;
    max-width: 375px;
    background-color: var(--color-bg-white);
    position: absolute;
    top: 56px;
    right: -1.5rem;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  &.is-active {
    @media screen and (max-width: 1279px) {
      transform: translateX(0);
      opacity: 1;
      visibility: visible;
    }
  }
}
.l-headerNav {
  @media screen and (max-width: 1279px) {
  }
}
.l-headerMenu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;

  @media screen and (max-width: 1279px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}
.l-headerMenuItem {
  color: var(--color-text-light);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.25rem;

  @media screen and (max-width: 1279px) {
    color: var(--color-text-main);
    font-weight: 400;
    width: 100%;
    min-height: 40px;
    justify-content: space-between;
  }

  &.--dropdown {
    @media screen and (max-width: 1279px) {
      padding: 0;
    }
    &::after {
      content: "";
      display: inline-block;
      width: 1.5rem;
      height: 1.5rem;
      background-image: url("../../images/icon_arrow_bottom_white.svg");
      background-size: contain;
      background-position: center;

      @media screen and (max-width: 1279px) {
        display: none;
      }
    }
  }

  a {
    @media screen and (max-width: 1279px) {
      width: 100%;
      display: block;
      padding-block: 0.5rem;
      padding-inline: 2rem 1rem;
    }
  }
}
.l-headerMenuCta {
  @media screen and (max-width: 1279px) {
    width: 100%;
  }

  a {
    color: var(--color-text-main);
    font-weight: bold;
    display: block;
    width: fit-content;
    background: linear-gradient(270deg, #ffdf85 0%, #e0bd2e 100%);
    border-radius: var(--radius-md);
    padding-block: 0.5rem;
    padding-inline: 1.25rem;
    position: relative;
    overflow: hidden;
    isolation: isolate; /* ::after の z-index: -1 がテキストより後ろに来るよう stacking context を作成 */
    @media screen and (max-width: 1279px) {
      font-weight: normal;
      border: none;
    }

    /* hover 用グラデーションを ::after で重ねて opacity をアニメーション */
    &::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(270deg, #fefff1 0%, #ffe26c 100%);
      opacity: 0;
      transition: opacity 0.3s ease;
      border-radius: inherit;
      z-index: -1; /* テキストより後ろ・ベースグラデーションより前に配置 */
    }

    &:hover::after {
      opacity: 1;
    }

    @media screen and (max-width: 1279px) {
      color: var(--color-text-main);
      background: transparent;
      width: 100%;
      padding-inline: 2rem 1rem;

      &::after {
        display: none;
      }
    }
  }
}
/* ドロップダウン */
.l-headerMenuItem.--dropdown {
  position: relative;

  @media screen and (max-width: 1279px) {
    flex-wrap: wrap;
  }

  > a {
    @media screen and (max-width: 1279px) {
      display: none;
    }
  }
}

@media screen and (min-width: 1280px) {
  .l-headerMenuItem.--dropdown:hover .l-headerDropdown {
    opacity: 1;
    visibility: visible;
    translate: -50% 0;
  }
}

.l-headerDropdownToggle {
  display: none;

  @media screen and (max-width: 1279px) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding-block: 0.5rem;
    padding-inline: 2rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-weight: 400;
    color: var(--color-text-main);
    text-align: left;

    /* + / − アイコン（2本線をグラデーションで描画） */
    &::after {
      content: "";
      flex-shrink: 0;
      width: 1.25rem;
      height: 1.25rem;
      background-image:
        linear-gradient(var(--color-text-main), var(--color-text-main)),
        linear-gradient(var(--color-text-main), var(--color-text-main));
      background-size: 14px 2px, 2px 14px;
      background-position: center, center;
      background-repeat: no-repeat;
      transition: background-size 0.2s ease;
    }

    &[aria-expanded="true"]::after {
      background-size: 14px 2px, 2px 0px;
    }
  }
}

.l-headerDropdown {
  list-style: none;

  /* デスクトップ：絶対配置でフェードイン */
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% -4px;
  min-width: 220px;
  background-color: var(--color-bg-white);
  border: 1px solid var(--color-border-lightGray);
  border-radius: 4px;
  padding-block: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, translate 0.2s ease;
  z-index: 1;

  /* モバイル：通常フローでトグル（max-height でアニメーション） */
  @media screen and (max-width: 1279px) {
    position: static;
    translate: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
    visibility: visible;
    display: block;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding-block: 0;
    transition: max-height 0.3s ease, padding-block 0.3s ease;

    &.is-open {
      max-height: 300px;
      padding-block: 0.25rem 0.5rem;
    }
  }

  .l-headerDropdownParentLink {
    @media screen and (min-width: 1280px) {
      display: none;
    }
  }

  li a {
    display: block;
    padding-block: 0.5rem;
    padding-inline: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-main);
    font-weight: 400;
    white-space: nowrap;

    &:hover {
      opacity: 0.7;
    }

    @media screen and (max-width: 1279px) {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-inline: 3rem 1rem;
      white-space: normal;

      &::after {
        content: "";
        flex-shrink: 0;
        width: 1rem;
        height: 1rem;
        background-image: url("../../images/icon_arrow_right_black.svg");
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
      }
    }
  }
}

.l-headingSideBorder {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.01em;
  padding-left: 24px;
  margin-bottom: 40px;
  position: relative;

  &::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 31px;
    background-color: var(--color-bg-darkBlack);
    position: absolute;
    top: 50%;
    left: 0;
    translate: 0 -50%;
  }
}
