*, *::before, *::after { box-sizing: border-box; }

:root {
  --text: #1a1a1a;
  --muted: #666;
  --accent: #2563eb;
  --bg: #fff;
  --border: #e5e7eb;
  --max-width: 680px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0 1rem;
}

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 0;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }

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

/* Post header */
.post-header { margin-bottom: 2rem; }
.post-meta {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.25rem;
}
.categories { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.categories a {
  background: #f3f4f6;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

/* Post content */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.post-content figure {
  margin: 1.5rem 0;
}
.post-content figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.post-content iframe {
  max-width: 100%;
}
.post-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.post-content td, .post-content th {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
}

/* Post list */
.archive-note { color: var(--muted); font-size: 0.9rem; margin-top: -0.5rem; }
.year-section h2 { color: var(--muted); font-weight: 500; }
.post-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
}
.post-list li {
  display: flex;
  gap: 1rem;
  padding: 0.25rem 0;
  align-items: baseline;
}
.post-list time {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 4.5rem;
}

/* App Store links */
.app-store-link {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  vertical-align: middle;
}
.app-store-link:hover { background: #333; }

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  cursor: zoom-out;
}
#lightbox[hidden] { display: none; }
#lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
}
#lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  padding: 0;
}
#lightbox-close:hover { opacity: 1; }
.post-content img { cursor: zoom-in; }

/* WP compat classes */
.alignleft { float: left; margin: 0 1rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1rem; }
.aligncenter { display: block; margin: 0 auto; }
.wp-caption { max-width: 100%; }
.wp-caption-dd { font-size: 0.875rem; color: var(--muted); }
.page-break { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
