/* ==========================================================
   blog.css — ブログ一覧 / 記事ページ専用
   style.css のトークン（--paper, --blue, --ink…）を前提に追記する。
   全ページには読ませず、blog.html と posts/*.html だけで読み込む。
   ========================================================== */
:root {
  /* コード・等幅用（フォント追加読み込みなしでシステム等幅を使う） */
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
  --code-bg: #16283f;   /* コードブロックの濃紺 */
  --code-ink: #e8eef6;  /* コード文字 */
}

/* ==========================================================
   一覧：記事カードのリスト
   ========================================================== */
.post-list,
.post-year-list { list-style: none; }
.post-year-group + .post-year-group { margin-top: 38px; }
.post-year {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--blue);
}
.post-year__icon {
  width: 31px;
  height: 31px;
  object-fit: contain;
}
.post-year-list {
  position: relative;
  padding-top: 14px;
}
.post-year-list::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 9'%3E%3Cpath d='M0 4.5C6 0 14 0 20 4.5S34 9 40 4.5' fill='none' stroke='%232d9ad2' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 9px;
}
.post-year-list li { border-bottom: 1px solid var(--sky); }

.post-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-decoration: none;
  padding: 17px 4px;
  transition: color 0.2s ease, padding 0.2s ease;
}
.post-card:hover {
  padding-inline: 10px 0;
}
.post-card:hover .post-card__title { color: var(--blue); }
.post-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.post-card__date {
  flex: none;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.post-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 0;
}

/* ==========================================================
   記事ページ：ヘッダ（タイトル・日付）
   ========================================================== */
.post-hero { text-align: left; padding-bottom: 30px; }
.post-hero .back-home { text-align: left; }
.post-hero__cat {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}
.post-hero__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.02em;
  margin: 10px 0 16px;
}
.post-hero__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.post-hero__date { font-family: var(--font-en); letter-spacing: 0.06em; }

/* ==========================================================
   記事本文の組版（.post-body）
   md → HTML 変換後の中身がここに入る前提でスタイルを当てる
   ========================================================== */
.post-body {
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
}
.post-body > * + * { margin-top: 1.5em; }

.post-body h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 2.2em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--sky);
}
.post-body h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-top: 1.8em;
}
.post-body h2 + *,
.post-body h3 + * { margin-top: 0.9em; }

.post-body p { margin-top: 1.2em; }

.post-body a {
  color: var(--blue);
  text-underline-offset: 3px;
  text-decoration-color: var(--sky);
}
.post-body a:hover { text-decoration-color: var(--blue); }

.post-body ul,
.post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: 0.4em; }
.post-body ul li::marker { color: var(--blue); }
.post-body ol li::marker { color: var(--blue); font-weight: 700; }

.post-body blockquote {
  border-left: 4px solid var(--blue);
  background: var(--paper);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 14px;
}
.post-body blockquote p { margin: 0; }

/* インラインコード */
.post-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper);
  color: #23507f;
  border-radius: 6px;
  padding: 0.15em 0.45em;
  word-break: break-word;
}

/* コードブロック */
.post-body pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 14px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
  box-shadow: var(--shadow);
}
.post-body pre code {
  font-family: var(--font-mono);
  background: none;
  color: inherit;
  padding: 0;
  white-space: pre;
}

.post-body img {
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-inline: auto;
  height: auto;
}
.post-body .post-media--photo { text-align: center; }
.post-body .post-media--photo img {
  width: min(72%, 280px);
  max-width: 100%;
}
.post-body .post-media--screen { text-align: center; }
.post-body .post-media--screen img {
  width: auto;
  max-width: 100%;
  max-height: 440px;
}
.post-body .post-media--screen video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 440px;
  margin-inline: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.post-body .post-aside {
  background: var(--paper);
  border: 1px solid var(--sky);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--muted);
}
.post-body .post-aside p { margin: 0; }
.post-body .post-x-quote {
  border-left: 4px solid var(--blue);
  background: var(--paper);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
}
.post-body .post-x-quote p {
  margin: 0;
  white-space: pre-wrap;
}
.post-body .post-x-quote footer {
  margin-top: 10px;
  font-family: var(--font-en);
  font-size: 12px;
}
.post-body .post-x-quote footer span {
  margin-left: 8px;
  color: var(--muted);
}
.post-body figure figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.post-body hr {
  border: none;
  height: 1px;
  background: var(--sky);
  margin: 2.4em 0;
}

/* テーブル */
.post-body .table-wrap { overflow-x: auto; }
.post-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.post-body th,
.post-body td {
  border: 1px solid var(--sky);
  padding: 8px 12px;
  text-align: left;
}
.post-body th { background: var(--paper); font-weight: 700; }

/* ==========================================================
   記事フッタ：一覧へ戻る・前後記事
   ========================================================== */
.post-foot { margin-top: 8px; }
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.post-nav a {
  flex: 1;
  text-decoration: none;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-nav a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.post-nav .dir {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--blue);
  display: block;
  margin-bottom: 4px;
}
.post-nav .t {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav a.next { text-align: right; }
.post-nav a.is-empty { visibility: hidden; }

.to-index {
  display: inline-block;
  margin-top: 26px;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--blue);
  text-decoration: none;
}
.to-index:hover { color: var(--ink); }

/* ==========================================================
   PC: 文字・余白を一回り大きく（style.css の 1000px 分岐に合わせる）
   ========================================================== */
@media (min-width: 1000px) {
  .post-card__title { font-size: 20px; }

  .post-hero__title { font-size: 34px; }
  .post-body { font-size: 16.5px; }
  .post-body h2 { font-size: 25px; }
  .post-body h3 { font-size: 19px; }
  .post-body pre { font-size: 14px; }
}

@media (max-width: 360px) {
  .post-card { gap: 10px; }
  .post-card__date { font-size: 10px; }
}
/* ブログは本文を読みやすくするため、横の海の飾りを省く */
.margin-deco { display: none; }
