/* =====================================================
   GeneratePress用セレクタ補完
   （custom.cssのElementor依存クラスをGP向けに上書き）
   ===================================================== */

/* コンテンツエリア：フル幅・中央寄せ */
.site-content {
  width: 100%;
}

.content-area,
#primary {
  width: 100% !important;
  max-width: 880px !important;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.site-main {
  width: 100%;
}

/* Elementor不在時のリストスタイル補完 */
.entry-content ul,
article ul {
  font-size: 101%;
  font-weight: 500;
  padding-left: 1.8em;
  margin-left: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}

.entry-content ul li,
article ul li {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  line-height: 1.7;
}

.entry-content ol,
article ol {
  padding-left: 1.8em;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* =====================================================
   図・画像・キャプション（Elementorクラスなし版）
   ===================================================== */
.entry-content figure,
article figure {
  margin: 1.5em 0;
  text-align: center;
}

/* 1×1追跡ピクセルは非表示 */
.entry-content figure img[width="1"],
article figure img[width="1"] {
  display: none !important;
}

.entry-content figure img:not([width="1"]),
article figure img:not([width="1"]) {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0 auto 6px;
}

.entry-content figcaption,
article figcaption {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 20px;
  font-style: italic;
}

/* アフィリエイトリンク内の画像（hover効果、追跡ピクセル除外） */
.entry-content figure a,
article figure a {
  display: block;
}

.entry-content figure a img:not([width="1"]),
article figure a img:not([width="1"]) {
  transition: transform .3s ease, opacity .3s ease;
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.entry-content figure a:hover img:not([width="1"]),
article figure a:hover img:not([width="1"]) {
  transform: scale(1.03);
  opacity: .9;
}

/* コンテンツエリアの左右余白 */
.entry-content,
.post-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* リンクの折り返し */
.entry-content a,
article a {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 本文の基本フォントサイズ */
.entry-content,
article {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}

/* =====================================================
   1カラム強制（サイドバー非表示）
   ===================================================== */
.sidebar-area,
.widget-area,
#secondary {
  display: none !important;
}

/* =====================================================
   アフィリエイトボタン色（本番と同一）
   ===================================================== */
.aff-btn-amazon a,
span.aff-btn-amazon a {
  display: inline-block;
  background-color: #FF9900;
  color: #fff !important;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 13px;
  margin: 2px;
}

.aff-btn-rakuten a,
span.aff-btn-rakuten a {
  display: inline-block;
  background-color: #BF0000;
  color: #fff !important;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 13px;
  margin: 2px;
}

.aff-btn-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* =====================================================
   比較表（tableContainer）
   ===================================================== */
.tableContainer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}

.tableContainer table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tableContainer th {
  background-color: #56899d;
  color: #fff;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.tableContainer td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  vertical-align: middle;
  text-align: center;
}

.tableContainer tr:nth-child(even) td {
  background-color: #f9f9f9;
}

.product-cell-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  min-width: 160px;
}

.moshimo-img-wrapper {
  flex: 0 0 auto;
}

/* もしも追跡ピクセルを非表示（グローバル） */
img[src*="i.moshimo.com"] {
  display: none !important;
}

.moshimo-img-wrapper img:not([src*="i.moshimo.com"]) {
  width: 80px;
  height: auto;
  display: block;
}

.product-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.product-name {
  font-size: 12px;
  line-height: 1.4;
  display: block;
  text-align: left;
  word-break: break-word;
}

/* ★評価をオレンジに */
.tableContainer td:nth-child(2) {
  font-size: 0.85rem;
  line-height: 1.6;
}
.star-rating {
  color: #e5720a;
  font-size: 1em;
}

/* aff-btn-wrapper を左寄せ・小さく */
.product-info .aff-btn-wrapper {
  justify-content: flex-start;
  gap: 4px;
  margin-top: 4px;
}

/* =====================================================
   アフィリエイトボックスミニ
   ===================================================== */
.moshimo-affiliate-box-mini {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin: 1.5em 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
}

.affiliate-box-label {
  font-size: 11px;
  font-weight: bold;
  background: #56899d;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  width: 100%;
}

.affiliate-box-image img {
  max-width: 120px;
  height: auto;
}

.affiliate-box-content {
  flex: 1;
  min-width: 200px;
}

.affiliate-box-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.affiliate-box-microcopy {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 8px;
}

.affiliate-box-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.affiliate-btn-amazon a,
span.affiliate-btn-amazon a {
  display: inline-block;
  background-color: #FF9900;
  color: #fff !important;
  font-weight: bold;
  padding: 7px 16px;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 13px;
}

.affiliate-btn-rakuten a,
span.affiliate-btn-rakuten a {
  display: inline-block;
  background-color: #BF0000;
  color: #fff !important;
  font-weight: bold;
  padding: 7px 16px;
  border-radius: 4px;
  text-decoration: none !important;
  font-size: 13px;
}

/* =====================================================
   自動目次（TOC）— モダンデザイン
   ===================================================== */
.sagasu-toc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0;
  margin: 1.8em 0 2.2em;
  max-width: 720px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}

.sagasu-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.sagasu-toc-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sagasu-toc-toggle {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  color: #64748b;
  transition: all .15s;
}
.sagasu-toc-toggle:hover {
  background: #e2e8f0;
  color: #334155;
}

.sagasu-toc-list {
  margin: 0;
  padding: 14px 18px 14px 40px;
  list-style: decimal;
  counter-reset: none;
}

.sagasu-toc-list li {
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  padding: 4px 0 !important;
  font-weight: 400 !important;
  color: #334155;
}

.sagasu-toc-list a {
  color: #2563eb;
  text-decoration: none;
  transition: color .15s;
}

.sagasu-toc-list a:hover {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =====================================================
   フォント（SF-Pro → システムフォント / Noto Sans JP）
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap');

body,
.entry-content,
article,
.site-header,
.main-navigation {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   アイキャッチ画像（GeneratePressデフォルト表示）
   ===================================================== */
.post-image img,
.featured-image img,
.wp-post-image,
.post-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 1.5em;
  display: block;
}

/* =====================================================
   GeneratePressヘッダー簡易調整
   ===================================================== */
.site-header {
  background-color: #2c3e50;
  padding: 12px 0;
}

.site-title a,
.site-header .site-title a {
  color: #fff !important;
  font-size: 1.4rem;
  font-weight: 700;
}

.site-description {
  color: #aaa;
  font-size: 0.8rem;
}

/* ナビゲーション */
.main-navigation a {
  color: #fff !important;
}

/* =====================================================
   記事概要ボックス
   ===================================================== */
.sagasu-excerpt-box {
  position: relative;
  border: 1px dashed #c9a668;
  border-radius: 4px;
  padding: 20px 20px 16px;
  margin: 0 0 1.5em;
  background: #fff;
}

.sagasu-excerpt-label {
  position: absolute;
  top: -11px;
  left: 16px;
  background: #fff;
  border: 1px solid #c9a668;
  color: #8b6914;
  font-size: 12px;
  font-weight: 500;
  padding: 1px 12px;
  border-radius: 3px;
}

.sagasu-excerpt-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #444;
}

/* =====================================================
   記事レイアウト：タイトル → 日付 → 画像の順に
   ===================================================== */
.inside-article {
  display: flex;
  flex-direction: column;
}

.inside-article > .entry-header {
  order: -1;
  margin-bottom: 0.5em;
}

/* タイトル */
.entry-title {
  font-weight: 500 !important;
  margin-bottom: 0.35em;
  line-height: 1.4;
}

/* by admin を非表示 */
.entry-meta .byline,
.single .byline {
  display: none !important;
}

/* 日付とアイキャッチの間隔 */
.entry-meta {
  margin-bottom: 1em;
}

/* アイキャッチ画像：高さ抑えめ・角丸 */
.inside-article > .featured-image {
  width: 100%;
  margin-bottom: 1em;
}

.inside-article > .featured-image img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 10px;
}

/* =====================================================
   スマホ対応（比較表ボタン・レイアウト）
   ===================================================== */
@media (max-width: 768px) {
  /* 比較表セル：縦積みに変更 */
  .product-cell-layout {
    flex-direction: column;
    align-items: flex-start;
    min-width: 90px;
    gap: 4px;
  }

  .moshimo-img-wrapper img:not([src*="i.moshimo.com"]) {
    width: 60px;
  }

  .product-name {
    text-align: left;
    font-size: 11px;
  }

  .product-info {
    text-align: left;
    width: 100%;
  }

  /* ボタン縦積み・14px間隔（custom.cssの高特異度ルールに !important で対抗） */
  .product-info .aff-btn-wrapper,
  .tableContainer .aff-btn-wrapper {
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .product-info .aff-btn-wrapper span {
    display: block;
    width: 100%;
  }

  .aff-btn-amazon a,
  span.aff-btn-amazon a,
  .aff-btn-rakuten a,
  span.aff-btn-rakuten a {
    font-size: 11px;
    padding: 5px 16px;
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    margin: 0;
  }

  /* 比較表の文字を小さく */
  .tableContainer table {
    font-size: 0.78rem;
  }

  .tableContainer th,
  .tableContainer td {
    padding: 6px 6px;
  }
}
