/* ===================================================
   TDMO — サイト全体の唯一のCSS
   色・余白の変更は :root の変数を優先して編集すること。
   ダークモードは prefers-color-scheme で自動切替。
   =================================================== */

:root {
  --bg: #faf9f6;
  --bg-card: #ffffff;
  --text: #1c1c1a;
  --muted: #6f6e68;
  --accent: #0f6e5c;
  --accent-soft: #e3f0ec;
  --border: #e6e4dd;
  --max-width: 44rem;
  --font-body: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, sans-serif;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161815;
    --bg-card: #1e211d;
    --text: #e8e6e0;
    --muted: #9a988f;
    --accent: #5fc4a8;
    --accent-soft: #1f2e2a;
    --border: #2c2f2a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.95;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

/* スキップリンク（アクセシビリティ） */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* レイアウト */
header.site, main, footer.site {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

header.site {
  padding-top: 2.25rem;
  padding-bottom: 1.1rem;
  margin-bottom: clamp(2rem, 6vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0;
}
.site-title a { color: var(--text); text-decoration: none; }
.site-title a:hover { color: var(--accent); }

header.site nav { display: flex; gap: 1.4rem; }
header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
header.site nav a:hover,
header.site nav a[aria-current="page"] { color: var(--accent); }

footer.site {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }

/* タイポグラフィ */
h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  line-height: 1.45;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
}
h2 {
  font-size: 1.3rem;
  margin-top: 2.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1.1rem; margin-top: 2rem; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; height: auto; border-radius: var(--radius); }
time { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }

.lead { font-size: 1.05rem; color: var(--muted); }

blockquote {
  margin: 1.75rem 0;
  padding: 0.5rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}

pre, code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  background: var(--accent-soft);
  border-radius: 6px;
}
code { padding: 0.15em 0.45em; font-size: 0.88em; }
pre { padding: 1.1rem 1.25rem; overflow-x: auto; line-height: 1.7; }
pre code { padding: 0; background: none; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ヒーロー（トップページ） */
.hero { margin-bottom: clamp(2rem, 6vw, 3rem); }
.hero .wordmark {
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.2;
  margin: 0;
  background: linear-gradient(120deg, var(--accent), var(--text));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  font-size: 1.02rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* セクションカード */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.section-grid a {
  display: block;
  padding: 1.05rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.section-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.section-grid strong { display: block; margin-bottom: 0.2rem; color: var(--accent); }
.section-grid span { font-size: 0.85rem; color: var(--muted); }

/* 記事一覧 */
ul.post-list { list-style: none; padding: 0; margin: 1.25rem 0; }
ul.post-list li {
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
ul.post-list li:hover { border-color: var(--accent); }
ul.post-list time { display: block; margin-bottom: 0.15rem; }
ul.post-list a { font-weight: 600; text-decoration: none; }
ul.post-list a:hover { text-decoration: underline; }
ul.post-list p { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* 記事ページ */
article > p:first-of-type { margin-top: 0; }
.article-meta { margin-bottom: 2rem; }

/* 印刷 */
@media print {
  header.site nav, footer.site { display: none; }
  body { background: #fff; color: #000; }
}
