/* Minimal dark theme for LiamDGray's blog */
/* #0d1117 bg, #e6edf3 text, #58a6ff accent */

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

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --content-width: 720px;
  --content-pad: 1.5rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin: 1.5em 0 0.5em;
  font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p, ul, ol {
  margin: 0 0 1.25em;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-alt);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

blockquote {
  margin: 0 0 1.25em;
  padding: 0 1em;
  border-left: 4px solid var(--accent);
  color: var(--text-muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* Site header */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--content-pad);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text) !important;
  text-decoration: none !important;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Main content */
main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem var(--content-pad) 4rem;
}

/* List page (blog index) */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-top: 0;
}

.page-description {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-card .post-title {
  margin: 0 0 0.35em;
  font-size: 1.25rem;
}

.post-card .post-title a {
  color: var(--text) !important;
  text-decoration: none !important;
}

.post-card .post-title a:hover {
  color: var(--accent) !important;
}

.post-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.post-tags .tag {
  color: var(--accent);
  font-size: 0.8125rem;
}

.post-tags .tag + .tag {
  margin-left: 0.25rem;
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75em;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Single post */
.single-post {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-header h1 {
  margin-top: 0;
  font-size: 2.25rem;
}

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35em;
}

.post-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content ul, .post-content ol {
  padding-left: 1.5em;
}

.post-content li {
  margin-bottom: 0.35em;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.5em 0.75em;
  text-align: left;
}

.post-content th {
  background: var(--bg-alt);
  font-weight: 600;
}

.reading-time {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.post-nav a {
  max-width: 45%;
}

.post-nav .next {
  text-align: right;
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem var(--content-pad);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-col p {
  margin: 0;
}

.footer-meta {
  font-size: 0.75rem;
  color: #8b949e;
  margin-top: 0.25rem !important;
}
.footer-meta a {
  color: #8b949e;
  text-decoration: none;
}
.footer-meta a:hover {
  color: #58a6ff;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.subscribe-form label {
  font-size: 0.875rem;
  font-weight: 500;
}

.subscribe-row {
  display: flex;
  gap: 0.5rem;
}

.subscribe-row input[type="email"] {
  flex: 1;
  padding: 0.5em 0.75em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.subscribe-row input[type="email"]:focus {
  border-color: var(--accent);
}

.subscribe-row button {
  padding: 0.5em 1em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.subscribe-row button:hover {
  background: var(--accent-hover);
}

/* Giscus wrapper */
.giscus-wrapper {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  list-style: none;
  padding: 0;
}

.pagination li {
  display: inline;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 0.35em 0.75em;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
}

.pagination a {
  color: var(--accent);
}

.pagination a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.pagination .active span {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 0;
    gap: 0.5rem;
  }

  .site-nav {
    gap: 1rem;
  }

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

  .subscribe-row {
    flex-direction: column;
  }

  .post-card {
    padding: 1rem;
  }

  .post-nav {
    flex-direction: column;
    gap: 0.5rem;
  }
}
