/* =========================================================
   JIN 互換スタイル（compat-jin.css）
   既存の1,021本の記事本文に残っている JIN・プラグインの飾りを、
   新しいデザインの見た目に合わせて表示するための CSS。
   ・本文の HTML は書き換えずに、見た目だけを差し替える
   ・WordPress のテーマでは、記事ページでこのファイルを読み込む
   ※ [ ... ] の形のショートコードは CSS では直せないため、
     テーマの functions.php で受け止める（決定事項.md 参照）
   ========================================================= */

.clearfix::after { content: ""; display: table; clear: both; }

/* ---------- 吹き出し（balloon-box）→ 新デザインの「ひとこと」 ---------- */
.prose .balloon-box {
  display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: start;
}
.prose .balloon-box .balloon-icon { grid-column: 1; grid-row: 1; }
.prose .balloon-box .balloon-icon img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.prose .balloon-box .icon-name { grid-column: 1; grid-row: 2; font-size: 10px; line-height: 1.4; color: var(--stone); text-align: center; margin-top: 4px; }
.prose .balloon-box .balloon-serif { grid-column: 2; grid-row: 1 / 3; }
.prose .balloon-box .balloon-content {
  background: var(--white); border-radius: 4px 16px 16px 16px; padding: 12px 18px;
  font-size: 15px; line-height: 1.85; box-shadow: 0 1px 0 var(--line);
}
.prose .balloon-box.balloon-right { grid-template-columns: 1fr 52px; }
.prose .balloon-box.balloon-right .balloon-icon,
.prose .balloon-box.balloon-right .icon-name { grid-column: 2; }
.prose .balloon-box.balloon-right .balloon-serif { grid-column: 1; }
.prose .balloon-box.balloon-right .balloon-content { border-radius: 16px 4px 16px 16px; background: #fff7cf; }

/* ---------- 顔文字のひとこと（l-fuki）→ 名前付きのメモ ---------- */
.prose .l-fuki {
  background: var(--white); border-radius: 4px 16px 16px 16px; padding: 12px 18px;
  font-size: 15px; line-height: 1.85; box-shadow: 0 1px 0 var(--line);
  border-left: 3px solid var(--accent);
}
.prose .l-fuki.yureo::before {
  content: "ユレオ"; display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--stone);
}

/* ---------- 囲み枠（simple-box1〜9）→ 「この記事でわかること」の箱 ---------- */
.prose [class^="simple-box"], .prose [class*=" simple-box"] {
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 24px 28px;
}
.prose [class^="simple-box"] > :first-child { margin-top: 0; }
.prose [class^="simple-box"] > :last-child { margin-bottom: 0; }
.prose [class^="simple-box"] ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.prose [class^="simple-box"] li { padding-left: 30px; position: relative; line-height: 1.8; }
.prose [class^="simple-box"] li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 16px; height: 9px;
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg);
}
.prose [class^="simple-box"] strong { background: none; }

/* ---------- 目次（Table of Contents Plus）→ 新デザインの目次の箱 ---------- */
.prose #toc_container {
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 22px 28px;
  width: auto !important; display: block; font-size: 15px;
}
.prose #toc_container .toc_title {
  margin: 0 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .24em; color: var(--stone);
}
.prose #toc_container ul { list-style: none; margin: 0; padding: 0; }
.prose #toc_container .toc_list { counter-reset: toc; }
.prose #toc_container .toc_list > li { counter-increment: toc; padding: 6px 0; border-top: 1px solid var(--line); }
.prose #toc_container .toc_list > li:first-child { border-top: 0; }
.prose #toc_container .toc_list > li > a::before {
  content: counter(toc, decimal-leading-zero); font-family: var(--font-display); font-weight: 700; color: var(--stone);
  margin-right: 12px; letter-spacing: .08em;
}
.prose #toc_container ul ul { padding-left: 34px; font-size: 14px; }
.prose #toc_container a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 新テーマでは左の固定目次があるため、PCでは本文中の古い目次を隠す（スマホでは表示） */
@media (min-width: 1181px) { .prose #toc_container { display: none; } }

/* ---------- リンクカード（Pz-LinkCard の [blogcard]・URL だけの行）→ 新デザインのカード ----------
   プラグイン自身の CSS は読まない（inc/setup.php）。外部・内部どちらのカードにも効く */
.prose .linkcard { margin: 2.2em 0; }
.prose :is(.lkc-external-wrap, .lkc-internal-wrap, .lkc-this-wrap) {
  max-width: none; background: var(--white); border: 1px solid var(--line); border-radius: 6px;
  transition: border-color .3s, transform .3s var(--ease);
}
.prose :is(.lkc-external-wrap, .lkc-internal-wrap, .lkc-this-wrap):hover { border-color: var(--ink); transform: translateY(-2px); }
.prose .lkc-link { display: block; padding: 16px 20px; color: inherit; text-decoration: none; }
.prose .lkc-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.prose .lkc-content { order: 1; height: auto; margin: 0; overflow: hidden; word-break: normal; overflow-wrap: anywhere; display: grid; gap: 4px; }
.prose .lkc-content::before { content: "LINK"; font: 600 11px var(--font-display); letter-spacing: .2em; color: var(--stone); }
.prose .lkc-internal-wrap .lkc-content::before { content: "RELATED"; }
.prose .lkc-title { margin: 0; }
.prose .lkc-title-text {
  font-weight: 700; font-size: 15px; line-height: 1.65; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prose .lkc-excerpt {
  font-size: 13px; line-height: 1.7; color: var(--stone); height: auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prose .lkc-info { order: 2; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--stone); margin: 4px 0 0; }
.prose .lkc-favicon { width: 16px; height: 16px; border-radius: 3px; margin: 0; }
.prose .lkc-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose .lkc-domain::after { content: " ↗"; }
.prose :is(.lkc-url, .lkc-share, .lkc-sns-hb, .lkc-sns-fb, .lkc-sns-tw, .lkc-sns-po, .lkc-card .clear) { display: none; }
/* 写真があるカード：左に写真（試作の関連リンクと同じ形） */
.prose .lkc-thumbnail { float: left; width: 160px; max-width: 160px; margin: 0 20px 0 0; padding: 0; }
.prose .lkc-thumbnail img, .prose .lkc-thumbnail-img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 0; border-radius: 4px; margin: 0; }
@media (max-width: 760px) {
  .prose .lkc-link { padding: 14px 16px; }
  .prose .lkc-thumbnail { width: 104px; max-width: 104px; margin-right: 14px; }
  .prose .lkc-title-text { font-size: 14px; }
  .prose .lkc-excerpt { display: none; }
}
/* 旧サイトの Font Awesome の矢印（6か所）。ライブラリは読まずに記号で代わりにする */
.prose .fa-chevron-circle-right::before { content: "›"; display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: 50%; background: var(--ink); color: var(--white); font-style: normal; font-size: .9em; line-height: 1; margin-right: .3em; }

/* ---------- 関連記事への強調リンク（emphasize-link_kanren） ---------- */
.prose .emphasize-link_kanren a {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px;
  font-weight: 700; line-height: 1.6;
}
.prose .emphasize-link_kanren a::after { content: "→"; margin-left: auto; font-family: var(--font-display); }

/* ---------- ボタン（jin-shortcode-button・color-button01） → 墨色の丸いボタン ---------- */
.prose .jin-flexbox { display: flex; justify-content: center; }
.prose .jin-shortcode-button a,
.prose [class^="color-button"] a {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: 99px !important; min-height: 48px;
  background: var(--ink) !important; color: var(--white) !important;
  font-weight: 700; font-size: 15px; letter-spacing: .04em; text-align: center; line-height: 1.5;
  box-shadow: none !important; transition: transform .3s var(--ease);
}
.prose .jin-shortcode-button a:hover, .prose [class^="color-button"] a:hover { transform: translateY(-2px); }
.prose [class^="color-button"] a[href*="youtube.com"] { background: #e62117 !important; }

/* ---------- Google の YouTube 登録ウィジェット（読み込まないので隠す） ---------- */
.prose .g-ytsubscribe { display: none; }

/* ---------- 商品リンク（Rinker）→ 新デザインの商品カード ---------- */
.prose .yyi-rinker-contents { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; }
.prose .yyi-rinker-box { display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: center; }
.prose .yyi-rinker-image { display: grid; place-items: center; }
.prose .yyi-rinker-image img { max-width: 96px; max-height: 96px; width: auto; height: auto; border-radius: 0; }
.prose .yyi-rinker-title a { font-weight: 700; font-size: 15px; line-height: 1.6; }
.prose .yyi-rinker-detail { font-size: 12px; color: var(--stone); line-height: 1.6; margin-top: 2px; }
.prose .yyi-rinker-detail .credit { font-size: 10px; }
.prose .yyi-rinker-detail .credit a { text-decoration: underline; }
.prose .yyi-rinker-detail p:empty, .prose .yyi-rinker-detail .price-box:empty { display: none; }
.prose .yyi-rinker-links { list-style: none; margin: 12px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.prose .yyi-rinker-links li { flex: 1 1 0; min-width: 110px; display: flex; }
.prose .yyi-rinker-links li img { position: absolute; width: 1px; height: 1px; } /* 計測用の1pxの画像 */
.prose .yyi-rinker-links a {
  flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px; background: var(--ink); color: var(--white);
  font-size: 13px; font-weight: 700; transition: background .2s, transform .2s;
}
.prose .yyi-rinker-links a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--shop, #999); flex: none; }
.prose .yyi-rinker-links a:hover { background: #2c3034; transform: translateY(-1px); }
.prose .yyi-rinker-links .amazonlink a { --shop: #ff9900; }
.prose .yyi-rinker-links .rakutenlink a { --shop: #ff4d4d; }
.prose .yyi-rinker-links .yahoolink a { --shop: #6aa8ff; }
.prose .yyi-rinker-links a::after { content: "↗"; font-size: .9em; opacity: .7; }
/* スマホ：画像を上、文字とボタンを下に。ボタンは3つ横並び（縦に3段にならないように） */
@media (max-width: 760px) {
  .prose .yyi-rinker-contents { padding: 16px; }
  .prose .yyi-rinker-box { grid-template-columns: 1fr; gap: 10px; }
  .prose .yyi-rinker-image img { max-width: 120px; max-height: 120px; }
  .prose .yyi-rinker-links { flex-wrap: nowrap; gap: 6px; }
  .prose .yyi-rinker-links li { min-width: 0; }
  .prose .yyi-rinker-links a { font-size: 12px; padding: 8px 6px; gap: 4px; min-height: 44px; }
  .prose .yyi-rinker-links a::before { width: 7px; height: 7px; }
}

/* ---------- 本文中の画像まわり ---------- */
.prose p > img, .prose > img, .prose a > img { margin-inline: auto; }
.prose p:has(> img:only-child) { text-align: center; }

/* ---------- 文字色の手直し（古い記事の青・赤などの文字色）→ 墨色にそろえ、強調は黄色のマーカーで ---------- */
.prose span[style*="color"] { color: inherit !important; }

/* ---------- 古い記事の YouTube 埋め込み（幅500pxの iframe）→ 画面の幅に合わせて 16:9 で表示 ---------- */
.prose iframe { max-width: 100%; }
.prose iframe[src*="youtube.com"], .prose iframe[src*="youtube-nocookie.com"] {
  width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; display: block;
}
@media (max-width: 760px) {
  .prose .yyi-rinker-links a { white-space: nowrap; }
  .prose .yyi-rinker-links a::after { display: none; }
}
