/* ✅ 基本設定 */
.article-container {
  max-width: clamp(700px, 90vw, 960px);
  margin: auto;
  margin-top: 85px;
  padding: clamp(1rem, 2vw, 2rem);
  background-color: #ffffff;
  color: #333;
  font-family: 'Helvetica Neue', sans-serif;
}

/* ✅ ヘッダータイトル */
.page-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  color: #005577;
}

/* ✅ 記事のセクション */
.section {
  padding: 1rem;
  background-color: #f2f6fa;
  border-left: 4px solid #03faf6;
  border-radius: 6px;
  margin-bottom: clamp(2rem, 3vw, 2.5rem);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.section h2 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: #003344;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.section h3 {
  text-align: center;
}

.section h4 {
  text-align: left;
}

.section p,
.section li {
  font-size: clamp(0.95rem, 1.8vw, 1rem);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

ul,
ol {
  padding-left: clamp(1rem, 2vw, 1.5rem);
  list-style-position: outside;
  margin-left: 0.5rem;
}

/* ✅ 強調テキスト */
strong {
  color: #006699;
}

/* ✅ 画像関連 */
.image-wrapper {
  text-align: center;
  margin: 2rem 0;
}

.image-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #ddd;
}

/* ✅ 目次 */
.table-of-contents {
  background-color: #f0f8ff;
  border-left: 4px solid #0077aa;
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.table-of-contents ul {
  list-style: none;
  padding-left: 0;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents a {
  color: #0077aa;
  text-decoration: none;
}

.table-of-contents a:hover {
  text-decoration: underline;
}

/* ✅ 固定ヘッダー対策 */
.anchor-offset {
  position: relative;
  scroll-margin-top: 70px;
  /* ✅ ヘッダー高さを統一 */
}

/* ✅ 補助情報ボックス */
.lead {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5em;
  padding: 1rem;
  border-radius: 4px;
}

.note-box,
.warning-box,
.summary-box {
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  border-radius: 4px;
}

.warning-box {
  background-color: #fff4e5;
  border-left: 4px solid #ffa94d;
}

.summary-box {
  background-color: #fff7e6;
  padding: 1.2rem;
  border-left: 5px solid #ffa500;
  margin-top: 2rem;
  margin-bottom: clamp(2rem, 3vw, 2.5rem);
  font-size: 1rem;
  border-radius: 6px;
}

/* ✅ 参考文献セクション */
#references {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f2f6fa;
  border-left: 4px solid #8ecae6;
  border-radius: 6px;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

#references h2 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: #003344;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

#references ul {
  padding-left: clamp(1rem, 2vw, 1.5rem);
  list-style: disc;
  margin-left: 0.5rem;
}

#references li {
  font-size: clamp(0.95rem, 1.8vw, 1rem);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}


/* ✅ モバイル対応 */
@media (max-width: 768px) {
  .article-container {
    padding: clamp(0.75rem, 2vw, 1rem);
    margin: 0;
    max-width: clamp(450px, 90vw, 960px);
    padding-top: 110px;

  }

  .page-title {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
  }

  .section h2 {
    font-size: clamp(1.1rem, 2vw, 1.2rem);
  }

  .section h3 {
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: red;
  }

  .section h4 {
    font-size: clamp(0.8rem, 1vw, 0.9rem);
  }

  .section h5 {
    text-align: center;
    color: red;
    font-size: clamp(0.8rem, 2vw, 1rem)
  }

  .section p,
  .section li {
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 500;
  }

  ul,
  ol {
    padding-left: 0.8rem; /* スマホでは少し詰める */
    margin-left: 0.3rem;
  }

  .summary-box p {
    font-size: clamp(0.8rem, 1vw, 0.9rem)
  }

  .summary-box h2 {
    font-size: clamp(1.1rem, 2vw, 1.2rem);
  }

  .comparison-table th,
  .comparison-table td {
    border: 1px solid #ccc;
    padding: 0.75rem 0.8rem;
    font-size: 0.7rem;
  }
}

/* ✅ 比較表 */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 1rem;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #ccc;
  padding: 0.75rem 1rem;
}

.comparison-table thead {
  background-color: #f5f5f5;
}

.comparison-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.comparison-table strong {
  font-weight: bold;
}

/* ✅ テーブルラッパー：横スクロール用 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* ✅ 比較表に最小幅を指定して折り返し防止 */
.comparison-table {
  min-width: 700px; /* 表が狭くなって崩れるのを防ぐ */
}

/* ✅ 数式・公式ボックス（グレー枠バージョン） */
.formula-box ,
.formula-box-a{
  background-color: #eaf4fb;
  border: 4px solid #999; /* ← ここをグレーに変更 */
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  text-align: center;
  font-size: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
  color: #1c2b36;
}


.formula-box code {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  background: transparent;
  padding: 0;
  color: inherit;
}

.affiliate-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  background-color: #f0f8ff;
  color: #1a0dab;
  border-radius: 8px;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #d0e0ff;
}

.affiliate-link:hover {
  background-color: #e6f0ff;
  text-decoration: underline;
  color: #0a58ca;
}

.book-cards-heading {
  margin: 2rem 0 0.75rem;
  color: #1d5c8a;
  font-size: 1.15rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0.75rem 0;
  padding: 1rem 1.1rem;
  background: #ffffff;
  color: #1c2b36;
  border: 1px solid #1d5c8a;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(29, 92, 138, 0.16);
  text-decoration: none;
}

.book-card:hover {
  box-shadow: 0 4px 14px rgba(29, 92, 138, 0.24);
}

.book-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: #1d5c8a;
}

.book-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  background: #1d5c8a;
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.book-card__icon {
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .book-card {
    padding: 0.9rem;
  }

  .book-card__title {
    font-size: 1.05rem;
  }
}


/* ✅ モバイル対応: formula-box */
@media (max-width: 768px) {
  .formula-box {
    font-size: 0.8rem;
    padding: 0.8rem;
  }

  .formula-box-a {
    font-size: 0.7rem;
    padding: 0.8rem;
  }

  .formula-box code {
    font-size: 0.85rem;
  }

  #references {
  padding: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

#references h2 {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #003344;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

#references ul {
  padding-left: clamp(1rem, 2vw, 1.5rem);
  list-style: disc;
  margin-left: 0.5rem;
}

#references li {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.summary-box {
  padding: 1.2rem;
  margin-top: 2rem;
  font-size: 0.8rem;
  border-radius: 6px;
}
}

.article-updated {
  text-align: right;
  color: #666;
  font-size: 0.8rem;
  margin: 0 0 1rem;
}

.section h2.with-level {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.section h2.with-level > span:first-child {
  min-width: 0;
  flex: 1 1 12rem;
}

.level-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background-color: #f0f8ff;
  color: #0077aa;
  border: 1px solid #0077aa;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.calc-box {
  text-align: left;
}

.calc-box .calc-formula {
  text-align: center;
  margin: 0.5rem 0;
}

.quiz-item {
  margin: 0.75rem 0;
  border: 1px solid #cccccc;
  border-radius: 6px;
  background-color: #fdfdfd;
}

.quiz-item button {
  width: 100%;
  text-align: left;
  padding: 1em;
  font-size: 1rem;
  border: none;
  background-color: #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: #333;
  font-family: inherit;
  min-height: 44px;
}

.quiz-item button span:first-child {
  flex: 1;
}

.quiz-answer {
  padding: 1em;
  background-color: #ffffff;
}

.article-pager {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.article-pager a {
  flex: 1 1 10rem;
  color: #0077aa;
  text-decoration: none;
  background-color: #f0f8ff;
  border: 1px solid #0077aa;
  padding: 0.75rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  line-height: 1.4;
}

.article-pager__prev {
  border-radius: 999px 8px 8px 999px;
}

.article-pager__prev::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 0.45rem solid transparent;
  border-bottom: 0.45rem solid transparent;
  border-right: 0.65rem solid #0077aa;
}

.article-pager__next {
  border-radius: 8px 999px 999px 8px;
}

.article-pager__next::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 0.45rem solid transparent;
  border-bottom: 0.45rem solid transparent;
  border-left: 0.65rem solid #0077aa;
}

.article-pager__category {
  border-radius: 999px;
}

.article-pager__category::before {
  content: "";
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background-color: #0077aa;
}

.comparison-table.shift-table {
  min-width: 0;
  width: 100%;
}
