/* ==========================================================================
   社割NEXT コーポレートサイト base.css
   リセット・body の既定・レイアウトの箱・ユーティリティ
   読み込み順: tokens.css → base.css → components.css → pages/{page}.css
   ブレークポイント: SP を基準に書き、@media (min-width: 1025px) で PC に切り替える
   ========================================================================== */

/* ---- リセット ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd, ol, ul {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

hr {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--color-border-default);
}

em, address {
  font-style: normal;
}

[hidden] {
  display: none !important;
}

/* ---- body の既定（文字/本文/大 と同じ値） ---- */
body {
  min-width: 320px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--color-text-primary);
  background: var(--color-background-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

/* ---- 画像の既定 ---- */
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---- フォーカスの見た目（キーボード操作のときだけ出す。Figma に指定は無い） ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   レイアウト
   ========================================================================== */

/* 本文幅の箱。SP は左右16px、PC は最大1200px（1440pxのアートボードで左右120px）で中央寄せ */
.l-container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-16);
}

@media (min-width: 1025px) {
  .l-container {
    /* 1025〜1280px でも端に付かないよう左右40pxを確保する。1280px以上で本文幅 1200px */
    max-width: calc(var(--content-width) + 80px);
    padding-inline: var(--space-40);
  }
}

/* ==========================================================================
   ユーティリティ
   ========================================================================== */

/* 見た目は隠し、スクリーンリーダーには読ませる */
.u-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* SP だけ・PC だけ表示（改行位置の出し分けなど） */
.u-pc-only {
  display: none !important;
}

@media (min-width: 1025px) {
  .u-sp-only {
    display: none !important;
  }

  .u-pc-only {
    display: revert !important;
  }
}

/* ハンバーガーメニューを開いている間、背面をスクロールさせない（header.js が body に付ける） */
body.is-menu-open {
  overflow: hidden;
}

@media (min-width: 1025px) {
  body.is-menu-open {
    overflow: visible;
  }
}
