/* =========================================================
   起業の経営学 第1版: 土台（リセット、文字の基本、レイアウトの道具）
   色・書体などの値は site.css の変数で決める。持ち主: デザイナー1
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px; /* ページ内リンクの着地を、固定ヘッダーの下にする */
}

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

/* class の付いたリストだけ、印と余白を消す（:where で弱くして、部品の class で上書きしやすくする） */
:where(ul[class], ol[class]) {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto; /* width と height の属性があっても、幅に合わせて縮む */
}

a {
  color: inherit;
}

button {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- 文字の基本 --- */
body {
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
}

h1, h2, h3, h4 {
  color: var(--color-navy-dark);
  font-family: var(--font-heading);
  line-height: 1.4;
  letter-spacing: 0.02em;
  word-break: auto-phrase; /* 日本語の見出しを文節で折り返す（対応ブラウザのみ） */
  text-wrap: balance;
  text-spacing-trim: trim-start; /* 行頭の「（ を半角の幅にして、見出しの頭をそろえる（対応ブラウザのみ） */
}

p,
li,
td,
dd,
figcaption {
  text-wrap: pretty; /* 最後の行に1〜2文字だけ残るのを避ける（対応ブラウザのみ） */
}

/* --- レイアウトの道具 --- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap {
  display: inline-block;
}

/* 6-1 スキップリンク */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--color-navy-dark);
  color: var(--color-white);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* 0-9 フォーカスの見せ方 */
:focus-visible {
  outline: 3px solid var(--color-link);
  outline-offset: 3px;
}

/* 画面には出さず、読み上げには残す */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
