/* 読みもの（/guides/）。色・文字は style.css のトークンを使う（2026-10-10、Substack・Wix・Linear の記事ページを参考に見直し）
   スマホで読みやすく：本文 16〜16.5px・行間 2、見出しは文節で改行（site/tools/wbr.py）、イラストはスマホで画面の端まで */

/* ---------- 読み進み具合のバー（guides.js） ---------- */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- 記事の頭 ---------- */
.post { max-width: 680px; }
.post .post-kicker { display: flex; align-items: center; gap: 8px; margin: 20px 0 14px; font-size: 13.5px; font-weight: 700; letter-spacing: .04em; }
.post-kicker a { color: var(--link); text-decoration: none; }
.post-kicker a:hover { text-decoration: underline; }
.post-kicker span[aria-hidden] { color: var(--dim); font-weight: 400; }
.post-kicker span:last-child { color: var(--sub); }

.post-head h1 { font-size: 30px; line-height: 1.45; margin: 0 0 18px; letter-spacing: .01em; }
.post .post-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; }
.post-meta img { width: 30px; height: auto; flex: none; }
.pm-txt { display: flex; flex-direction: column; line-height: 1.5; }
.pm-by { font-size: 14px; font-weight: 700; color: var(--ink); }
.pm-sub { font-size: 12.5px; color: var(--sub); }
.pm-sub span[aria-hidden] { color: var(--dim); }
.pm-up { color: var(--ink); font-weight: 700; }

/* イラスト：スマホでは画面の端まで */
.post .post-hero { margin: 0 0 28px; }
.post .post-hero img { display: block; width: 100%; max-width: none; height: auto; border: 0; border-radius: 20px; }

.post .post-lead { font-size: 17px; line-height: 2; margin: 0 0 24px; }
.post .post-lead:has(+ .post-lead) { margin-bottom: 14px; }

/* この記事のポイント */
.post-points { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px 8px; margin: 8px 0 32px; }
.post .pp-t { font-size: 14px; margin: 0 0 10px; color: var(--sub); letter-spacing: .04em; }
.post .post-points ul { list-style: none; padding: 0; margin: 0; counter-reset: pp; }
.post .post-points li { position: relative; padding: 0 0 16px 34px; margin: 0; font-size: 15.5px; line-height: 1.75; font-weight: 700; counter-increment: pp; }
.post-points li::before { content: counter(pp); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; line-height: 22px; text-align: center; font-weight: 700; }

/* 目次 */
.post-toc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0 16px; margin: 40px 0 12px; }
.post .post-toc p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; font-weight: 700; color: var(--sub); letter-spacing: .04em; }
.post .post-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.post .post-toc li { counter-increment: toc; margin: 0; }
.post-toc a { display: block; position: relative; padding: 8px 0 8px 2.3em; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.6; }
.post-toc a::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 8px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.post-toc a:hover { color: var(--link); }

/* ---------- 本文 ---------- */
.post { counter-reset: sec; }
.post > h2 { font-size: 22px; line-height: 1.55; margin: 60px 0 14px; scroll-margin-top: 20px; }
.post > h2[id]:not(#related):not(#refs) { counter-increment: sec; }
.post > h2[id]:not(#related):not(#refs)::before { content: counter(sec, decimal-leading-zero); display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: .08em; color: var(--accent); font-variant-numeric: tabular-nums; }
.post h3 { font-size: 17.5px; line-height: 1.6; margin: 34px 0 8px; }
.post p { margin: 0 0 1.25em; font-size: 16.5px; line-height: 2; }
.post ul, .post ol { margin: 0 0 1.4em; padding-left: 1.3em; font-size: 16.5px; line-height: 1.9; }
.post li { margin: 0 0 .5em; }
.post li::marker { color: var(--accent); }
.post strong { font-weight: 700; }

/* 外部リンク（別タブ）には小さな矢印 */
a.ext::after { content: "↗"; display: inline-block; margin-left: 2px; font-size: .8em; text-decoration: none; }

/* 表（スマホでも収める。6列の表だけ横スクロール） */
.table-scroll { overflow-x: auto; margin: 12px 0 28px; -webkit-overflow-scrolling: touch; border-radius: 14px; border: 1px solid var(--line); }
.post table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.65; background: var(--card); }
.post table.wide { min-width: 560px; }
.post th, .post td { text-align: left; vertical-align: top; padding: 13px 14px; border-bottom: 1px solid var(--line); line-height: 1.7; }
/* 時刻・名前など短いセルは折り返さない（「7:0｜0」のように切れないように）。class は表を作るときに付ける（5文字以下・見出し行は付けない） */
.post th.fit, .post td.fit { white-space: nowrap; }
.post thead th { background: var(--sunk); font-size: 12.5px; color: var(--sub); font-weight: 700; letter-spacing: .04em; }
.post tbody tr:last-child td, .post tbody tr:last-child th { border-bottom: 0; }
.post tbody th { font-weight: 700; }
.post .table-note { font-size: 13px; line-height: 1.7; color: var(--sub); margin: -12px 0 24px; }

/* 書き写せるテンプレート：上に色のついた見出しの帯、チェックリストは四角のチェック欄 */
.template { border: 1px solid var(--line-strong); border-radius: 18px; margin: 32px 0 36px; background: var(--card); overflow: hidden; }
.post .template-t { position: relative; margin: 0; padding: 14px 22px 14px 52px; background: var(--tint); border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; font-weight: 700; color: var(--link); letter-spacing: .02em; }
.post .template-t::before { content: ""; position: absolute; left: 22px; top: 50%; margin-top: -9px; width: 18px; height: 18px; border-radius: 5px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.post .template ul, .post .template ol { margin: 0; padding: 18px 22px 8px; font-size: 15.5px; line-height: 1.85; }
.post .template li { margin: 0 0 14px; }
.post .template ol { padding-left: 2.6em; }
/* チェックリストは四角の欄（紙に書き写したときにチェックを入れる形） */
.post .template ul { list-style: none; }
.post .template ul li { position: relative; padding-left: 32px; }
.post .template ul li::before { content: ""; position: absolute; left: 0; top: .32em; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--paper); }
/* 注意書き（医療など） */
.note { position: relative; background: var(--sunk); border-radius: 16px; padding: 18px 20px 18px 54px; margin: 4px 0 36px; }
.note::before { content: "!"; position: absolute; left: 20px; top: 21px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.post .note p { margin: 0 0 .7em; font-size: 14.5px; line-height: 1.85; }
.post .note p:last-child { margin-bottom: 0; }

/* アプリの画面（見本データ）：2倍・3倍の解像度で、カードの中に置く */
.post figure.shot { margin: 28px 0 36px; padding: 18px; background: var(--sunk); border-radius: 22px; }
.post figure.shot img { max-width: 360px; margin: 0 auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: none; }
.post figure.shot figcaption { max-width: 360px; margin: 12px auto 0; }
/* 記事の途中のイラスト */
.post figure.illust { margin: 28px 0 36px; }
.post figure.illust img { max-width: none; border: 0; border-radius: 20px; }
@media (max-width: 560px) {
  .post figure.shot { margin-left: -8px; margin-right: -8px; padding: 14px; }
  .post figure.illust { margin-left: -24px; margin-right: -24px; }
  .post figure.illust img { border-radius: 0; }
}

/* 画面の見本 */
.post figure { margin: 10px 0 28px; }
.post figure img { display: block; width: 100%; max-width: 320px; height: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.post figcaption { font-size: 13px; color: var(--sub); margin-top: 10px; line-height: 1.7; }

/* 参考 */
.post .refs { padding-left: 0; list-style: none; font-size: 13.5px; line-height: 1.75; color: var(--sub); }
.post .refs li { margin-bottom: 10px; overflow-wrap: anywhere; }

/* 関連する記事 */
.post .related-cards { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.post .related-cards li { margin: 0; }
.related-cards a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.related-cards img { width: 100%; height: auto; }
.related-cards .thumb { margin-bottom: 4px; }
.rc-k { font-size: 12px; font-weight: 700; color: var(--link); letter-spacing: .04em; }
.rc-t { font-size: 15.5px; font-weight: 700; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.rc-d { font-size: 13px; color: var(--sub); line-height: 1.6; }
.related-cards a:hover .rc-t { color: var(--link); }
.post .related-faq { margin: 8px 0 0; font-size: 14.5px; }
.post .related-faq .arrow-link, .post-app .arrow-link { white-space: normal; }
/* 念のため：記事のページは横にスクロールさせない（はみ出しても見えるのは画面の中だけ） */
html:has(.post) , body:has(.post) { overflow-x: clip; }

/* アプリの紹介（記事の最後だけ・控えめに） */
.post-app { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-top: 52px; }
.post-app img { width: 40px; height: auto; flex: none; }
.post .post-app p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.8; }
.post-app .arrow-link { font-size: 14.5px; }

/* 本文は書籍と同じ組み方：文字単位で折り返し（行の長さがそろう）、段落だけ両端そろえ、禁則は strict。
   text-wrap: pretty は使わない（Safari は段落全体の行を短く組み直し、両端そろえと合わさると文字の間が大きく空く。2026-10-10）。
   文節で折り返すと右端がガタガタになって長い文章が読みにくい。見出し・目次・表だけ文節で折り返す */
.post p, .post li, .post figcaption { word-break: normal; overflow-wrap: anywhere; line-break: strict; text-wrap: wrap; }
.post > p, .post .post-lead { text-align: justify; text-justify: inter-character; }
.post > p.table-note { text-align: left; }
.post li, .post figcaption { text-align: left; }
.post td, .post th { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; text-align: left; }
.post .post-points li, .post .note p, .post .post-app p, .post .rc-d, .post .related-faq { text-align: left; }
/* 見出し・目次・一覧・関連記事は両端そろえにしない（文節の区切りがあるので、そろえると文字の間が空く） */
.post h1, .post h2, .post h3, .post .post-toc li, .post .guide-list li, .post .guide-list p, .post .related-cards li, .post .lead { text-align: left; }

/* 記事のいちばん下：一覧に戻る */
.post-back { margin: 28px 0 8px; text-align: center; }
.post-back a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.post-back a::before { content: "‹"; font-size: 18px; line-height: 1; color: var(--sub); }
.post-back a:hover { border-color: var(--ink); }

/* 見出しは文節で折り返す。iPhone の Safari は auto-phrase が無いので、site/tools/wbr.py が入れた <wbr> のところだけで折り返す */
.post h1, .post h2, .post h3, .post-toc a, .guide-list h2 { word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- 一覧 ---------- */
.post .guide-list { list-style: none; padding: 0; margin: 8px 0 40px; }
.post .guide-list li { border-bottom: 1px solid var(--line); margin: 0; }
.guide-list a { display: flex; gap: 24px; align-items: center; padding: 26px 0; text-decoration: none; color: var(--ink); }
/* パソコンでは 3:2 に切り出して文字の高さとそろえる（犬が右寄りの絵が多いので少し右を残す） */
.guide-list img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: 62% 50%; }
.gl-t { min-width: 0; }
.gl-k { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--link); letter-spacing: .04em; }
.post .guide-list h2 { font-size: 18px; line-height: 1.55; margin: 0 0 6px; }
.post .guide-list p { margin: 0; color: var(--sub); font-size: 14.5px; line-height: 1.75; }
.guide-list a:hover h2 { color: var(--link); }

/* ---------- スマホ ---------- */
@media (max-width: 560px) {
  .post-head h1 { font-size: 25px; line-height: 1.5; }
  .post .post-hero { margin-left: -24px; margin-right: -24px; }
  .post .post-hero img { border-radius: 0; }
  .post > h2 { font-size: 20px; margin-top: 52px; }
  .post p, .post ul, .post ol { font-size: 16px; }
  .post .post-lead { font-size: 16.5px; }
  .post th, .post td { padding: 12px 10px; font-size: 14px; }
  .post .related-cards { grid-template-columns: 1fr; gap: 0; }
  .post .related-cards li + li { border-top: 1px solid var(--line); }
  .related-cards a { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 2px; padding: 14px 0; }

  .rc-d { display: none; }
  /* 文字の多い表（class="stack"）は、スマホでは1行ずつのカードにする */
  .post table.stack thead { display: none; }
  .post table.stack, .post table.stack tbody, .post table.stack tr, .post table.stack th, .post table.stack td { display: block; width: auto; }
  .post table.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .post table.stack tr:last-child { border-bottom: 0; }
  .post table.stack th, .post table.stack td { padding: 0; border: 0; }
  .post table.stack tbody th { font-size: 15px; margin-bottom: 6px; }
  .post table.stack td { margin-top: 6px; font-size: 14px; }
  .post table.stack td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--sub); letter-spacing: .04em; }
  .guide-list a { flex-direction: column; gap: 12px; }
  .guide-list img { aspect-ratio: auto; }
}

/* ---------- ホバーの動き（マウスのときだけ。動きを減らす設定では色だけ変える） ---------- */
.thumb { display: block; flex: none; overflow: hidden; border-radius: 14px; }
.guide-list .thumb { width: 240px; }
.thumb img { display: block; width: 100%; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.guide-list h2, .rc-t, .post-toc a, .post-back a, .related-faq a { transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.arrow-link::after { display: inline-block; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.post a:not(.ext):not([class]) , .post a.ext { text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-thickness .15s ease, color .15s ease; }
.post-back a::before { display: inline-block; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) {
  .guide-list a:hover .thumb img, .related-cards a:hover .thumb img { transform: scale(1.04); }
  .guide-list a:hover h2, .related-cards a:hover .rc-t { color: var(--link); }
  .arrow-link:hover::after { transform: translateX(3px); }
  .post-toc a:hover { color: var(--link); }
  .post-back a:hover { border-color: var(--ink); background: var(--paper); }
  .post-back a:hover::before { transform: translateX(-3px); }
  .post a.ext:hover, .post p a:hover, .post li a:hover { text-decoration-thickness: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .thumb img, .arrow-link::after, .post-back a::before { transition: none; }
  .guide-list a:hover .thumb img, .related-cards a:hover .thumb img { transform: none; }
}
@media (max-width: 560px) { .guide-list .thumb { width: 100%; } .related-cards .thumb { grid-row: 1 / 4; border-radius: 10px; } }

/* ---------- ごはんの量の計算（/guides/dog-food-calculator） ---------- */
.calc { background: var(--card); border: 1px solid var(--line-strong); border-radius: 20px; padding: 22px 22px 18px; margin: 4px 0 36px; }
.post .calc-t { font-size: 17px; margin: 0 0 14px; }
.post .calc-t::before { content: none; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; align-items: start; }
.calc-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.calc-row label { font-size: 13px; font-weight: 700; color: var(--sub); line-height: 1.5; }
.calc-hint { font-size: 12px; color: var(--sub); line-height: 1.5; }
/* 単位は入力欄の中（右端）に置く。欄の幅を全部そろえるため */
.calc-input { position: relative; }
.calc input, .calc select { display: block; width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); font: inherit; font-size: 17px; color: var(--ink); }
.calc-input input { padding-right: 104px; }
.calc-input span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--sub); white-space: nowrap; pointer-events: none; }
.calc select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; font-size: 16px; }
.calc input:focus, .calc select:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.calc input::placeholder { color: var(--dim); }
.calc-out { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.post .calc-empty { margin: 0; font-size: 14.5px; color: var(--sub); }
.calc-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.calc-res > div { background: var(--tint); border-radius: 14px; padding: 12px 14px; }
.calc-res > div.is-empty b { color: var(--dim); }
.calc-res dt { font-size: 12px; color: var(--sub); font-weight: 700; line-height: 1.5; }
.calc-res dd { margin: 4px 0 0; font-size: 14px; color: var(--sub); }
.calc-res b { font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.post .calc-how { margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: var(--sub); text-align: left; }
.post .calc-note { margin: 14px 0 0; font-size: 13px; line-height: 1.8; color: var(--sub); text-align: left; }
@media (max-width: 560px) {
  .calc { padding: 18px 16px 16px; }
  .calc-form { grid-template-columns: 1fr; }
  .calc-res { grid-template-columns: 1fr; }
  .calc-res > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .calc-res dd { margin: 0; }
}
