/* ===== 全体レイアウト ===== */
:root {
  --primary: #1a56db;
  --primary-dark: #1241a8;
  --accent: #ff6b35;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --max-width: 1100px;
}
body {
  font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  background: #fff;
}
/* ===== ヘッダー ===== */
.site-header {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 999;
}
.site-title a,
.site-title a:hover {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.4rem;
}
.main-navigation a {
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.main-navigation a:hover {
  color: #fff !important;
}
/* ===== コンテンツ幅 ===== */
.container, .grid-container {
  max-width: var(--max-width);
}
/* ===== 記事ページ：2カラムレイアウト ===== */
.content-area {
  width: 70%;
}
.widget-area {
  width: 28%;
}
/* ===== 記事タイトル ===== */
.entry-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
  border-left: 5px solid var(--primary);
  padding-left: 16px;
  margin-bottom: 20px;
}
/* ===== アイキャッチ画像 ===== */
.post-thumbnail img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}
/* ===== 更新日バッジ ===== */
.entry-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
}
.entry-meta .updated-badge {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
/* ===== 目次（Table of Contents） ===== */
#toc_container {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 28px 0;
}
#toc_container .toc_title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
#toc_container ul li a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.92rem;
}
#toc_container ul li a:hover {
  text-decoration: underline;
}
/* ===== H2見出し ===== */
.entry-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 12px 20px;
  border-radius: 6px;
  margin: 40px 0 20px;
  line-height: 1.4;
}
/* ===== H3見出し ===== */
.entry-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 14px;
  margin: 28px 0 14px;
}
/* ===== H4見出し ===== */
.entry-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px dotted var(--border);
  padding-bottom: 6px;
  margin: 20px 0 10px;
}
/* ===== 比較表（TablePress連携） ===== */
.tablepress {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}
.tablepress thead th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
}
.tablepress tbody tr:nth-child(even) {
  background: #f0f7ff;
}
.tablepress tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.tablepress tbody tr:hover {
  background: #dbeafe;
  transition: background 0.15s;
}
/* ===== おすすめバッジ（1位表示） ===== */
.rank-1-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-left: 8px;
}
/* ===== CTAボタン（アフィリエイトリンク） ===== */
.cta-button {
  display: block;
  width: fit-content;
  margin: 20px auto;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--accent) 0%, #e85d2f 100%);
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none !important;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255,107,53,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,53,0.45);
}
.cta-button::after {
  content: ' →';
}
/* ===== 広告ユニット（記事中・AdSense最適配置） ===== */
.ad-unit-in-content {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin: 32px 0;
  text-align: center;
  position: relative;
}
.ad-unit-in-content::before {
  content: '広告';
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--border);
  color: var(--text-light);
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 10px;
}
/* ===== FAQ セクション ===== */
.faq-section {
  margin: 36px 0;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  background: #f0f7ff;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.97rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.faq-question::before {
  content: 'Q';
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.faq-answer {
  padding: 14px 18px 14px 42px;
  font-size: 0.93rem;
  border-top: 1px solid var(--border);
  line-height: 1.75;
}
.faq-answer::before {
  content: 'A  ';
  color: var(--accent);
  font-weight: 900;
}
/* ===== まとめボックス ===== */
.summary-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 24px 28px;
  margin: 36px 0;
}
.summary-box h3 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: 14px;
  border: none;
  padding: 0;
}
.summary-box ul {
  margin: 0;
  padding-left: 20px;
}
.summary-box ul li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}
/* ===== 著者情報ボックス ===== */
.author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 48px 0 24px;
}
.author-avatar img {
  border-radius: 50%;
  width: 80px;
  height: 80px;
  object-fit: cover;
}
.author-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.author-bio {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.65;
}
/* ===== 関連記事 ===== */
.related-posts {
  margin: 40px 0;
}
.related-posts h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.related-post-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none !important;
  transition: box-shadow 0.2s;
}
.related-post-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.related-post-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.related-post-card .card-title {
  padding: 12px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
/* ===== サイドバー ===== */
.sidebar .widget {
  margin-bottom: 28px;
}
.sidebar .widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
/* ===== サイドバー：人気記事 ===== */
.popular-posts-widget .post-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.popular-posts-widget .post-rank {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* ===== サイドバー：スティッキー広告枠 ===== */
.sidebar-ad-sticky {
  position: sticky;
  top: 80px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
/* ===== パンくずリスト ===== */
.breadcrumb-wrap {
  font-size: 0.82rem;
  color: var(--text-light);
  padding: 10px 0 18px;
}
.breadcrumb-wrap a {
  color: var(--primary);
  text-decoration: none;
}
/* ===== フッター ===== */
.site-footer {
  background: #1f2937;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  padding: 32px 0 16px;
}
.site-footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
}
/* ===================================================
   ヘッダー3層構造（トップバー / メインヘッダー / ナビバー）
   =================================================== */
/* --- Layer 1: トップバー --- */
.top-info-bar {
  background: #0f172a;
  padding: 5px 0;
  font-size: 0.75rem;
  line-height: 1;
}
.top-info-bar .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-info-bar a,
.top-info-bar span {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.15s;
}
.top-info-bar a:hover {
  color: rgba(255,255,255,0.85);
}
.top-info-bar .divider {
  margin: 0 10px;
  opacity: 0.2;
}
.top-info-bar .new-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  margin-right: 10px;
}
.top-info-bar .today-date {
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
}
/* --- Layer 2: メインヘッダー --- */
.site-header {
  background: #1a56db !important;
  box-shadow: 0 2px 12px rgba(26,86,219,0.35) !important;
  padding: 0 !important;
}
.header-main-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
/* ロゴエリア */
.logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.logo-icon-box {
  width: 38px;
  height: 38px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-icon-box svg {
  width: 24px;
  height: 24px;
}
.logo-texts .site-name {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}
.logo-texts .site-tagline {
  display: block;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  margin-top: 3px;
}
/* 検索バー */
.header-search-form {
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
}
.header-search-form input[type="search"] {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border: none;
  border-radius: 50px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.87rem;
  outline: none;
  transition: background 0.2s;
}
.header-search-form input[type="search"]::placeholder {
  color: rgba(255,255,255,0.5);
}
.header-search-form input[type="search"]:focus {
  background: rgba(255,255,255,0.25);
}
.header-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  pointer-events: none;
}
/* ヘッダーCTAボタン */
.header-cta-area {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.header-cta-btn {
  padding: 7px 15px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}
.header-cta-btn:hover {
  transform: translateY(-1px);
}
.header-cta-btn.outline {
  background: transparent;
  color: rgba(255,255,255,0.85) !important;
  border: 1.5px solid rgba(255,255,255,0.35);
}
.header-cta-btn.outline:hover {
  border-color: rgba(255,255,255,0.7);
  color: #fff !important;
}
.header-cta-btn.filled {
  background: #fff;
  color: #1a56db !important;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-cta-btn.filled:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
/* --- Layer 3: ナビゲーションバー（カテゴリー） --- */
.category-nav-bar {
  background: #1241a8;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.category-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav-inner::-webkit-scrollbar {
  display: none;
}
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 11px 14px;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  text-decoration: none !important;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
  flex-shrink: 0;
}
.cat-nav-item:hover {
  color: #fff;
}
.cat-nav-item.current-cat,
.cat-nav-item.current-menu-item {
  color: #fff;
  font-weight: 700;
}
.cat-nav-item.current-cat::after,
.cat-nav-item.current-menu-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 3px;
  background: #ff6b35;
  border-radius: 3px 3px 0 0;
}
.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-dot.vpn       { background: #60a5fa; }
.cat-dot.saas      { background: #34d399; }
.cat-dot.ai-tools  { background: #fbbf24; }
.cat-dot.hosting   { background: #a78bfa; }
.cat-dot.security  { background: #f87171; }
.cat-dot.ranking   { background: #94a3b8; }
.cat-new-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: #ff6b35;
  color: #fff;
  margin-left: 2px;
}
.cat-count-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  margin-left: 1px;
}
/* ===== カテゴリーカードグリッド（トップページ） ===== */
.cat-cards-section {
  padding: 28px 0;
}
.cat-cards-section .section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-card-item {
  display: block;
  text-decoration: none !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 10px 14px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: #fff;
}
.cat-card-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(26,86,219,0.1);
  transform: translateY(-2px);
}
.cat-card-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: block;
}
.cat-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.cat-card-count {
  font-size: 0.72rem;
  color: var(--text-light);
  display: block;
}
/* カテゴリー別アクセントカラー（カードホバー時） */
.cat-card-item[data-cat="vpn"]:hover       { border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.cat-card-item[data-cat="saas"]:hover      { border-color: #10b981; box-shadow: 0 4px 12px rgba(16,185,129,0.15); }
.cat-card-item[data-cat="ai-tools"]:hover  { border-color: #f59e0b; box-shadow: 0 4px 12px rgba(245,158,11,0.15); }
.cat-card-item[data-cat="hosting"]:hover   { border-color: #8b5cf6; box-shadow: 0 4px 12px rgba(139,92,246,0.15); }
.cat-card-item[data-cat="security"]:hover  { border-color: #ef4444; box-shadow: 0 4px 12px rgba(239,68,68,0.15); }
.cat-card-item[data-cat="ranking"]:hover   { border-color: #64748b; box-shadow: 0 4px 12px rgba(100,116,139,0.15); }
/* ===== カテゴリーバッジ（記事ヘッダー内） ===== */
.article-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none !important;
  margin-bottom: 10px;
}
.article-cat-badge.vpn       { background: #dbeafe; color: #1241a8; }
.article-cat-badge.saas      { background: #d1fae5; color: #065f46; }
.article-cat-badge.ai-tools  { background: #fef3c7; color: #92400e; }
.article-cat-badge.hosting   { background: #ede9fe; color: #4c1d95; }
.article-cat-badge.security  { background: #fee2e2; color: #991b1b; }
.article-cat-badge.ranking   { background: #f1f5f9; color: #334155; }
/* ===== モバイル対応 ===== */

/* ===================================================
   モバイル最適化 改善版（2026-03-23）
   =================================================== */

/* --- 768px以下：タブレット/スマホ共通 --- */
@media (max-width: 768px) {
  /* トップバーを非表示（スペース節約） */
  .top-info-bar { display: none; }

  /* メインヘッダー調整 */
  .header-main-inner {
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  /* ロゴ縮小 */
  .logo-icon-box { width: 32px; height: 32px; }
  .logo-icon-box svg { width: 20px; height: 20px; }
  .logo-texts .site-name { font-size: 1.05rem; }
  .logo-texts .site-tagline { display: none; }

  /* 検索バー：モバイルでは幅を絞る */
  .header-search-form {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
  }
  .header-search-form input[type="search"] {
    padding: 7px 12px 7px 32px;
    font-size: 0.82rem;
  }

  /* CTAボタン */
  .header-cta-btn.outline { display: none; }
  .header-cta-btn.filled {
    padding: 6px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* カテゴリーナビ */
  .category-nav-inner { padding: 0 8px; }
  .cat-nav-item { padding: 9px 10px; font-size: 0.8rem; }
  .cat-count-label { display: none; }

  /* コンテンツ幅 */
  .content-area, .widget-area { width: 100% !important; }

  /* 記事タイトル */
  .entry-title { font-size: 1.3rem; padding-left: 12px; }
  .entry-content h2 { font-size: 1.15rem; padding: 10px 14px; }
  .entry-content h3 { font-size: 1.05rem; }

  /* 比較表 */
  .tablepress { font-size: 0.82rem; }
  .tablepress thead th, .tablepress tbody td { padding: 8px 10px; }

  /* CTAボタン（本文内） */
  .cta-button { width: 100%; box-sizing: border-box; }

  /* 関連記事 */
  .related-posts-grid { grid-template-columns: 1fr; }

  /* 著者ボックス */
  .author-box { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .author-avatar img { width: 64px; height: 64px; }

  /* カテゴリーカード */
  .cat-cards-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-card-item { padding: 12px 6px; }
  .cat-card-icon { font-size: 1.4rem; }
  .cat-card-name { font-size: 0.76rem; }

  /* FAQボックス */
  .faq-question { font-size: 0.92rem; }
  .faq-answer { padding: 12px 14px 12px 14px; font-size: 0.9rem; }

  /* まとめボックス */
  .summary-box { padding: 16px 18px; }
}

/* --- 480px以下：スマートフォン専用 --- */
@media (max-width: 480px) {
  /* ヘッダーで検索を非表示 → ロゴとCTAのみ */
  .header-search-form { display: none; }
  .header-cta-btn.filled {
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  /* カテゴリーカード 2列 */
  .cat-cards-grid { grid-template-columns: repeat(2, 1fr); }

  /* タイトル */
  .entry-title { font-size: 1.2rem; }

  /* フォント調整 */
  body { font-size: 15px; }
  .entry-content p { line-height: 1.75; }

  /* テーブルスクロール */
  .tablepress-table-wrapper, .entry-content table {
    overflow-x: auto;
    display: block;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .tablepress {
    min-width: 480px;
  }

  /* まとめボックス */
  .summary-box { padding: 14px 14px; margin: 24px 0; }
  .summary-box h3 { font-size: 1rem; }
}

/* --- GeneratePress 固有レイアウト対応 --- */
@media (max-width: 768px) {
  /* GeneratePressのデフォルトナビを完全に非表示 */
  .main-navigation { display: none !important; }

  /* サイドバーをコンテンツ下に */
  .generate-columns-wrapper {
    display: block !important;
  }
  .generate-columns-wrapper .widget-area {
    width: 100% !important;
    margin-top: 32px;
  }

  /* ページパディング */
  .grid-container { padding: 0 12px; }
}
