/* =================================================================
   ブログ記事 専用スタイル
   - 長文の読みやすさ（行間 1.85、最大幅 720px）
   - サイドバー TOC（sticky）
   - リッチコンテンツ（表、比較、Do/Don't、流程図、callout、author）
   - @media print：A4 印刷に最適化
   ================================================================= */

/* レイアウト */
.blog-article {
  --brand: #c8102e;
  --text: #222;
  --text-muted: #666;
  --border: #e8e8e8;
  --bg-soft: #faf7f5;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* ───────── Hero ───────── */
.blog-hero {
  background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%);
  padding: 24px 0 0;
  border-bottom: 1px solid var(--border);
}
.blog-hero-inner {
  padding: 8px 20px 24px;
}
.blog-hero-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.blog-category {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
  font-weight: 600;
}
.blog-read-time::before {
  content: "⏱ ";
}
.blog-title {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 700;
  margin: 8px 0 6px;
  letter-spacing: -0.01em;
}
.blog-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.6;
}
.blog-hero-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.blog-hero-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blog-hero-author strong {
  display: block;
  font-size: 14px;
}
.blog-hero-author-title {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.blog-hero-dates {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--text-muted);
}
.blog-hero-cover {
  max-width: 1200px;
  margin: 0 auto;
}
.blog-hero-cover img {
  max-height: 420px;
  object-fit: cover;
}

/* ───────── Main 2-column layout ───────── */
.blog-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding: 48px 20px 64px;
  align-items: start;
}
@media (max-width: 960px) {
  .blog-main {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .blog-sidebar { display: none; }
}

/* ───────── Sidebar (TOC) ───────── */
.blog-sidebar { position: sticky; top: 24px; }
.blog-toc {
  border-left: 2px solid var(--border);
  padding: 8px 0 8px 14px;
  font-size: 13px;
}
.blog-toc-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.blog-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.blog-toc-item a {
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  padding: 2px 0;
  transition: color 0.15s;
  border-left: 2px solid transparent;
  margin-left: -16px;
  padding-left: 14px;
}
.blog-toc-item a:hover { color: var(--brand); }
.blog-toc-item.is-active a {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}
.blog-toc-level-3 { padding-left: 16px; }
.blog-toc-level-3 a { font-size: 12px; }

/* ───────── Content ───────── */
.blog-content {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}
.blog-lead {
  font-size: 15px;
  line-height: 1.8;
  background: var(--bg-soft);
  padding: 18px 22px;
  border-left: 4px solid var(--brand);
  border-radius: 0 6px 6px 0;
  margin: 0 0 36px;
  color: #444;
}

/* ───────── Section / Heading ───────── */
.blog-section { margin-bottom: 48px; }
.blog-section[id] { scroll-margin-top: 100px; }
.blog-h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
  padding: 8px 0 8px 16px;
  border-left: 6px solid var(--brand);
  line-height: 1.4;
}
.blog-h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.blog-h3[id] { scroll-margin-top: 100px; }
.blog-paragraph {
  margin: 0 0 18px;
}
.blog-paragraph strong { color: #111; }

/* ───────── Lists ───────── */
.blog-list {
  margin: 0 0 18px;
  padding-left: 24px;
}
.blog-list li { margin-bottom: 8px; }
.blog-list-ordered { list-style: decimal; }
.blog-list-unordered { list-style: disc; }

/* ───────── Image / Figure ───────── */
.blog-figure {
  margin: 28px 0;
  text-align: center;
}
.blog-figure-medium {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.blog-figure img {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.blog-figcaption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

/* ───────── Video ───────── */
.blog-video-wrap {
  margin: 28px 0;
  text-align: center;
}
.blog-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.blog-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ───────── Table ───────── */
.blog-table-wrap { margin: 24px 0 28px; }
.blog-table-caption {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.blog-table-scroll { overflow-x: auto; }
.blog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border);
}
.blog-table th,
.blog-table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
  line-height: 1.6;
  vertical-align: top;
}
.blog-table th {
  background: #f7f5f3;
  font-weight: 700;
  font-size: 13px;
  color: #333;
}
.blog-table th.is-highlight,
.blog-table td.is-highlight {
  background: #fff5f5;
}
.blog-table th.is-highlight { background: #fde6e8; color: var(--brand); }

/* ───────── Comparison ───────── */
.blog-comparison { margin: 28px 0 32px; }
.blog-comparison-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}
.blog-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.blog-comparison-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.blog-comparison-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.blog-comparison-card-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.blog-comparison-rating-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}
.blog-comparison-rating-max {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 2px;
}
.blog-comparison-pros strong,
.blog-comparison-cons strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.blog-comparison-pros strong { color: #2e7d32; }
.blog-comparison-cons strong { color: #c62828; }
.blog-comparison-pros ul,
.blog-comparison-cons ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 13px;
  line-height: 1.65;
}
.blog-comparison-pros li::before {
  content: "✓ ";
  color: #2e7d32;
  font-weight: 700;
}
.blog-comparison-cons li::before {
  content: "− ";
  color: #c62828;
  font-weight: 700;
}

/* ───────── Do / Don't ───────── */
.blog-dodont { margin: 24px 0 28px; }
.blog-dodont-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
}
.blog-dodont-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .blog-dodont-grid { grid-template-columns: 1fr; }
}
.blog-dodont-do,
.blog-dodont-dont {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.blog-dodont-do { border-top: 4px solid #2e7d32; }
.blog-dodont-dont { border-top: 4px solid #c62828; }
.blog-dodont-do h4,
.blog-dodont-dont h4 {
  margin: 0 0 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.blog-dodont-do h4 span { color: #2e7d32; font-size: 18px; }
.blog-dodont-dont h4 span { color: #c62828; font-size: 18px; }
.blog-dodont-do ul,
.blog-dodont-dont ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
}
.blog-dodont-do li,
.blog-dodont-dont li {
  padding: 4px 0 4px 18px;
  position: relative;
}
.blog-dodont-do li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2e7d32;
}
.blog-dodont-dont li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #c62828;
}

/* ───────── Flowchart ───────── */
.blog-flowchart {
  margin: 28px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.blog-flowchart-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.blog-flowchart-svg svg { display: block; margin: 0 auto; }

/* ───────── Callout ───────── */
.blog-callout {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.75;
}
.blog-callout-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.blog-callout-body { margin: 0; }
.blog-callout-info {
  background: #eff7ff;
  border-color: #2b7bff;
}
.blog-callout-info .blog-callout-title { color: #1d6dee; }
.blog-callout-tip {
  background: #fff8e6;
  border-color: #f0a500;
}
.blog-callout-tip .blog-callout-title { color: #c08300; }
.blog-callout-warn {
  background: #ffeeee;
  border-color: #d93838;
}
.blog-callout-warn .blog-callout-title { color: #c02020; }
.blog-callout-success {
  background: #eaf7eb;
  border-color: #2e7d32;
}
.blog-callout-success .blog-callout-title { color: #1f5e21; }

/* ───────── Quote ───────── */
.blog-quote {
  margin: 22px 0;
  padding: 14px 20px;
  border-left: 4px solid var(--border);
  font-style: italic;
  color: var(--text-muted);
}
.blog-quote-cite { display: block; margin-top: 6px; font-size: 12px; font-style: normal; }

/* ───────── External link icon ───────── */
.blog-ext-link {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.blog-ext-link:hover { text-decoration-thickness: 2px; }

/* ───────── Author byline ───────── */
.blog-author {
  margin: 48px 0 32px;
  padding: 22px;
  background: var(--bg-soft);
  border-radius: 12px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 640px) {
  .blog-author { flex-direction: column; }
}
.blog-author-avatar img { display: block; }
.blog-author-info { flex: 1; min-width: 0; }
.blog-author-header strong { font-size: 15px; }
.blog-author-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}
.blog-author-bio {
  font-size: 13px;
  line-height: 1.7;
  color: #444;
  margin: 6px 0 8px;
}
.blog-author-meta {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 11px;
  color: var(--text-muted);
}
.blog-author-meta li::before { content: "▸ "; color: var(--brand); }
.blog-author-reviewed { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* ───────── Product card ───────── */
.blog-product-card {
  margin: 26px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.blog-product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 700;
  z-index: 1;
}
.blog-product-card-link {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}
@media (max-width: 480px) {
  .blog-product-card-link { grid-template-columns: 1fr; }
}
.blog-product-card-info h4 { font-size: 14px; margin: 0 0 10px; line-height: 1.5; }
.blog-product-card-price { font-size: 16px; color: var(--brand); margin-bottom: 12px; }
.blog-product-card-regular {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}
.blog-product-card-cta { font-size: 13px; color: var(--brand); font-weight: 600; }

/* ───────── FAQ ───────── */
.blog-faq-section { margin-top: 56px; }
.blog-faq-list { display: flex; flex-direction: column; gap: 0; }
.blog-faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.blog-faq-item summary {
  display: flex;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}
.blog-faq-q {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.blog-faq-a {
  margin-top: 10px;
  padding-left: 36px;
  font-size: 14px;
  line-height: 1.85;
  color: #444;
}

/* ───────── References ───────── */
.blog-references { margin-top: 48px; }
.blog-references-list {
  margin: 0;
  padding-left: 24px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.85;
}
.blog-references-list li { margin-bottom: 6px; }

/* ───────── Related articles ───────── */
.blog-related { margin-top: 48px; }
.blog-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.blog-related-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
@media (max-width: 640px) {
  .blog-related-card { grid-template-columns: 120px 1fr; }
  .blog-related-card img { width: 120px !important; height: 80px !important; }
}
.blog-related-card:hover { border-color: var(--brand); }
.blog-related-card img { border-radius: 4px; }
.blog-related-card > div { display: flex; flex-direction: column; gap: 4px; }
.blog-related-cat { font-size: 11px; color: var(--brand); font-weight: 600; }
.blog-related-card strong { font-size: 14px; line-height: 1.5; }
.blog-related-card small { font-size: 11px; color: var(--text-muted); margin-top: auto; }

/* ───────── Footer ───────── */
.blog-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.blog-footer p { margin: 0; font-size: 13px; color: var(--text-muted); }
.blog-footer a { color: var(--brand); }

/* ───────── Print button ───────── */
.blog-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.blog-print-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* =================================================================
   @media print — A4 PDF 出力に最適化
   - サイドバー TOC、ヘッダー、フッター、関連記事、印刷ボタンを隠す
   - 本文は最大幅 100%、リンクの URL を文末に展開
   ================================================================= */
@media print {
  /* サイトのナビ・サイドバー・関連物を隠す */
  .top-header,
  .mobile-top-text,
  .main-nav,
  .site-footer,
  .floating-icons,
  .blog-sidebar,
  .blog-footer,
  .blog-print-btn,
  .blog-related,
  .blog-hero-byline > div:not(.blog-hero-author):not(.blog-hero-dates),
  .age-popup,
  .skip-to-content,
  .page-faq,
  .search-expand {
    display: none !important;
  }

  body { background: #fff !important; }
  .blog-article {
    max-width: 100% !important;
    color: #000;
    font-size: 11pt;
    line-height: 1.6;
  }
  .blog-main {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
  }
  .blog-content {
    max-width: 100% !important;
    font-size: 11pt;
  }
  .blog-hero {
    padding: 0 !important;
    background: none !important;
    page-break-after: avoid;
  }
  .blog-hero-cover {
    max-height: 5cm;
    overflow: hidden;
  }
  .blog-h2 {
    page-break-after: avoid;
    border-left-color: #888;
    color: #000;
    margin-top: 16pt;
  }
  .blog-h3 {
    page-break-after: avoid;
    color: #000;
  }
  .blog-section {
    page-break-inside: avoid;
  }
  .blog-figure,
  .blog-table-wrap,
  .blog-comparison,
  .blog-dodont,
  .blog-flowchart,
  .blog-callout,
  .blog-video-wrap {
    page-break-inside: avoid;
  }
  /* 印刷時は動画ポスターを画像として表示（コントロールは不要） */
  .blog-video-frame {
    aspect-ratio: auto;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .blog-video {
    position: static;
    height: auto;
    max-height: 8cm;
    object-fit: contain;
  }
  /* 外部リンクの URL を可視化 — 印刷時に参照できるよう */
  .blog-ext-link[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }
  /* 章節の FAQ details はすべて開いた状態に */
  .blog-faq-item[open] .blog-faq-a,
  .blog-faq-item .blog-faq-a {
    display: block !important;
    padding-left: 18pt;
  }
  .blog-faq-item summary {
    list-style: none;
    font-weight: 700;
  }
}
