/* ============================================================
   blog.css - Shared styles for tsukurukun.jp/blog
   Design: extends the terms.html / privacy-policy.html pattern
   Accent: #3b82f6 (blue-500)
   ============================================================ */

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  line-height: 1.8;
  color: #333;
  background-color: #f9fafb;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #2563eb;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Blog Header (top nav) ---- */
.blog-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.blog-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111;
}

.blog-header-logo img {
  height: 32px;
  width: auto;
}

.blog-header-logo span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

.blog-header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.blog-header-nav a {
  font-size: 0.85rem;
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-header-nav a:hover {
  color: #3b82f6;
  text-decoration: none;
}

.blog-header-cta {
  background: #3b82f6;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem !important;
  transition: background 0.2s, transform 0.15s;
}

.blog-header-cta:hover {
  background: #2563eb;
  color: #fff !important;
  transform: translateY(-1px);
}

/* ---- Blog Hero ---- */
.blog-hero {
  position: relative;
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  background: #1e293b;
}

.blog-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.6;
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
}

.blog-hero-overlay h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 640px;
}

.blog-hero-overlay p {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.9;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---- Container (article body wrapper) ---- */
.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---- Blog Meta (date, author, read time) ---- */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.blog-meta time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blog-meta .meta-divider {
  color: #d1d5db;
}

.blog-meta .meta-author {
  font-weight: 500;
  color: #374151;
}

.blog-meta .meta-readtime {
  color: #9ca3af;
}

/* ---- Table of Contents ---- */
.blog-toc {
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin-bottom: 36px;
}

.blog-toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding-left: 0;
}

.blog-toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 6px;
}

.blog-toc ol li::before {
  content: counter(toc-counter) '.';
  font-weight: 600;
  color: #3b82f6;
  margin-right: 8px;
  font-size: 0.85rem;
}

.blog-toc ol li a {
  font-size: 0.9rem;
  color: #374151;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-toc ol li a:hover {
  color: #3b82f6;
}

/* ---- Blog Content (article body typography) ---- */
.blog-content {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #374151;
}

/* -- Headings -- */
.blog-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 4px solid #3b82f6;
  line-height: 1.4;
}

.blog-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.blog-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-top: 24px;
  margin-bottom: 8px;
}

/* -- Paragraphs -- */
.blog-content p {
  margin-bottom: 16px;
}

/* -- Lists -- */
.blog-content ul,
.blog-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

.blog-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.blog-content li > ul,
.blog-content li > ol {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* -- Blockquote -- */
.blog-content blockquote {
  border-left: 4px solid #dbeafe;
  background: #f0f7ff;
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  color: #1e40af;
  font-size: 0.95rem;
  line-height: 1.8;
}

.blog-content blockquote p:last-child {
  margin-bottom: 0;
}

/* -- Images & Figures -- */
.blog-content img {
  display: block;
  margin: 24px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.blog-content figure {
  margin: 28px 0;
  text-align: center;
}

.blog-content figure img {
  margin: 0 auto 8px;
}

.blog-content figcaption {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 8px;
  line-height: 1.5;
}

/* -- Code -- */
.blog-content code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Consolas', monospace;
}

.blog-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  line-height: 1.6;
  font-size: 0.85rem;
}

.blog-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* -- Tables -- */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.blog-content thead {
  background: #f1f5f9;
}

.blog-content th,
.blog-content td {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.blog-content th {
  font-weight: 600;
  color: #1e293b;
}

.blog-content tbody tr:hover {
  background: #f9fafb;
}

/* -- Horizontal Rule -- */
.blog-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 36px 0;
}

/* -- Strong / Emphasis -- */
.blog-content strong {
  font-weight: 600;
  color: #1e293b;
}

.blog-content em {
  font-style: italic;
}

/* ---- Call to Action Box ---- */
.blog-cta {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 32px;
  margin: 40px 0;
  text-align: center;
}

.blog-cta-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.blog-cta-text {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 20px;
  line-height: 1.7;
}

.blog-cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.blog-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  color: #fff;
  text-decoration: none;
}

.blog-cta-btn:active {
  transform: translateY(0);
}

.blog-cta-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 12px;
}

.blog-cta-divider {
  border: none;
  border-top: 1px solid #bfdbfe;
  margin: 24px 0;
}

.blog-cta-app-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
  font-weight: 500;
}

.blog-cta-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.blog-cta-badge-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.blog-cta-badge-group a {
  display: block;
  transition: transform 0.15s, opacity 0.15s;
}

.blog-cta-badge-group a:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.blog-cta-badge-group img {
  height: 40px;
  width: auto;
}

.blog-cta-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.blog-cta-qr img {
  width: 96px;
  height: 96px;
  border-radius: 4px;
}

.blog-cta-qr span {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ---- Download Button ---- */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 28px;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  cursor: pointer;
}

.download-btn:hover {
  background: #3b82f6;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---- Related Articles ---- */
.blog-related {
  margin: 48px 0 0;
}

.blog-related-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid #3b82f6;
}

.blog-related-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.blog-related-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-related-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.blog-related-card-thumb {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-related-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.blog-related-card:hover .blog-related-card-thumb img {
  transform: scale(1.05);
}

.blog-related-card-body {
  padding: 12px 14px 16px;
}

.blog-related-card-date {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.blog-related-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Blog Footer ---- */
.blog-footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  margin-top: 64px;
}

.blog-footer-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
}

.blog-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

.blog-footer-links a {
  font-size: 0.85rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}

.blog-footer-links a:hover {
  color: #3b82f6;
}

.blog-footer-copyright {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ---- Blog Card (for index / listing page) ---- */
.blog-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}

.blog-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: row;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.blog-card-thumb {
  width: 240px;
  min-height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-thumb img {
  transform: scale(1.05);
}

.blog-card-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.blog-card-date {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.blog-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Blog Index Page Specific ---- */
.blog-index-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 48px 20px 32px;
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 50%, #dbeafe 100%);
  border-bottom: 1px solid #e2e8f0;
}

.blog-index-hero-content {
  text-align: left;
  flex: 1;
}

.blog-index-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.blog-index-hero p {
  font-size: 0.95rem;
  color: #6b7280;
  max-width: 480px;
  line-height: 1.7;
}

.blog-index-hero-mascot {
  width: 160px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

/* ---- Info / Highlight Box ---- */
.blog-info-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #92400e;
}

.blog-info-box strong {
  color: #78350f;
}

/* ---- Premium Feature Box ---- */
.blog-premium-box {
  background: #faf5ff;
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #6b21a8;
}

.blog-premium-box strong {
  color: #581c87;
}

.blog-premium-box .premium-label {
  display: inline-block;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

/* ---- Step / Numbered Steps ---- */
.blog-steps {
  counter-reset: step-counter;
  margin: 24px 0;
}

.blog-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.blog-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

.blog-step-body {
  flex: 1;
}

.blog-step-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.blog-step-body p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 0;
}

/* ---- Comparison Table ---- */
.blog-comparison {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.88rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.blog-comparison thead th {
  background: #3b82f6;
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  text-align: center;
}

.blog-comparison thead th:first-child {
  text-align: left;
}

.blog-comparison tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}

.blog-comparison tbody td:first-child {
  text-align: left;
  font-weight: 500;
  color: #1e293b;
}

.blog-comparison tbody tr:nth-child(even) {
  background: #f9fafb;
}

.blog-comparison tbody tr:hover {
  background: #f0f7ff;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .blog-header-inner {
    padding: 10px 16px;
  }

  .blog-header-logo span {
    font-size: 0.75rem;
  }

  .blog-header-nav {
    gap: 12px;
  }

  .blog-header-nav a {
    font-size: 0.8rem;
  }

  .blog-hero-overlay h1 {
    font-size: 1.3rem;
  }

  .blog-container {
    padding: 24px 16px 48px;
  }

  .blog-content h2 {
    font-size: 1.15rem;
    margin-top: 36px;
  }

  .blog-content h3 {
    font-size: 1rem;
  }

  .blog-toc {
    padding: 16px 18px;
  }

  .blog-cta {
    padding: 24px 20px;
  }

  .blog-cta-title {
    font-size: 1.05rem;
  }

  .blog-cta-btn {
    display: block;
    text-align: center;
    padding: 14px 24px;
  }

  /* Cards stack vertically on mobile */
  .blog-card {
    flex-direction: column;
  }

  .blog-card-thumb {
    width: 100%;
    min-height: 180px;
    max-height: 200px;
  }

  .blog-card-body {
    padding: 16px;
  }

  .blog-card-title {
    font-size: 1rem;
  }

  .blog-index-hero {
    padding: 32px 16px 24px;
    gap: 16px;
  }

  .blog-index-hero-content {
    text-align: center;
  }

  .blog-index-hero h1 {
    font-size: 1.3rem;
  }

  .blog-index-hero-mascot {
    width: 100px;
  }

  .blog-related-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .blog-related-card-thumb {
    height: 140px;
  }

  .blog-footer-links {
    flex-direction: column;
    gap: 12px;
  }

  /* Comparison table horizontal scroll */
  .blog-comparison-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .blog-step {
    gap: 12px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .blog-card-thumb {
    width: 200px;
  }
}

/* ---- Print ---- */
@media print {
  .blog-header,
  .blog-footer,
  .blog-cta,
  .download-btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.6;
  }

  .blog-container {
    max-width: 100%;
    padding: 0;
  }

  .blog-content h2 {
    border-left-color: #000;
    page-break-after: avoid;
  }

  .blog-content img {
    max-width: 80%;
    box-shadow: none;
  }

  .blog-content blockquote {
    border-left-color: #999;
    background: none;
    color: #333;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }

  .blog-header-nav a[href]::after,
  .blog-footer-links a[href]::after {
    content: none;
  }
}
