/* ========================================
   HEADER
   ======================================== */
/* PC：1300〜1920pxでロゴ220〜480px、ナビ間隔16〜32pxへ補間。
 * 1300px未満はサイト共通のrem比例縮小に従う。 */
.header {
  background: #fff;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.6rem, calc(1.935483871vw - .9161290323rem), 2.8rem);
  min-height: 10rem;
  margin-left: clamp(3.8461538462vw, calc(12.9032258065vw - 11.7741935484rem), 6.7708333333vw);
  margin-right: clamp(3.5416666667vw, calc(2.9032258065vw + 1.2258064516rem), 3.8461538462vw);
  padding-block: 2rem;
}

.header a {
  color: inherit;
  text-decoration: none;
  transition: opacity .2s;
}

.header__logo {
  flex-shrink: 0;
  width: clamp(22rem, calc(41.935483871vw - 32.5161290323rem), 48rem);
}

.header__logo img {
  width: 100%;
}

/* グローバルナビ・子メニュー */
.header__nav {
  margin-left: auto;
}

.header__nav > ul {
  display: flex;
  align-items: center;
  gap: clamp(1.6rem, calc(2.5806451613vw - 1.7548387097rem), 3.2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__nav a {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.header__information {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.header__information span {
  width: .6rem;
  height: .6rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-.2rem) rotate(45deg);
}

.header__nav-parent {
  position: relative;
}

.header__submenu {
  position: absolute;
  top: calc(100% + 1.6rem);
  right: 0;
  z-index: 10;
  min-width: 23rem;
  margin: 0;
  padding: .8rem;
  list-style: none;
  border: 1px solid #e4edf4;
  border-top: 3px solid #0281cd;
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: 0 1.2rem 3.6rem rgb(23 44 87 / 14%);
  visibility: hidden;
  opacity: 0;
  transform: translateY(.8rem);
  transition: opacity .2s, transform .2s, visibility .2s;
}

/* 親項目からパネルへの移動中もhoverを保つ。 */
.header__submenu::before {
  content: "";
  position: absolute;
  inset: -1.9rem 0 auto;
  height: 1.9rem;
}

.header__submenu li + li {
  border-top: 1px solid #edf2f7;
}

.header__submenu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 1.5rem 1.6rem;
  border-radius: .6rem;
  color: #172c57;
  font-size: 1.5rem;
  font-weight: 500;
  transition: background-color .2s, color .2s;
}

.header__submenu a::after {
  content: "";
  width: .7rem;
  height: .7rem;
  border-top: 1px solid #0281cd;
  border-right: 1px solid #0281cd;
  transform: rotate(45deg);
  transition: transform .2s;
}

.header__nav-parent:focus-within > .header__submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.header__submenu a:focus-visible {
  background: #f2f8fc;
  color: #0281cd;
}

/* 電話：1300〜1920pxでラベル12〜14px、番号30〜39px。 */
.header__contact {
  flex-shrink: 0;
}

.header__phone {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__phone-label {
  border: 1px solid #0281cd;
  border-radius: 100vmax;
  padding: .4rem 1.4rem;
  color: #0281cd;
  font-size: clamp(1.2rem, calc(.3225806452vw + .7806451613rem), 1.4rem);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.header__phone-number {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #0281cd;
  font-family: "Roboto", sans-serif;
  font-size: clamp(3rem, calc(1.4516129032vw + 1.1129032258rem), 3.9rem);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.header__phone-number img {
  width: clamp(2.4rem, calc(.9677419355vw + 1.1419354839rem), 3rem);
  filter: brightness(0) saturate(100%) invert(38%) sepia(99%) saturate(1458%) hue-rotate(169deg) brightness(90%) contrast(101%);
}

.header__hours {
  margin-top: .4rem;
  font-size: 1.2rem;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.header__menu {
  display: none;
}

.header a:focus-visible {
  outline: 3px solid #0281cd;
  outline-offset: 4px;
}

@media (hover: hover) {
  .header a:hover {
    opacity: .75;
  }
  .header__nav-parent:hover > .header__submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }
  .header .header__submenu a:hover {
    opacity: 1;
    background: #f2f8fc;
    color: #0281cd;
  }
  .header__submenu a:hover::after {
    transform: translateX(.3rem) rotate(45deg);
  }
}

/* remの比例縮小が止まる幅で、ロゴ＋メニュー表示に切り替える。 */
@media (max-width: 1056.25px) {
  .header__inner {
    min-height: 8rem;
    margin-inline: 3.8461538462%;
    padding-block: 1.6rem;
    gap: 2rem;
  }
  .header__logo {
    width: clamp(32rem, calc(20.8152645273vw + 12.3247714991rem), 39.3846153846rem);
    max-width: calc(100% - 6.4rem);
  }
  .header__nav, .header__contact {
    display: none;
  }
  .header__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 4.4rem;
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.4;
    white-space: nowrap;
  }
  .header__menu-lines {
    display: block;
    width: 2.8rem;
    height: 1rem;
    border-block: 1px solid currentColor;
  }
}

/* 中間幅：共通のrem下限8.125pxで、メニュー表示を拡大。 */
@media (min-width: 768px) and (max-width: 1056.25px) {
  .header__menu {
    width: 5.2rem;
    gap: .7rem;
    font-size: 1.3rem;
  }
  .header__menu-lines {
    width: 3.6rem;
    height: 1.2rem;
  }
}

/* SP：1rem = 10px。ロゴは375pxで202px、767pxで260px。
 * ヘッダー全体を画面上部に追従させる。 */
@media (max-width: 767px) {
  html {
    scroll-padding-top: 8rem;
  }
  .header {
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 4px rgb(23 44 87 / 8%);
  }
  .header__inner {
    min-height: 6.4rem;
  }
  .header__logo {
    width: clamp(20.2rem, calc(14.7959183673vw + 14.6515306122rem), 26rem);
    max-width: calc(100% - 5.2rem);
  }
  .header__menu {
    justify-content: center;
    width: 5.2rem;
    min-height: 4.8rem;
    margin-right: -.6rem;
    padding: .8rem .6rem;
    font-size: .9rem;
  }
  .header__menu-lines {
    width: 2.4rem;
    height: .8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header a, .header__submenu, .header__submenu a::after {
    transition: none;
  }
}


/* ========================================
   ハンバーガーメニュー
   ======================================== */
/* XDの375px固定デザイン。中間幅のhtml文字サイズ縮小を受けないようpxで指定する。 */
:where(.header__menu) {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

/* WordPressの管理バーは601〜782pxで固定表示になるため、その下に追従させる。 */
@media (min-width: 601px) and (max-width: 767px) {
  .admin-bar .header {
    top: var(--wp-admin--admin-bar--height, 0px);
  }
}

.header__menu:focus-visible {
  outline: 3px solid #0281cd;
  outline-offset: 2px;
}

html:has(.sp-menu[open]) {
  overflow: hidden;
}

.sp-menu {
  width: 100%;
  max-width: none;
  max-height: 100dvh;
  margin: 0 0 auto auto;
  padding: 0;
  border: 0;
  background: #172c57;
  color: #fff;
  font-size: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sp-menu[open] {
  animation: sp-menu-fade .3s ease-out;
}

.sp-menu::backdrop {
  background: transparent;
}

@keyframes sp-menu-fade {
  from { opacity: 0; }
}

.sp-menu__inner {
  padding-bottom: 38px;
}

.sp-menu__head {
  position: relative;
  height: 76px;
}

.sp-menu__logo {
  position: absolute;
  top: 22px;
  left: 12px;
  width: 202px;
}

.sp-menu__close {
  position: absolute;
  top: 8px;
  right: max(4px, calc(3.8461538462vw - 10px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 52px;
  min-height: 48px;
  padding: 12px 0 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.sp-menu__close-icon {
  position: relative;
  width: 24px;
  height: 17px;
}

.sp-menu__close-icon::before,
.sp-menu__close-icon::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 24px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.sp-menu__close-icon::after {
  transform: rotate(-45deg);
}

.sp-menu__list,
.sp-menu__sub,
.sp-menu__social {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-menu__list {
  margin-inline: 12px;
  border-top: 1px solid rgb(255 255 255 / 50%);
}

.sp-menu__list > li {
  border-bottom: 1px solid rgb(255 255 255 / 50%);
}

.sp-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 45px;
  padding: 0 10px 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sp-menu__plus {
  position: relative;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
}

.sp-menu__plus::before,
.sp-menu__plus::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 15px;
  height: 1px;
  background: currentColor;
}

.sp-menu__plus::after {
  transform: rotate(90deg);
}

.sp-menu__toggle[aria-expanded="true"] .sp-menu__plus::after {
  display: none;
}

.sp-menu__sub {
  padding: 10px 0 15px 65px;
  border-top: 1px solid rgb(255 255 255 / 50%);
  font-size: 13px;
  line-height: 26px;
}

.sp-menu__sub a {
  color: inherit;
  text-decoration: none;
}

.sp-menu__sub a::before {
  content: "- ";
}

.sp-menu__social {
  display: flex;
  justify-content: center;
  gap: 19px;
  margin-top: 32px;
}

.sp-menu__social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}

.sp-menu__social img {
  width: auto;
  max-width: 32px;
  height: auto;
  max-height: 32px;
}

.sp-menu__buttons {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 29px;
}

.sp-menu__buttons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 114px;
  height: 57px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 5px;
  color: inherit;
  font-size: 12px;
  line-height: 17px;
  text-decoration: none;
}

.sp-menu__buttons img {
  width: auto;
  height: 20px;
}

.sp-menu a:focus-visible,
.sp-menu button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (hover: hover) {
  .sp-menu a,
  .sp-menu button {
    transition: opacity .2s;
  }
  .sp-menu a:hover,
  .sp-menu button:hover {
    opacity: .75;
  }
}

/* 中間幅は全幅に広げず、右側にSPと同じ幅で開く。 */
@media (min-width: 768px) {
  .sp-menu {
    width: 375px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-menu[open] { animation: none; }
  .sp-menu a, .sp-menu button { transition: none; }
}

/* XD照合 */
@media (min-width: 768px) {
  .header__hours {
    font-size: 1.3rem;
  }
}
