:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #2a2926;
  --muted: #6d695f;
  --line: #e3dfd5;
  --accent: #2f6b5f;
  --accent-strong: #245449;
  --accent-soft: #e6efeb;
  --warm: #c9823b;
  --warm-soft: #f8eee2;
  --shadow: 0 1px 2px rgba(40, 36, 28, 0.05), 0 4px 16px rgba(40, 36, 28, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181918;
    --surface: #212321;
    --text: #e8e5de;
    --muted: #a39f95;
    --line: #34362f;
    --accent: #7cc0ae;
    --accent-strong: #9ad3c3;
    --accent-soft: #23302c;
    --warm: #e0a668;
    --warm-soft: #33291e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --bg: #181918;
  --surface: #212321;
  --text: #e8e5de;
  --muted: #a39f95;
  --line: #34362f;
  --accent: #7cc0ae;
  --accent-strong: #9ad3c3;
  --accent-soft: #23302c;
  --warm: #e0a668;
  --warm-soft: #33291e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
/* 詰め組みは見出しだけ。本文は句読点の間を残して読みやすく */
h1, h2, h3, .site-name, .hero-lead, .card-title, .toc { font-feature-settings: "palt" 1; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent) url("/favicon.svg") center / cover no-repeat;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.site-name { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; }
.tagline { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }
.header-nav { display: flex; gap: 16px; font-size: 0.85rem; flex: none; }
.header-nav a { color: var(--muted); text-decoration: none; }
.header-nav a:hover { color: var(--accent); }

/* トップ：ブログ紹介は記事カードと別物に見えるよう、面ではなく帯で置く */
.hero-band {
  background:
    radial-gradient(circle at 88% 20%, var(--accent-soft) 0, transparent 55%),
    linear-gradient(180deg, var(--accent-soft), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero { padding-top: 44px; padding-bottom: 40px; }
.hero-label {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.hero-lead { font-size: 1.75rem; font-weight: 700; line-height: 1.55; margin: 0 0 16px; letter-spacing: 0.04em; }
.hero-text { color: var(--muted); font-size: 0.95rem; margin: 0 0 22px; max-width: 34em; }
.hero-profile { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.hero-profile .avatar { width: 44px; height: 44px; font-size: 0.85rem; }
.hero-by { display: block; font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.hero-name { display: block; font-weight: 700; line-height: 1.4; }
.hero-profile:hover .hero-name { color: var(--accent); }
.hero-profile:hover .hero-name::after { content: " →"; }
.latest { margin-top: 36px; }
.section-title {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 700;
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.card a {
  display: block;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.card a:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.78rem; color: var(--muted); }
.card-title { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.6; margin: 6px 0 6px; }
.card a:hover .card-title { color: var(--accent); }
.card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

/* 記事 */
.crumbs { font-size: 0.78rem; color: var(--muted); margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.post {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  margin: 14px 0 0;
}
.post h1 { font-size: 1.6rem; line-height: 1.55; margin: 0 0 12px; letter-spacing: 0.04em; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.85rem; margin: 0 0 24px; }

.toc {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 16px 20px 12px;
  margin: 0 0 32px;
  font-size: 0.92rem;
}
.toc-title { font-weight: 700; margin: 0 0 6px; letter-spacing: 0.1em; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc ol ol { padding-left: 1.1em; list-style: none; font-size: 0.9em; }
.toc ol ol li::before { content: "– "; color: var(--muted); }
.toc li { margin: 2px 0; line-height: 1.7; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.body h2 {
  font-size: 1.3rem;
  line-height: 1.55;
  margin: 56px 0 20px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 5px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.body h3 {
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px dotted var(--line);
}
.body h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm);
  margin-right: 10px;
  vertical-align: 0.15em;
}
.body p { margin: 0 0 1.5em; }
.body ul, .body ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.body li { margin-bottom: 0.35em; }
.body li::marker { color: var(--accent); }
.body strong { background: linear-gradient(transparent 62%, var(--warm-soft) 62%); }
.body blockquote {
  position: relative;
  margin: 0 0 1.5em;
  padding: 18px 20px 18px 48px;
  background: var(--warm-soft);
  border-radius: 12px;
  font-weight: 700;
}
.body blockquote::before {
  content: "“";
  position: absolute;
  left: 14px;
  top: 2px;
  font-size: 2.6rem;
  line-height: 1.4;
  color: var(--warm);
  font-family: Georgia, serif;
}
.body blockquote p { margin: 0; }
.body table { border-collapse: collapse; width: 100%; margin-bottom: 1.5em; font-size: 0.95rem; }
.body th, .body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.body th { background: var(--accent-soft); }

.pr {
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  display: inline-block;
  margin: 0 0 20px;
}
.draft-flag {
  background: #fff3c4;
  color: #6a5200;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  display: inline-block;
  margin: 0 0 12px;
}

/* YouTube（クリックで読み込み） */
.yt {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0 0 1.5em;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; transition: opacity 0.15s; }
.yt:hover img { opacity: 1; }
.yt button {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #e1251b;
  cursor: pointer;
}
.yt button::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* シェア */
.share { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { width: 100%; margin: 0 0 4px; font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.share a, .share button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }

/* 著者 */
.author {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 22px 24px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.avatar {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.author p { margin: 0; }
.author-label { font-size: 0.75rem; color: var(--muted); }
.author-name { font-weight: 700; font-size: 1.05rem; }
.author-bio { font-size: 0.88rem; color: var(--muted); line-height: 1.75; margin: 4px 0 6px !important; }
.author-more { font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.author-more::after { content: " →"; }

.related { margin-top: 48px; }
.related h2 { font-size: 0.85rem; letter-spacing: 0.15em; color: var(--muted); margin: 0 0 14px; }

/* フッター */
.site-footer {
  margin-top: 72px;
  padding: 32px 0 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-name { font-weight: 700; color: var(--text); margin: 0 0 10px; letter-spacing: 0.08em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.copy { margin: 16px 0 0; font-size: 0.78rem; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .tagline { display: none; }
  .header-nav { gap: 12px; }
  .hero { padding-top: 32px; padding-bottom: 30px; }
  .hero-lead { font-size: 1.35rem; }
  .post { padding: 24px 18px 20px; border-radius: 12px; margin-left: -4px; margin-right: -4px; }
  .post h1 { font-size: 1.35rem; }
  .body h2 { font-size: 1.15rem; margin-top: 44px; }
  .author { padding: 18px; }
  .avatar { width: 48px; height: 48px; font-size: 0.9rem; }
}
