/* ═══════ VARIABLES ═══════ */

:root, [data-theme="light"] {
  --bg: #fafaf8;
  --text: #2b2b2b;
  --text-secondary: #888;
  --text-faded: #aaa;
  --text-dim: #bbb;
  --border: #e8e8e4;
  --hover: #666;
  --img-bg: #f0efe9;
}

[data-theme="dark"] {
  --bg: #111;
  --text: #d4d4d4;
  --text-secondary: #888;
  --text-faded: #666;
  --text-dim: #555;
  --border: #222;
  --hover: #aaa;
  --img-bg: #1a1a1a;
}

/* ═══════ BASE ═══════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  transition: background 0.3s, color 0.3s;
}

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

/* ═══════ HEADER ═══════ */

header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left h1 {
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 3px;
}

.header-left h1 a {
  color: var(--text);
  text-decoration: none;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 16px;
}

nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

nav a {
  font-size: 0.88rem;
  color: var(--text-faded);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover, nav a.active { color: var(--text); }

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-faded);
  padding: 6px;
  margin-top: 2px;
  transition: color 0.2s;
}

.theme-toggle:hover { color: var(--text); }

/* ═══════ POST LIST (front page) ═══════ */

.post-item { margin-bottom: 20px; }

.post-item-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.post-item-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.post-item-title:hover { color: var(--hover); }

.post-item-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.post-item-snippet {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}

/* ═══════ POST DETAIL ═══════ */

.back-link {
  font-size: 0.85rem;
  color: var(--text-faded);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 28px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--text); }

.post-detail-title {
  font-size: 1.65rem;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.35;
}

.post-detail-date {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.post-detail-body {
  font-size: 1.08rem;
  line-height: 1.8;
}

.post-detail-body p { margin-bottom: 18px; }

.post-detail-body img {
  width: 100%;
  border-radius: 3px;
  margin: 24px 0;
}

.post-detail-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 3px;
  margin: 24px 0;
}

/* ═══════ BOOKS SECTION ═══════ */

.section-title {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.book-entry { margin-bottom: 18px; }

.book-title-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.book-name {
  font-size: 1rem;
  font-weight: 500;
  font-style: italic;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-faded);
}

.book-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ═══════ ABOUT ═══════ */

.about-text {
  font-size: 1rem;
  line-height: 1.8;
}

.about-text p { margin-bottom: 16px; }

/* ═══════ FOOTER ═══════ */

footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: border-color 0.3s;
}

footer a {
  color: var(--text-faded);
  text-decoration: none;
  margin-right: 16px;
  transition: color 0.2s;
}

footer a:hover { color: var(--text); }

/* ═══════ RESPONSIVE ═══════ */

@media (max-width: 480px) {
  .post-item-header { flex-direction: column; gap: 0; }
  .book-title-line { flex-direction: column; gap: 0; }
}
