/* =========================================================================
   ろひラボ デザインシステム v1
   出典: 月100万円超のアフィリエイトブログ4サイト(SWELL/JIN:R/SANGO/自作)の
         本番CSS実測値に基づく。数値はすべて計測結果、色はWCAG AA検証済み。
   ========================================================================= */

:root {
  /* --- カラートークン(すべて白文字/黒文字でAA以上を検証済み) --- */
  --c-bg:          #fbfbfc;   /* ページ背景。純白にしない */
  --c-content-bg:  #ffffff;   /* 記事エリアだけ純白で浮かせる */
  --c-text:        #3c4043;   /* 本文(対白 10.3:1) */
  --c-text-sub:    #6b7280;   /* 補足(対白 4.8:1) */
  --c-main:        #1b4965;   /* メイン: ディープブルー(対白 9.2:1) */
  --c-main-dark:   #123449;   /* ソリッドボタンの影用 */
  --c-htag:        #1b3a52;   /* 見出し */
  --c-link:        #0f6fa8;   /* リンク(対白 5.2:1 = AA) */
  --c-accent:      #d53a3a;   /* アクセント: CTA専用(白文字 4.67:1 = AA) */
  --c-accent-dark: #a82c2c;
  --c-border:      #dcdcdc;
  --c-gray-bg:     #f5f6f7;
  --c-star:        #fac225;
  --c-good:        #2e9e5b;   /* メリット */
  --c-bad:         #d24545;   /* デメリット */
  --c-marker:      #fff3a3;
  --c-faq-q:       #d55656;

  /* --- タイポグラフィ --- */
  --fz-body:   17px;
  --lh-body:   1.9;
  --w-content: 740px;

  /* --- 影 --- */
  --sh-box:  0 2px 4px rgba(0,0,0,.05), 0 4px 4px -4px rgba(0,0,0,.1);
  --sh-btn:  0 2px 2px rgba(0,0,0,.1), 0 4px 8px -4px rgba(0,0,0,.2);
  --sh-btn-hover: 0 4px 12px rgba(0,0,0,.1), 0 12px 24px -12px rgba(0,0,0,.2);
  --sh-card: 0 0 4px rgba(0,0,0,.15);
}

/* =========================================================================
   0. テーマ(Cocoon)側の調整
   ファーストビューは「結論+CTA」に使う。記事上のSNSボタンは押し下げ要因なので消す
   ========================================================================= */
.article-header .sns-share.ss-top,
.entry-header .sns-share.ss-top { display: none !important; }

/* 目次はレンダラー側(.rl-toc)が「最初のH2の直前」に出すのでテーマ側は消す(二重表示防止) */
.entry-content > .toc, .article .toc { display: none !important; }

/* 記事タイトルはスマホで大きすぎるので抑える */
.entry-title, .article-title { line-height: 1.45; }
@media (max-width: 767px) { .entry-title, .article-title { font-size: 1.42em; } }

/* =========================================================================
   1. 基礎: タイポグラフィと余白(最重要・これだけで読みやすさの大半が決まる)
   ========================================================================= */
body {
  background: var(--c-bg);
  color: var(--c-text);
  /* Webフォント不使用: 表示速度がCVRに直結するため稼ぐブログは全てシステムフォント */
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", Meiryo, sans-serif;
  font-size: var(--fz-body);
  line-height: var(--lh-body);
  letter-spacing: .02em;
}

.rl-content {
  max-width: var(--w-content);   /* 和文38〜45字/行。800px超は視線の戻りで離脱要因 */
  margin-inline: auto;
  background: var(--c-content-bg);
}

.rl-content p { margin: 0 0 2em; }

.rl-content h2 {
  font-size: 1.45em;
  line-height: 1.4;
  margin: 4.5em 0 1.8em;         /* 上マージンが本文の4.5em ← これが効く */
  padding: .6em .8em;
  color: #fff;
  background: var(--c-main);
  border-radius: 4px;
  font-weight: 700;
}
.rl-content h3 {
  font-size: 1.25em;
  line-height: 1.4;
  margin: 3.2em 0 1.6em;
  padding-left: .7em;
  border-left: 5px solid var(--c-main);
  color: var(--c-htag);
  font-weight: 700;
}
.rl-content h4 {
  font-size: 1.1em;
  line-height: 1.4;
  margin: 2.6em 0 1.4em;
  color: var(--c-htag);
  font-weight: 700;
}
.rl-content h2:first-child, .rl-content h3:first-child { margin-top: 0; }

.rl-content a { color: var(--c-link); text-decoration: underline; text-underline-offset: 3px; }
.rl-content strong { font-weight: 700; color: #22262a; }
.rl-content ul, .rl-content ol { margin: 0 0 2em; padding-left: 1.4em; }
.rl-content li { margin-bottom: .6em; }
.rl-content img { max-width: 100%; height: auto; border-radius: 4px; }

/* マーカー: 下半分だけ塗る蛍光ペン型(細い下線は視認性が低く効果がない) */
.rl-marker {
  background: linear-gradient(transparent 58%, var(--c-marker) 58%);
  font-weight: 700;
}

/* =========================================================================
   2. CTA(最重要の収益パーツ)
   ========================================================================= */
.rl-cta { margin: 3.3rem auto; text-align: center; }

/* ボタン上のマイクロコピー: 心理的障壁を下げる。両脇に飾り罫 */
.rl-cta__micro {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; line-height: 1.5; margin: 0 0 14px;
  color: var(--c-text-sub); font-weight: 700;
}
.rl-cta__micro::before, .rl-cta__micro::after {
  content: ""; width: 21px; height: 1px; background: currentColor;
}
.rl-cta__btn {
  display: block; width: 100%; max-width: 560px; margin: 0 auto;
  min-height: 52px; padding: .95em 1.5em;
  border-radius: 80px;                 /* ピル型 */
  background: var(--c-accent);         /* 白文字で4.67:1 = AA合格 */
  color: #fff !important;
  font-size: 17px; font-weight: 700; text-decoration: none !important;
  box-shadow: var(--sh-btn);
  transition: box-shadow .25s, transform .25s;
}
.rl-cta__btn:hover { box-shadow: var(--sh-btn-hover); transform: translateY(-1px); }
.rl-cta__btn small { display: block; font-size: .74em; font-weight: 400; opacity: .9; margin-top: 3px; }
.rl-cta__note { font-size: 12px; color: #8a8f94; margin: 9px 0 0; }

/* 副CTA: 主CTAと視覚的に階層化する(淡色・影なし)。迷いを消すため */
.rl-cta--sub .rl-cta__btn {
  background: #fff; color: var(--c-main) !important;
  border: 2px solid var(--c-main); box-shadow: none;
}
.rl-cta--sub .rl-cta__btn:hover { background: var(--c-main); color: #fff !important; }

/* 2連ボタン(詳細を見る + 公式サイトへ)。上位41サイトで最も汎用的な型 */
.rl-cta__pair { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.rl-cta__pair .rl-cta__btn { flex: 1 1 0; margin: 0; }
.rl-cta__btn--sub {
  background: #fff !important; color: var(--c-main) !important;
  border: 2px solid var(--c-main); box-shadow: none;
}
@media (max-width: 480px) { .rl-cta__pair { flex-direction: column; } }

/* =========================================================================
   2b. サービス基本情報 / 口コミ / 執筆者クレジット
   ========================================================================= */
.rl-spec { margin: 0 0 2em; border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; background: #fff; }
.rl-spec__title { background: var(--c-main); color: #fff; font-weight: 700; padding: .7em 1em; font-size: .98em; }
.rl-spec__table { width: 100%; border-collapse: collapse; font-size: .93em; }
.rl-spec__table th {
  width: 32%; background: #f6f8fa; text-align: left; font-weight: 700;
  padding: .75em 1em; border-bottom: 1px solid var(--c-border); vertical-align: top;
}
.rl-spec__table td { padding: .75em 1em; border-bottom: 1px solid var(--c-border); line-height: 1.65; }
.rl-spec__table tr:last-child th, .rl-spec__table tr:last-child td { border-bottom: none; }

/* 属性付きの口コミ(統計の直後に生の声を足す) */
.rl-review { margin: 0 0 1.2em; padding: 1.1em 1.2em; border-radius: 6px; border-left: 5px solid; font-size: .95em; }
.rl-review--good { background: #f3f9f5; border-left-color: var(--c-good); }
.rl-review--bad  { background: #fbf5f5; border-left-color: var(--c-bad); }
.rl-review__who { font-size: .82em; font-weight: 700; color: var(--c-text-sub); margin-bottom: .45em; }
.rl-review__text p:last-child { margin-bottom: 0; }

/* 執筆者/監修者(E-E-A-T。実績は必ず数字で) */
.rl-author {
  margin: 0 0 2.5em; padding: 1.2em 1.3em; border-radius: 6px;
  background: #f7f9fb; border: 1px solid var(--c-border); font-size: .93em;
}
.rl-author__head { display: flex; align-items: center; gap: 10px; margin-bottom: .6em; }
.rl-author__role {
  background: var(--c-main); color: #fff; font-size: .78em; font-weight: 700;
  padding: .25em .7em; border-radius: 3px;
}
.rl-author__name { font-weight: 700; font-size: 1.05em; color: var(--c-htag); }
.rl-author__body p:last-child { margin-bottom: 0; }
.rl-author__body { line-height: 1.75; }

/* =========================================================================
   3. ボックス類(装飾は3パターンまでに制限する)
   ========================================================================= */
.rl-box { padding: 1.5em; margin: 0 0 2em; border-radius: 4px; background: #fff; }

/* ① ポイント: 上辺だけ色 */
.rl-box--point { border-top: 3px solid var(--c-main); box-shadow: var(--sh-box); }
/* ② メモ/注釈: 内側に破線 */
.rl-box--note { background: var(--c-gray-bg); color: #5f5a59; position: relative; }
.rl-box--note::before {
  content: ""; position: absolute; inset: 6px;
  border: 1px dashed rgba(199,199,199,.7); border-radius: inherit; pointer-events: none;
}
/* ③ 結論(冒頭に置く「答え」ボックス) */
.rl-box--answer {
  background: #f0f6fa; border: 2px solid var(--c-main); box-shadow: var(--sh-box);
}
.rl-box__title {
  display: block; font-weight: 700; font-size: 1.05em;
  color: var(--c-main); margin-bottom: .7em;
}
.rl-box--answer .rl-box__title::before { content: "✓ "; }
.rl-box p:last-child, .rl-box ul:last-child { margin-bottom: 0; }

/* メリット/デメリットリスト */
.rl-merit, .rl-demerit { list-style: none; padding: 1.3em 1.5em; margin: 0 0 2em; border-radius: 4px; }
.rl-merit  { background: #f0f9f4; border: 1px solid #bfe4cd; }
.rl-demerit{ background: #fdf3f3; border: 1px solid #f0cccc; }
.rl-merit li, .rl-demerit li { position: relative; padding-left: 1.6em; margin-bottom: .6em; }
.rl-merit li::before  { content: "◎"; position: absolute; left: 0; color: var(--c-good); font-weight: 700; }
.rl-demerit li::before{ content: "×"; position: absolute; left: 0; color: var(--c-bad); font-weight: 700; }

/* =========================================================================
   4. 吹き出し(中身は1文まで。長文化すると可読性が落ちる)
   ========================================================================= */
.rl-balloon { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 2em; }
.rl-balloon--right { flex-direction: row-reverse; }
.rl-balloon__icon {
  flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--c-gray-bg); border: 2px solid #ececec;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
}
.rl-balloon__text {
  position: relative; max-width: 560px; padding: 1em 1.2em;
  border: 1px solid var(--c-border); border-radius: 10px;
  background: #fff; line-height: 1.65; font-size: .95em;
}
.rl-balloon__text::before, .rl-balloon__text::after {
  content: ""; position: absolute; top: 18px; border: 9px solid transparent;
}
.rl-balloon__text::before { left: -18px; border-right-color: var(--c-border); }
.rl-balloon__text::after  { left: -16px; border-right-color: #fff; }
.rl-balloon--right .rl-balloon__text::before { left: auto; right: -18px; border-right-color: transparent; border-left-color: var(--c-border); }
.rl-balloon--right .rl-balloon__text::after  { left: auto; right: -16px; border-right-color: transparent; border-left-color: #fff; }
.rl-balloon__text p:last-child { margin-bottom: 0; }

/* =========================================================================
   5. 比較表(SPで崩れると比較記事のCVはゼロになる)
   ========================================================================= */
.rl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 2em; }
.rl-table {
  border-collapse: separate; border-spacing: 0;
  min-width: 560px; width: 100%; font-size: 15px; background: #fff;
}
.rl-table th, .rl-table td {
  padding: 11px 12px; border: 1px solid var(--c-border);
  text-align: center; line-height: 1.6; white-space: normal;
}
.rl-table thead th { background: var(--c-main); color: #fff; font-weight: 700; }
.rl-table tbody th {                    /* 1列目を固定 */
  position: sticky; left: 0; z-index: 1;
  background: #f8f9fa; text-align: left; min-width: 96px; font-weight: 700;
  box-shadow: 2px 0 4px -2px rgba(0,0,0,.15);   /* スクロール可能を示唆 */
}
.rl-table tbody tr:nth-child(even) td { background: #fafbfc; }
.rl-table .is-best { background: #fff8e6 !important; font-weight: 700; }

/* =========================================================================
   6. ランキング / 評価スター
   ========================================================================= */
.rl-rank { counter-reset: rank; list-style: none; padding: 0; margin: 0 0 2em; }
.rl-rank__item {
  position: relative; background: #fff; border: 1px solid var(--c-border);
  border-radius: 6px; padding: 1.6em 1.3em 1.3em; margin-bottom: 1.4em;
  box-shadow: var(--sh-box);
}
.rl-rank__item::before {
  counter-increment: rank; content: counter(rank);
  position: absolute; top: -12px; left: 16px;
  width: 2em; line-height: 2; text-align: center; border-radius: 4px;
  background: #3c3c3c; color: #fff; font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
}
.rl-rank__item:nth-child(1)::before { background-image: linear-gradient(to left top,#f7bf05,#fcea7f,#fcd700,#f7d305,#eaca12,#ac9303,#f7d305,#fcea7f,#f7e705,#eaca12,#f7bf05); color: #6b4e00; }
.rl-rank__item:nth-child(2)::before { background-image: linear-gradient(to left top,#a5a5a5,#e5e5e5,#ae9c9c,#a5a5a5,#7f7f7f,#a5a5a5,#e5e5e5,#a5a5a5); color: #464646; }
.rl-rank__item:nth-child(3)::before { background-image: linear-gradient(to left top,#c46522,#e8b27d,#d07217,#c47222,#b9722e,#834c17,#c47222,#e8b27d,#c48022); color: #4a2a08; }
.rl-rank__name { font-size: 1.15em; font-weight: 700; margin: .2em 0 .5em; color: var(--c-htag); }

.rl-stars { color: var(--c-star); font-size: 1.1em; letter-spacing: 1px; }
.rl-stars__num { color: var(--c-text-sub); font-size: .8em; margin-left: .4em; letter-spacing: 0; }

/* =========================================================================
   7. FAQ(details/summaryベース。JS不要でSEOにも安全)
   ========================================================================= */
.rl-faq { margin: 0 0 2em; }
.rl-faq__item { border: 1px solid var(--c-border); border-radius: 4px; margin-bottom: .6em; background: #fff; }
.rl-faq__q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1em 1.1em; cursor: pointer; font-weight: 700; list-style: none;
  background: var(--c-gray-bg);
}
.rl-faq__q::-webkit-details-marker { display: none; }
.rl-faq__q::before { content: "Q"; color: var(--c-faq-q); font-weight: 700; margin-right: .7em; flex: 0 0 auto; }
.rl-faq__q::after { content: "＋"; color: var(--c-text-sub); flex: 0 0 auto; margin-left: 1em; }
.rl-faq__item[open] .rl-faq__q::after { content: "−"; }
.rl-faq__a { padding: 1.1em; line-height: 1.8; }
.rl-faq__a p:last-child { margin-bottom: 0; }

/* =========================================================================
   8. 内部リンクカード(離脱率対策の主力。稼ぐブログは1記事に数十個使う)
   ========================================================================= */
.rl-linkcard {
  display: block; position: relative; margin: 2.5em auto 2em; padding: 16px;
  border: 1px solid var(--c-border); border-radius: 6px; background: #fff;
  text-decoration: none !important; color: inherit;
  transition: box-shadow .25s, transform .25s;
}
.rl-linkcard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.rl-linkcard__caption {
  position: absolute; top: -.85em; left: 16px; padding: 0 .6em;
  font-size: 11px; line-height: 2; background: #fff; color: var(--c-main);
  border: 1px solid var(--c-border); border-radius: 2px;
}
.rl-linkcard__title { display: block; font-weight: 700; line-height: 1.45; color: var(--c-link); }
.rl-linkcard__excerpt { display: block; font-size: .8em; line-height: 1.5; margin-top: .5em; opacity: .8; color: var(--c-text); }

/* =========================================================================
   9. 目次
   ========================================================================= */
.rl-toc {
  background: #fff; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 1.4em 1.5em; margin: 0 0 3em; box-shadow: var(--sh-box);
}
.rl-toc__title { font-weight: 700; font-size: 1.05em; text-align: center; margin-bottom: .9em; color: var(--c-main); }
.rl-toc ol { counter-reset: toc; list-style: none; padding-left: 0; margin: 0; }
.rl-toc li { counter-increment: toc; margin-bottom: .55em; line-height: 1.5; padding-left: 2em; position: relative; }
.rl-toc li::before {
  content: counter(toc); position: absolute; left: 0; top: .15em;
  width: 1.5em; height: 1.5em; line-height: 1.5em; text-align: center;
  background: var(--c-main); color: #fff; border-radius: 3px; font-size: .78em; font-weight: 700;
}
.rl-toc a { color: var(--c-text); text-decoration: none; }
.rl-toc a:hover { color: var(--c-link); text-decoration: underline; }

/* PR表記 */
.rl-pr { font-size: 12px; color: #8a8f94; margin: 0 0 1.6em; }

/* =========================================================================
   10. モバイル(トラフィックの大半。ここが本番)
   ========================================================================= */
@media (max-width: 767px) {
  body { font-size: 16px; }            /* iOSのフォーム自動ズーム閾値でもある */
  .rl-content { padding-inline: 4vw; }
  .rl-content h2 { font-size: 1.3em; margin-top: 3.2em; }
  .rl-content h3 { font-size: 1.15em; margin-top: 2.6em; }
  .rl-content h4 { font-size: 1.05em; }
  .rl-cta__btn { width: 100%; min-height: 48px; font-size: 16px; }  /* WCAG 2.5.5 / Apple HIG 44pt */
  .rl-table { font-size: 14px; min-width: 480px; }
  .rl-table th, .rl-table td { padding: 8px; }
  .rl-balloon__icon { flex-basis: 46px; width: 46px; height: 46px; font-size: 20px; }
  .rl-box { padding: 1.2em; }
  a, button { min-height: 44px; }
}
