/* フォント読み込み（全記事共通・本家と同じNoto Sans JP）*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

/* ==============================================
   CryptoGolfClub Blog — Mobile Responsive CSS
   iPhone / スマホ向けレスポンシブスタイル
   全ブログ記事共通で読み込む
   ============================================== */

/* ============================================
   ★ サイトヘッダー（全記事共通・必須）
   このCSSがないとヘッダーが崩れる
   ============================================ */
.site-header {
  background: #fff;
  border-bottom: 2px solid #198754;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  width: 100%;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.02em;
  text-decoration: none;
  color: #333;
}
.logo .c {
  color: #198754;
}
.header-nav {
  display: flex;
  gap: 16px;
  font-size: .85rem;
  font-family: 'Noto Sans JP', sans-serif;
}
.header-nav a {
  color: #555;
  text-decoration: none;
}
.header-nav a:hover {
  color: #198754;
}

/* ============================================
   ★ 横スクロール完全防止（全デバイス共通）
   スマホでズームしても右端が切れない根本対策
   ============================================ */
html {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100%;
  min-width: 0;
}

/* 全要素がviewport幅を超えないよう保証 */
*,
*::before,
*::after {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

/* 画像・動画・iframe は必ず親幅内に収める */
img,
video,
iframe,
embed,
object {
  max-width: 100% !important;
  height: auto;
}

/* テキストの折り返し強制 */
p, li, td, th, span, div, h1, h2, h3, h4, h5, h6 {
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {
  .main-wrap {
    grid-template-columns: 1fr !important;
    padding: 0 10px;
    gap: 16px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
  }

  /* ヘッダー：横幅100%に収める・gap問題を解消 */
  .site-header {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .header-inner {
    padding: 0 12px;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .logo {
    flex-shrink: 0;
    font-size: 1.2rem !important;
    white-space: nowrap;
  }

  .header-nav {
    gap: 8px;
    font-size: .78rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .header-nav a {
    white-space: nowrap;
  }

  .breadcrumb {
    padding: 0 12px;
    font-size: .72rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .article-header {
    padding: 16px 16px 0;
  }

  .article-title {
    font-size: 1.35rem !important;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .article-body {
    padding: 16px 16px;
  }

  .article-body h2 {
    font-size: 1.08rem;
    margin: 24px 0 8px;
  }

  .article-body h3 {
    font-size: .95rem;
  }

  .article-body p {
    font-size: .93rem;
    line-height: 1.8;
    word-break: break-all;
    overflow-wrap: break-word;
  }

  .article-body .lead {
    font-size: .95rem;
    padding: 10px 12px;
    line-height: 1.7;
  }

  .article-body ul {
    margin-left: 16px;
    font-size: .9rem;
  }

  /* テーブルの横スクロール対応 */
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: .82rem;
  }

  .article-body th,
  .article-body td {
    padding: 6px 8px;
    white-space: nowrap;
  }

  .hero-img {
    max-height: 220px;
  }

  .img-caption {
    font-size: .68rem;
    padding: 0 8px;
  }

  .article-img-wrap img {
    max-height: 240px;
  }

  .highlight-box {
    padding: 12px 14px;
    font-size: .9rem;
  }

  .source-note {
    padding: 10px 12px;
    font-size: .75rem;
  }

  .sidebar {
    display: block !important;
    margin-top: 8px;
  }

  .widget {
    padding: 12px;
  }

  .affiliate-box {
    padding: 12px;
  }

  .affiliate-box p {
    font-size: .82rem;
  }

  .site-footer {
    padding: 16px 12px;
    font-size: .72rem;
  }
}

/* --- iPhone / Small mobile (max-width: 480px) --- */
@media (max-width: 480px) {
  /* テーブルを確実に横スクロール可能にする */
  .article-body table,
  table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* インラインスタイルで固定幅が指定されても上書き */
  .article-body * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 横スクロールを引き起こすインライン要素を制御 */
  .article-body pre,
  .article-body code {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .main-wrap {
    padding: 0 6px;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 24px;
  }

  .header-inner {
    padding: 0 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .logo {
    font-size: 1.25rem !important;
  }

  .header-nav {
    gap: 8px;
    font-size: .75rem;
    flex-wrap: wrap;
  }

  .header-nav a {
    white-space: nowrap;
  }

  .breadcrumb {
    padding: 0 10px;
    font-size: .68rem;
    gap: 4px;
  }

  .article-header {
    padding: 12px 14px 0;
  }

  .article-title {
    font-size: 1.2rem !important;
    line-height: 1.5;
    margin-bottom: 8px;
  }

  .article-meta {
    font-size: .72rem;
    gap: 8px;
  }

  .article-body {
    padding: 14px 14px;
  }

  .article-body h2 {
    font-size: 1.02rem;
    margin: 20px 0 8px;
    padding-left: 8px;
  }

  .article-body h3 {
    font-size: .92rem;
    margin: 16px 0 6px;
  }

  .article-body p {
    font-size: .9rem;
    line-height: 1.78;
    margin-bottom: 14px;
    word-break: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .article-body .lead {
    font-size: .9rem;
    padding: 8px 10px;
    line-height: 1.65;
    margin-bottom: 16px;
  }

  .article-body ul {
    margin-left: 14px;
    font-size: .87rem;
  }

  .article-body ul li {
    margin-bottom: 4px;
    line-height: 1.7;
  }

  .article-body table {
    font-size: .78rem;
    margin: 12px 0;
  }

  .article-body th,
  .article-body td {
    padding: 5px 6px;
  }

  .hero-img {
    max-height: 180px;
  }

  .article-img-wrap img {
    max-height: 200px;
  }

  .highlight-box {
    padding: 10px 12px;
    font-size: .87rem;
    margin: 16px 0;
  }

  .highlight-box .box-title {
    font-size: .85rem;
  }

  .source-note {
    padding: 8px 10px;
    font-size: .72rem;
    margin-top: 24px;
  }

  .related-item a {
    font-size: .78rem;
  }

  /* 長いURLやテキストのはみ出し防止 */
  .article-body a {
    word-break: break-all;
  }

  .article-card {
    border-radius: 6px;
  }
}

/* --- 関連記事サムネイル統一 (全画面サイズ・全パターン対応) --- */
.related-item {
  display: flex !important;
  gap: 10px !important;
  padding: 8px 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #F5F5F5 !important;
  align-items: center !important;
}
.related-item:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.ri-thumb {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  background: #F0F8F4 !important;
  overflow: hidden !important;
  text-align: center !important;
}
.ri-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}
.related-item a {
  font-size: .82rem !important;
  line-height: 1.45 !important;
  color: #222 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.related-item a:hover {
  color: #198754 !important;
}

/* --- Very small screens (max-width: 360px) --- */
@media (max-width: 360px) {
  .article-title {
    font-size: 1.1rem !important;
  }

  .article-body p {
    font-size: .87rem;
  }

  .article-body .lead {
    font-size: .87rem;
  }

  .logo {
    font-size: 1.15rem !important;
  }
}

/* ==============================================
   レビュー・口コミ アバター付きカード
   全記事共通（絵文字禁止・SVGアバター必須ルール対応）
   ============================================== */

/* レビューカード（良い口コミ） */
.review-card {
  background: #F8F8F8;
  border-left: 3px solid #198754;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 14px 0;
}

/* レビューカード（悪い口コミ・不満系） */
.review-card-bad {
  background: #FFF5F5;
  border-left: 3px solid #E74C3C;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 14px 0;
}

/* レビューカード（中立・ニュートラル） */
.review-card-neutral {
  background: #F5F5F5;
  border-left: 3px solid #888;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 14px 0;
}

/* アバター + メタ情報 ヘッダー行 */
.review-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.review-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.review-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-name {
  font-size: .82rem;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
}

.review-stars {
  display: flex;
  gap: 2px;
  align-items: center;
}

.review-text {
  font-size: .9rem;
  line-height: 1.78;
  color: #444;
  margin: 0;
}

/* モバイル対応 */
@media (max-width: 480px) {
  .review-card,
  .review-card-bad,
  .review-card-neutral {
    padding: 12px 12px;
  }

  .review-avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .review-name {
    font-size: .78rem;
  }

  .review-text {
    font-size: .87rem;
  }
}

/* ==============================================
   SVGインラインアイコン 共通スタイル
   ============================================== */

/* インラインSVGを文字と並べる時のベースライン調整 */
svg.ic {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
}

/* ボックスタイトル内アイコン */
.box-title svg,
h2 svg,
h3 svg {
  vertical-align: middle;
  margin-right: 6px;
}

/* ==============================================
   ★★★ 画像トリミング「上部優先」ルール（2026-05-26追加）
   人物の顔が切れないよう、全記事画像はobject-position:topを適用
   ============================================== */

/* 記事内ヒーロー画像・セクション画像 */
.hero-img,
.section-img,
.article-img-wrap img,
img[class*="hero"],
img[class*="section"] {
  object-fit: cover !important;
  object-position: top !important;
}

/* サムネイル画像（ブログ一覧・トップページ） */
.ni-thumb img,
.ri-thumb img,
.sp-carousel-img,
.sp-carousel-item img {
  object-fit: cover !important;
  object-position: top !important;
}

/* ニュースフィードのサムネイル */
.news-item img,
.article-thumb img {
  object-fit: cover !important;
  object-position: top !important;
}
