/* 支給393pxカンプに基づく共通SP。採用ページはフッターの指定だけを使う。 */
@media (width <= 767px) {
  .p-site-page {
    --sp-gutter: 24px;
    --header-bar-height: 64px;
    --sp-action-height: 68px;
    min-width: 0;
    /* 下に固定する帯（資料請求・製品を探す）にページの最後が隠れないようにする */
    padding-bottom: calc(var(--sp-action-height) + env(safe-area-inset-bottom));
    font-size: var(--fs-sm);
  }

  /* SP は追従させない。会社案内などは main をヘッダーの下に潜らせている（corporate.css）ので、
     static にすると main が手前に来てロゴを押せなくなる。relative で重なり順（--z-gnav）を残す */
  .p-site-page .l-gnav {
    position: relative;
  }

  .p-site-page .l-gnav--subpage .l-gnav__inner {
    width: 100%;
    min-height: 64px;
    align-items: flex-start;
    padding: 10px var(--sp-gutter);
  }

  .p-site-page .l-gnav__logo .c-logo__tagline {
    display: block;
    margin-bottom: 3px;
    font-size: var(--fs-xs);
    line-height: 17px;
  }

  .p-site-page .l-gnav__logo img {
    display: block;
    width: 185px;
    height: auto;
  }

  .p-site-page .l-gnav__menu,
  .p-site-page .l-gnav__sns {
    display: none;
  }

  .p-site-page .l-header__toggle {
    position: absolute;
    right: 12px;
    width: 70px;
    min-height: 67px;
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
  }

  .p-site-page.is-nav-open .l-header__toggle {
    position: fixed;
  }

  .p-site-page .c-nav-toggle__label {
    display: none;
  }

  .p-site-page .l-header__toggle .c-nav-toggle__icon,
  .p-site-page .l-header__toggle .c-nav-toggle__icon::before,
  .p-site-page .l-header__toggle .c-nav-toggle__icon::after {
    width: 46px;
    height: 3px;
  }

  .p-site-page .l-header__toggle .c-nav-toggle__icon::before {
    top: -15px;
  }

  .p-site-page .l-header__toggle .c-nav-toggle__icon::after {
    top: 14px;
  }

  .p-site-page .c-nav-toggle.is-open {
    background: var(--color-white);
    color: var(--color-text);
  }

  .p-site-page .c-nav-toggle.is-open .c-nav-toggle__icon {
    background: transparent;
  }

  .p-site-page .c-nav-toggle.is-open .c-nav-toggle__icon::before,
  .p-site-page .c-nav-toggle.is-open .c-nav-toggle__icon::after {
    top: 0;
    width: 30px;
    opacity: 1;
  }

  .p-site-page .c-nav-toggle.is-open .c-nav-toggle__icon::before {
    rotate: 45deg;
  }

  .p-site-page .c-nav-toggle.is-open .c-nav-toggle__icon::after {
    rotate: -45deg;
  }

  .p-site-page.p-home-page .l-header__logo {
    padding: 20px 0 0 var(--sp-gutter);
  }

  .p-site-page.p-home-page .l-header__logo .c-logo__tagline {
    margin-bottom: 7px;
    font-size: clamp(11px, 3.6vw, 14px);
    line-height: 17px;
  }

  .p-site-page.p-home-page .l-header__logo img {
    width: 216px;
    height: auto;
  }

  .p-site-page.p-home-page:not(.is-nav-open) .l-header__toggle {
    top: 17px;
    color: var(--color-white);
  }

  .p-site-page .p-nav__inner {
    display: block;
    width: 100%;
    max-width: none;
    padding: 90px var(--sp-gutter) 48px;
  }

  .p-site-page .p-nav__col,
  .p-site-page .p-nav__side {
    width: 100%;
    padding: 0;
  }

  .p-site-page .p-nav__list {
    gap: 5px 10px;
  }

  .p-site-page .p-nav__link {
    gap: 7px;
  }

  .p-site-page .p-nav__thumb {
    width: 36px;
    height: 36px;
  }

  .p-site-page .p-nav__text,
  .p-site-page .p-nav__hours {
    font-size: var(--fs-xs);
  }

  .p-site-page .p-nav__side {
    margin-top: 40px;
  }

  .p-site-page .p-nav__meta,
  .p-site-page .p-nav__company {
    margin-top: 30px;
  }

  .p-site-page .p-nav__menu {
    gap: 20px 30px;
  }

  .p-site-page .p-nav__hours {
    white-space: normal;
  }

  /* 下に固定する帯。トップは FV 内の帯（style.css）、採用は ENTRY の帯を使う */
  .p-site-page .p-product-action {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-float);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: calc(var(--sp-action-height) + env(safe-area-inset-bottom));
  }

  .p-site-page .p-product-action__tel {
    min-width: 0;
    height: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 0;
    background-color: var(--color-main);
  }

  .p-site-page .p-product-action__catalog {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
    height: 100%;
    padding: 0 0 env(safe-area-inset-bottom);
    border: 0;
    background-color: var(--color-accent);
    color: var(--color-white);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
  }

  .p-site-page .p-product-action__catalog .c-nav-toggle__icon::before {
    top: -8px;
  }

  .p-site-page .p-product-action__catalog .c-nav-toggle__icon::after {
    top: 8px;
  }

  .p-site-page.is-nav-open:not(.is-site-menu) .p-product-action {
    visibility: hidden;
  }

  /* 右上メニューは下の帯のすぐ上で終え、帯を見せたままにする（トップは FV 内の同じ高さの帯） */
  .p-site-page.is-site-menu .p-nav {
    bottom: calc(var(--sp-action-height) + env(safe-area-inset-bottom));
  }

  /* 右上のボタンから開いたときは、製品の欄を出さず PC ヘッダーと同じ項目だけにする。
     カンプがないため、文字の大きさと間隔は採用ページの SP メニューにそろえた。
     ロゴは開く前と動かないよう、そのページのヘッダーのロゴと同じ位置・大きさにする。 */
  .p-site-page.is-site-menu .p-nav__inner {
    display: none;
  }

  /* 下層は .l-gnav--subpage .l-gnav__inner・.l-gnav__logo と同じ */
  .p-site-page.is-site-menu .p-nav__site {
    display: block;
    padding: 10px var(--sp-gutter) 48px;
  }

  .p-site-page .p-nav__site .c-logo__tagline {
    margin-bottom: 3px;
    font-size: var(--fs-xs);
    line-height: 17px;
  }

  .p-site-page .p-nav__site .c-logo__img {
    width: 185px;
    height: auto;
  }

  /* トップは .p-home-page .l-header__logo と同じ */
  .p-site-page.p-home-page.is-site-menu .p-nav__site {
    padding-top: 20px;
  }

  /* ヘッダーの白ロゴ（logo-white.png）は画像の上に 1px の透明な余白があるので、
     絵柄の位置をそろえるため下余白は 7px ＋ 1px にする */
  .p-site-page.p-home-page .p-nav__site .c-logo__tagline {
    margin-bottom: 8px;
    font-size: clamp(11px, 3.6vw, 14px);
  }

  .p-site-page.p-home-page .p-nav__site .c-logo__img {
    width: 216px;
  }

  .p-site-page .p-nav__site-menu {
    display: grid;
    gap: 28px;
    margin-top: 56px;
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1;
    list-style: none;
  }

  .p-site-page .p-nav__site-sns {
    gap: var(--space-sm);
    margin-top: var(--space-lg);
  }

  .p-site-page .p-nav__site-sns img {
    width: 17px;
    height: auto;
  }

  /* 文字のSVGはそのまま使い、分離したオレンジ線だけを順番に描く。 */
  .p-site-page .c-title-lines-sp {
    --title-line-first-top: calc(100% * 29.2 / 50);
    --title-line-first-width: 100%;
    --title-line-height: calc(100% * 20 / 50);
  }

  .p-inquiry-page .c-title-lines-sp {
    --title-line-first-top: calc(100% * 20.6 / 82);
    --title-line-first-width: calc(100% * 188 / 222);
    --title-line-second-top: calc(100% * 64.6 / 82);
    --title-line-second-width: 100%;
    --title-line-height: calc(100% * 17 / 82);
  }

  .p-entry-page .c-title-lines-sp {
    --title-line-first-top: calc(100% * 21.8 / 94);
    --title-line-second-top: calc(100% * 73.8 / 94);
    --title-line-second-width: calc(100% * 178 / 218);
    --title-line-height: calc(100% * 20 / 94);
  }

  .p-privacy-page .c-title-lines-sp {
    --title-line-first-top: calc(100% * 23.6 / 96);
    --title-line-second-top: calc(100% * 75.6 / 96);
    --title-line-second-width: 100%;
    --title-line-height: calc(100% * 20 / 96);
  }

  .p-report-page .c-title-lines-sp {
    --title-line-first-top: calc(100% * 29.2 / 102);
    --title-line-second-top: calc(100% * 81.2 / 102);
    --title-line-second-width: calc(100% * 178 / 338);
    --title-line-height: calc(100% * 20 / 102);
  }

  /* 404 もほかのページの SVG 見出しと同じく、帯の左端をパンくずの「TOP」にそろえる（汎用ページの内側余白を外す） */
  .p-not-found-page .p-wp-page__hero-inner {
    padding-inline: 0;
  }

  /* 404 は文字の見出しなので、SVG 見出し（40px・行送り 1.3、帯は文字の左 8px から右 10px まで）に寄せ、
     帯の位置は文字の大きさ（em）から決める。1行目の帯は「ページが」の4文字分。
     改行は <br> の位置だけにし、375px 以下で「ん」だけが次の行に落ちないようにする */
  .p-not-found-page .p-wp-page__title {
    max-width: none;
    padding-inline: 8px 10px;
    font-size: 4rem;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
  }

  .p-not-found-page .c-title-lines-sp {
    --title-line-first-top: 0.85em;
    --title-line-first-width: calc(4em + 18px);
    --title-line-second-top: 2.15em;
    --title-line-second-width: 100%;
    --title-line-height: 0.5em;
  }

  .p-site-page .c-title-lines-sp::before,
  .p-site-page .c-title-lines-sp::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto;
    top: var(--title-line-first-top);
    left: 0;
    display: block;
    width: var(--title-line-first-width);
    height: var(--title-line-height);
    background-color: var(--color-accent);
    transform-origin: left center;
    animation: form-title-line var(--duration-slow) var(--easing-out) both;
  }

  .p-site-page .c-title-lines-sp::after {
    top: var(--title-line-second-top);
    width: var(--title-line-second-width);
    animation-delay: var(--duration-slow);
  }

  .p-site-page .c-title-lines-sp--single::after {
    display: none;
  }

  .p-site-page .c-heading-v,
  .p-site-page .c-heading-v--reverse {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 6px;
    padding-left: var(--space-2xs);
  }

  .p-site-page .c-heading-v__en {
    margin: 0;
    writing-mode: horizontal-tb;
    font-size: var(--fs-md);
    line-height: 1.13;
  }

  .p-site-page .c-heading-v__ja {
    display: block;
    padding: 0;
    writing-mode: horizontal-tb;
  }

  .p-site-page .c-heading-v__ja img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
  }

  .p-site-page .c-heading-v__ja::before,
  .p-site-page .c-heading-v--reverse .c-heading-v__ja::before {
    top: 34px;
    right: auto;
    bottom: auto;
    left: -10px;
    width: calc(100% + 20px);
    height: 26px;
    transform-origin: left center;
  }

  .p-site-page .c-heading-v.is-hidden .c-heading-v__ja::before {
    scale: 0 1;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__inner {
    display: block;
    padding: 50px var(--sp-gutter) 0;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__logo {
    margin-bottom: 44px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__logo img {
    display: block;
    width: 293px;
    max-width: 100%;
    height: auto;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__hours {
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 20px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__address {
    margin-top: var(--space-sm);
    font-size: var(--fs-sm);
    line-height: 20px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__sp-break {
    display: initial;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__address dt + dd {
    margin-top: 7px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__address dd + dt {
    margin-top: 9px;
  }

  /* XD では、1行の所在地名（島松沢工場・札幌支店）と住所の間だけ 24px 送りになっている */
  :is(.p-site-page, .p-recruit-page) .l-footer__address dd + dt + dd {
    margin-top: 4px;
  }

  /* 住所の最後の行からメニューまでの間隔を XD（文字の下端から上端まで 38px）に合わせる */
  :is(.p-site-page, .p-recruit-page) .l-footer__nav {
    padding-top: 32px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__menu {
    grid-template-columns: repeat(3, 86px);
    justify-content: start;
    gap: 18px 10px;
    font-size: var(--fs-sm);
    line-height: 17px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__sns {
    margin-top: 26px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__tel {
    width: 100%;
    min-height: 82px;
    margin-top: 36px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__tel .c-tel__label {
    font-size: var(--fs-lg);
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__tel .c-tel__number {
    font-size: 2.4rem;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__policy {
    margin-top: 19px;
    line-height: 25px;
  }

  /* XD：区切り線は緑の線の上端から 754px、コピーライトの基準線は 789px、フッター全体の高さは 817px */
  :is(.p-site-page, .p-recruit-page) .l-footer__copyright {
    margin: 30px var(--sp-gutter) 0;
    padding: 17px 0 20px;
    line-height: 25px;
  }

  :is(.p-site-page, .p-recruit-page) .l-footer__copyright small {
    font-size: inherit;
  }
}

@media (width <= 767px) and (prefers-reduced-motion: reduce) {
  .p-site-page .c-title-lines-sp::before,
  .p-site-page .c-title-lines-sp::after {
    animation: none;
  }
}
