:root {
  --sl-container-width: 1080px;
  --sl-header-height: 80px;
  --sl-header-height-mobile: 50px;
  --sl-color-primary: #3c4675;
  --sl-color-primary-dark: #1d2134;
  --sl-color-accent: #aa0310;
  --sl-color-white: #fff;
  --sl-transition: 0.25s ease;
}

.p-testimonials__item[id] {
  scroll-margin-top: calc(var(--sl-header-height) + 24px);
}

header.p-header,
header.p-header.js-header,
header.sl-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  overflow: visible;
  background: var(--sl-color-primary-dark);
}

body.p-blog .wp-site-blocks,
body.p-blog .entry-content.wp-block-post-content {
  background: #fff;
  color: #2a2a2a;
}

.sl-header,
.sl-header *,
.sl-mobile-nav,
.sl-mobile-nav *,
.sl-footer,
.sl-footer * {
  box-sizing: border-box;
}

.sl-header,
.sl-header button,
.sl-header a,
.sl-mobile-nav,
.sl-mobile-nav button,
.sl-mobile-nav a,
.sl-footer,
.sl-footer a {
  color: var(--sl-color-white);
}

.sl-header a,
.sl-mobile-nav a,
.sl-footer a {
  color: inherit;
  text-decoration: none;
}

.sl-header ul,
.sl-mobile-nav ul,
.sl-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sl-header img,
.sl-mobile-nav img,
.sl-footer img,
.sl-floating-contact img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sl-container {
  width: min(100%, var(--sl-container-width));
  margin: 0 auto;
}

.sl-header {
  display: grid;
  grid-template-columns: 300px 1fr 130px;
  align-items: center;
  min-height: var(--sl-header-height);
  column-gap: 40px;
  padding-left: 20px;
  font-family: "Noto Sans JP", sans-serif;
  overflow: visible;
}

.sl-header .site-title {
  margin: 0;
  line-height: 1;
}

.sl-header__logo img {
  width: 295px;
  margin-left: 24px;
}

.sl-header__nav {
  justify-self: end;
}

.sl-header__nav-list {
  display: flex;
  align-items: center;
  gap: 30px;
}

.sl-header__nav-item {
  position: relative;
  z-index: 1001;
}

.sl-header__nav-link {
  color: var(--sl-color-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  transition: opacity var(--sl-transition);
}

.sl-header__nav-link:hover {
  opacity: 0.75;
}

.sl-header__nav-button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  color: var(--sl-color-white);
  background: transparent;
  cursor: pointer;
}

.sl-header__subnav {
  position: absolute;
  top: calc(100% + 24px);
  left: 50%;
  z-index: 1010;
  min-width: 230px;
  padding: 12px 0;
  background: var(--sl-color-white);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity var(--sl-transition), visibility var(--sl-transition), transform var(--sl-transition);
}

/* 親項目とサブメニューの隙間を埋める透明なブリッジ。
   hover が途切れずサブメニュー内の要素をクリックできるようにする。 */
.sl-header__subnav::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 24px;
}

.sl-header__nav-item--has-children:hover .sl-header__subnav,
.sl-header__nav-item--has-children:focus-within .sl-header__subnav {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.sl-header__subnav-link {
  display: block;
  padding: 10px 24px;
  color: var(--sl-color-primary-dark) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.sl-header__subnav-link:hover {
  background: rgba(60, 70, 117, 0.08);
}

.sl-header__contact {
  justify-self: end;
}

.sl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 700;
  letter-spacing: 0;
  transition: opacity var(--sl-transition);
}

.sl-btn:hover {
  opacity: 0.92;
}

.sl-btn--primary {
  min-width: 130px;
  min-height: 80px;
  padding: 0 24px;
  background: var(--sl-color-accent);
  color: var(--sl-color-white);
  font-size: 16px;
  line-height: 1.2;
}

.sl-header__menu-button {
  display: none;
}

.sl-mobile-nav {
  display: none;
}

.p-fixed-nav {
  display: none;
}

.sl-floating-contact {
  position: fixed !important;
  top: 50% !important;
  right: 0 !important;
  transform: translateY(-50%) !important;
  z-index: 950 !important;
  transition: opacity var(--sl-transition);
}

.sl-floating-contact:hover {
  opacity: 0.9;
}

.sl-floating-contact img {
  width: auto;
  height: auto;
  max-width: 84px;
  max-height: 95vh;
}

.modal.is-open,
.modal[aria-hidden="false"] {
  position: fixed;
  inset: 0;
  z-index: 20000 !important;
  pointer-events: auto;
}

.modal.is-open .modal__overlay,
.modal[aria-hidden="false"] .modal__overlay {
  z-index: 20000 !important;
}

/*
 * 開いた .modal は position:fixed + z-index:20000 !important で各自が独立した
 * stacking context になるため、その上に重ねて開くモーダル(例:シミュレーション結果内の
 * 「お問い合わせはこちら」→ modal-contact)はオーバーレイの z-index では前面化できない。
 * シミュレーションモーダル自体の開時 z-index を一段下げ、上に開くモーダルを前面に出す。
 */
#modal-simulation.modal.is-open,
#modal-simulation.modal[aria-hidden="false"] {
  z-index: 19999 !important;
}

footer.p-footer,
footer.sl-site-footer {
  background: var(--sl-color-primary-dark);
}

.sl-footer {
  padding: 40px 0 24px;
  color: var(--sl-color-white);
  font-family: "Noto Sans JP", sans-serif;
}

.sl-footer__top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.sl-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex: 0 0 auto;
}

.sl-footer__logo img {
  width: 238px;
}

.sl-footer__address {
  margin: 0;
  color: var(--sl-color-white);
  font-size: 14px;
  line-height: 1.8;
}

.sl-footer__address a {
  text-decoration: underline;
}

.sl-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 32px 48px;
  flex: 1 1 auto;
}

.sl-footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
}

.sl-footer__nav-link--end {
  margin-top: auto;
}

.sl-footer__nav-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sl-footer__nav-link {
  display: block;
  color: var(--sl-color-white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  transition: opacity var(--sl-transition);
}

.sl-footer__nav-link:hover {
  opacity: 0.75;
}

.sl-footer__sublist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sl-footer__sublink {
  display: block;
  color: var(--sl-color-white);
  font-size: 15px;
  line-height: 1.4;
  transition: opacity var(--sl-transition);
}

.sl-footer__sublink::before {
  content: "- ";
}

.sl-footer__sublink:hover {
  opacity: 0.75;
}

.sl-footer__bottom {
  margin-top: 40px;
  text-align: center;
}

.sl-footer__copyright {
  margin: 0;
  color: var(--sl-color-white);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .sl-container {
    width: min(100%, calc(100% - 40px));
  }
}

@media (max-width: 767px) {
  .p-testimonials__item[id] {
    scroll-margin-top: calc(var(--sl-header-height-mobile) + 16px);
  }

  header.p-header,
  header.p-header.js-header,
  header.p-header.js-header.is-fixed,
  header.sl-site-header {
    background: var(--sl-color-primary-dark);
    z-index: 1300;
  }

  body.sl-menu-open {
    overflow: hidden;
  }

  .sl-header {
    grid-template-columns: 1fr auto;
    min-height: var(--sl-header-height-mobile);
    column-gap: 16px;
    padding: 8px 24px;
  }

  .sl-header__logo img {
    width: 200px;
    margin-left: 0;
  }

  .sl-header__nav,
  .sl-header__contact,
  .sl-header__subnav,
  .sl-floating-contact {
    display: none;
  }

  .sl-header__menu-button {
    display: inline-flex;
    position: relative;
    z-index: 1302;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .sl-header__menu-button-line {
    display: block;
    width: 32px;
    height: 2px;
    background: var(--sl-color-white);
  }

  .sl-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99990 !important;
    padding: 0 24px 40px;
    background: var(--sl-color-primary-dark);
    color: var(--sl-color-white);
    overflow-y: auto;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.24s ease, visibility 0.24s ease;
  }

  .sl-mobile-nav:not([hidden]) {
    display: block;
  }

  .sl-mobile-nav.is-open {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sl-mobile-nav__dialog {
    transform: translateY(12px);
    transition: transform 0.28s ease;
  }

  .sl-mobile-nav.is-open .sl-mobile-nav__dialog {
    transform: translateY(0);
  }

  .sl-mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--sl-header-height-mobile);
  }

  .sl-mobile-nav__logo img {
    width: 200px;
  }

  .sl-mobile-nav__close {
    border: 0;
    background: transparent;
    color: var(--sl-color-white);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
  }

  .sl-mobile-nav__list {
    margin-top: 24px;
    padding-inline: 16px;
  }

  .sl-mobile-nav__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  }

  .sl-mobile-nav__link,
  .sl-mobile-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 0;
    border: 0;
    background: transparent;
    color: var(--sl-color-white);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
  }

  .sl-mobile-nav__toggle-icon {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: url("../img/corp/common/icon-down.svg") center / 14px 8px no-repeat;
    transition: transform var(--sl-transition);
  }

  .sl-mobile-nav__toggle[aria-expanded="true"] .sl-mobile-nav__toggle-icon {
    transform: rotate(180deg);
  }

  .sl-mobile-nav__sublist {
    padding: 0 0 14px 12px;
  }

  .sl-mobile-nav__sublink {
    display: block;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
  }

  .sl-mobile-nav__actions {
    display: grid;
    gap: 16px;
    margin-top: 40px;
    padding: 0 48px;
  }

  .sl-mobile-nav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.1em;
  }

  .sl-mobile-nav__cta > span:last-child {
    flex: 0 0 112px;
    width: 112px;
    text-align: left;
  }

  .sl-mobile-nav__cta--request {
    background: var(--sl-color-accent);
    color: var(--sl-color-white);
  }

  .sl-mobile-nav__cta--contact {
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: var(--sl-color-white);
    color: var(--sl-color-primary);
  }

  .sl-mobile-nav__cta--contact > span:last-child {
    color: var(--sl-color-primary) !important;
  }

  .sl-mobile-nav__cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sl-color-white);
  }

  .sl-mobile-nav__cta--contact .sl-mobile-nav__cta-icon {
    background: var(--sl-color-primary);
  }

  .sl-mobile-nav__cta-icon img {
    width: 19px;
    height: 19px;
    object-fit: contain;
  }

  .sl-footer {
    padding: 40px 0 96px;
  }

  .sl-footer__top {
    flex-direction: column;
    gap: 48px;
  }

  .sl-footer__brand {
    gap: 24px;
  }

  .sl-footer__address {
    display: none;
  }

  .sl-footer__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }

  .sl-footer__nav-col {
    gap: 24px;
  }

  .sl-footer__nav-link {
    font-size: 15px;
  }

  .sl-footer__sublink {
    font-size: 14px;
  }

  .sl-footer__bottom {
    text-align: left;
  }

  .p-fixed-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    display: block;
    padding-bottom: env(safe-area-inset-bottom);
    background: transparent;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
  }

  body.sl-menu-open .p-fixed-nav {
    display: none;
  }

  .p-fixed-nav a,
  .p-fixed-nav picture {
    display: block;
  }

  .p-fixed-nav__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
  }
}

@media (min-width: 768px) {
  .p-fixed-nav {
    display: none !important;
  }
}
