/* =====================================
   Base utilities
   ===================================== */
/* dividers */
.section-divider {
  border: none;
  border-top: 2px solid #ccc;
  margin: 20px 0;
  width: 100%;
}

.section-dotted-divider {
  border: none;
  border-top: 2px dotted #ccc;
  margin: 20px 0;
  width: 100%;
  height: 0;
}

/* spacers */
.blank {
  height: 2rem;
}

.blank-end {
  height: 5rem;
}

/* emphasis & subtle text */
.emphasis {
  font-weight: 700;
  color: #333;
  font-size: 1.5rem;
  margin: 30px 0;
}

.silent {
  font-size: .8em;
  color: #666;
}

/* =====================================
   Tables
   ===================================== */
.spec-table {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: .95em;
  border: 1px solid #ccc;
}

.spec-table th,
.spec-table td {
  padding: 10px 14px;
  border: 1px solid #ccc;
  background: #fff;
  vertical-align: top;
  text-align: left;
}

.spec-table th {
  background: #f7f7f7;
  width: 35%;
  font-weight: 700;
}

.spec-box {
  background: #e9ffe0;
  margin: 1em;
  padding: 1em;
  border-left: 3px solid #89d66d;
  font-size: 1rem;
}

/* 横スクロール用の基本 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* グローバルの table{ width:100% } を上書きして、テーブル自身を大きくできるように */
.table-wrapper .spec-table {
  width: 100% !important;
  max-width: 100% !important;
  word-break: break-word;
  table-layout: auto;
}

.table-wrapper th {
  width: max-content;
  padding: 12px;
}

.table-wrapper img{
    width: 200px; height: auto;
  }


/* (optional) generic table baseline */
table {
  border-collapse: collapse;
  width: 100%;
  font-family: sans-serif;
}

th,
td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
  background: #fff;
}

th {
  background: #f9f9f9;
}

/* =====================================
   Tooltip
   ===================================== */
.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #555;
}

.tooltip-portal {
  position: fixed;
  z-index: 9999;
  max-width: min(90vw, 500px);
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease;
  pointer-events: none;
  word-wrap: break-word;
}

.tooltip-portal::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.tooltip-portal[data-placement="top"]::after {
  border-top-color: #333;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
}

.tooltip-portal[data-placement="bottom"]::after {
  border-bottom-color: #333;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}

.tooltip-portal[data-placement="left"]::after {
  border-left-color: #333;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
}

.tooltip-portal[data-placement="right"]::after {
  border-right-color: #333;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
}

.tooltip-portal.is-visible {
  opacity: 1;
  visibility: visible;
}

.tooltip .tooltip-text {
  display: none !important;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tooltip-portal {
    transition: none;
  }
}

/* =====================================
   Rating (stars)
   ===================================== */
.rating-table-wrapper {
  max-width: 600px;
  margin: 30px auto;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  background: #89d66d;
}

.stars {
  --rating: 4.5;
  --star-size: 1.2rem;
  display: inline-block;
  font-size: var(--star-size);
  font-family: Arial, sans-serif;
  line-height: 1;
  position: relative;
}

.stars::before {
  content: "★★★★★";
  color: #727272;
}

.stars::after {
  content: "★★★★★";
  color: gold;
  position: absolute;
  inset: 0 auto auto 0;
  width: calc(var(--rating) / 5 * 100%);
  overflow: hidden;
  white-space: nowrap;
}

.score {
  margin-left: .5em;
  font-size: .9rem;
  color: #666;
}

/* スマホ時：★5の行はコメントを折り返して改行（評価は2列目想定） */
@media (max-width: 768px) {

  .rating-table tr:has(td:nth-child(2) .stars[data-rate="5"]),
  .rating-table tr:has(td:nth-child(2) .stars:where(:not([data-rate])):has(.star.is-on:nth-child(5))) {
    display: grid;
    grid-template-columns: minmax(6em, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
  }

  .rating-table tr:has(td:nth-child(2) .stars[data-rate="5"])>td:nth-child(1),
  .rating-table tr:has(td:nth-child(2) .stars:has(.star.is-on:nth-child(5)))>td:nth-child(1) {
    grid-column: 1;
  }

  .rating-table tr:has(td:nth-child(2) .stars[data-rate="5"])>td:nth-child(2),
  .rating-table tr:has(td:nth-child(2) .stars:has(.star.is-on:nth-child(5)))>td:nth-child(2) {
    grid-column: 2;
  }

  .rating-table tr:has(td:nth-child(2) .stars[data-rate="5"])>td:nth-child(3),
  .rating-table tr:has(td:nth-child(2) .stars:has(.star.is-on:nth-child(5)))>td:nth-child(3) {
    grid-column: 1 / -1;
    margin-top: .25em;
  }
}

/* =====================================
   Affiliate shop buttons (pattern 1)
   ===================================== */
.shop-buttons {
  max-width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: #fff;
}

.shop-buttons a.shop-btn,
.shop-buttons a.shop-btn:link,
.shop-buttons a.shop-btn:visited,
.shop-buttons a.shop-btn:hover,
.shop-buttons a.shop-btn:active {
  text-decoration: none !important;
  color: inherit !important;
}

.shop-buttons a.shop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.2em;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  border: 1px solid rgba(0, 0, 0, .06);
  transition: transform .05s ease, box-shadow .2s ease, opacity .2s ease;
  width: 100%;
  max-width: 420px;
}

.shop-buttons a.shop-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.shop-buttons a.shop-btn:active {
  transform: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .10);
}

.shop-buttons a.shop-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .75);
  outline-offset: 2px;
}

.shop-btn__logo {
  font-size: 1em;
  opacity: .95;
}

.shop-btn__label {
  font-size: .95em;
  opacity: .95;
}

/* brand colors */
.shop-buttons .btn-amazon {
  background: #232f3e;
  color: #fff;
}

.shop-buttons .btn-rakuten {
  background: #bf0000;
  color: #fff;
}

.shop-buttons .btn-yahoo {
  background: #ff0033;
  color: #fff;
}

/* Amazon inner yellow frame */
.shop-buttons .btn-amazon {
  overflow: hidden;
}

.shop-buttons .btn-amazon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #ff9900;
  pointer-events: none;
  opacity: .7;
}

/* dark scheme tweaks */
@media (prefers-color-scheme: dark) {
  .shop-buttons a.shop-btn {
    border-color: rgba(255, 255, 255, .1);
  }
}

/* =====================================
   Affiliate shop buttons (pattern 2)
   ===================================== */
.shop-buttons2 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: #fff;
}

.shop-buttons2 a.shop-btn,
.shop-buttons2 a.shop-btn:link,
.shop-buttons2 a.shop-btn:visited,
.shop-buttons2 a.shop-btn:hover,
.shop-buttons2 a.shop-btn:active {
  text-decoration: none !important;
  color: inherit !important;
}

.shop-buttons2 a.shop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 0;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  border: 1px solid rgba(0, 0, 0, .06);
  transition: transform .05s ease, box-shadow .2s ease, opacity .2s ease;
  width: 100%;
  max-width: 420px;
}

.shop-buttons2 a.shop-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.shop-buttons2 a.shop-btn:active {
  transform: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .10);
}

.shop-buttons2 a.shop-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .75);
  outline-offset: 2px;
}

.shop-buttons2 .btn-amazon {
  background: #232f3e;
  color: #fff;
  overflow: hidden;
}

.shop-buttons2 .btn-rakuten {
  background: #bf0000;
  color: #fff;
}

.shop-buttons2 .btn-yahoo {
  background: #ff0033;
  color: #fff;
}

.shop-buttons2 .btn-amazon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #ff9900;
  pointer-events: none;
  opacity: .7;
}

@media (prefers-color-scheme: dark) {
  .shop-buttons2 a.shop-btn {
    border-color: rgba(255, 255, 255, .1);
  }
}

/* =====================================
   Affiliate shop buttons (pattern 3)
   ===================================== */
.card {
  max-width: 600px;
  margin: 20px auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.card .left {
  flex: 0 0 300px;
  max-width: 100%;
  height: 300px;
  /* 高さ固定 */
  display: flex;
  align-items: center;
  /* 縦中央 */
  justify-content: center;
  /* 横中央 */
  overflow: hidden;
}

.card .left img {
  height: 100%;
  width: auto;
  border-radius: 8px;

}

.card .right {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 👈 縦中央揃え */
  align-items: center;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  /* 👈 タイトルも中央寄せにするなら */
}

.btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  /* 👈 ボタンを中央寄せ */
}

.btns a {
  display: block;
  text-align: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  transition: transform .1s ease, box-shadow .2s ease;
  width: 220px;
  /* 👈 ボタン幅を揃えるなら指定 */
}

.btns a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.btn-amazon {
  background: #232f3e;
  position: relative;
}

.btn-amazon::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #ff9900;
  pointer-events: none;
}

.btn-rakuten {
  background: #bf0000;
}

.btn-yahoo {
  background: #ff0033;
}

@media (max-width: 768px) {
  .card {
    justify-content: center;
    /* 👈 子要素（画像＋テキスト）を中央に並べる */
    text-align: center;
    /* 👈 テキストやボタンも中央揃え */
  }

  .card .right {
    align-items: center;
    /* 👈 ボタンや商品名を中央寄せ */
  }
}


/* =====================================
   Comparison (two-column examples)
   ===================================== */
.comparison-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.comparison-column {
  flex: 1;
  min-width: 300px;
}

.column-title {
  text-align: center;
  font-size: 1.4em;
  margin-bottom: 10px;
  font-weight: 700;
}

.example-title {
  padding: 8px;
  font-weight: 700;
  color: #fff;
}

.good {
  background: #4CAF50;
}

.bad {
  background: #E74C3C;
}

.good-example,
.bad-example {
  margin-bottom: 15px;
}

.good-example ul {
  background: #E8F5E9;
  padding: 15px;
  margin: 0;
  list-style: disc inside;
}

.bad-example ul {
  background: #FDECEA;
  padding: 15px;
  margin: 0;
  list-style: disc inside;
}

/* =====================================
   Responsive media box
   ===================================== */
.responsive-box {
  width: 80%;
  max-width: 800px;
  min-width: 200px;
  margin: auto;
}

.responsive-box img {
  width: 100%;
  height: auto;
  display: block;
}

/* =====================================
   Article card
   ===================================== */
.article {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: background-color .2s, box-shadow .2s;
  margin-bottom: 12px;
}

.article:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.article:last-of-type {
  margin-bottom: 0;
}

.image-box {
  flex: 1;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.text-box1 {
  font-weight: bold;
  padding: 5px;
  font-size: 1.2rem;
  box-sizing: border-box;
}

.text-box2 {
  padding: 8px 5px;
  font-size: .8rem;
  box-sizing: border-box;
}

/* =====================================
   Pagination
   ===================================== */
.pagination {
  text-align: center;
  margin: 20px 0;
}

.pagination a {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 4px;
  border: 1px solid #ccc;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
}

.pagination a.active {
  background: #0073e6;
  color: #fff;
  border-color: #0073e6;
}

.pagination a:hover {
  background: #f0f0f0;
}

/* =====================================
   X (Twitter) share button
   ===================================== */
.btn-x {
  --x-bg: #000;
  --x-fg: #fff;
  --x-bg-hover: #111;
  --x-border: #000;
  --x-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border: 1px solid var(--x-border);
  border-radius: 999px;
  background: var(--x-bg);
  color: var(--x-fg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--x-shadow);
  transition: background .2s ease, transform .06s ease, box-shadow .2s ease;
}

.btn-x:hover {
  background: var(--x-bg-hover);
  transform: translateY(-1px);
}

.btn-x:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.btn-x:focus-visible {
  outline: 2px solid #1d9bf0;
  outline-offset: 2px;
}

.btn-x__icon {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-x__label {
  font-size: .95rem;
}

.btn-x.is-sm {
  padding: .45rem .8rem;
}

.btn-x.is-sm .btn-x__icon {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
}

.btn-x.is-sm .btn-x__label {
  font-size: .9rem;
}

@media (prefers-color-scheme: light) {
  .btn-x {
    --x-bg: #000;
    --x-fg: #fff;
    --x-border: #000;
  }
}

/* =====================================
   Responsive
   ===================================== */
@media (max-width: 768px) {

  /* tables */
  .spec-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    word-break: break-word;
  }

  .table-wrapper {
    margin-inline: 0px !important;
    padding-inline: 0px !important;
  }

  .table-wrapper .spec-table {
    width: max-content;
    table-layout: auto;
    word-break: normal;
  }

  .table-wrapper img{
    max-width: 100%; height: auto;
  }

  .spec-box {
    font-size: .95rem;
  }

  /* rating */
  .rating-table-wrapper {
    max-width: none;
    margin: 16px 0;
    padding: 12px;
  }

  .stars {
    --star-size: 1rem;
  }

  /* shop buttons */
  .shop-buttons a.shop-btn,
  .shop-buttons2 a.shop-btn {
    max-width: 560px;
    width: 100%;
  }

  /* article card stacks */
  .article {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .image-box {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .text-box1 {
    font-size: 1.05rem;
  }

  .text-box2 {
    font-size: .9rem;
  }

  /* X button full width */
  .btn-x {
    width: 100%;
    justify-content: center;
  }

  /* comparison -> single column */
  .comparison-column {
    min-width: 100%;
  }

  .responsive-box {
    min-width: 0;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .spec-box {
    font-size: .9rem;
  }

  .stars {
    --star-size: .95rem;
  }

  .shop-buttons a.shop-btn,
  .shop-buttons2 a.shop-btn {
    padding: .8em .9em;
  }

  .example-title {
    font-size: 1.1em;
  }
}

/* Touch devices: slightly larger tooltip text */
@media (hover: none) and (pointer: coarse) {
  .tooltip-portal {
    font-size: 15px;
    padding: 12px 14px;
  }
}

/* X誘導ボタン */
.btn-x-follow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  width: 100%;
  background-color: #000;
  color: #fff !important;
  /* 👈 強制的に白に */
  font-weight: bold;
  font-size: clamp(1rem, 1vw + 0.9rem, 1.2rem);
  border-radius: 6px;
  text-decoration: none !important;
  /* 👈 下線や色を消す */
  box-sizing: border-box;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.btn-x-follow:hover {
  background-color: #222;
  color: #fff !important;
  /* 👈 ホバー時も白文字維持 */
}