/* ==========================================================================
   Massiv Tech Blog
   デザイントークン (feature-design の「デザイン」セクションに対応)
   ========================================================================== */

:root {
  /* 配色 */
  --color-bg: #fffdf9;
  --color-text: #1e1c2a;
  --color-text-muted: rgb(30 28 42 / 55%);
  --color-accent: #e55d3e;
  --color-border: #efece4;
  --color-code-bg: #232032;
  --color-code-text: #f8f8f6;

  /* 書体 */
  --font-serif: ui-serif, "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* レイアウト */
  --content-width: 44rem;
  --content-padding: 1.25rem;
}

/* ==========================================================================
   ベース
   ========================================================================== */

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.9;
  font-feature-settings: "palt";
}

a {
  color: inherit;
  text-decoration-color: rgb(229 93 62 / 45%);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent);
}

.accent {
  color: var(--color-accent);
}

/* ==========================================================================
   ヘッダー・フッター
   ========================================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem var(--content-padding);
  border-bottom: 1px solid var(--color-border);
}

/* ワードマークの下にラベルを重ねたスタック型のロックアップ */
.site-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-logo-mark {
  height: 1.2rem;
  width: auto;
}

/* ワードマーク (専用書体) と張り合わないよう、従属するラベルとして小さく大文字で添える。
   letter-spacing はワードマークとラベルの幅が揃うように調整した値 */
.site-logo-suffix {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-text-muted);
}

.site-footer .site-logo-suffix {
  color: rgb(248 248 246 / 65%);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

.site-nav a {
  text-decoration: none;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-padding) 4rem;
}

.site-footer {
  width: 100%;
  background: var(--color-text);
  color: var(--color-code-text);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-accent);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem var(--content-padding) 2rem;
}

.site-footer-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  text-decoration: none;
}

.site-footer-tagline {
  margin: 0.75rem 0 0;
  color: rgb(248 248 246 / 55%);
  font-size: 0.8rem;
}

.site-footer-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

.site-footer-copyright {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem var(--content-padding) 2rem;
  border-top: 1px solid rgb(248 248 246 / 12%);
  color: rgb(248 248 246 / 55%);
  font-size: 0.75rem;
}

/* ==========================================================================
   トップページ (hero + 記事一覧)
   ========================================================================== */

/* 記事一覧の前に置くのはサイト説明の 1 行だけなので、
   大きな見出しを前提とした広い余白は取らない */
.hero {
  padding: 2.5rem 0 2rem;
}

/* サイト説明は本文カラムより狭くすると末尾の数文字だけが 2 行目に折り返されるため、
   カラム幅いっぱいを使って標準的な画面幅では 1 行に収める。
   カラムより狭い画面では通常どおり折り返す */
.hero-description {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.post-list-item {
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--color-border);
}

.post-list-date {
  flex-shrink: 0;
  min-width: 6.5rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.post-list-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.6;
}

.post-list-title a {
  text-decoration: none;
}

.post-list-title a:hover {
  text-decoration: underline;
  text-decoration-color: rgb(229 93 62 / 45%);
}

.post-list-tags {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.post-list-empty {
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

@media (max-width: 40rem) {
  .post-list-item {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }

  .post-list-title {
    width: 100%;
    order: 1;
  }

  .post-list-tags {
    margin-left: 0;
  }
}

/* ==========================================================================
   記事ページ
   ========================================================================== */

.post-header {
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.post-title {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  line-height: 1.55;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.post-tags li {
  padding: 0.05rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.post-body {
  padding-top: 1.5rem;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 2.5em 0 0.75em;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.6;
}

.post-body h2 {
  font-size: 1.4rem;
}

.post-body h3 {
  font-size: 1.15rem;
}

.post-body h4 {
  font-size: 1rem;
}

.post-body p {
  margin: 1.25em 0;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5em;
}

.post-body li {
  margin: 0.3em 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.post-body blockquote {
  margin: 1.25em 0;
  padding: 0.25em 0 0.25em 1.25em;
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
}

.post-body hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.post-body th,
.post-body td {
  padding: 0.5em 0.75em;
  border: 1px solid var(--color-border);
  text-align: left;
}

.post-back {
  margin-top: 3rem;
  font-size: 0.85rem;
}

.post-back a {
  text-decoration: none;
}

/* ==========================================================================
   コード (インライン・ブロック)
   ========================================================================== */

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.post-body :not(pre) > code {
  padding: 0.15em 0.4em;
  background: rgb(30 28 42 / 6%);
  border-radius: 4px;
}

.post-body pre {
  margin: 1.5em 0;
  padding: 1.1em 1.3em;
  overflow-x: auto;
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border-radius: 8px;
  line-height: 1.7;
}

.post-body pre code {
  background: none;
  padding: 0;
}

/* Prism トークン (ブランド配色に合わせた独自テーマ) */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #908da6;
}

.token.punctuation,
.token.operator {
  color: #b8b5c9;
}

.token.keyword,
.token.tag,
.token.important {
  color: #f08562;
}

.token.string,
.token.char,
.token.attr-value,
.token.inserted {
  color: #9ed7a8;
}

.token.function,
.token.class-name,
.token.selector,
.token.attr-name {
  color: #f2d49b;
}

.token.number,
.token.boolean,
.token.constant,
.token.symbol {
  color: #d8a9f0;
}

.token.property,
.token.builtin,
.token.variable {
  color: #9ecbf2;
}

.token.deleted {
  color: #f08c8c;
}

.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

/* ==========================================================================
   404
   ========================================================================== */

.not-found {
  padding: 4rem 0;
}

.not-found-title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent);
}
