/* TubeAffi 商品カード v2 — テーマ非依存・モバイルファースト
   シグネチャ: カード上端の3モールカラーエッジ（アンバー→クリムゾン→レッド） */

.taffi-card {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 24px;
  margin: 2em 0;
  background: #ffffff;
  border: 1px solid #e9e4d8;
  border-radius: 14px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(30, 26, 20, 0.04), 0 14px 34px -18px rgba(30, 26, 20, 0.18);
  color: #1f2328;
  line-height: 1.5;
  overflow: hidden;
}
.taffi-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #e08a00 0%, #e08a00 32%, #bf0000 36%, #bf0000 64%, #e8113c 68%, #e8113c 100%);
}

.taffi-card__media {
  flex: none;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #faf8f2;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(30, 26, 20, 0.05);
  overflow: hidden;
}
.taffi-card__media img.taffi-card__image {
  max-width: 88%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0;
  box-shadow: none;
}

.taffi-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.taffi-card__title {
  margin: 2px 0 10px;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1.5;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.taffi-card__price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 2px;
}
.taffi-card__price-label {
  font-size: 0.68em;
  font-weight: 700;
  color: #7b8178;
  border: 1px solid #d9d3c4;
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 0.08em;
}
.taffi-card__price {
  font-size: 1.45em;
  font-weight: 800;
  color: #c0392b;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.taffi-card__price-note {
  font-size: 0.7em;
  color: #b0aa9c;
}

.taffi-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  font-size: 0.84em;
  text-decoration: none !important;
  color: inherit;
  width: fit-content;
}
.taffi-card__rating:hover .taffi-card__rating-note { color: #857f70; text-decoration: underline; }
.taffi-stars {
  position: relative;
  display: inline-block;
  color: #ddd6c6;
  letter-spacing: 2px;
  line-height: 1;
}
.taffi-stars__fill {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #e8a33d;
}
.taffi-card__rating-avg {
  font-weight: 800;
  color: #a4761c;
}
.taffi-card__rating-note {
  color: #b0aa9c;
  font-size: 0.85em;
}

.taffi-card__buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}
.taffi-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px 13px 12px;
  border-radius: 10px;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 0.88em;
  letter-spacing: 0.02em;
  border: none;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.taffi-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}
.taffi-btn::after {
  content: "›";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-54%);
  font-size: 1.1em;
  font-weight: 800;
  opacity: 0.85;
}
.taffi-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  color: #ffffff !important;
}
.taffi-btn:focus-visible {
  outline: 2px solid #1f2328;
  outline-offset: 2px;
}
.taffi-btn--amazon {
  background: #232f3e;
  box-shadow: 0 6px 14px -6px rgba(35, 47, 62, 0.55);
}
.taffi-btn--amazon::after { color: #ff9900; opacity: 1; }
.taffi-btn--rakuten {
  background: #b00000;
  box-shadow: 0 6px 14px -6px rgba(176, 0, 0, 0.5);
}
.taffi-btn--yahoo {
  background: #e8113c;
  box-shadow: 0 6px 14px -6px rgba(232, 17, 60, 0.5);
}
.taffi-btn--amazon:hover { box-shadow: 0 10px 20px -8px rgba(35, 47, 62, 0.65); }
.taffi-btn--rakuten:hover { box-shadow: 0 10px 20px -8px rgba(176, 0, 0, 0.6); }
.taffi-btn--yahoo:hover { box-shadow: 0 10px 20px -8px rgba(232, 17, 60, 0.6); }

.taffi-card__credit {
  margin-top: 12px;
  font-size: 0.64em;
  color: #beb8aa;
  letter-spacing: 0.03em;
  text-align: right;
}

@media (max-width: 560px) {
  .taffi-card {
    flex-direction: column;
    gap: 16px;
    padding: 18px 18px 16px;
  }
  .taffi-card__media {
    width: 100%;
    height: 190px;
  }
  .taffi-card__buttons { grid-template-columns: 1fr; }
  .taffi-card__credit { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .taffi-btn { transition: none; }
  .taffi-btn:hover { transform: none; }
}

/* --- 順位バッジ（ランキング記事） --- */
.taffi-rank {
  position: absolute;
  top: -1px;
  left: 16px;
  z-index: 2;
  padding: 8px 10px 6px;
  border-radius: 0 0 8px 8px;
  color: #fff;
  font-weight: 800;
  font-size: 0.82em;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.4);
}
.taffi-rank--1 { background: linear-gradient(160deg, #d4a017, #b8860b); }
.taffi-rank--2 { background: linear-gradient(160deg, #9fa8b3, #7d8894); }
.taffi-rank--3 { background: linear-gradient(160deg, #b5713f, #96562a); }
.taffi-rank--other { background: #6d7278; }
.taffi-card .taffi-rank + .taffi-card__media { margin-top: 12px; }

/* --- 良い点/気になる点（動画内評価） --- */
.taffi-eval-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.taffi-eval-row .taffi-eval { margin: 0; }
@media (max-width: 600px) {
  .taffi-eval-row { grid-template-columns: 1fr; }
}
.taffi-eval {
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  border: 1px solid;
  font-size: 0.92em;
}
.taffi-eval--good {
  background: #f2f7ee;
  border-color: #cfe0c3;
}
.taffi-eval--bad {
  background: #faf3ec;
  border-color: #e8d5bd;
}
.taffi-eval__label {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 0.88em;
  letter-spacing: 0.04em;
}
.taffi-eval--good .taffi-eval__label { color: #3c6e33; }
.taffi-eval--bad .taffi-eval__label { color: #a05c1c; }
.taffi-eval ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.taffi-eval li {
  position: relative;
  list-style: none !important;
  padding-left: 1.5em;
  margin: 4px 0 !important;
  line-height: 1.6;
}
.taffi-eval li::marker { content: "" !important; }
.taffi-eval--good li::before {
  content: "○";
  position: absolute;
  left: 0.1em;
  color: #4c8a3f;
  font-weight: 800;
}
.taffi-eval--bad li::before {
  content: "△";
  position: absolute;
  left: 0.1em;
  color: #c07a2c;
  font-weight: 800;
}

/* --- ランキング比較表 --- */
.taffi-rtable-wrap {
  overflow-x: auto;
  margin: 1.8em 0;
  border: 1px solid #e9e4d8;
  border-radius: 12px;
  background: #fff;
}
.taffi-rtable {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.88em;
}
.taffi-rtable th {
  background: #2e5e4e;
  color: #f9f6ec;
  padding: 10px 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.taffi-rtable td {
  padding: 10px 12px;
  border-top: 1px solid #f0ece2;
  vertical-align: middle;
}
.taffi-rtable tbody tr:nth-child(even) td { background: #fbf9f4; }
.taffi-rtable__rank .taffi-rank {
  position: static;
  display: inline-block;
  border-radius: 8px;
  padding: 5px 9px;
  box-shadow: none;
}
.taffi-rtable__product { min-width: 200px; }
.taffi-rtable__product-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  line-height: 1.4;
}
.taffi-rtable__product img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: #faf8f2;
  flex: none;
}
.taffi-rtable__rating b { color: #a4761c; }
.taffi-rtable__rating small {
  display: block;
  color: #b0aa9c;
  font-size: 0.82em;
}
.taffi-rtable__price b { color: #c0392b; }
.taffi-rtable__links-inner {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.taffi-rtable__link {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.85em;
  font-weight: 700;
  white-space: nowrap;
}
.taffi-rtable__link--amazon { background: #232f3e; }
.taffi-rtable__link--rakuten { background: #b00000; }
.taffi-rtable__link--yahoo { background: #e8113c; }
.taffi-rtable__link:hover { filter: brightness(1.1); }
.taffi-rtable__note {
  margin: 8px 12px 10px;
  font-size: 0.7em;
  color: #b0aa9c;
}

/* YouTube埋め込み: テーマによらず常に16:9を維持（スマホの縦伸び防止） */
.wp-block-embed-youtube .wp-block-embed__wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
}
.wp-block-embed-youtube .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 冒頭の統合表記（広告+AI）: 法令上冒頭必須のため位置は固定し、視覚的に控えめに */
p.taffi-notice {
  font-size: 0.72em;
  color: #a5a29b;
  text-align: right;
  margin: 0 0 12px;
  line-height: 1.4;
}

/* 比較表の商品名は2行まで */
.taffi-rtable__product span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- お気に入りボタン（右下フローティング・SPは下部ナビの上） --- */
button.taffi-fav,
.taffi-fav {
  position: fixed;
  right: 14px;
  bottom: 88px; /* SP: フッター追従ナビの上 */
  z-index: 2147483000 !important; /* 常に最前面レイヤー */
  width: auto !important;
  max-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1.5px solid #d9483b;
  border-radius: 999px;
  background: #fff;
  color: #d9483b;
  font-weight: 800;
  font-size: 0.9em;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(30, 26, 20, 0.45);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
@media (min-width: 768px) {
  .taffi-fav { right: 28px; bottom: 28px; }
}
.taffi-fav__icon { font-size: 1.15em; line-height: 1; }
.taffi-fav:hover { transform: translateY(-1px); }
.taffi-fav.is-active {
  background: #d9483b;
  color: #fff;
}
.taffi-fav:focus-visible { outline: 2px solid #1f2328; outline-offset: 2px; }

/* --- お気に入り一覧 --- */
.taffi-fav-list__status,
.taffi-fav-list__empty { color: #8a8f98; }
.taffi-fav-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 10px 0;
}
.taffi-fav-card {
  position: relative;
  background: #fff;
  border: 1px solid #e9e4d8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px -14px rgba(30, 26, 20, 0.25);
}
.taffi-fav-card__link { text-decoration: none !important; color: inherit; display: block; }
.taffi-fav-card__link img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.taffi-fav-card__title {
  margin: 0;
  padding: 12px 14px 14px;
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.taffi-fav-card__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(31, 35, 40, 0.65);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.taffi-fav-card__remove:hover { background: #d9483b; }

/* リンク版FAB（記事以外のページ） */
a.taffi-fav,
a.taffi-fav:hover {
  text-decoration: none !important;
  color: #d9483b;
}

/* ===== よくある質問（FAQ） ===== */
.mg-faq {
    display: grid;
    gap: 10px;
    margin: 1.2em 0 2em;
}
.mg-faq__item {
    border: 1px solid #e3e0d8;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.mg-faq__item summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 14px 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.mg-faq__item summary::-webkit-details-marker { display: none; }
.mg-faq__item summary::before {
    content: "Q";
    flex: none;
    font-weight: 800;
    color: #2e7d32;
}
.mg-faq__item[open] summary { border-bottom: 1px dashed #e3e0d8; }
.mg-faq__item p {
    margin: 0;
    padding: 12px 16px 14px 16px;
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.mg-faq__item p::before {
    content: "A";
    flex: none;
    font-weight: 800;
    color: #c62828;
}

/* ===== 本文中の商品アフィリリンク ===== */
a.mg-item {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}
a.mg-item::after {
    content: "🛒";
    font-size: 0.8em;
    margin-left: 3px;
}

/* ===== 冒頭の要点ブロック（3行でわかる／黒板の帯＋赤ペンの採点丸） ===== */
.mg-lead {
    position: relative;
    margin: 1.5em 0 2.2em;
    background: #FFFDF7;
    border: 1.5px solid rgba(35, 74, 60, 0.16);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(35, 74, 60, 0.06), 0 8px 20px rgba(35, 74, 60, 0.07);
}
/* 見出し = 黒板の帯 */
.mg-lead h2.mg-lead__title {
    margin: 0;
    padding: 13px 20px 12px 50px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #2E5E4E 0%, #27503F 100%);
    color: #F6F1E6;
    font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
    font-weight: 900;
    font-size: 1.06em;
    line-height: 1.45;
    letter-spacing: 0.08em;
    position: relative;
    /* チョークの罫 */
    border-bottom: 1px dashed rgba(249, 246, 236, 0.32);
}
/* 和英併記（サイトの見出し慣習に合わせる。目次には出ないCSS生成文字） */
.mg-lead h2.mg-lead__title::after {
    content: "POINT";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62em;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(249, 246, 236, 0.62);
}
/* 赤ペンの採点マル */
.mg-lead h2.mg-lead__title::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 19px;
    height: 19px;
    margin-top: -11px;
    border: 2.5px solid #E4695C;
    border-radius: 50%;
    transform: rotate(-8deg);
}
/* 本文 = ノート紙 */
.mg-lead ul {
    counter-reset: mg-lead;
    list-style: none;
    margin: 0;
    padding: 16px 22px 18px;
    display: grid;
    gap: 12px;
}
.mg-lead li {
    counter-increment: mg-lead;
    position: relative;
    margin: 0;
    padding-left: 36px;
    line-height: 1.85;
    font-size: 0.97em;
    font-weight: 500;
    color: #2A2A26;
}
.mg-lead li + li {
    padding-top: 12px;
    border-top: 1px dashed rgba(35, 74, 60, 0.16);
}
.mg-lead li::before {
    content: counter(mg-lead);
    position: absolute;
    left: 0;
    top: 4px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 2px solid #D9483B;
    border-radius: 50%;
    color: #D9483B;
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-weight: 900;
    font-size: 12.5px;
    line-height: 1;
    background: #fff;
}
.mg-lead li + li::before { top: 16px; }
.mg-lead li::marker { content: none; }
@media (max-width: 767px) {
    .mg-lead h2.mg-lead__title { padding: 12px 16px 11px 44px; font-size: 1em; }
    .mg-lead h2.mg-lead__title::after { display: none; }
    .mg-lead h2.mg-lead__title::before { left: 15px; }
    .mg-lead ul { padding: 14px 16px 16px; gap: 10px; }
    .mg-lead li { padding-left: 32px; font-size: 0.95em; }
    .mg-lead li::before { width: 22px; height: 22px; font-size: 12px; }
}

/* Amazonアソシエイト規約 第5条の表示（フッター最下部・控えめだが読める大きさ） */
.taffi-amazon-disclosure {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px 14px;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.7;
    color: #6E7A72;
}

/* ---- 価格の動き（当サイトの日次記録による一次データ） ---- */
.taffi-trend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 8px 10px;
  background: #f6f8f7;
  border-radius: 8px;
  color: #2e5e4e;
}
.taffi-trend .taffi-spark {
  flex: 0 0 auto;
  color: #2e5e4e;
  opacity: .85;
}
.taffi-trend__text {
  margin: 0;
  font-size: .82rem;
  line-height: 1.6;
  color: #3d4b46;
}
.taffi-trend__note {
  display: block;
  margin-top: 2px;
  font-size: .72rem;
  color: #8a9a93;
}
@media (max-width: 480px) {
  .taffi-trend { gap: 8px; padding: 7px 8px; }
  .taffi-trend .taffi-spark { width: 84px; height: 24px; }
  .taffi-trend__text { font-size: .78rem; }
}

/* ---- あわせて読みたい（内部リンク） ---- */
ul.mg-related {
  margin: 0 0 1.6em;
  padding: 14px 18px 14px 34px;
  list-style: disc;
  background: #f9f6ec;
  border-left: 4px solid #2e5e4e;
  border-radius: 0 8px 8px 0;
}
ul.mg-related li { margin: 0; padding: 3px 0; }
ul.mg-related a {
  color: #234a3c;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(35, 74, 60, .3);
}
ul.mg-related a:hover { color: #d9483b; border-bottom-color: #d9483b; }
