/* 全ページ共通のメガメニュー。既存の本文/フッターのリンクには影響しない。 */
body .site-header__nav .site-nav { gap: clamp(20px, 2vw, 36px); }
body .site-header__nav .site-nav__item { position: static; }
body .site-header__nav [hidden] { display: none !important; }
body .site-header__nav .site-nav__trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: var(--site-header-height, 82px);
  padding: 0;
  border: 0;
  background: none;
  color: #07154b;
  font: inherit;
  font-size: clamp(14px, 1.08vw, 18px);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease;
}
body .site-header__nav .site-nav__trigger .dashicons {
  width: 12px;
  height: 12px;
  font-size: 12px;
  transition: transform 240ms ease;
}
body .site-header__nav .site-nav__trigger[aria-expanded="true"] .dashicons { transform: rotate(180deg); }
body .site-header__nav .site-nav__trigger:is(:hover, :focus-visible, [aria-expanded="true"]),
body .site-header__nav .is-current > :is(.site-nav__trigger, .site-nav__direct) { color: #0867f2; }
body .site-header__nav .site-nav__trigger:focus-visible { outline: 2px solid #0867f2; outline-offset: -2px; border-radius: 3px; }
body .site-header__nav .site-nav__direct { min-height: var(--site-header-height, 82px); font-weight: 500; }
.site-mega-open .site-header { transform: none; }

body .site-header__nav .mega-menu {
  position: absolute;
  top: 100%;
  left: 3.5%;
  right: 3.5%;
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 2fr);
  max-width: 1440px;
  max-height: calc(100dvh - var(--site-header-height, 100px) - var(--site-admin-bar-offset, 0px) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-inline: auto;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 60px rgb(27 52 99 / 12%);
  opacity: 0;
  transform: translateY(-7px);
  transition: opacity 240ms ease, transform 280ms cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
body .site-header__nav .is-open > .mega-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mega-menu__intro { padding: 40px 38px; background: #fbfcff; }
.mega-menu__eyebrow { margin: 0 0 16px; color: #0867f2; font-size: 12px; font-weight: 600; letter-spacing: .16em; }
.mega-menu__title { margin: 0; color: #07154b; font-size: 23px; font-weight: 700; line-height: 1.6; letter-spacing: .025em; }
.mega-menu__description { margin: 16px 0 28px; max-width: 280px; color: #52627e; font-size: 13px; line-height: 1.9; }
body .site-header__nav .mega-menu__overview {
  display: inline-flex;
  min-height: 40px;
  gap: 16px;
  color: #0867f2;
  font-size: 14px;
  font-weight: 600;
  white-space: normal;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: #b3ceff;
}
body .site-header__nav .mega-menu a::after { display: none; }
body .site-header__nav .mega-menu__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px 22px;
  margin: 0;
  padding: 26px 30px;
  list-style: none;
}
body .site-header__nav .mega-menu__link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 100px;
  padding: 18px 12px;
  border-radius: 10px;
  color: #07154b;
  font-size: 16px;
  white-space: normal;
  transition: background-color 240ms ease, color 240ms ease;
}
.mega-menu__icon { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 10px; background: #f0f6ff; }
.mega-menu__icon img { display: block; width: 26px; height: 26px; }
.mega-menu__copy { min-width: 0; }
.mega-menu__name { display: block; font-size: 16px; font-weight: 600; line-height: 1.7; }
.mega-menu__caption { display: block; margin-top: 7px; color: #52627e; font-size: 12px; font-weight: 400; line-height: 1.9; }
.mega-menu__arrow { flex: 0 0 16px; width: 16px; height: 16px; margin: 6px 0 0 auto; color: #7893bb; font-size: 16px; transition: transform 240ms ease, color 240ms ease; }
body .site-header__nav .mega-menu__link:is(:hover, :focus-visible) { color: #0867f2; background: #f4f8ff; }
.mega-menu__link:is(:hover, :focus-visible) .mega-menu__arrow { color: #0867f2; transform: translateX(3px); }
.mega-menu__empty { padding: 24px; font-size: 14px; color: #52627e; }

@media (max-width: 1080px) {
  body .site-header__nav .site-nav { grid-template-columns: 1fr; gap: 0; }
  body .site-header__nav .site-nav__item { border-bottom: 1px solid #e8eef7; }
  body .site-header__nav .site-nav__trigger,
  body .site-header__nav .site-nav__direct,
  body .site-header__nav .site-nav__fallback {
    width: 100%; min-height: 56px; justify-content: space-between; padding: 12px 4px; border: 0; font-size: 15px;
  }
  body .site-header__nav .mega-menu {
    position: static; display: block; max-height: none; margin: 0 0 16px; border: 0; border-radius: 12px;
    box-shadow: none; background: #f8faff; transform: none;
  }
  .mega-menu__intro { padding: 20px 20px 8px; border: 0; background: none; }
  .mega-menu__eyebrow, .mega-menu__title, .mega-menu__description { display: none; }
  body .site-header__nav .mega-menu__overview { padding: 0; border: 0; justify-content: flex-start; font-size: 14px; }
  body .site-header__nav .mega-menu__links { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 8px 16px; gap: 0; }
  body .site-header__nav .mega-menu__link { min-height: 70px; padding: 14px 12px; border: 0; align-items: flex-start; }
  .mega-menu__name { font-size: 14px; }
  .mega-menu__caption { font-size: 12px; }
}
@media (max-width: 767px) {
  body .site-header__nav .mega-menu__links { grid-template-columns: 1fr; }
  .mega-menu__icon { flex-basis: 34px; height: 34px; border-radius: 8px; }
  .mega-menu__icon img { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  body .site-header__nav .mega-menu,
  body .site-header__nav .mega-menu__link,
  body .site-header__nav .site-nav__trigger,
  body .site-header__nav .site-nav__trigger .dashicons,
  .mega-menu__arrow { transition: none; }
}
