/* =========================================================
   Simple Monotone Blog Style
   - デフォルトに近い、シンプル & モノトーン
   - 日本語ゴシック体（スタイリッシュ）
   - テーブルを見やすく整形
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@500;700&display=swap');

:root {
  /* --- モノトーンカラーパレット --- */
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #5c5c5c;
  --color-border: #e2e2e2;
  --color-border-strong: #cfcfcf;
  --color-surface: #f7f7f7;
  --color-code-bg: #f2f2f2;
  --color-link: #1a1a1a;

  /* --- フォント --- */
  --font-body: "Noto Sans JP", -apple-system, BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-heading: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* --- タイポスケール --- */
  --fs-base: 17px;
  --lh-base: 1.85;
  --measure: 720px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  padding: 2rem;
}

/* =========================================================
   記事コンテナ
   ========================================================= */

.post,
article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* =========================================================
   見出し
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin-top: 2.6em;
  margin-bottom: 0.8em;
}

h1 {
  font-size: 2em;
  font-weight: 700;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 0.4em;
  margin-top: 0;
}

h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.35em;
}

h3 {
  font-size: 1.2em;
}

h4 {
  font-size: 1.05em;
  color: var(--color-text-muted);
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

/* =========================================================
   本文要素
   ========================================================= */

p {
  margin: 0 0 1.4em;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border-strong);
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--color-text);
}

strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3em 0;
}

blockquote {
  margin: 1.6em 0;
  padding: 0.2em 1.2em;
  border-left: 3px solid var(--color-border-strong);
  color: var(--color-text-muted);
}

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

ul, ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
}

li {
  margin-bottom: 0.4em;
}

li > ul,
li > ol {
  margin-top: 0.4em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2em auto;
  border-radius: 4px;
}

figcaption {
  text-align: center;
  font-size: 0.85em;
  color: var(--color-text-muted);
  margin-top: -1.2em;
  margin-bottom: 2em;
}

/* =========================================================
   コード
   ========================================================= */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.2em 1.4em;
  overflow-x: auto;
  margin: 1.6em 0;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

/* =========================================================
   テーブル（見やすさ重視）
   ========================================================= */

.table-wrapper {
  overflow-x: auto;
  margin: 2em 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.6;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85em;
  color: var(--color-text-muted);
  margin-bottom: 0.5em;
}

thead th {
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  border-top: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  padding: 0.7em 1em;
  white-space: nowrap;
}

tbody td {
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--color-surface);
}

tbody tr:hover {
  background: #eeeeee;
}

/* 数値列は右寄せにしたい場合に付けるクラス */
td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   その他 UI パーツ
   ========================================================= */

.post-meta {
  color: var(--color-text-muted);
  font-size: 0.9em;
  margin-bottom: 2.5em;
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: 0.8em;
  padding: 0.15em 0.7em;
  border-radius: 999px;
}

::selection {
  background: #1a1a1a;
  color: #ffffff;
}

/* =========================================================
   レスポンシブ
   ========================================================= */

@media (max-width: 600px) {
  :root {
    --fs-base: 16px;
  }
  .post, article {
    padding: 2.5rem 1.2rem 4rem;
  }
  h1 { font-size: 1.6em; }
  h2 { font-size: 1.3em; }
  thead th, tbody td {
    padding: 0.6em 0.7em;
  }
}
