/* =========================================================
   介護食ノート ― 共通スタイル
   feedingnotes（../子供向け栄養/assets/style.css）を 2026-11-11 に写して、次を変えた。
   - 色：テラコッタをやめて藍色にした（別のサイトだと見て分かるように）
   - 文字：本文をスマホで18px、パソコンで19px にした（feedingnotes は17px と18px）。読者に50〜60代が多いとみたため
   - 赤ちゃんの記事だけで使う部品（早見表、月齢の表、トップのタブ、記録ツール、本の案内）は写していない
   ========================================================= */

:root {
  --bg:        #FBFAF7;
  --surface:   #FFFFFF;
  --surface2:  #F3F1EC;
  --text:      #2C2F33;
  --text2:     #545A61;
  --text3:     #757B82;
  --line:      #E3E0D9;
  --line2:     #CFCAC0;

  --accent:      #2F5F7F;   /* 藍色。見出し・リンク・強調 */
  --accent-deep: #22465F;
  --accent-soft: #E9F0F5;

  --green:      #587A52;    /* 「こうすると安心」の囲み */
  --green-soft: #EDF2EA;
  --amber:      #9A6824;    /* 注意 */
  --amber-soft: #FAF1DF;
  --warn:       #B3231B;    /* 窒息や受診など、安全に関わることだけ。ふつうの注意には使わない */

  --radius: 14px;
  --shadow-card: 0 1px 2px rgba(40,45,50,.05), 0 4px 14px rgba(40,45,50,.05);
  --measure: 34em;          /* 本文1行の最大幅 */

  --font: "Hiragino Sans", "ヒラギノ角ゴシック", "BIZ UDPGothic",
          "Noto Sans JP", "Yu Gothic Medium", "游ゴシック Medium",
          system-ui, -apple-system, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #16181A;
    --surface:   #1E2124;
    --surface2:  #23272B;
    --text:      #E7E9EB;
    --text2:     #B0B6BC;
    --text3:     #8A9198;
    --line:      #2E3337;
    --line2:     #40464C;
    --accent:      #8DB7D4;
    --accent-deep: #A9CAE2;
    --accent-soft: #1D2830;
    --green:      #8FB187;
    --green-soft: #1F2620;
    --amber:      #D3A560;
    --amber-soft: #2A2317;
    --warn:       #F08A80;
    --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.22);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg:        #16181A;
  --surface:   #1E2124;
  --surface2:  #23272B;
  --text:      #E7E9EB;
  --text2:     #B0B6BC;
  --text3:     #8A9198;
  --line:      #2E3337;
  --line2:     #40464C;
  --accent:      #8DB7D4;
  --accent-deep: #A9CAE2;
  --accent-soft: #1D2830;
  --green:      #8FB187;
  --green-soft: #1F2620;
  --amber:      #D3A560;
  --amber-soft: #2A2317;
  --warn:       #F08A80;
  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.22);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.9;
  letter-spacing: .02em;
  font-feature-settings: "palt" 1;
}
@media (min-width: 768px) { body { font-size: 19px; } }

img { max-width: 100%; height: auto; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: .25em; }
a:hover { color: var(--accent); }
a.go { font-weight: 700; } /* ほかの記事への案内（→とろみのつけ方）。段落の最後に置く */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- レイアウト ---------- */
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--measure); }
main.wrap { padding-top: 30px; } /* h1 がヘッダーの線に貼りつかないように（feedingnotes には無い）。.wrap の padding より強くするため main.wrap にした */

/* ---------- ヘッダー ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.logo {
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.logo svg { display: block; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.3; }
.logo-sub { font-size: 11.5px; font-weight: 400; letter-spacing: .02em; color: var(--text3); } /* サイト名の下のひとこと。医師が書いていることを全ページで伝える */
.site-header nav { display: flex; gap: 18px; font-size: 15px; }
.site-header nav a { color: var(--text2); text-decoration: none; padding: 12px 0; } /* 上下の余白は、指で押せる高さを確保するため */
.site-header nav a:hover { color: var(--accent); }

/* ---------- 見出し ---------- */
h1 {
  font-size: 27px; line-height: 1.55; letter-spacing: .01em;
  margin: 0 0 18px; font-weight: 700;
}
@media (min-width: 768px) { h1 { font-size: 32px; } }
.nobr { white-space: nowrap; }

h2 {
  font-size: 22px; line-height: 1.6; margin: 52px 0 16px;
  font-weight: 700; color: var(--text);
  padding-left: 14px; border-left: 4px solid var(--accent);
}
@media (min-width: 768px) { h2 { font-size: 24px; } }

h3 { font-size: 19px; margin: 34px 0 10px; font-weight: 700; }

p { margin: 0 0 1.5em; }

/* ---------- リード文 ---------- */
.lead {
  font-size: 18px; color: var(--text2); line-height: 1.85;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 36px;
}
.lead p:last-child { margin-bottom: 0; }

/* ---------- 囲み ---------- */
.box { border-radius: var(--radius); padding: 18px 20px; margin: 28px 0; font-size: 17px; line-height: 1.85; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box .box-title { font-weight: 700; margin: 0 0 8px; font-size: 17px; }

.box-safe   { background: var(--green-soft); border: 1px solid var(--green); }
.box-safe   .box-title { color: var(--green); }
.box-note   { background: var(--amber-soft); border: 1px solid var(--amber); }
.box-note   .box-title { color: var(--amber); }
.box-plain  { background: var(--surface2); border: 1px solid var(--line); }

/* ---------- 表 ---------- */
.table-scroll { overflow-x: auto; margin: 26px 0; -webkit-overflow-scrolling: touch; }
table {
  border-collapse: collapse; width: 100%; min-width: 320px;
  font-size: 16px; line-height: 1.7;
  font-variant-numeric: tabular-nums;
}
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface2); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
caption { caption-side: bottom; font-size: 14px; color: var(--text3); text-align: left; padding-top: 10px; }

/* ---------- 記事カード ---------- */
.cards { display: grid; gap: 14px; margin: 0 0 40px; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 18px;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40,45,50,.07), 0 10px 24px rgba(40,45,50,.09); }
.card h3 { margin: 8px 0 8px; font-size: 19px; line-height: 1.55; }
.card p { margin: 0; font-size: 15.5px; color: var(--text2); line-height: 1.8; }

.card-lead { border-color: var(--line2); background: var(--accent-soft); }
.card-wide { grid-column: 1 / -1; }

/* ---------- 出典 ---------- */
.sources { margin: 48px 0 0; font-size: 15px; color: var(--text2); line-height: 1.85; }
.sources h2 { font-size: 17px; border: 0; padding: 0; margin: 0 0 10px; color: var(--text3); letter-spacing: .06em; }
.sources ol { margin: 0; padding-left: 1.3em; }
.sources li { margin-bottom: 6px; }

/* ---------- 更新履歴（医学的に意味のある変更だけを載せる） ---------- */
.changelog { margin: 32px 0 0; font-size: 15px; color: var(--text2); line-height: 1.85; }
.changelog h2 { font-size: 17px; border: 0; padding: 0; margin: 0 0 10px; color: var(--text3); letter-spacing: .06em; }
main .changelog ul { list-style: none; margin: 0; padding: 0; }
main .changelog li { margin-bottom: 10px; }
.changelog-date { display: block; font-size: 14px; color: var(--text3); }

/* ---------- 免責 ---------- */
.disclaimer {
  margin: 40px 0 0; padding: 18px 20px;
  background: var(--surface2); border-radius: var(--radius);
  font-size: 15px; color: var(--text2); line-height: 1.85;
}
.disclaimer p:last-child { margin-bottom: 0; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 64px; border-top: 1px solid var(--line);
  padding: 28px 0 44px; font-size: 15px; color: var(--text3);
}
.site-footer a { color: var(--text2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }

/* ---------- 更新日 ---------- */
.meta { font-size: 14.5px; color: var(--text3); margin: 0 0 28px; }

/* 見出しの下の「この記事を書いた人」。検索から記事に来た人にも、医師が書いていることが最初の画面で分かるように */
.author-card {
  background: var(--accent-soft); border-radius: 10px;
  padding: 12px 16px; margin: -14px 0 24px;
  font-size: 15.5px; line-height: 1.75; color: var(--text2);
}
.author-card p { margin: 0; }
.author-card-title { font-size: 14px; font-weight: 700; color: var(--accent-deep); }
.author-card a { white-space: nowrap; }

/* 広告表示（ステマ規制）。記事内にアフィリエイトリンクを置くページで、本文より先に出す */
.ad-note { font-size: 14px; color: var(--text3); margin: 0 0 24px; }

/* もしもアフィリエイトの広告リンクを、指で押せる高さ44px以上のボタンにする（feedingnotes と同じ） */
a[href*="af.moshimo.com/af/c/click"] {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin: 6px 6px 6px 2px; padding: 6px 16px;
  border: 1px solid var(--accent); border-radius: 10px;
  background: var(--surface); color: var(--accent-deep);
  font-size: 16px; font-weight: 700; line-height: 1.4; text-align: center;
  text-decoration: none; vertical-align: middle;
}
a[href*="af.moshimo.com/af/c/click"]:hover,
a[href*="af.moshimo.com/af/c/click"]:focus-visible { background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- 商品カード（feedingnotes の案C と同じ形） ----------
   商品名・「広告」の札・一言の説明・店のボタンで1つの箱にする。
   ボタンの色は楽天市場の赤（#BF0000、白い文字）と Amazon のオレンジ（#FF9900、黒い文字）。ダークモードでも色は変えない。
   表示回数を数える1×1の画像は、ボタンの並びの升目を取らないように左上に重ねる */
.pcard {
  margin: 28px 0; padding: 16px;
  background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.pcard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pcard-name { margin: 0; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.55; color: var(--text); word-break: auto-phrase; overflow-wrap: anywhere; }
.pcard-tag {
  flex: none; padding: 0 8px; border: 1px solid var(--line2); border-radius: 999px;
  font-size: 12.5px; line-height: 1.7; color: var(--text2); white-space: nowrap;
}
.pcard-note { margin: 6px 0 14px; font-size: 16px; line-height: 1.75; color: var(--text2); }
.pcard-btns { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
.pcard-btns a:only-of-type { grid-column: 1 / -1; }
.pcard-btns img { position: absolute; left: 0; top: 0; width: 1px; height: 1px; pointer-events: none; }
.pcard-btns a.pcard-r,
.pcard-btns a.pcard-a {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; margin: 0; padding: 0 8px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 16px; font-weight: 700; line-height: 1.3; white-space: nowrap;
  text-decoration: none;
}
.pcard-btns a.pcard-r { background: #BF0000; color: #FFFFFF; }
.pcard-btns a.pcard-r:hover,
.pcard-btns a.pcard-r:focus-visible { background: #9E0000; color: #FFFFFF; }
.pcard-btns a.pcard-a { background: #FF9900; color: #111111; }
.pcard-btns a.pcard-a:hover,
.pcard-btns a.pcard-a:focus-visible { background: #F08804; color: #111111; }
/* 公式サイトのボタン（A8.net の商品リンク）。A8.net の生成したコードは変えられないので、飛び先の px.a8.net で選ぶ */
.pcard-btns a[href*="px.a8.net"] {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; margin: 0; padding: 0 8px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 16px; font-weight: 700; line-height: 1.3; white-space: nowrap;
  text-decoration: none;
  background: var(--text); color: var(--bg);
}
.pcard-btns a[href*="px.a8.net"]:hover,
.pcard-btns a[href*="px.a8.net"]:focus-visible { background: var(--text2); color: var(--bg); }

/* ---------- リスト ---------- */
main ul, main ol { margin: 0 0 1.6em; padding-left: 1.4em; }
main li { margin-bottom: .5em; }
main li::marker { color: var(--accent); }
.box ul, .box ol { padding-left: 1.2em; }

/* ---------- 体操の手順（絵つき） ----------
   <ol class="steps"> の li に、絵（img）と文（p）を入れる。絵の無い手順は p だけでよい */
main ol.steps {
  list-style: none; padding: 0; margin: 20px 0 28px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
  counter-reset: step;
}
main ol.steps li {
  margin: 0; padding: 10px 10px 12px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius);
  counter-increment: step;
}
main ol.steps img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #fff; }
main ol.steps p { margin: 8px 0 0; font-size: 16px; line-height: 1.6; }
main ol.steps p::before { content: counter(step) ". "; font-weight: 700; color: var(--accent); }
main ol.steps li.wide { grid-column: 1 / -1; }
@media (min-width: 768px) { main ol.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
figure.photo { margin: 20px 0 24px; }
figure.photo img { display: block; width: 100%; max-width: 420px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }

/* ---------- 狭い画面の表 ---------- */
@media (max-width: 480px) {
  table { font-size: 15px; min-width: 300px; }
  th, td { padding: 9px 8px; }
}

/* ---------- 目次（長いページだけに置く） ----------
   項目の文は、飛び先の見出しと同じ文にする。見出しを変えたら目次も変える */
.toc {
  margin: 0 0 32px; padding: 14px 20px 8px;
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 16px; line-height: 1.6;
}
.toc .toc-title { font-weight: 700; font-size: 15px; color: var(--text3); margin: 0 0 4px; letter-spacing: .06em; }
main .toc ol { list-style: none; margin: 0; padding: 0; }
main .toc li { margin: 0; border-top: 1px solid var(--line); }
main .toc li:first-child { border-top: 0; }
.toc a { display: block; padding: 9px 0; text-decoration: none; color: var(--accent-deep); }

/* 目次やヘッダーの「記事一覧」から飛んだとき、見出しが上に固定したヘッダーの裏に隠れないようにする */
h2[id], h3[id], .pcard[id] { scroll-margin-top: 74px; }

/* ---------- 埋め込みフォーム ----------
   高さは、フォームを作ってから実測して決める（feedingnotes では幅334pxで1628px、幅578pxで1361px だった）。
   足りないと iframe の中でスクロールが出て、スマホで二重スクロールになる */
.form-embed {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.form-embed iframe { display: block; width: 100%; border: 0; height: 1680px; }
@media (min-width: 560px) { .form-embed iframe { height: 1420px; } }

/* ---------- 印刷 ---------- */
@media print {
  .site-header, .site-footer nav, .card { box-shadow: none; }
  body { font-size: 11pt; background: #fff; color: #000; }
}
