/* ===================================
   ベース設定
=================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #F7F3EC;
  --ink:       #1C1917;
  --ink-light: #6B6560;
  --accent:    #8B6F47;
  --border:    #DDD7CE;
  --serif:     'Cormorant Garamond', 'Georgia', serif;
  --sans:      'Noto Sans JP', sans-serif;

  /* カテゴリカラー */
  --cat-1: #C9A8B2;   /* 習いごと — くすみローズ */
  --cat-2: #8FAF96;   /* まなび・お金 — セージグリーン */
  --cat-3: #C4956A;   /* たのしむ — テラコッタ */
  --cat-4: #9B9BB5;   /* 日々のこと — ラベンダー */
  --cat-x: #B0A898;   /* その他 */
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  font-weight: 300;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* コンテナ：記事ページは狭く、トップは広く */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================================
   ヘッダー
=================================== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
}
.site-header .container--wide,
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}
nav { display: flex; gap: 2rem; }
nav a {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-light);
}
nav a:hover { color: var(--ink); text-decoration: none; }

/* ===================================
   ヒーロー（トップページ）
=================================== */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.2;
}
.divider {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 1.5rem auto 2.5rem;
}
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  text-align: center;
  margin: 0 0 2.5rem;
}

/* ===================================
   トピックナビ（タイトル下）
=================================== */
.topic-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 3.5rem;
  margin-bottom: 2.5rem;
}
.topic-nav a {
  font-family: var(--sans);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.topic-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ===================================
   カテゴリセクション
=================================== */
.category-section {
  margin-bottom: 3.5rem;
}
.category-heading {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--ink-light);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}

/* ===================================
   ページレイアウト（メイン＋サイドバー）
=================================== */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 3rem;
  align-items: start;
}
.main-content { min-width: 0; }

/* ===================================
   サイドバー
=================================== */
.sidebar {
  position: sticky;
  top: 2rem;
}
.sidebar-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  color: var(--ink-light);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}
.recent-posts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.recent-posts li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sidebar-date {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--ink-light);
  letter-spacing: 0.04em;
}
.sidebar-link {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ===================================
   記事グリッド（2カラム）
=================================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; border-top: 1px solid var(--border); padding-top: 2rem; margin-top: 1rem; }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .container, .container--wide { padding: 0 1rem; }
  .site-header { padding: 1rem 0; margin-bottom: 1.5rem; }
  .hero { padding: 1.5rem 0 1rem; }
  .topic-nav { gap: 0.25rem 1.5rem; margin-bottom: 1.5rem; }
  .topic-nav a { font-size: 0.9rem; }
  .hero-sub { font-size: 0.85rem; margin-bottom: 1.5rem; }
  .category-section { margin-bottom: 2.5rem; }
  .card-body { padding: 1rem; }
}

/* ===================================
   カード
=================================== */
.post-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}
.post-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-decoration: none;
}

/* 画像エリア */
.card-visual {
  display: block;
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
}
.card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card-visual:hover img { transform: scale(1.04); }

/* 画像なし → カテゴリカラー背景 */
.card-visual--color {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
}
.card-visual-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  text-align: center;
  line-height: 1.4;
}

/* カテゴリバッジ */
.card-badge {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  background: rgba(255,255,255,0.88);
  color: var(--ink);
}
/* 画像ありはバッジを画像左上に重ねる */
.card-visual:not(.card-visual--color) .card-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
}

/* カード本文 */
.card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-date {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-light);
  margin-bottom: 0.35rem;
}
.post-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.75;
  flex: 1;
  margin-bottom: 0.75rem;
}
.read-more {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* ===================================
   記事ページ
=================================== */
.back-link {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  margin-bottom: 2.5rem;
}
.back-link:hover { color: var(--ink); text-decoration: none; }

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.article-category {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--ink-light);
  border: 1px solid var(--border);
  padding: 0.15rem 0.7rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}
.article-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin-top: 0.5rem;
}

/* ===================================
   記事本文
=================================== */
.article-text { margin-bottom: 5rem; }
.article-text h2 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}
.article-text h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}
.article-text p { margin-bottom: 1.4rem; font-size: 0.95rem; }
.article-text ul,
.article-text ol { margin: 1rem 0 1.4rem 1.5rem; }
.article-text li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.article-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.article-text strong {
  font-weight: 400;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}
.post-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 1.75rem;
}
.post-body::after { content: ""; display: block; clear: both; }
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-body a:hover { opacity: 0.75; }

/* ===================================
   フッター
=================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-light);
  letter-spacing: 0.06em;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.4rem;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--ink);
}

.static-page {
  max-width: 720px;
  margin: 0 auto;
}
