/* tips(ITのお役立ち情報)の記事(template-parts/single-tips.php)。posts.css の後に、tips の記事ページだけで読み込む(inc/tips-content.php)。
   すべてのルールは記事の枠 .tips-article の中だけに効く。お知らせの記事・一覧・固定ページ・ヘッダー・フッター・パンくずには効かない。
   色は sbcc の紺と金だけ(下の変数。記事の枠の中だけで定義)。角は丸く(--tips-radius)、影は付けない。
   PC とスマホ・タブレットの切り替えは、画面の幅ではなく、記事の枠の幅(コンテナクエリ。1030px 以上で目次を左に固定)。
   本文の中の画像の目印(.sbcc-img-ph)は、追加CSSのまま(ここでは指定しない)。本文の一番上のアイキャッチ画像の目印(.tips-eyecatch、fix7)は、その見た目をここで写して指定する。
   例外はパンくずだけ(このページに限って、記事の枠と同じ幅にする。下の「パンくず」) */

.tips-article {
  --tips-navy: #16233f;
  --tips-navy-2: #22365e;
  --tips-gold: #b4863a;
  --tips-gold-soft: #d8c29a;
  --tips-tint: #f7f4ee;
  --tips-tint-2: #efe7d8;
  --tips-line: #e3ddd0;

  /* 角の丸み:テーマに角丸の部品が無いため、記事の画像の目印(追加CSSの .sbcc-img-ph__box)と同じ 8px */
  --tips-radius: 8px;
  /* 小さな英字のラベルと章番号だけ、等幅の書体 */
  --tips-mono: ui-monospace, Consolas, monospace;
  /* 目次を固定する位置と、目次から移動したときの見出しの上の余白(ヘッダーは画面の上に固定されないので、余白だけ) */
  --tips-sticky-top: var(--anchor-offset, 24px);

  /* PC(目次を固定するとき)の欄の幅(2026-11-21 修正、同日 fix3 で左右の余白をなくした。fix5 で本文を左、目次を右に入れ替えた)。
     本文:以前の幅(記事の枠 − 目次 236px − 間 56px)の 85%(1440px で 772px)。間は 56px のまま。
     目次:残りの幅すべて(1440px で約 372px)。本文の左端と目次の右端は、記事の概要の区画の左右の端にそろう。幅は枠を含む外側の幅。% は記事の枠の中身の幅(.tips-layout で使う) */
  --tips-column-gap: 56px;
  --tips-body-width: calc((100% - 236px - 56px) * 0.85);
  /* PC の本文の段落の文字の大きさ(下の「広い枠」の .tips-body) */
  --tips-body-font-pc: 17px;

  /* 記事の概要の左右の内側の余白と、本文の欄の内側の余白・枠線の太さ(fix8 で変数にした。値は以前と同じ。cqi は使う所(記事の枠の中)で計算される) */
  --tips-profile-pad-x: clamp(16px, 3.6cqi, 40px);
  --tips-body-pad: clamp(24px, 3cqi, 36px);
  --tips-body-border: 1px;
  /* PC の「ずらす量」:本文の中身の左端を「基準線 + 1文字分」に置くための差。
     基準線(fix8) = 記事の枠の左端 + 記事の概要の内側の余白(記事の概要の白い表の枠線の左端)。本文の中身の左端 = 記事の枠の左端 + 本文の枠線 + 本文の内側の余白。
     fix9 で、そこからさらに1文字分(本文の段落の文字の大きさ --tips-body-font-pc = 17px)右へ。1440px で 40 − 1 − 36 + 17 = 20px */
  --tips-body-shift: calc(var(--tips-profile-pad-x) - var(--tips-body-border) - var(--tips-body-pad) + var(--tips-body-font-pc));
}

/* パンくず:このページ(tips の記事)に限って、記事の枠と同じ最大 1200px にし、左端をヒーローの左端にそろえる。
   ほかのページのパンくず(style.css の .breadcrumb、最大 960px)は変えない(この CSS は tips の記事ページだけで読み込む。さらに、記事の枠があるページに限る) */
.site-main:has(> .tips-article) > .breadcrumb {
  max-width: calc(1200px + (var(--page-x) * 2));
}

/* スマホ(画面の幅 640px 未満)のパンくず(fix10):最後の項目(今の記事のタイトル)を出さない。タイトルは、すぐ下のヒーローの H1 に出ているため。
   「ITのお役立ち情報」の後ろに、同じ区切りの「›」(style.css の .breadcrumb__item + .breadcrumb__item::before と同じ記号・色・間隔)を1つ残し、ヒーローに続くことを示す。
   見た目だけ。HTML(inc/breadcrumb.php)と構造化データ(mu-plugin sbcc-seo の BreadcrumbList)には、タイトルが残る。display: none なので読み上げからも外れる(H1 で読み上げられる)。
   パンくずが1行になった分、ヒーローが上に詰まる。パンくずとヒーローの間(記事の枠の上の余白 24px)は PC と同じまま */
@media (max-width: 639.98px) {
  .site-main:has(> .tips-article) > .breadcrumb .breadcrumb__item:last-child:has(> [aria-current="page"]) {
    display: none;
  }

  .site-main:has(> .tips-article) > .breadcrumb .breadcrumb__item:has(+ .breadcrumb__item:last-child > [aria-current="page"])::after {
    content: "›";
    margin-inline: 0.6em;
    color: rgba(22, 35, 63, 0.45);
  }
}

/* 記事の枠(中央揃え、最大幅 1200px)。下層ページの本文幅(960px)より広い */
.tips-article__frame {
  container: tips / inline-size;
  width: 100%;
  max-width: calc(1200px + (var(--page-x) * 2));
  margin-inline: auto;
  padding: 24px var(--page-x) 72px;
  line-break: strict;
}

/* ===== ① ヒーロー(紺の帯) ===== */
.tips-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* 上下の余白(fix6):上の段をなくしたので、タイトルの上とリード文の下の見た目の余白をそろえる。
     上は、金色の線(6px)の分だけ下より広くする(1440px で 30px/24px、1024px で約 24px/19px、スマホで 20px/14px)。スマホは左右 14px */
  padding: clamp(20px, 2.5cqi, 30px) clamp(14px, 5.4cqi, 64px) clamp(14px, 2cqi, 24px);
  border-radius: var(--tips-radius);
  background: linear-gradient(135deg, var(--tips-navy) 0%, var(--tips-navy-2) 100%);
  color: #fff;
}

/* 上辺の金色の線(6px) */
.tips-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 6px;
  background: var(--tips-gold);
}

/* 右上のマーク(重なる2つの吹き出しの線画)。文字の後ろに置き、帯の端で切れる。
   128px(最初の 260px の約 49%。fix4)。fix6:記事番号・日付をなくしたので、帯の右上に寄せた。タイトルの右の余白(下の .tips-hero__title)に収まる。スマホでは出さない */
.tips-hero__mark {
  position: absolute;
  top: 10px;
  right: -20px;
  z-index: 0;
  width: 128px;
  height: auto;
  color: var(--tips-gold);
  opacity: 0.5;
  pointer-events: none;
}

.tips-hero__body {
  position: relative;
  z-index: 1;
}

.tips-hero__body > * {
  margin-block: 0;
}

/* タイトル(H1)。記事の枠の幅に合わせて、文字の大きさを変える(fix3 で以前の 80%。スマホは読みやすさのため 18px で止める)。
   文節の切れ目で折り返す(word-break: auto-phrase。<html lang="ja">)。日付は途中で折り返さない(.tips-hero__nowrap。inc/tips-content.php の sbcc_tips_title_html()) */
.tips-hero__title {
  color: #fff;
  font-size: clamp(18px, 2.48cqi, 30px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: auto-phrase;
  text-wrap: pretty;
}

.tips-hero__nowrap {
  white-space: nowrap;
}

/* 広い枠:タイトルの右に、マークの入る余白を空ける(fix3。マークとタイトルの文字が重ならないように) */
@container tips (min-width: 600px) {
  .tips-hero__title {
    padding-right: 90px;
  }
}

@container tips (min-width: 1100px) {
  .tips-hero__title {
    padding-right: 120px;
  }
}

/* 区切り線(白の半透明)と抜粋(リード文)。抜粋は全角45字以内(PC で1行。編集画面の案内は inc/acf-tips-profile.php) */
.tips-hero__lead {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.7;
}

/* ===== 小さな英字+日本語の見出し(記事の概要・目次) ===== */
.tips-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin: 0 0 16px;
  color: var(--tips-navy);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.tips-label__en {
  color: var(--color-gold-text);
  font-family: var(--tips-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
}

/* ===== ② 記事の概要 ===== */
.tips-profile {
  margin-top: clamp(28px, 4cqi, 40px);
  /* 上下の余白は fix3・fix4 で詰めた(1440px で 36px → 10px) */
  padding: 10px var(--tips-profile-pad-x);
  border-radius: var(--tips-radius);
  background: var(--tips-tint);
}

/* 見出し(記事の概要 ARTICLE PROFILE。fix7 で日本語を先に)は表の上の1行。下の余白は最小限(fix4) */
.tips-profile > .tips-label {
  margin-bottom: 4px;
  line-height: 1.3;
}

.tips-profile__box {
  overflow: hidden;
  border: 1px solid var(--tips-line);
  border-radius: var(--tips-radius);
  background: var(--color-bg);
}

.tips-profile__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.85;
}

.tips-profile__table th,
.tips-profile__table td {
  padding: 4px 20px;
  text-align: left;
  vertical-align: top;
}

.tips-profile__table th {
  width: 14em;
  background: var(--tips-tint);
  color: var(--tips-navy);
  font-weight: 500;
}

.tips-profile__table tr + tr > * {
  border-top: 1px solid var(--tips-line);
}

/* この記事で分かること(fix7):箇条書きにせず、1行の文(印なし)。PC では入りきらない分を「…」で省略する(下の「広い枠」)。それ以外の幅では折り返して全文を出す */
.tips-profile__oneline {
  display: block;
}

/* 狭い枠(スマホ):項目名を小さめの文字で、値の上に置く(fix4) */
@container tips (max-width: 599px) {
  .tips-profile__table th,
  .tips-profile__table td {
    display: block;
    width: auto;
    padding-inline: 14px;
  }

  .tips-profile__table th {
    padding-top: 7px;
    padding-bottom: 0;
    font-size: 13px;
    line-height: 1.5;
  }

  .tips-profile__table td {
    padding-top: 1px;
    padding-bottom: 8px;
  }

  .tips-profile__table tr + tr > td {
    border-top: 0;
  }
}

/* 広い枠(PC)とスマホ:記事番号と更新日の両方があるとき、2つの組(項目名と値)を1行に並べる(fix3 で PC、fix4 でスマホも)。ほかの行は1行に1つ。
   1030px 未満のタブレットの幅(項目名が左の列の表)では、これまでどおり縦に並べる */
@container tips (max-width: 599px) or (min-width: 1030px) {
  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) {
    display: block;
  }

  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) > tbody {
    display: flex;
    flex-wrap: wrap;
  }

  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) .tips-profile__row {
    width: 100%;
  }

  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) .tips-profile__row--no,
  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) .tips-profile__row--modified {
    width: 50%;
  }

  .tips-profile__row--no + .tips-profile__row--modified > * {
    border-top: 0;
  }
}

@container tips (min-width: 1030px) {
  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) .tips-profile__row {
    display: grid;
    grid-template-columns: 14em minmax(0, 1fr);
  }

  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) th {
    width: auto;
  }

  /* この記事で分かること:1行(fix7)。入りきらない分(全角45字を超える値)は「…」で省略する。
     表のままのとき(記事番号か更新日が無いとき)も値の欄の幅を超えないよう、列の幅を固定の計算にする(項目名の列は 14em のまま) */
  .tips-profile__table {
    table-layout: fixed;
  }

  .tips-profile__oneline {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* スマホ:横に並べた更新日の左に、縦の罫線(値どうしの区切り) */
@container tips (max-width: 599px) {
  .tips-profile__table:has(.tips-profile__row--no + .tips-profile__row--modified) .tips-profile__row {
    display: block;
  }

  .tips-profile__row--no + .tips-profile__row--modified {
    border-left: 1px solid var(--tips-line);
  }
}

/* ===== ③ 目次と本文 ===== */
.tips-layout {
  margin-top: clamp(36px, 5cqi, 56px);
}

.tips-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tips-toc__item + .tips-toc__item {
  border-top: 1px solid var(--tips-line);
}

.tips-toc__link {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr);
  column-gap: 6px;
  padding: 10px 8px 10px 12px;
  border-left: 2px solid transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.65;
  text-decoration: none;
}

.tips-toc__link:hover {
  color: var(--tips-navy);
  text-decoration: underline;
  text-decoration-color: var(--tips-gold);
  text-underline-offset: 4px;
}

.tips-toc__no {
  padding-top: 1px;
  color: var(--color-gold-text);
  font-family: var(--tips-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* 今読んでいる章(assets/js/single-tips-toc.js が aria-current を付ける) */
.tips-toc__link[aria-current] {
  border-left-color: var(--tips-gold);
  background: var(--tips-tint);
  color: var(--tips-navy);
  font-weight: 500;
}

/* PC の左の目次は、狭い枠では出さない */
.tips-toc--side {
  display: none;
}

/* スマホ・タブレット:本文の上の、開け閉めできる目次(最初は閉じている) */
.tips-toc--drawer {
  margin-bottom: 36px;
  border: 1px solid var(--tips-line);
  border-radius: var(--tips-radius);
  background: var(--color-bg);
}

.tips-toc__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 14px 48px 14px 18px;
  position: relative;
  color: var(--tips-navy);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  list-style: none;
  cursor: pointer;
}

.tips-toc__summary::-webkit-details-marker {
  display: none;
}

/* 開け閉めの印(+ / −) */
.tips-toc__summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--tips-gold);
  font-family: var(--tips-mono);
  font-size: 20px;
  line-height: 1;
  transform: translateY(-50%);
}

.tips-toc--drawer[open] > .tips-toc__summary::after {
  content: "−";
}

.tips-toc--drawer[open] > .tips-toc__summary {
  border-bottom: 1px solid var(--tips-line);
}

.tips-toc--drawer > nav {
  padding: 6px 12px 12px;
}

/* 本文 */
.tips-body {
  min-width: 0;
  font-size: 16px;
  line-height: 1.95;
}

/* 本文の枠(fix5):目次の項目の間の線と同じ色(--tips-line)、1px、角丸、白の地。
   スマホ(画面の幅 640px 未満)では付けない(文字の入る幅を確保するため)。この境目だけ、依頼の定義どおり画面の幅で判定する */
@media (min-width: 640px) {
  .tips-body {
    padding: var(--tips-body-pad);
    border: var(--tips-body-border) solid var(--tips-line);
    border-radius: var(--tips-radius);
    background: var(--color-bg);
  }
}

.tips-body > *,
.tips-chapter > * {
  margin-block: 0;
}

/* アイキャッチ画像(fix7。本文の欄の一番上、最初の章の見出しの上。inc/tips-content.php の sbcc_tips_eyecatch_html())。
   本文の欄の幅いっぱい、横1200 × 縦630(OGP と同じ比率)。はみ出す部分は中央を基準に切り取る。角丸 8px */
.tips-eyecatch {
  margin-inline: 0;
}

.tips-eyecatch__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  object-position: center;
  border-radius: var(--tips-radius);
}

/* 画像が無いときの目印(編集できる人がログインしているときだけ出る)。見た目は本文の中の画像の目印(追加CSSの .sbcc-img-ph)と同じ。
   大きさは画像と同じ比率。中の文字は上下の中央。狭い枠では、比率を保つため内側の余白を詰める */
.tips-eyecatch__box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1200 / 630;
  padding: 2em 1.5em;
  border: 2px dashed #9a9a9a;
  border-radius: 8px;
  background: #f2f2f2;
  color: #555;
  text-align: center;
  overflow-wrap: anywhere;
}

.tips-eyecatch__box > p {
  margin: 0 0 0.5em;
}

.tips-eyecatch__label {
  color: #16233f;
  font-weight: bold;
}

.tips-body .tips-eyecatch__box > .tips-eyecatch__meta {
  margin: 0;
  font-size: 0.85em;
}

@container tips (max-width: 599px) {
  .tips-eyecatch__box {
    padding: 0.75em 1em;
    line-height: 1.6;
  }
}

.tips-body > * + *,
.tips-chapter > * + * {
  margin-top: 1.4em;
}

/* 章と章の間:広めの余白と細い区切り線 */
.tips-body > * + .tips-chapter {
  margin-top: clamp(48px, 6cqi, 64px);
}

/* アイキャッチ画像と最初の章の間(fix7):章と章の間より狭く */
.tips-body > .tips-eyecatch + * {
  margin-top: clamp(28px, 4cqi, 40px);
}

.tips-body > .tips-chapter + .tips-chapter {
  padding-top: clamp(48px, 6cqi, 64px);
  border-top: 1px solid var(--tips-line);
}

/* H2:左に章番号(金・等幅)、右に見出し。下に紺の線 */
.tips-chapter__title {
  padding-bottom: 14px;
  border-bottom: 2px solid var(--tips-navy);
  color: var(--tips-navy);
  font-size: clamp(20px, 2.3cqi, 24px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
  scroll-margin-top: var(--tips-sticky-top);
}

.tips-chapter__title--numbered {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
}

.tips-chapter__no {
  min-width: 3ch;
  color: var(--tips-gold);
  font-family: var(--tips-mono);
  font-size: 0.86em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tips-chapter > .tips-chapter__title + * {
  margin-top: 1.6em;
}

/* H3:左に金の縦線、文字は紺 */
.tips-body h3 {
  margin-top: 2.2em;
  padding-left: 14px;
  border-left: 4px solid var(--tips-gold);
  color: var(--tips-navy);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  scroll-margin-top: var(--tips-sticky-top);
}

.tips-body h3 + * {
  margin-top: 1em;
}

/* 太字・リンク(リンクはテーマの記事の本文と同じ見た目) */
.tips-body strong {
  color: var(--tips-navy);
  font-weight: 700;
}

.tips-body a {
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* リスト:印を金に */
.tips-body ul,
.tips-body ol {
  padding-left: 1.5em;
}

.tips-body li + li {
  margin-top: 0.4em;
}

.tips-body li::marker {
  color: var(--tips-gold);
}

.tips-body ol > li::marker {
  font-family: var(--tips-mono);
}

/* 引用(⚠ の注意書き):左に金の線、薄い地、角丸 */
.tips-body blockquote {
  margin-inline: 0;
  padding: 16px 20px;
  border-left: 4px solid var(--tips-gold);
  border-radius: var(--tips-radius);
  background: var(--tips-tint);
}

.tips-body blockquote > * {
  margin-block: 0;
}

.tips-body blockquote > * + * {
  margin-top: 0.8em;
}

/* 表:角丸の枠、見出し行は濃いめの地、行ごとに罫線、偶数行は薄い地。狭いときは横にスクロール */
.tips-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--tips-line);
  border-radius: var(--tips-radius);
  background: var(--color-bg);
}

.tips-table-scroll:focus-visible {
  outline: 2px solid var(--tips-navy);
  outline-offset: 2px;
}

.tips-table-scroll table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.75;
}

.tips-table-scroll th,
.tips-table-scroll td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.tips-table-scroll thead th {
  background: var(--tips-tint-2);
  color: var(--tips-navy);
  font-weight: 500;
}

.tips-table-scroll tbody tr {
  border-top: 1px solid var(--tips-line);
}

.tips-table-scroll tbody tr:nth-child(even) {
  background: var(--tips-tint);
}

/* ===== ④ 記事の最後 ===== */
.tips-end {
  margin-top: clamp(48px, 7cqi, 80px);
  padding-top: 20px;
  border-top: 1px solid var(--tips-line);
}

.tips-end > * {
  margin-block: 0;
}

.tips-end__to-top {
  text-align: right;
}

.tips-end__top {
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-underline-offset: 6px;
}

/* 前の記事/次の記事(お知らせの記事と同じ部品。posts.css の .entry__nav の形を使い、色だけ紺と金に) */
.tips-end .entry__nav {
  margin-top: 32px;
  border-top-color: var(--tips-line);
}

.tips-end .entry__nav a {
  color: var(--tips-navy);
}

.tips-end .entry__nav-label {
  color: var(--color-text-muted);
}

.tips-end .entry__nav-title {
  text-decoration-color: var(--tips-gold);
}

/* 読み上げ用の見出し(前後の記事の「screen-reader-text」。posts.css の指定は一覧の枠 .posts__inner の中だけなので、ここでも隠す) */
.tips-end .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ITのお役立ち情報の一覧へ戻る(サイト共通のボタン .button。配色は style.css のまま:紺の地に白い文字、ホバーで白地に紺の文字と紺の枠) */
.tips-end .tips-end__back {
  margin-top: 40px;
  text-align: center;
}

/* ===== 狭い枠(1100px 未満):ヒーローのマークを、さらに小さく、薄くする(fix4:116px)。帯の右上、タイトルの右の余白に置く ===== */
@container tips (max-width: 1099px) {
  .tips-hero__mark {
    top: 6px;
    right: -24px;
    width: 116px;
    opacity: 0.3;
  }
}

/* ===== 狭い枠(スマホ):帯に空きがなく、マークが文字に重なるので出さない(fix4)。リード文は 13px ===== */
@container tips (max-width: 599px) {
  .tips-hero__mark {
    display: none;
  }

  .tips-hero__lead {
    font-size: 13px;
  }
}

/* ===== 広い枠(PC):目次を本文の左に置き、画面の上に固定する ===== */
@container tips (min-width: 1030px) {
  /* 本文を左、目次を右に置く(fix5)。HTML の順番(目次 → 本文)は変えず、並べる位置だけを指定する */
  .tips-layout {
    display: grid;
    grid-template-columns: var(--tips-body-width) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--tips-column-gap);
  }

  .tips-layout > .tips-body {
    grid-column: 1;
    grid-row: 1;
  }

  .tips-layout > .tips-toc--side {
    grid-column: 2;
    grid-row: 1;
  }

  .tips-layout--no-toc {
    display: block;
  }

  /* 区画の間の縦の余白(fix10):PC だけ、ヒーロー〜記事の概要と、記事の概要〜本文・目次を、それぞれ以前の 50% にする(1440px で 40 → 20px、56 → 28px)。
     元の値(下の「② 記事の概要」「③ 目次と本文」の margin-top)は、1030px 未満とスマホで今までどおり使う */
  .tips-profile {
    margin-top: calc(clamp(28px, 4cqi, 40px) * 0.5);
  }

  .tips-layout {
    margin-top: calc(clamp(36px, 5cqi, 56px) * 0.5);
  }

  /* リード文は1行(fix6)。45字を超える抜粋が入ったときは、入りきらない分を「…」で省略する(1030px 未満は省略せず折り返す) */
  .tips-hero__lead {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* 右の目次:枠ごと画面の上に固定する。画面より長いときは、枠の中だけをスクロールする(fix5 で枠を付けた) */
  .tips-toc--side {
    display: block;
    position: sticky;
    top: var(--tips-sticky-top);
    max-height: calc(100vh - (var(--tips-sticky-top) * 2));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px;
    border: 1px solid var(--tips-line);
    border-radius: var(--tips-radius);
    background: var(--color-bg);
  }

  .tips-toc--drawer {
    display: none;
  }

  .tips-body {
    font-size: var(--tips-body-font-pc);
  }

  /* fix8・fix9:本文の欄の左端(枠線)は動かさず、枠を右へ「ずらす量」(--tips-body-shift。1440px で 20px)だけ広げる。
     枠の内側の左の余白を「ずらす量」だけ広げ、中身(章番号・見出し・段落・表・画像の目印・アイキャッチなど)の左端を、記事の概要の白い表の枠線の左端 + 1文字分に置く。
     右の余白はそのまま(文字の入る幅は変わらない)。目次の欄は、右端(記事の概要の区画の右端)と間の余白を変えずに、その分だけ狭まる(列の幅は 1fr)。
     記事の概要と同じ計算式なので、PC のどの幅でもそろう */
  .tips-layout {
    grid-template-columns: calc(var(--tips-body-width) + var(--tips-body-shift)) minmax(0, 1fr);
  }

  .tips-body {
    padding-left: calc(var(--tips-body-pad) + var(--tips-body-shift));
  }

  .tips-layout--no-toc > .tips-body {
    padding-left: var(--tips-body-pad);
  }

  .tips-body h3 {
    font-size: 19px;
  }
}

/* ===== 記事の画像(2026-11-22 追加):<figure class="tips-figure"><a href="原寸"><img></a></figure> =====
   画像は img.sbcc.jp の 1600×900。本文の幅いっぱいに、角丸 8px・細い枠で表示する。クリックで原寸を新しいタブで開く。
   .tips-body を頭に付けているのは、既存の .tips-chapter > * + *(上の余白)と .tips-body a(下線)より後で確実に効かせるため */
.tips-body .tips-figure {
  box-sizing: border-box;
  margin: 1.5em 0;
}

.tips-body .tips-figure *,
.tips-body .tips-figure *::before,
.tips-body .tips-figure *::after {
  box-sizing: border-box;
}

.tips-body .tips-figure a {
  display: block;
  border: 0;
  color: inherit;
  text-decoration: none;
}

.tips-body .tips-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--tips-line);
  border-radius: 8px;
  box-shadow: none;
}

/* 2枚続く画像(03a→03b、05a→05b)は近づける */
.tips-body .tips-figure + .tips-figure {
  margin-top: 0.75em;
}

/* ホバーは枠線の色だけ変える(動き・影なし) */
.tips-body .tips-figure a:hover img {
  border-color: var(--tips-gold-soft);
}
