:root {
  --bg-color: #fff;
  --text-color: #222;
  --text-secondary: #666;
  --border-color: #e5e5e5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #3a3735;
    --text-color: #e8e4dc;
    --text-secondary: #b8b4ac;
    --border-color: #4a4744;
  }
}

[data-theme="dark"] {
  --bg-color: #3a3735;
  --text-color: #e8e4dc;
  --text-secondary: #b8b4ac;
  --border-color: #4a4744;
}

[data-theme="light"] {
  --bg-color: #fff;
  --text-color: #222;
  --text-secondary: #666;
  --border-color: #e5e5e5;
}

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

html {
  font-size: 18px;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  padding: 2rem 1.5rem 4rem;
  max-width: 640px;
  margin: 0 auto;
}

a {
  color: var(--text-color);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* Header / Navigation */
header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.site-title {
  font-size: 1.1rem;
  font-weight: normal;
  margin-bottom: 0.5rem;
}

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

nav {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

nav a {
  margin-right: 1.25rem;
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Main content */
main {
  min-height: 60vh;
}

/* Homepage */
.homepage {
  text-align: center;
}

.homepage .post-list {
  text-align: left;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.hero {
  padding: 2rem 0 1rem;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.button {
  display: inline-block;
  margin: 2rem 0;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.15s, color 0.15s;
}

.button:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* Post list (homepage) */
.post-list {
  list-style: none;
}

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

.post-list .post-title {
  font-size: 1.2rem;
  font-weight: normal;
  margin-bottom: 0.25rem;
}

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

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

.post-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Single post / page */
article h1 {
  font-size: 1.8rem;
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

article .post-meta {
  margin-bottom: 2rem;
}

article p {
  margin-bottom: 1.5rem;
}

article h2, article h3, article h4 {
  font-weight: normal;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

article h2 {
  font-size: 1.3rem;
}

article h3, article h4 {
  font-size: 1.1rem;
}

article ul, article ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.5rem;
}

article li ul, article li ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

article blockquote {
  border-left: 3px solid var(--border-color);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
}

article blockquote p {
  margin-bottom: 0.75rem;
}

article blockquote p:last-child {
  margin-bottom: 0;
}

article hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

/* Drop cap */
.has-drop-cap::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 1;
  padding-right: 0.5rem;
  padding-top: 0.1rem;
  font-weight: normal;
}

/* Featured image */
.featured-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 2rem;
  border-radius: 4px;
}

/* Back link */
.back-link {
  display: block;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 1.5rem 1rem 3rem;
  }

  article h1 {
    font-size: 1.5rem;
  }

  .has-drop-cap::first-letter {
    font-size: 3rem;
  }
}
