/* ==========================================================================
   jsuereth.com - Modern Minimalist Systems Engineer Design (Option A)
   ========================================================================== */

:root {
  --bg: #fdfdfd;
  --bg-subtle: #f6f8fa;
  --text: #24292f;
  --text-muted: #57606a;
  --border: #e1e4e8;
  --border-subtle: #eaeef2;
  --accent: #c85a17;       /* Warm rust/amber */
  --accent-hover: #b04c10;
  --accent-light: rgba(200, 90, 23, 0.08);
  --code-bg: #f4f6f8;
  --inline-code-bg: #eff2f5;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --max-width: 740px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-subtle: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --border: #30363d;
  --border-subtle: #21262d;
  --accent: #f0883e;       /* Warm glowing amber */
  --accent-hover: #ff9b53;
  --accent-light: rgba(240, 136, 62, 0.12);
  --code-bg: #161b22;
  --inline-code-bg: #1f242c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-subtle: #161b22;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --border-subtle: #21262d;
    --accent: #f0883e;
    --accent-hover: #ff9b53;
    --accent-light: rgba(240, 136, 62, 0.12);
    --code-bg: #161b22;
    --inline-code-bg: #1f242c;
  }
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 { font-size: 1.95rem; margin-top: 0; }
h2 { font-size: 1.45rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.3em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p {
  margin-top: 0;
  margin-bottom: 1.25em;
}

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

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

/* Layout Container */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

/* Header & Navigation */
header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.35rem 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Main Content */
main.main-content {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* Intro Section (Clean, understated) */
.intro-section {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.intro-greeting {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.intro-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.intro-links a {
  color: var(--accent);
  text-decoration: none;
}

.intro-links a:hover {
  text-decoration: underline;
}

/* Talks Archive & Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

th, td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  background-color: var(--bg-subtle);
}

tr:hover td {
  background-color: var(--bg-subtle);
}

.table-year {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.95rem;
}

.table-title {
  font-weight: 600;
  color: var(--text);
}

.table-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.2rem;
}

.table-links {
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Status Badges */
.badge-active {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  background-color: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

[data-theme="dark"] .badge-active {
  color: #4ade80;
  background-color: rgba(74, 222, 128, 0.15);
}

.badge-past {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Post Cards & Lists */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-item-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

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

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

.post-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  background-color: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Article Page */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.22;
  margin-bottom: 0.8rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

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

.article-content li {
  margin-bottom: 0.4em;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--accent);
  background-color: var(--bg-subtle);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Code & Preformatted */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--inline-code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  position: relative;
}

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

/* Copy Button for Code Blocks */
.code-block-wrapper {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.code-block-wrapper:hover .copy-code-btn {
  opacity: 1;
}

.copy-code-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Table of Contents */
.toc-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.toc-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.toc-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.92rem;
}

.toc-box li {
  margin-bottom: 0.35rem;
}

/* Pagination & Navigation */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

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

/* Bio Photo & Author card */
.bio-photo-wrapper {
  margin: 1.5rem 0;
}

.bio-photo {
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  background-color: var(--bg);
  transition: border-color 0.2s ease;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .intro-greeting { font-size: 1.75rem; }
  .article-title { font-size: 1.75rem; }
  .site-nav { gap: 0.75rem; font-size: 0.85rem; }
}
