/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fafafa;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* --- Typography --- */
h1, h2, h3 {
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }

p { margin-bottom: 1.2rem; }

/* --- Links --- */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover { color: #555; }

/* --- Site Header --- */
.site-header { margin-bottom: 3rem; }
.site-header h1 a { text-decoration: none; }
.site-header h1 a:hover { color: #555; }

nav { margin-top: 0.4rem; }
nav a {
  margin-right: 1.2rem;
  font-size: 0.9rem;
  color: #555;
}
nav a:hover { color: #1a1a1a; }

/* --- Lists --- */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 1.4rem;
}

.post-list .post-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
}

.post-list .post-date {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.1rem;
  font-variant-numeric: tabular-nums;
}

.post-list .post-detail {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.1rem;
}

/* --- Collapsible Sections --- */
details { margin-bottom: 2rem; }
details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin-bottom: 0.6rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ""; }
details summary::before {
  content: "+";
  font-size: 0.9rem;
  font-weight: 400;
  color: #888;
  width: 1rem;
  flex-shrink: 0;
}
details[open] summary::before {
  content: "\2013";
}
details summary h2 { margin-bottom: 0; }

/* --- Article --- */
article header { margin-bottom: 2rem; }
article header time {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-bottom: 0.3rem;
}
article header h1 { font-size: 1.5rem; }
article h2 { margin-top: 2rem; margin-bottom: 0.6rem; }
article h3 { margin-top: 1.5rem; margin-bottom: 0.4rem; }
article ul, article ol { margin-bottom: 1.2rem; padding-left: 1.4rem; }
article li { margin-bottom: 0.3rem; }
article blockquote {
  border-left: 3px solid #ccc;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #555;
  font-style: italic;
}
article hr { border: none; border-top: 1px solid #ddd; margin: 2rem 0; }

/* --- Back Link --- */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: #888;
}
.back-link:hover { color: #1a1a1a; }

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: #999;
}
.site-footer a { color: #999; }
.site-footer a:hover { color: #555; }

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  body { color: #e0e0e0; background: #111; }
  a:hover { color: #aaa; }
  .site-header h1 a:hover { color: #aaa; }
  nav a { color: #aaa; }
  nav a:hover { color: #e0e0e0; }
  details summary::before { color: #666; }
  .post-list .post-date { color: #777; }
  .post-list .post-detail { color: #999; }
  article header time { color: #777; }
  .back-link { color: #777; }
  .back-link:hover { color: #e0e0e0; }
  article blockquote { border-left-color: #444; color: #aaa; }
  article hr { border-top-color: #333; }
  .site-footer { border-top-color: #222; color: #666; }
  .site-footer a { color: #666; }
  .site-footer a:hover { color: #aaa; }
}
