/* =============================================================================
 * /idea/css/article.css
 * 記事ページ (idea/surprise/sXXXX.php 等) 共通スタイル
 * すべてのセレクタは .article-page 配下にスコープしてあり、
 * サイト全体の他CSSと衝突しない。
 * ========================================================================== */

/* 固定ヘッダーの実効高さを JS が実測してこの変数に入れる
   フォールバック値は 212px (ヘッダー実視覚高さ ~182 + 余白30) */
:root { --site-header-h: 212px; }
html { scroll-padding-top: var(--site-header-h); }

.article-page *, .article-page *::before, .article-page *::after { box-sizing: border-box; }

.article-page {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  background: #f7f7f7;
}

/* ===== PAGE WRAPPER ===== */
.article-page .page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  /* 上部余白は固定ヘッダー高さに連動 */
  padding: var(--site-header-h) 20px 60px;
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto 1fr;
  gap: 0 36px;
}

.article-page .article-header {
  grid-column: 1 / -1;
  margin-bottom: 32px;
}

/* ===== BREADCRUMB ===== */
.article-page .article-breadcrumb {
  margin: 0 0 12px;
  padding: 0;
}
.article-page .article-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: #777;
}
.article-page .article-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-page .article-breadcrumb li:not(:last-child)::after {
  content: "›";
  color: #bbb;
  font-size: 13px;
  line-height: 1;
}
.article-page .article-breadcrumb a {
  color: #555;
  text-decoration: none;
  transition: color .15s;
}
.article-page .article-breadcrumb a:hover {
  color: #c00;
  text-decoration: underline;
}
.article-page .article-breadcrumb li[aria-current="page"] {
  color: #c00;
  font-weight: bold;
}

/* ===== EYECATCH ===== */
.article-page .eyecatch {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
  border-radius: 6px 6px 0 0;
}

/* ===== TITLE BLOCK ===== */
.article-page .title-block {
  background: #fff;
  border-radius: 0 0 6px 6px;
  padding: 24px 28px 20px;
  border: 1px solid #e0e0e0;
  border-top: none;
}
.article-page .cat-badge {
  display: inline-block;
  background: #c00;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 12px;
}
.article-page .title-block h1 {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 900;
  color: #111;
  line-height: 1.5;
  margin-bottom: 14px;
}
.article-page .article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #888;
}
.article-page .article-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.article-page .meta-dot {
  width: 7px; height: 7px;
  background: #c00;
  border-radius: 50%;
  display: inline-block;
}

/* ===== MAIN BODY ===== */
.article-page .article-body {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  padding: 36px 32px 40px;
  min-width: 0;
}

/* リード文 */
.article-page .article-lead {
  background: linear-gradient(135deg, #fffaf3 0%, #fff 72%);
  border: 1px solid #efd8b7;
  border-radius: 8px;
  padding: 32px 28px 24px;
  margin: 14px 0 40px;
  font-size: 15px;
  line-height: 2;
  color: #3f3f3f;
  position: relative;
  box-shadow: 0 8px 22px rgba(0,0,0,.035);
}
.article-page .article-lead::before {
  content: "はじめに";
  position: absolute;
  left: -1px;
  top: -17px;
  display: inline-flex;
  align-items: center;
  background: #f0a500;
  border-left: solid 5px #f6c65e;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 10px 14px 10px 20px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0;
  min-height: 28px;
}

/* H2 */
.article-page .article-body h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: visible;
  background: transparent;
  color: #111;
  padding: 0 0 0px;
  margin: 46px 0 22px;
  border-radius: 0;
  border-bottom: 1px solid #dcdcdc;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.5;
}
.article-page .article-body h2:first-of-type { margin-top: 0; }
.article-page .article-body h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 110px;
  height: 3px;
  background: #c00;
}
.article-page .article-body h2 .h2-num {
  flex-shrink: 0;
  background: #c00;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  width: 48px;
  height: 48px;
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.article-page .article-body h2 .h2-text { padding: 0; flex: 1; }

/* H3 */
.article-page .article-body h3 {
  font-size: 15px;
  font-weight: bold;
  color: #222;
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #ddd;
}

/* 段落 */
.article-page .article-body p {
  color: #444;
  line-height: 1.9;
  margin-bottom: 16px;
}

/* チェックリスト */
.article-page .check-list { list-style: none; padding: 0; margin: 0 0 20px; }
.article-page .check-list li {
  padding: 7px 0 7px 26px;
  position: relative;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  font-size: 14px;
  line-height: 1.7;
}
.article-page .check-list li:last-child { border-bottom: none; }
.article-page .check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #c00;
  font-weight: bold;
  font-size: 13px;
}

/* 注意ボックス */
.article-page .caution-box {
  display: grid;
  grid-template-columns: 116px 1fr;
  align-items: stretch;
  background: #fffaf0;
  border-radius: 8px;
  margin: 0 0 22px;
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  overflow: hidden;
}
.article-page .caution-box-label {
  background: #fff3d4;
  color: #f0a500;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.article-page .caution-line-icon { width: 46px; height: 46px; flex-shrink: 0; }
.article-page .caution-line-icon path,
.article-page .caution-line-icon line {
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.article-page .caution-box-body { padding: 18px 20px; color: #5b4a22; }
.article-page .caution-box strong { color: #f0a500; font-weight: bold; }

/* 商品カード */
.article-page .product-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 20px;
}
.article-page .product-card {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  column-gap: 14px;
  align-items: stretch;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  background:
    linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, .3)),
    url(https://agereru.com/images/bg_00001.jpg) center / cover no-repeat,
    #fff;
  box-shadow: 3px 3px 4px rgba(0, 0, 0, .3);
  transition: box-shadow .2s, transform .2s;
}
.article-page .product-card:hover {
  box-shadow: 4px 4px 6px rgba(0, 0, 0, .38);
  transform: translateY(-1px);
}

/* 左カラム：画像 */
.article-page .product-card-image {
  grid-column: 1;
  width: 120px;
  height: 100%;
  min-height: 120px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
}
.article-page .product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 右カラム：タイトル・説明・ボタンを縦に並べる */
.article-page .product-card-body {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

/* （旧 product-card-icon は廃止。安全のため非表示） */
.article-page .product-card-icon {
  display: none;
}
.article-page .product-card-icon-legacy-placeholder {
  /* 念のための無効化ブロック。実害なし */
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.article-page .product-card-name {
  font-size: 14px;
  font-weight: bold;
  color: #222;
  line-height: 1.45;
  margin: 0;
}
.article-page .product-card-desc {
  flex: 1;
  font-size: 12px;
  color: #333;
  line-height: 1.6;
  margin: 0;
}
.article-page .product-card-btn {
  display: block;
  background: #c00;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 0;
  border-radius: 3px;
  transition: background .2s, transform .15s;
  align-self: stretch;
}
.article-page .product-card-btn:hover {
  background: #a40000;
}

/* FAQ */
.article-page .faq-list { margin: 0 0 20px; }
.article-page .faq-item {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.article-page .faq-q {
  background: #f5f5f5;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 14px;
  color: #222;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.article-page .faq-q-icon {
  flex-shrink: 0;
  background: #c00;
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}
.article-page .faq-a {
  padding: 12px 16px 12px 48px;
  font-size: 14px;
  color: #555;
  line-height: 1.8;
  background: #fff;
  position: relative;
}
.article-page .faq-a-icon {
  position: absolute;
  left: 16px; top: 12px;
  background: #333;
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}

/* 内部リンク */
.article-page .related-links {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 18px 22px;
  margin: 36px 0 0;
}
.article-page .related-links-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: bold;
  color: #666;
  margin-bottom: 12px;
}
.article-page .related-links-icon { width: 28px; height: 28px; color: #c00; flex-shrink: 0; }
.article-page .related-links-icon path,
.article-page .related-links-icon line {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.article-page .related-links ul { list-style: none; padding: 0; }
.article-page .related-links li { border-bottom: 1px solid #e0e0e0; }
.article-page .related-links li:last-child { border-bottom: none; }
.article-page .related-links a {
  display: block;
  padding: 9px 0 9px 15px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
  position: relative;
  transition: color .2s;
}
.article-page .related-links a::before {
  content: "›";
  position: absolute;
  left: 0;
  color: #c00;
  font-weight: bold;
}
.article-page .related-links a:hover { color: #c00; }

/* 関連リンク：画像+タイトルの3ブロック横並び（.related-links-grid 使用時） */
.article-page .related-links ul.related-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.article-page .related-links ul.related-links-grid li {
  border-bottom: none;       /* 既存ul liのアンダーラインを無効化 */
  padding: 0;
  margin: 0;
}
.article-page .related-links ul.related-links-grid li a {
  display: block;
  padding: 0;                /* 既存ul li aの padding を上書き */
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  color: #222;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, color .15s;
}
.article-page .related-links ul.related-links-grid li a::before {
  display: none;             /* 既存の「›」プレフィックスを非表示 */
}
.article-page .related-links ul.related-links-grid li a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
  color: #c00;
}
.article-page .related-link-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f5f5f5;
}
.article-page .related-link-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-page .related-link-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}
/* タイトル先頭の「赤丸＋白い右三角」アイコン */
.article-page .related-link-title::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #c00;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M4.5 3 L9 6 L4.5 9 Z' fill='white'/></svg>");
  background-repeat: no-repeat;
  background-position: 55% center;
  background-size: 60% 60%;
}

/* ===== SIDEBAR ===== */
.article-page .article-sidebar { position: relative; }
.article-page .sidebar-inner {
  position: sticky;
  /* JSで実測した固定ヘッダー高さ＋余白 */
  top: var(--site-header-h);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 目次 */
.article-page .toc-widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: 3px solid #c00;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.article-page .toc-widget-title {
  background: #fafafa;
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: bold;
  color: #666;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.article-page .toc-list { list-style: none; padding: 12px 0; }
.article-page .toc-list li { border-bottom: 1px solid #f4f4f4; }
.article-page .toc-list li:last-child { border-bottom: none; }
.article-page .toc-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: background .15s, color .15s;
}
.article-page .toc-list a:hover { background: #fff5f5; color: #c00; }
.article-page .toc-list a.active {
  background: #fff0f0;
  color: #c00;
  font-weight: bold;
}
.article-page .toc-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #c00;
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* サイドバー CTA */
.article-page .sidebar-cta {
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
  border: 1px solid #f0caca;
  border-top: 3px solid #c00;
  border-radius: 0 0 8px 8px;
  padding: 20px 16px 18px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.045);
}
.article-page .sidebar-cta-logo {
  display: block;
  max-width: 170px;
  height: auto;
  margin: 0 auto 12px;
}
.article-page .sidebar-cta-text {
  font-size: 12px;
  color: #555;
  line-height: 1.75;
  margin-bottom: 14px;
}
.article-page .sidebar-cta-btn {
  display: block;
  background: #c00;
  color: #fff;
  text-align: center;
  text-decoration: none;
  padding: 11px 0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.article-page .sidebar-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(204,0,0,.22);
}

/* サイドバー タグ */
.article-page .sidebar-widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}
.article-page .sidebar-widget-title {
  background: #f4f4f4;
  border-bottom: 1px solid #e8e8e8;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: bold;
  color: #666;
  letter-spacing: 0.06em;
}
.article-page .sidebar-widget-body { padding: 14px; }
.article-page .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
}
.article-page .tag-list a {
  display: inline-block;
  background: #f0f0f0;
  color: #555;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.article-page .tag-list a:hover { background: #c00; color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .article-page .caution-box { grid-template-columns: 1fr; }
  .article-page .caution-box-label {
    flex-direction: row;
    padding: 13px 16px;
  }
  .article-page .caution-line-icon { width: 28px; height: 28px; }
}

@media (max-width: 720px) {
  .article-page .page-wrap { grid-template-columns: 1fr; }
  .article-page .article-header { grid-column: 1; }
  .article-page .article-sidebar { order: -1; }
  .article-page .sidebar-inner { position: static; }
  .article-page .product-cards { grid-template-columns: 1fr; }
  .article-page .article-body h2 {
    gap: 12px;
    font-size: 18px;
  }
  .article-page .article-body h2 .h2-num {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
  .article-page .article-lead {
    padding: 32px 20px 22px;
    margin-top: 14px;
  }
  .article-page .product-card {
    grid-template-columns: 100px 1fr;
    column-gap: 12px;
  }
  .article-page .product-card-image {
    width: 100px;
    min-height: 100px;
  }
}
