/* ============================================
   貴金属買取研究所 — メインスタイルシート
   Mobile-first / SEO重視 / アフィリエイト最適化
   ============================================ */

/* === カスタムプロパティ === */
:root {
  --gold:        #c9a227;
  --gold-light:  #fdf6e3;
  --gold-dark:   #9a7c1a;
  --danger:      #c0392b;
  --danger-light:#fef0ef;
  --success:     #27ae60;
  --success-light:#edfaf1;
  --text:        #1e1e1e;
  --text-muted:  #666;
  --bg:          #f8f7f4;
  --white:       #ffffff;
  --border:      #e0ddd5;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
  --shadow:      0 3px 12px rgba(0,0,0,.10);
  --radius:      8px;
  --radius-lg:   14px;
  --font:        'Hiragino Kaku Gothic ProN','Hiragino Sans','Meiryo',sans-serif;
  --max-w:       1080px;
  --sidebar-w:   280px;
}

/* === リセット === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5em; }

/* === ベース === */
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   ヘッダー
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

.site-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-dark);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .875rem;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--gold-dark); text-decoration: none; }
.nav-cta {
  background: var(--gold);
  color: var(--white) !important;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
}
.nav-cta:hover { background: var(--gold-dark); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s;
}

/* ============================================
   レイアウト
   ============================================ */
.layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-top: 32px;
  padding-bottom: 56px;
}
main { flex: 1; min-width: 0; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; }

/* ============================================
   記事共通
   ============================================ */
article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding: .6rem 1rem;
  border-left: 4px solid var(--gold);
  background: var(--gold-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.4;
}
article h2:first-child { margin-top: 0; }

article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.2rem 0 .4rem;
  color: var(--gold-dark);
}

article p { margin-bottom: .85rem; }

/* メタ情報 */
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: .8rem;
  color: var(--text-muted);
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}
.tag--warning { background: #fff3cd; color: #856404; }
.tag--gold    { background: var(--gold-light); color: var(--gold-dark); }
.update-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--text);
}

/* リード */
.lead-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  font-size: 1.0rem;
}
.lead-box p:last-child { margin-bottom: 0; }

/* ============================================
   目次
   ============================================ */
.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 36px;
}
.toc-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: .9rem;
}
.toc ol { padding-left: 1.4em; }
.toc li { margin: .35rem 0; font-size: .92rem; }
.toc a { color: var(--gold-dark); }

/* ============================================
   失敗事例カード
   ============================================ */
.failure-case {
  background: var(--danger-light);
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.failure-label {
  font-weight: 700;
  color: var(--danger);
  font-size: .85rem;
  margin-bottom: 4px !important;
}
.failure-case h3 {
  font-size: 1rem;
  color: var(--danger);
  margin: 4px 0 8px;
}
.failure-case p:last-child { margin-bottom: 0; }

/* ============================================
   落とし穴
   ============================================ */
.pitfall-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 14px 0;
  position: relative;
}
.pitfall-num {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 6px !important;
}

/* ============================================
   テーブル
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .9rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table thead { background: var(--gold); }
.data-table th { color: var(--white); padding: 10px 14px; text-align: left; font-weight: 700; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--gold-light); }

/* ============================================
   ヒントボックス
   ============================================ */
.tip-box {
  background: var(--gold-light);
  border: 1px solid #ead89a;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.tip-title { font-weight: 700; margin-bottom: 6px !important; }

/* ============================================
   チェックリスト
   ============================================ */
.checklist {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.check-item {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: .94rem;
}
.check-item:last-child { border-bottom: none; }
.check-item--ok { color: var(--success); }
.check-item--ng { color: var(--danger); }

/* ============================================
   コツリスト
   ============================================ */
.tips-list {
  list-style: none;
  padding: 0;
  counter-reset: tips;
}
.tips-list li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px 16px 60px;
  margin: 12px 0;
  position: relative;
  counter-increment: tips;
}
.tips-list li::before {
  content: counter(tips);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}
.tips-list li h3 { margin: 0 0 4px; font-size: 1rem; }
.tips-list li p  { margin: 0; font-size: .9rem; color: var(--text-muted); }

/* ============================================
   税金セクション
   ============================================ */
.tax-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 14px 0;
}
.tax-block h3 { color: var(--text); font-size: 1rem; margin-bottom: 8px; }
.formula {
  background: #f0f0f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 10px;
  font-family: monospace;
  font-size: .9rem;
}
.formula p:last-child { margin: 0; }
.formula-note { font-size: .8rem; color: var(--text-muted); margin-top: 6px; font-family: var(--font); }
.tax-points { padding-left: 1.5em; }
.tax-points li { margin: 6px 0; font-size: .92rem; }

/* ============================================
   警告ボックス
   ============================================ */
.warning-box {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .85rem;
  color: #5c4200;
  margin: 16px 0;
}
.warning-box p { margin: 0; }

/* ============================================
   CTA
   ============================================ */
.cta-box {
  background: var(--success-light);
  border: 1px solid #b2dfdb;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 24px 0;
  text-align: center;
}
.cta-box p { margin-bottom: 12px; }
.cta-box p:last-child { margin-bottom: 0; }
.cta-box--gold { background: var(--gold-light); border-color: #ead89a; }

.final-cta {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-top: 36px;
  text-align: center;
}
.final-cta-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.final-cta p { margin-bottom: 20px; opacity: .9; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s, transform .1s;
  cursor: pointer;
  border: none;
}
.btn--primary {
  background: var(--gold);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--gold-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.final-cta .btn--primary {
  background: var(--white);
  color: var(--gold-dark);
  font-size: 1rem;
}
.final-cta .btn--primary:hover { background: #f5f5f5; }
.btn--large { padding: 14px 32px; font-size: 1.05rem; }

/* ============================================
   FAQ
   ============================================ */
.faq-section { margin-top: 2rem; }

.faq-list { margin-top: 16px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 16px 48px 16px 18px;
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text);
  position: relative;
  line-height: 1.5;
}
.faq-question::after {
  content: '＋';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--gold);
  transition: transform .2s;
}
.faq-question[aria-expanded="true"]::after {
  content: '−';
}
.faq-question:hover { background: var(--gold-light); }

.faq-answer {
  padding: 0 18px 16px;
  font-size: .92rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.faq-answer p { margin: 12px 0 0; }

/* ============================================
   サイドバー
   ============================================ */
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.widget-title {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-widget--sticky {
  position: sticky;
  top: 72px;
}

.ranking-list {
  padding-left: 1.4em;
  font-size: .88rem;
}
.ranking-list li { margin: 8px 0; }
.ranking-list a { color: var(--gold-dark); }

.price-display { font-size: .9rem; }
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.price-row:last-of-type { border-bottom: none; }
.price-label { color: var(--text-muted); }
.price-value { font-weight: 700; color: var(--gold-dark); }
.price-note { font-size: .75rem; color: var(--text-muted); margin-top: 8px; }

.related-list {
  list-style: none;
  padding: 0;
  font-size: .87rem;
}
.related-list li { border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list a {
  display: block;
  padding: 8px 0;
  color: var(--gold-dark);
  line-height: 1.4;
}

/* ============================================
   フッター
   ============================================ */
.site-footer {
  background: #2c2c2c;
  color: #aaa;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: .8rem;
}
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-nav a { color: #aaa; }
.footer-nav a:hover { color: var(--white); text-decoration: none; }

/* ============================================
   セクション共通
   ============================================ */
section { margin-bottom: 8px; }

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    gap: 24px;
  }
  .sidebar {
    width: 100%;
  }
  .sidebar-widget--sticky {
    position: static;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .site-nav a:last-child { border-bottom: none; }
  .hamburger { display: flex; }

  h1 { font-size: 1.35rem; }
  article h2 { font-size: 1.15rem; }

  .data-table { font-size: .82rem; }
  .data-table th, .data-table td { padding: 8px 10px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .tips-list li { padding-left: 50px; }
  .final-cta { padding: 24px 16px; }
}
