/* CSS Variables for theming */
:root {
  --bg: #fff;
  --text: #111;
  --text-muted: #666;
  --border: #eee;
}

[data-theme="dark"] {
  --bg: #111;
  --text: #eee;
  --text-muted: #999;
  --border: #333;
}

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

/* Smooth theme transitions */
html {
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Container */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Site header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.site-title:hover {
  opacity: 0.7;
}

/* Theme toggle button */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  color: var(--text);
  line-height: 1;
}

#theme-toggle:hover {
  opacity: 0.7;
}

/* Show/hide sun/moon based on theme */
.sun { display: none; }
.moon { display: inline; }

[data-theme="dark"] .sun { display: inline; }
[data-theme="dark"] .moon { display: none; }

/* Blog roll / post list */
.posts {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* Full post entries on home page */
.post-entry {
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border);
}

.post-entry:last-child {
  border-bottom: none;
}

.post-entry .post-header {
  margin-bottom: 1.5rem;
}

.post-entry .post-header h2 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.post-entry .post-header time {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.post-header time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Post content */
.post-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content img {
  width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
}

.post-content a {
  color: var(--text);
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.post-content h2 {
  font-size: 1.25rem;
}

.post-content h3 {
  font-size: 1.1rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
}

.post-content pre {
  background: var(--border);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.post-content code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  font-size: 0.9em;
}

/* Footer */
.site-footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  main {
    padding: 0 2rem 4rem;
  }

  .site-header {
    padding: 3rem 2rem;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }
}

/* Larger image container for photos */
@media (min-width: 900px) {
  .post-content img {
    width: calc(100% + 4rem);
    margin-left: -2rem;
    max-width: none;
  }
}
