/* =========================================================
   analylog ― SWELL 風スタイル
   白カード＋柔らかい影、角丸、ピル型バッジ、アクセント見出し、目次ボックス
   ========================================================= */

:root {
  --key: #2f80ed;
  --key-dark: #1c5fbf;
  --key-soft: #eaf2fe;
  --text: #2b2b2b;
  --text-light: #6b7280;
  --heading: #1a2230;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e6e9ef;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(20, 40, 80, .06);
  --shadow-hover: 0 10px 28px rgba(20, 40, 80, .13);
  --maxw: 1120px;
  --content-w: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--key); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-brand { display: flex; flex-direction: column; line-height: 1.1; }
.site-brand:hover { text-decoration: none; }
.brand-name { font-size: 1.4rem; font-weight: 800; color: var(--heading); letter-spacing: .01em; }
.brand-accent { color: var(--key); }
.brand-sub { font-size: .62rem; color: var(--text-light); letter-spacing: .2em; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--heading); font-weight: 600; font-size: .92rem; }
.site-nav a:hover { color: var(--key); text-decoration: none; }

/* ---------- ヒーロー ---------- */
.hero {
  background: linear-gradient(135deg, #eaf2fe 0%, #f4f6f9 55%, #eef6f3 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px 56px;
  text-align: center;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 14px;
  letter-spacing: .01em;
}
.hero-title .accent { color: var(--key); }
.hero-tagline { font-size: 1.05rem; color: var(--text); margin: 0; font-weight: 600; }
.hero-desc { color: var(--text-light); max-width: 640px; margin: 12px auto 0; font-size: .95rem; }

/* ---------- 記事一覧 ---------- */
.article-list-section { max-width: var(--maxw); margin: 0 auto; padding: 48px 24px 64px; }
.section-head { margin-bottom: 28px; }
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--heading);
  position: relative;
  padding-left: 16px;
  margin: 0;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15em;
  bottom: .15em;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(var(--key), var(--key-dark));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--key), var(--key-dark));
}
.thumb-cat {
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: .14em;
  opacity: .92;
  text-transform: uppercase;
}
/* カテゴリ別サムネ配色 */
.cat-nmr { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.cat-クロマトグラフィー, .cat-chromatography { background: linear-gradient(135deg, #0ea5a4, #0d9488); }
.cat-質量分析, .cat-ms { background: linear-gradient(135deg, #f59e0b, #d97706); }

.card-body { padding: 18px 20px 22px; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cat-badge {
  background: var(--key-soft);
  color: var(--key-dark);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
}
a.cat-badge:hover { background: var(--key); color: #fff; text-decoration: none; }
.card-thumb-link { display: block; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--key); }
.list-section { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 64px; }
.list-count { color: var(--text-light); font-size: .9rem; margin: 8px 0 0; }
.draft-badge {
  background: #fde8e8;
  color: #c0392b;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.card-date { color: var(--text-light); font-size: .78rem; margin-left: auto; }
.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  color: var(--text-light);
  font-size: .86rem;
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty { color: var(--text-light); text-align: center; padding: 40px; }

/* ---------- 記事ページ ---------- */
.single { max-width: var(--content-w); margin: 0 auto; padding: 36px 24px 72px; }
.breadcrumb {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--key); }
.breadcrumb .current { color: var(--text); }

.single-header { margin-bottom: 30px; }
.single-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--text-light);
  font-size: .8rem;
}
.single-title { font-size: 1.9rem; line-height: 1.45; font-weight: 800; color: var(--heading); margin: 0 0 16px; }
.single-lead {
  background: var(--key-soft);
  border-radius: 10px;
  padding: 16px 18px;
  color: #33455e;
  font-size: .92rem;
  line-height: 1.8;
  margin: 0 0 16px;
}
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.tag { display: inline-block; font-size: .76rem; color: var(--text-light); background: #f0f2f6; border-radius: 6px; padding: 3px 9px; text-decoration: none; }
a.tag:hover { background: var(--key-soft); color: var(--key-dark); text-decoration: none; }

/* 目次 */
.toc {
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 0 36px;
}
.toc-title {
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 10px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc-title::before { content: ""; width: 5px; height: 18px; border-radius: 3px; background: var(--key); display: inline-block; }
.toc ul { margin: 0; padding-left: 20px; }
.toc > ul { padding-left: 4px; }
.toc li { margin: 6px 0; list-style: none; position: relative; padding-left: 16px; }
.toc li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--key); opacity: .5; }
.toc a { color: var(--text); font-size: .9rem; }
.toc a:hover { color: var(--key); }
.toc ul ul li::before { background: transparent; border: 1px solid var(--key); }

/* 本文タイポグラフィ */
.post-body { font-size: 1rem; line-height: 1.95; color: var(--text); }
.post-body h2 {
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--heading);
  margin: 2.6em 0 1em;
  padding: .55em .8em;
  background: var(--key-soft);
  border-left: 5px solid var(--key);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}
.post-body h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--heading);
  margin: 2em 0 .8em;
  padding-left: .7em;
  border-left: 4px solid var(--key);
  line-height: 1.5;
}
.post-body h4 { font-size: 1.05rem; font-weight: 700; color: var(--heading); margin: 1.6em 0 .6em; }
.post-body p { margin: 1.2em 0; }
.post-body a { color: var(--key); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.post-body ul, .post-body ol { margin: 1.2em 0; padding-left: 1.6em; }
.post-body li { margin: .5em 0; }
.post-body strong { color: var(--heading); font-weight: 700; }
.post-body blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  background: #f7f9fb;
  border-left: 4px solid #c4d2e2;
  border-radius: 0 8px 8px 0;
  color: #52606d;
}
.post-body blockquote p { margin: .4em 0; }
.post-body hr { border: 0; border-top: 1px dashed #d4d9e0; margin: 2.6em 0; }
.post-body code {
  background: #eef1f5;
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .9em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.post-body pre { background: #1f2733; color: #e6edf3; padding: 18px; border-radius: 10px; overflow-x: auto; }
.post-body pre code { background: transparent; color: inherit; padding: 0; }

/* 表 */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .92rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.post-body th, .post-body td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.post-body thead th { background: var(--key); color: #fff; font-weight: 700; }
.post-body tbody tr:nth-child(even) { background: #f7f9fc; }
.post-body tbody tr:hover { background: var(--key-soft); }

/* 記事フッターのボタン */
.single-footer { margin-top: 48px; text-align: center; }
.btn-back {
  display: inline-block;
  background: var(--key);
  color: #fff;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(47, 128, 237, .35);
  transition: background .2s, transform .2s;
}
.btn-back:hover { background: var(--key-dark); text-decoration: none; transform: translateY(-2px); }

/* 404 */
.notfound { max-width: 600px; margin: 0 auto; padding: 90px 24px; text-align: center; }
.notfound h1 { font-size: 4rem; color: var(--key); margin: 0 0 8px; }

/* ---------- フッター ---------- */
.site-footer { background: #1a2230; color: #cdd5e0; margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 42px 24px; text-align: center; }
.footer-brand { font-size: 1.3rem; font-weight: 800; color: #fff; margin: 0 0 8px; }
.footer-note { color: #9aa6b6; font-size: .88rem; margin: 0 auto 18px; max-width: 520px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin: 0 0 16px; }
.footer-nav a { color: #aeb8c6; font-size: .82rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-copy { color: #6b7686; font-size: .78rem; margin: 0; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
  .hero-title { font-size: 1.6rem; }
  .hero-inner { padding: 48px 20px 40px; }
  .header-inner { padding: 0 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .single-title { font-size: 1.45rem; }
  .post-body h2 { font-size: 1.25rem; }
  .article-list-section, .single { padding-left: 16px; padding-right: 16px; }
}
