/* ===== デザイントークン ===== */
:root {
  --color-bg-page:        #24201d;
  --color-sidebar-border: #b5241a;
  --color-accent-new:     #b5241a;
  --color-text-primary:   #ffffff;
  --color-text-muted:     #999999;
  --color-card-divider:   rgba(255, 255, 255, 0.08);
  --color-tag-border:     rgba(255, 255, 255, 0.5);

  --sidebar-width:      240px;
  --content-max:       1200px;
  --postmeta-width:     220px;
  --postimages-width:   600px;
  --card-gap:            40px;
  --card-pad-v:          60px;
  --card-pad-h:          40px;
}

/* ===== リセット ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== ベース ===== */
html { font-size: 16px; }
body {
  background-color: var(--color-bg-page);
  background-image: url('/common/body_bg.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: 0 0;
  color: var(--color-text-primary);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== サイトレイアウト ===== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== サイドバー ===== */
.site-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 5px solid var(--color-sidebar-border);
  padding: 40px 50px 40px 0;
  display: flex;
  flex-direction: column;
  gap: 45px;
  overflow: hidden;
}

/* 背景装飾ロゴ */
.sidebar-back-logo {
  position: absolute;
  left: -56px;
  top: -19px;
  width: 247px;
  height: 627px;
  transform: rotate(-5.33deg);
  pointer-events: none;
}

/* ロゴ */
.sidebar-logo a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
}

.sidebar-logo-bar {
  display: block;
  width: 1px;
  height: 72px;
}

.sidebar-logo-type {
  display: block;
  width: 31px;
  height: 223px;
}

/* メニューボタン */
.sidebar-menu-btn {
  background: none;
  border: 1px solid #fff;
  border-radius: 3px;
  padding: 10px;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  align-self: center;
}

.menu-dots {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  grid-template-rows: repeat(3, 6px);
  gap: 3px;
}

.menu-dots span {
  display: block;
  width: 6px;
  height: 6px;
  background: #d9d9d9;
  border-radius: 50%;
}

.menu-label {
  font-size: 10px;
  font-family: 'Noto Sans JP', sans-serif;
}

/* ===== メインコンテンツ ===== */
.site-content {
  flex: 1;
  min-width: 0;
  border-left: 1px solid #555;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* ===== ブレッドクラム ===== */
.breadcrumbs {
  display: flex;
  border-bottom: 1px solid #555;
  flex-shrink: 0;
}

.breadcrumb-item {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 350;
  font-size: 13px;
  color: var(--color-text-primary);
  padding: 10px 25px;
  border-right: 1px solid #555;
  white-space: nowrap;
}

.breadcrumb-item.current {
  color: var(--color-text-muted);
}

/* ===== フィード（トップ・一覧） ===== */
.post-feed {
  width: 100%;
}

/* ===== PostCard ===== */
.post-card {
  display: flex;
  gap: var(--card-gap);
  align-items: flex-start;
  justify-content: center;
  padding: var(--card-pad-v) var(--card-pad-h);
  border-bottom: 1px solid var(--color-card-divider);
}

/* PostCard 内の3カラム幅固定 */
.post-meta         { flex: 0 1 18%; max-width: var(--postmeta-width); }
.post-images       { flex: 1; min-width: 0; }
.post-card-right   { flex: 0 1 18%; max-width: var(--postmeta-width); }

/* ===== PostMeta ===== */
.post-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.post-meta-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* NEW バッジ */
.badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-new);
  color: #fff;
  font-family: 'EB Garamond', serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 6px 30px;
  align-self: flex-start;
}

/* 記事タイトル */
.post-title-wrap a {
  font-family: 'Kiwi Maru', serif;
  font-size: 32px;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.post-title-wrap a:hover { opacity: 0.8; }

/* 日付 */
.post-date {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 100;
  line-height: 1;
  white-space: nowrap;
}

.post-date .year { font-size: 16px; }
.post-date .mmdd { font-size: 32px; }

/* カテゴリ */
.post-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-meta-icon {
  width: 22px;
  height: 14px;
  flex-shrink: 0;
}

.post-meta-icon--tag {
  height: 18px;
}

.category-tag {
  font-family: 'Kiwi Maru', serif;
  font-size: 12px;
  border: 0.5px solid var(--color-tag-border);
  padding: 3px 10px;
  white-space: nowrap;
}

.category-tag:hover { background: rgba(255,255,255,0.08); }

/* タグ・感情タグ */
.post-tags,
.post-emotions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tag-badge {
  font-family: 'Kiwi Maru', serif;
  font-size: 12px;
  padding: 3px 8px;
  color: var(--color-text-muted);
}

.tag-badge:hover { color: var(--color-text-primary); }

/* 説明文 */
.post-description {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

.post-image-description {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: #999;
  line-height: 20px;
}

/* ===== PostImages ===== */
.post-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 800px;
}

.post-images-inner {
  max-width: 680px;
  margin-inline: auto;
}

/* Markdown 本文内の画像を600px幅に揃える */
.post-images img:not(.webclap-icon) {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 30px;
}

/* 「読みました」ボタン */
.webclap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #d9d9d9;
  padding: 15px 40px;
  font-family: 'Kiwi Maru', serif;
  font-size: 20px;
  color: var(--color-text-primary);
  transition: border-color 0.2s, opacity 0.2s;
  width: 100%;
  max-width: 250px;
}

.webclap-btn:hover { opacity: 0.7; }

.webclap-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* 「続きはこちら」 */
.post-more {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 14px 20px;
  text-align: center;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--color-text-muted);
  transition: border-color 0.2s, color 0.2s;
  margin-top: 4px;
}

.post-more:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--color-text-primary);
}

/* ===== ノンブル風ページネーション（右下固定） ===== */
.nomber-pagination {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 100;
}

.nomber-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 80px;
}

.nomber-prev,
.nomber-next {
  font-size: 20px;
  color: var(--color-text-primary);
  line-height: 1;
  transition: opacity 0.2s;
}

.nomber-prev:hover,
.nomber-next:hover { opacity: 0.6; }

.nomber-prev.disabled,
.nomber-next.disabled { opacity: 0.2; pointer-events: none; }

.nomber-current {
  font-family: 'EB Garamond', serif;
  font-size: 64px;
  line-height: 1;
  color: var(--color-text-primary);
  text-align: right;
}

/* ===== 一覧・タクソノミーページ ===== */
.page-title {
  padding: 40px 40px 0;
  font-family: 'Kiwi Maru', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-card-divider);
  padding-bottom: 24px;
}

.taxonomy-description {
  padding: 16px 40px 24px;
  font-size: 14px;
  color: var(--color-text-muted, #888);
  line-height: 1.8;
  border-bottom: 1px solid var(--color-card-divider);
}

/* ===== 個別記事ページ ===== */
.single-wrap {
  padding: 40px;
  max-width: calc(var(--sidebar-width) + var(--postmeta-width) + var(--card-gap) + var(--postimages-width) + var(--card-pad-h) * 2);
}

.single-post {
  display: flex;
  gap: var(--card-gap);
  align-items: flex-start;
}

.single-post .post-meta-single {
  width: var(--postmeta-width);
  flex-shrink: 0;
  position: sticky;
  top: 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.single-post .post-content {
  width: var(--postimages-width);
  flex-shrink: 0;
}

.single-post .post-content img {
  width: 100%;
  height: auto;
  margin-bottom: 8px;
}

.post-body {
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-text-muted);
}

/* 前後ナビ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-card-divider);
  font-size: 13px;
  color: var(--color-text-muted);
}

.post-nav-link:hover { color: var(--color-text-primary); }

/* ===== 404 ===== */
.error-page {
  text-align: center;
  padding: 120px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.error-page h1 {
  font-family: 'EB Garamond', serif;
  font-size: 80px;
  color: var(--color-text-muted);
}
