/* Responsive: yes */

/* =========================================================
   全体調整
   - パンくずリストは表示したまま、最後の記事タイトルだけ非表示
   - 非表示後に残る余白を圧縮
   ========================================================= */

/* PC・スマホ共通：パンくず内の最後の記事タイトルだけ非表示 */
body.page-entry .breadcrumb .breadcrumb-child:last-child {
  display: none !important;
}

/* PC・スマホ共通：最後の記事タイトルの直前にある区切り記号「>」も非表示 */
body.page-entry .breadcrumb .breadcrumb-gt:nth-last-child(2),
body.page-entry .breadcrumb .breadcrumb-gt:has(+ .breadcrumb-child:last-child) {
  display: none !important;
}

/* パンくず全体の下余白を控えめにする */
body.page-entry .breadcrumb {
  margin-bottom: 10px !important;
  padding-bottom: 0 !important;
}

/* 記事タイトル上の余白を控えめにする */
body.page-entry .entry-header,
body.page-entry .entry-title {
  margin-top: 0 !important;
}

/* カテゴリ下・広告上に出る余白を控えめにする */
body.page-entry .entry-categories,
body.page-entry .entry-category,
body.page-entry .categories,
body.page-entry .entry-tags,
body.page-entry .entry-tag {
  margin-bottom: 8px !important;
}

/* 記事本文上の広告枠まわりの余白を控えめにする */
body.page-entry .g-ads,
body.page-entry .g-h-ads {
  margin-top: 8px !important;
  margin-bottom: 10px !important;
}

/* =========================================================
   スマホ記事ページ調整
   - 本文フォントサイズは変更しない
   - 本文行間を26pxに調整
   - 記事上の為替情報パネルを非表示
   - カテゴリタグを小さく・上下を詰める
   - スマホ上部のMarket NEXTアプリ誘導を非表示
   ========================================================= */

@media screen and (max-width: 767px) {
  /* スマホ記事本文：フォントサイズは維持し、行間だけ調整 */
  body.page-entry,
  body.page-entry * {
    line-height: 26px !important;
  }

  body.page-entry p {
    margin-top: 0 !important;
    margin-bottom: 0.9em !important;
  }

  /* 記事上「読む前にチェック！最新FX為替情報」を非表示 */
  .p-entry-chart {
    display: none !important;
  }

  /* スマホ上部のMarket NEXTアプリ誘導を非表示 */
  .c-marketnext,
  .c-marketnext-layout,
  .c-marketnext-pic,
  .c-marketnext-body,
  .c-marketnext-badges {
    display: none !important;
  }

  .c-section:has(.c-marketnext),
  .c-section:has(img[src*="logo-marketnext"]),
  .c-section:has(img[src*="top-app"]) {
    display: none !important;
  }

  /* パンくず下の余白をさらに圧縮 */
  body.page-entry .breadcrumb {
    margin-top: 12px !important;
    margin-bottom: 4px !important;
    padding-bottom: 0 !important;
  }

  /* パンくずの直後に余白だけ残る場合の対策 */
  body.page-entry .breadcrumb + * {
    margin-top: 0 !important;
  }

  /* 記事タイトルまわりの余白を圧縮 */
  body.page-entry .entry-header {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  body.page-entry .entry-title {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    padding-top: 0 !important;
  }

  /* 日付まわりの余白を控えめに */
  body.page-entry .entry-date,
  body.page-entry .date,
  body.page-entry time {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  /* スマホ記事ページ：カテゴリタグを小さく・上下を詰める */
  body.page-entry .entry-categories,
  body.page-entry .entry-category,
  body.page-entry .categories,
  body.page-entry .entry-tags,
  body.page-entry .entry-tag {
    gap: 4px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.1 !important;
  }

  body.page-entry .entry-categories a,
  body.page-entry .entry-category a,
  body.page-entry .categories a,
  body.page-entry .entry-tags a,
  body.page-entry .entry-tag a,
  body.page-entry a[rel="tag"] {
    display: inline-block !important;
    font-size: 12px !important;
    line-height: 1.05 !important;
    padding: 5px 12px !important;
    margin: 0 4px 5px 0 !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  /* カテゴリ下から広告までの余白を圧縮 */
  body.page-entry .entry-categories + *,
  body.page-entry .entry-category + *,
  body.page-entry .categories + *,
  body.page-entry .entry-tags + *,
  body.page-entry .entry-tag + * {
    margin-top: 6px !important;
  }

  /* 記事本文上の広告枠まわりの余白を圧縮 */
  body.page-entry .g-ads,
  body.page-entry .g-h-ads {
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* 空の広告枠が余白だけ残す場合は高さを詰める */
  body.page-entry .g-ads:empty,
  body.page-entry .g-h-ads:empty {
    display: none !important;
  }
}
