/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; line-height: 1.15; }

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Back to Index ===== */
.back-to-index {
  margin-bottom: 24px;
}
.back-to-index a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}
.back-to-index a:hover {
  color: #2563eb;
}

/* ===== Layout ===== */
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

@media (max-width: 640px) {
  .article-body {
    padding: 24px 16px 60px;
  }
}

/* ===== Hero Image ===== */
.article-hero {
  margin: 0 0 1.5rem;
}
.article-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ===== Article Dates ===== */
.article-dates {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* ===== Typography ===== */
.article-body h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  margin-bottom: 1.25rem;
  color: #334155;
}

.article-body strong {
  font-weight: 600;
  color: #0f172a;
}

.article-body em {
  font-style: italic;
}

/* ===== Links ===== */
.article-body a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.article-body a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

/* ===== Images ===== */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

.article-body figure {
  margin: 1.5rem 0;
}

.article-body figcaption {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  margin-top: 0.5rem;
}

/* ===== Lists ===== */
.article-body ul,
.article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.article-body ul {
  list-style-type: disc;
}

.article-body ol {
  list-style-type: decimal;
}

.article-body li {
  margin-bottom: 0.375rem;
  color: #334155;
}

.article-body li > ul,
.article-body li > ol {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

/* ===== Blockquote ===== */
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #3b82f6;
  background-color: #f8fafc;
  border-radius: 0 8px 8px 0;
  color: #475569;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ===== Table ===== */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}

@media (min-width: 641px) {
  .article-body table {
    display: table;
  }
}

.article-body thead th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #cbd5e1;
}

.article-body tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}

.article-body tbody tr:hover {
  background-color: #f8fafc;
}

/* ===== Code ===== */
.article-body code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background-color: #f1f5f9;
  color: #be185d;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-body pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background-color: #1e293b;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
}

.article-body pre code {
  background-color: transparent;
  color: #e2e8f0;
  padding: 0;
  font-size: 0.875rem;
}

/* ===== Horizontal Rule ===== */
.article-body hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2.5rem 0;
}

/* ===== Definition List ===== */
.article-body dl {
  margin-bottom: 1.25rem;
}

.article-body dt {
  font-weight: 600;
  color: #0f172a;
  margin-top: 1rem;
}

.article-body dd {
  margin-left: 1.5rem;
  color: #334155;
}

/* ===== iframe (YouTube等) ===== */
.article-body iframe {
  max-width: 100%;
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* ===== Author Footer ===== */
.author-footer-container {
  display: flex;
  align-items: flex-start;
  border-top: 2px solid #e0e0e0;
  padding: 25px;
  margin-top: 30px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.author-footer-image-wrapper {
  flex-shrink: 0;
  margin-right: 20px;
}

.article-body .author-footer-image {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  display: inline-block;
  margin: 0;
}

.author-footer-info p {
  margin: 0 0 5px 0;
  color: #343a40;
  line-height: 1.5;
}

.author-footer-name {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 8px;
}

.author-footer-title,
.author-footer-organization {
  font-size: 1em;
  color: #555;
}

.author-footer-bio {
  font-size: 0.95em;
  color: #444;
}

.author-footer-links a {
  color: #2563eb;
  text-decoration: none;
  margin-right: 12px;
  font-size: 0.9em;
}

.author-footer-links a:hover {
  text-decoration: underline;
}

.author-footer-published-at {
  font-size: 0.9em;
  color: #777;
  margin-top: 10px;
}

.author-footer-name {
  cursor: pointer;
  transition: color 0.2s;
}
.author-footer-name:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ===== Author Profile Modal ===== */
.author-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.author-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  text-align: center;
}
.author-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.author-modal-close:hover {
  color: #475569;
}
.author-modal-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-bottom: 16px;
}
.author-modal-name {
  font-size: 1.5em;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 4px;
}
.author-modal-title {
  font-size: 1em;
  color: #475569;
  margin-bottom: 2px;
}
.author-modal-organization {
  font-size: 0.9em;
  color: #64748b;
}
.author-modal-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 20px 0;
}
.author-modal-bio-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-align: left;
}
.author-modal-bio {
  font-size: 0.95em;
  color: #475569;
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: left;
}
.author-modal-links {
  text-align: left;
}
.author-modal-links a {
  display: block;
  color: #2563eb;
  text-decoration: none;
  font-size: 0.9em;
  margin-bottom: 6px;
}
.author-modal-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .author-footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-footer-image-wrapper {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .author-modal {
    padding: 24px 16px;
  }
}

/* ===== Custom CSS ===== */
/* ===== AITRADERLAB カスタムCSS（可読性重視・修正版） ===== */

/* ------------------------------
   記事ページ
------------------------------ */
.article-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.9;
  font-size: 16px;
}

/* 見出し */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  color: #111827;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 2.2em;
  margin-bottom: 0.8em;
}

.article-body h1 {
  font-size: 2.2rem;
}

.article-body h2 {
  font-size: 1.8rem;
  border-left: 6px solid #00c8ff;
  padding-left: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}

.article-body h3 {
  font-size: 1.4rem;
  padding-bottom: 6px;
  border-bottom: 1px solid #d1d5db;
}

.article-body h4 {
  font-size: 1.15rem;
}

/* 本文 */
.article-body p,
.article-body li,
.article-body dd,
.article-body dt {
  color: #374151;
  font-size: 16px;
  line-height: 1.9;
}

/* リスト */
.article-body ul,
.article-body ol {
  margin: 1em 0 1.5em 1.5em;
  padding: 0;
}

.article-body li {
  margin-bottom: 0.5em;
}

/* 太字・斜体 */
.article-body strong {
  color: #111827;
  font-weight: 700;
}

.article-body em {
  color: #4b5563;
}

/* リンク */
.article-body a {
  color: #009fe8;
  text-decoration: none;
  font-weight: 500;
}

.article-body a:hover {
  color: #0077b6;
  text-decoration: underline;
}

/* 画像 */
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 10px;
}

/* 引用 */
.article-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: #f3f8fb;
  border-left: 4px solid #00c8ff;
  color: #374151;
  border-radius: 8px;
}

/* コード */
.article-body code {
  background: #f3f4f6;
  color: #111827;
  padding: 0.2em 0.45em;
  border-radius: 4px;
  font-size: 0.95em;
}

.article-body pre {
  background: #111827;
  color: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}

/* テーブル */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: #ffffff;
}

.article-body th,
.article-body td {
  border: 1px solid #d1d5db;
  padding: 12px 14px;
  text-align: left;
  color: #374151;
}

.article-body thead th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
}

/* 著者フッター */
.author-footer-container {
  margin-top: 56px;
  padding: 24px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #374151;
}

/* 戻るリンク */
.back-to-index a {
  display: inline-block;
  margin-top: 20px;
  color: #009fe8;
  text-decoration: none;
  font-weight: 600;
}

.back-to-index a:hover {
  text-decoration: underline;
}

/* ------------------------------
   ヒーローセクション
------------------------------ */
.hero {
  position: relative;
  padding: 100px 20px;
  text-align: center;
  background:
    linear-gradient(rgba(8, 15, 35, 0.45), rgba(8, 15, 35, 0.45)),
    linear-gradient(135deg, #0f172a 0%, #13203f 50%, #0b1220 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero--bg-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 35, 0.45);
  z-index: 1;
}

.hero__title,
.hero__subtitle {
  position: relative;
  z-index: 2;
}

.hero__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero__subtitle {
  margin-top: 18px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* ------------------------------
   記事一覧ページ
------------------------------ */
.article-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: #b6e9ff;
  box-shadow: 0 12px 28px rgba(0, 159, 232, 0.10);
}