/**
 * File Name: hero-header.css
 * 2026-07-16 | Final Checked & Left-Aligned Sub-Menu
 */

/* ==========================================================================
   1. ベース・スマホ縦想定スタイル
   ========================================================================== */
.l-hero-hdr {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: var(--z_1-up);
}

.p-hero-hdr__bg,
.p-hero-hdr__overlay {
  position: absolute;
  inset: 0;
}

.p-hero-hdr__img {
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  object-fit: cover;
  position: absolute;
  top: -4px;
  left: 0;
}

.p-hero-hdr__overlay {
  background: rgba(0, 0, 0, 0.2);
}

.p-hero-hdr__deco {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z_20-content);
  width: 100%;
  height: auto;
  pointer-events: none;
}

.p-hero-hdr__deco-reverse {
  position: absolute;
  bottom: 0;
  right: 0;
  top: auto;
  left: auto;
  z-index: var(--z_10-content);
  width: 100%;
  height: auto;
  pointer-events: none;
  transform: scale(-1);
}

.p-hero-hdr__logo {
  position: absolute;
  top: 10px;
  left: 5px;
  z-index: var(--z_20-content);
  width: 300px;
  max-width: 60%;
}

.p-hero-hdr__logo img {
  width: 100%;
  height: auto;
}

.p-hero-hdr__cta {
  display: none;
  flex: 0 0 auto;
}

.p-hero-hdr__cta-item {
  position: relative;
  display: inline-block;
  min-width: 240px;
  padding: 18px 40px;
  background-color: #1d3d5e;
  border: 1px solid var(--lower-color-4, #ffffff);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.1em;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
  border-radius: 0;
}

.p-hero-hdr__cta-item:hover {
  background-color: #bfa25e;
  border-color: #bfa25e;
  color: #1d3d5e;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.p-hero-hdr__cta-text {
  display: block;
  width: 100%;
  line-height: 1;
  color: inherit;
}

.p-int-hero-hdr__visual-bubble {
  position: absolute;
  top: 50%;
  left: 25%;
  width: 200px;
  filter: sepia(100%) saturate(2500%) hue-rotate(320deg) brightness(90%);
  transform-origin: center center;
  animation: bubblePop 2s 3 ease-in-out forwards;
}

@keyframes bubblePop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-8deg);
  }
  50% {
    transform: scale(0.95) rotate(0deg);
  }
  75% {
    transform: scale(1.05) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.p-int-hero-hdr__visual-bubble img {
  width: 100%;
  height: auto;
}

.p-hero-hdr__mobile-trigger {
  display: block;
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: var(--z_990-tool);
  transition: opacity 0.3s ease;
}

.p-hero-hdr__hamburger {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  position: relative;
}

.p-hero-hdr__hamburger span {
  display: block;
  position: absolute;
  left: 7px;
  width: 30px;
  height: 2px;
  background: #fff;
  transition: all 0.3s ease-in-out;
}

.p-hero-hdr__hamburger span:nth-child(1) {
  top: 12px;
}
.p-hero-hdr__hamburger span:nth-child(2) {
  top: 21px;
}
.p-hero-hdr__hamburger span:nth-child(3) {
  top: 30px;
}

.p-hero-hdr__hamburger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.p-hero-hdr__hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}
.p-hero-hdr__hamburger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 767px) {
  .p-header .p-header__nav,
  .p-header .p-header__mega-menu {
    display: none;
  }
  .p-hero-hdr__cta-item {
    min-width: 140px;
    padding: 10px 16px;
  }
  .p-hero-hdr__cta-text {
    font-size: 13px;
  }
}

/* ==========================================================================
   2. スマホ横向き限定レイアウト
   ========================================================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .l-hero-hdr {
    height: 100vh;
    min-height: 100vh;
  }

  .p-hero-hdr__deco {
    width: 50%;
  }

  .p-hero-hdr__deco-reverse {
    width: 50%;
  }

  .p-hero-hdr__logo {
    width: 180px;
    top: 8px;
    left: 10px;
  }

  .p-int-hero-hdr__visual-bubble {
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
  }

  .p-int-hero-hdr__nav.is-open {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
  }

  .p-int-hero-hdr__nav-inner,
  .p-int-hero-hdr__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
  }

  .p-int-hero-hdr__btn {
    width: 45%;
    flex: 0 0 45%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
}

/* ==========================================================================
   3. タブレットサイズ (768px以上) ＆ 高さが501px以上
   ========================================================================== */
@media screen and (min-width: 768px) and (min-height: 501px) {
  .l-hero-hdr {
    min-height: 100vh;
    justify-content: flex-end;
    overflow: visible;
  }

  .p-hero-hdr__img {
    object-position: 30% 50%;
  }

  .p-hero-hdr__deco {
    width: 50%;
  }

  .p-hero-hdr__reverse,
  .p-hero-hdr__deco-reverse {
    width: 50%;
  }

  .p-hero-hdr__mobile-trigger {
    display: none;
  }

  .p-hero-hdr__logo {
    width: 30%;
    left: 15px;
    top: 15px;
  }

  .p-hero-hdr__cta {
    display: flex;
    gap: 12px;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: var(--z_20-content);
  }

  .p-int-hero-hdr__visual-bubble {
    top: 38%;
    left: calc(67% - 550px);
    width: 300px;
    transform: none;
  }
}

/* ==========================================================================
   4. PC大画面サイズ (1024px以上) ＆ 高さが501px以上
   ========================================================================== */
@media screen and (min-width: 1024px) and (min-height: 501px) {
}

/* ==========================================================================
   【追加】MENUボタンの連結サブメニュー用スタイル（左寄せ＆はみ出し防止版）
   ========================================================================== */

/* 親コンテナを縦並びのフレキシブルボックスに */
.p-hero-hdr__cta {
  flex-direction: column !important;
  align-items: flex-end;
}

.p-hero-hdr__menu-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* 親ボタン（MENU）の挙動調整 */
.p-hero-hdr__cta-item.js-menu-parent {
  cursor: pointer;
  width: 100%;
}

/* 子メニューのラッパー（デフォルトは閉じる、max-heightでアコーディオン化） */
.p-hero-hdr__sub-menu {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  /* 連結感を出すために上のボーダーをなくす、または重ねる調整 */
  margin-top: -1px;
}

/* 親ボタンがアクティブ（開いた状態）のときに子メニューを展開 */
/* 長いテキストでの2行化や項目追加に対応できるよう、max-heightの限界値を400pxへ拡張 */
.p-hero-hdr__cta-item.is-active + .p-hero-hdr__sub-menu {
  max-height: 400px;
}

/* 連結する少し小さなサブボタンのスタイル */
.p-hero-hdr__sub-item {
  position: relative;
  display: inline-block;
  width: 100%;
  min-width: 240px;
  /* 上下12px、左右20pxの余白を設けて、左寄せテキストの美しさを確保 */
  padding: 12px 20px;
  background-color: rgba(29, 61, 94, 0.95); /* 少しだけ透明度を入れて差を出す */
  border: 1px solid var(--lower-color-4, #ffffff);
  color: #ffffff;
  font-size: 13px; /* テキストも少し小さく */
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-align: left; /* ★センターから左寄せに統一 */
  box-sizing: border-box;
  transition: all 0.25s ease;
}

/* サブボタンのホバー表現 */
.p-hero-hdr__sub-item:hover {
  background-color: #bfa25e;
  border-color: #bfa25e;
  color: #1d3d5e;
}

.p-hero-hdr__sub-text {
  display: block;
  width: 100%;
  /* テキストがはみ出して周囲の枠と重ならないよう、自動折り返しを許可 */
  white-space: normal;
  word-break: break-all;
  line-height: 1.4; /* 複数行になったときの見栄えを考慮した行間 */
  color: inherit;
}

/* スマホサイズ（767px以下）での調整 */
@media (max-width: 767px) {
  .p-hero-hdr__sub-item {
    min-width: 140px;
    padding: 8px 12px;
  }
  .p-hero-hdr__sub-text {
    font-size: 11px;
    line-height: 1.3;
  }
}
