/* Trader Alternatives — one small stylesheet for the whole site. */

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --text-soft: #57606a;
  --accent: #0b6e4f;
  --border: #e4e7eb;
  --code-bg: #f5f6f8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --text: #e6e8eb;
    --text-soft: #9aa4b0;
    --accent: #4cc38a;
    --border: #2a2f36;
    --code-bg: #1d2127;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
header.site {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

header.site .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover { color: var(--accent); }

nav.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 1.25rem;
}

nav.site-nav a:hover { color: var(--accent); }

/* Main content */
main {
  padding: 2.5rem 0 4rem;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

p { margin: 0 0 1.1rem; }

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

.lead {
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* Post list on the landing page */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list .post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.2rem;
}

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

.post-list .post-title:hover { color: var(--accent); }

.post-list .post-desc {
  margin: 0.3rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.empty-note {
  color: var(--text-soft);
  font-style: italic;
}

/* Article pages */
article .post-meta {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

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

article figure {
  margin: 1.25rem 0;
}

article figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

article figcaption {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.45rem;
  text-align: center;
}

article blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
}

article code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.15em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

article pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

article pre code { background: none; padding: 0; }

article ul, article ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

article th, article td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* Footer */
footer.site {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

footer.site a { color: var(--text-soft); }
footer.site a:hover { color: var(--accent); }
