/* =========================================================
   デスクギアラボ 共通スタイル
   - 在宅ワーク／デスク環境ガジェットのレビュー・比較サイト
   - 静的HTML/CSS。全ページでこの1枚を読み込む。
   ========================================================= */

/* ---------- デザイントークン ---------- */
:root {
  /* カラー */
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e6e9ef;
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --brand-soft: #eaf1ff;
  --accent: #ff7a00;      /* 購入CTA */
  --accent-dark: #e56b00;
  --star: #f5a623;
  --good: #16a34a;
  --good-soft: #eafaf0;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --navy: #0f172a;
  --navy-soft: #1e293b;

  /* 形状 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, .08);
  --container: 1100px;

  /* タイポ */
  --font: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", "BIZ UDPGothic", Meiryo, system-ui, sans-serif;
}

/* ---------- ベース ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- 上部の広告表記バー（ステマ規制対応） ---------- */
.promo-bar {
  background: var(--navy);
  color: #cbd5e1;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  letter-spacing: .02em;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 20px;
  color: var(--navy);
  letter-spacing: .01em;
}
.logo:hover { text-decoration: none; }
.logo .logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 900;
}
.logo .logo-sub { color: var(--brand); }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  width: 42px; height: 42px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

/* ---------- ヒーロー ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, #dbe7ff 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.hero .container { padding-block: 56px 48px; }
.hero h1 {
  font-size: clamp(26px, 4.5vw, 42px);
  line-height: 1.35;
  margin: 0 0 16px;
  color: var(--navy);
  letter-spacing: .01em;
}
.hero h1 .hl {
  background: linear-gradient(transparent 62%, #ffe08a 62%);
  padding-inline: 2px;
}
.hero p.lead {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 0 26px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 汎用セクション ---------- */
.section { padding-block: 52px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 26px; flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 0; color: var(--navy);
  position: relative; padding-left: 16px;
}
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: .15em; bottom: .15em;
  width: 6px; border-radius: 4px;
  background: linear-gradient(var(--brand), #7c3aed);
}
.section-head .more { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* 購入CTA（アフィリエイト） */
.btn-buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px;
  font-weight: 800; font-size: 16px; color: #fff;
  padding: 15px 20px; border-radius: 12px;
  background: linear-gradient(180deg, #ff9330, var(--accent));
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: transform .05s ease, box-shadow .1s ease;
}
.btn-buy:hover { text-decoration: none; filter: brightness(1.03); }
.btn-buy:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn-buy.rakuten { background: linear-gradient(180deg, #f2545b, #bf0000); box-shadow: 0 4px 0 #8f0000; }
.buy-group { display: grid; gap: 10px; margin: 14px 0; }

/* ---------- カテゴリチップ ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip .emoji { font-size: 16px; }

/* ---------- 記事カードグリッド ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .2s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.article-card .thumb {
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; text-align: center;
  padding: 16px; position: relative;
}
.article-card .thumb .cat-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(15, 23, 42, .78); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.article-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card h3 { margin: 0; font-size: 17px; line-height: 1.5; color: var(--navy); }
.article-card .excerpt { font-size: 13.5px; color: var(--text-muted); margin: 0; }
.article-card .meta { margin-top: auto; font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; }

/* 横長カード（記事一覧のピックアップ用） */
.article-card.wide { display: grid; grid-template-columns: 280px 1fr; }
.article-card.wide .thumb { aspect-ratio: auto; min-height: 170px; height: 100%; }

/* サムネのグラデ（画像未設定時のプレースホルダ） */
.g-blue { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.g-violet { background: linear-gradient(135deg, #7c3aed, #db2777); }
.g-green { background: linear-gradient(135deg, #059669, #10b981); }
.g-orange { background: linear-gradient(135deg, #f97316, #f43f5e); }
.g-slate { background: linear-gradient(135deg, #334155, #64748b); }

/* ---------- 星評価 ---------- */
.stars { --pct: 100%; display: inline-block; position: relative; font-size: 17px; line-height: 1; white-space: nowrap; }
.stars::before { content: "★★★★★"; color: #e2e6ee; letter-spacing: 2px; }
.stars::after {
  content: "★★★★★"; color: var(--star); letter-spacing: 2px;
  position: absolute; left: 0; top: 0; width: var(--pct); overflow: hidden;
}
.rating-num { font-weight: 800; color: var(--navy); margin-left: 6px; }

/* ---------- ランキング ---------- */
.rank-list { display: grid; gap: 20px; }
.rank-item {
  position: relative;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px; display: grid;
  grid-template-columns: 220px 1fr; gap: 22px;
}
.rank-item .rank-badge {
  position: absolute; top: -12px; left: -12px;
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 20px;
  box-shadow: var(--shadow-md);
  background: var(--brand);
}
.rank-item:nth-child(1) .rank-badge { background: linear-gradient(135deg, #f5a623, #e08600); }
.rank-item:nth-child(2) .rank-badge { background: linear-gradient(135deg, #9aa6b2, #6b7683); }
.rank-item:nth-child(3) .rank-badge { background: linear-gradient(135deg, #c58b4e, #a06a2c); }
.rank-item .r-thumb {
  border-radius: 10px; aspect-ratio: 4/3; display: grid; place-items: center;
  color: #fff; font-weight: 800; text-align: center; padding: 12px; font-size: 14px;
}
.rank-item .r-main h3 { margin: 4px 0 6px; font-size: 20px; color: var(--navy); }
.rank-item .r-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rank-item .r-desc { font-size: 14.5px; color: var(--text); margin: 0 0 12px; }
.spec-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.spec-mini span {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--text-muted);
}
.spec-mini b { color: var(--navy); }

/* ---------- メリット / デメリット ---------- */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.pc-box { border-radius: 12px; padding: 16px 18px; border: 1px solid var(--border); }
.pc-box h4 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pc-box ul { margin: 0; padding-left: 20px; }
.pc-box li { font-size: 14px; margin-bottom: 6px; }
.pc-pros { background: var(--good-soft); border-color: #bfe8cd; }
.pc-pros h4 { color: var(--good); }
.pc-cons { background: #fdecec; border-color: #f3c6c6; }
.pc-cons h4 { color: var(--bad); }

/* ---------- 比較表 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--border); }
table.compare {
  width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; font-size: 14px;
}
table.compare th, table.compare td { padding: 12px 14px; text-align: center; border-bottom: 1px solid var(--border); }
table.compare thead th { background: var(--navy); color: #fff; font-weight: 700; position: sticky; top: 0; }
table.compare tbody th { background: var(--bg-soft); text-align: left; font-weight: 700; color: var(--navy); white-space: nowrap; }
table.compare tbody tr:hover td { background: #fafbfe; }
table.compare .best { color: var(--brand); font-weight: 800; }

/* ---------- 記事本文 ---------- */
.article-wrap { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 40px; align-items: start; }
.article-body { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow-sm); }
.article-body > *:first-child { margin-top: 0; }
.article-header h1 { font-size: clamp(24px, 3.6vw, 34px); line-height: 1.45; color: var(--navy); margin: 8px 0 14px; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.article-body h2 {
  font-size: 23px; color: var(--navy); margin: 40px 0 16px; padding: 10px 0 10px 16px;
  border-left: 6px solid var(--brand); background: linear-gradient(90deg, var(--brand-soft), transparent);
  border-radius: 0 8px 8px 0;
}
.article-body h3 { font-size: 19px; color: var(--navy); margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px dotted var(--border); }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body img { border-radius: 10px; margin: 8px 0 20px; }

/* 目次 */
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin: 24px 0 30px; }
.toc .toc-title { font-weight: 800; color: var(--navy); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc a { color: var(--text); font-weight: 600; }

/* コールアウト */
.callout { border-radius: 12px; padding: 16px 18px; margin: 20px 0; border: 1px solid var(--border); background: var(--bg-soft); font-size: 14.5px; }
.callout.point { background: #fff8e6; border-color: #f5e2a8; }
.callout.point b { color: #b7791f; }
.callout .callout-title { font-weight: 800; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }

/* 商品カード（記事内） */
.product { border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 24px 0; background: #fff; box-shadow: var(--shadow-sm); }
.product .p-top { display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center; }
.product .p-thumb { aspect-ratio: 1/1; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; text-align: center; padding: 10px; font-size: 13px; }
.product h4 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.product .p-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.aff-note { font-size: 11.5px; color: var(--text-muted); text-align: center; margin: 6px 0 0; }

/* サイドバー */
.sidebar { display: grid; gap: 24px; position: sticky; top: 84px; }
.widget { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.widget h3 { margin: 0 0 14px; font-size: 16px; color: var(--navy); padding-left: 12px; border-left: 4px solid var(--brand); }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.widget li:last-child { border-bottom: 0; }

/* パンくず */
.breadcrumb { font-size: 13px; color: var(--text-muted); padding-block: 16px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { margin: 0 6px; }

/* ---------- CTAバナー ---------- */
.cta-band { background: linear-gradient(135deg, var(--navy), #1e3a8a); color: #fff; border-radius: 18px; padding: 40px; text-align: center; }
.cta-band h2 { margin: 0 0 10px; font-size: 26px; }
.cta-band p { margin: 0 0 22px; color: #cbd5e1; }

/* ---------- フッター ---------- */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: 60px; }
.site-footer .container { padding-block: 48px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer .logo { color: #fff; margin-bottom: 12px; }
.site-footer p { font-size: 13.5px; color: #94a3b8; margin: 0 0 8px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #cbd5e1; font-size: 13.5px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #23324a; margin-top: 32px; padding-top: 20px; text-align: center; font-size: 12.5px; color: #7e8ba3; }

/* ---------- ユーティリティ ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.new { background: #fee2e2; color: #b91c1c; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .article-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav { position: fixed; inset: 64px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch;
         padding: 8px 16px 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
         transform: translateY(-140%); transition: transform .25s ease; }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 12px; border-radius: 8px; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .rank-item { grid-template-columns: 1fr; }
  .article-card.wide { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
  .product .p-top { grid-template-columns: 1fr; text-align: center; }
  .product .p-thumb { max-width: 200px; margin-inline: auto; }
  .article-body { padding: 22px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
}
