/* Brutalist — pure black/white, links use body color */
:root {
  --text-primary: #000000;
  --text-secondary: #666666;
  --bg-primary: #ffffff;
  --link-color: #000000;
  --link-hover: #444444;
  --code-bg: #f5f5f5;
  --border-color: #e0e0e0;
}

[data-theme="dark"] {
  --text-primary: #e8e8e8;
  --text-secondary: #888888;
  --bg-primary: #0d0d0d;
  --link-color: #e8e8e8;
  --link-hover: #bbbbbb;
  --code-bg: #1f1f1f;
  --border-color: #2a2a2a;
}

/* Social icon links */
.nav-socials {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

nav .nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 5px;
  transition: color 0.2s;
}

.nav-social:hover {
  color: var(--link-color);
}

.nav-social svg {
  display: block;
}

/* Theme toggle button */
.theme-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  transition: color 0.2s;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--border-color);
}

.theme-toggle:hover {
  color: var(--link-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

a:hover {
  color: var(--link-hover);
}

h1 {
  font-size: 2rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  margin: 1.25rem 0 0.5rem 0;
  font-weight: 600;
}

.anchor-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8em;
  margin-left: 0.5rem;
  opacity: 0.3;
  transition: opacity 0.2s, color 0.2s;
  user-select: none;
}

.anchor-link:hover {
  opacity: 1;
  color: var(--link-color);
  text-decoration: none;
}

code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

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

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

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

nav {
  padding: 1.5rem 0 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

footer {
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding: 0.75rem 0 1.5rem 0;
}

footer p {
  margin: 0;
}

article {
  margin-bottom: 4rem;
}

article > header > h1 {
  margin-top: 0;
}

.post-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

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

nav a {
  color: var(--text-primary);
  text-decoration: none;
  margin: 0 1rem;
}

nav a:first-child {
  margin-left: 0;
}

nav a:hover {
  color: var(--link-color);
}

nav .current {
  font-weight: 600;
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
}

.brand-short {
  display: none;
}

@media (max-width: 600px) {
  nav {
    padding: 1rem 0;
    margin-bottom: 1rem;
  }

  .nav-right {
    gap: 0.5rem;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .theme-toggle::before {
    display: none;
  }
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.25rem 0;
}

.post-title {
  flex: 1;
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* KEEP favorite posts - just make them bold */
.favorite-post .post-title {
  font-weight: 600;
}


blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--link-color);
  background: var(--code-bg);
  font-style: italic;
  color: var(--text-secondary);
}

blockquote p {
  margin: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

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

th {
  font-weight: 600;
  background: var(--code-bg);
  border-bottom: 2px solid var(--border-color);
}

tbody tr:nth-child(even) {
  background: var(--code-bg);
}

tbody tr:hover {
  background: var(--border-color);
}

/* Responsive images */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

@media (max-width: 600px) {
  .post-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-date {
    margin-left: 0;
    margin-top: 0.25rem;
  }
}/* Syntax highlighting (Chroma, class-based).
   Light = `hugo gen chromastyles --style=github`
   Dark  = `hugo gen chromastyles --style=monokai` scoped under [data-theme="dark"]
   Backgrounds are unified onto --code-bg so highlighted and plain code blocks
   match in both modes and follow the theme toggle. */

/* Unify code-block background with the rest of the site, both modes. */
.bg, .chroma { background-color: var(--code-bg); -webkit-text-size-adjust:none; }

/* ---- Light mode (github) ---- */
.chroma .err { color:#f6f8fa;background-color:#82071e }
.chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
.chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
.chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
.chroma .hl { background-color:#dedede }
.chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
.chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
.chroma .line { display:flex; }
.chroma .k { color:#cf222e }
.chroma .kc { color:#cf222e }
.chroma .kd { color:#cf222e }
.chroma .kn { color:#cf222e }
.chroma .kp { color:#cf222e }
.chroma .kr { color:#cf222e }
.chroma .kt { color:#cf222e }
.chroma .na { color:#1f2328 }
.chroma .nc { color:#1f2328 }
.chroma .no { color:#0550ae }
.chroma .nd { color:#0550ae }
.chroma .ni { color:#6639ba }
.chroma .nl { color:#900;font-weight:bold }
.chroma .nn { color:#24292e }
.chroma .nx { color:#1f2328 }
.chroma .nt { color:#0550ae }
.chroma .nb { color:#6639ba }
.chroma .bp { color:#6a737d }
.chroma .nv { color:#953800 }
.chroma .vc { color:#953800 }
.chroma .vg { color:#953800 }
.chroma .vi { color:#953800 }
.chroma .vm { color:#953800 }
.chroma .nf { color:#6639ba }
.chroma .fm { color:#6639ba }
.chroma .s { color:#0a3069 }
.chroma .sa { color:#0a3069 }
.chroma .sb { color:#0a3069 }
.chroma .sc { color:#0a3069 }
.chroma .dl { color:#0a3069 }
.chroma .sd { color:#0a3069 }
.chroma .s2 { color:#0a3069 }
.chroma .se { color:#0a3069 }
.chroma .sh { color:#0a3069 }
.chroma .si { color:#0a3069 }
.chroma .sx { color:#0a3069 }
.chroma .sr { color:#0a3069 }
.chroma .s1 { color:#0a3069 }
.chroma .ss { color:#032f62 }
.chroma .m { color:#0550ae }
.chroma .mb { color:#0550ae }
.chroma .mf { color:#0550ae }
.chroma .mh { color:#0550ae }
.chroma .mi { color:#0550ae }
.chroma .il { color:#0550ae }
.chroma .mo { color:#0550ae }
.chroma .o { color:#0550ae }
.chroma .ow { color:#0550ae }
.chroma .or { color:#0550ae }
.chroma .p { color:#1f2328 }
.chroma .c { color:#57606a }
.chroma .ch { color:#57606a }
.chroma .cm { color:#57606a }
.chroma .c1 { color:#57606a }
.chroma .cs { color:#57606a }
.chroma .cp { color:#57606a }
.chroma .cpf { color:#57606a }
.chroma .gd { color:#82071e;background-color:#ffebe9 }
.chroma .ge { color:#1f2328 }
.chroma .gi { color:#116329;background-color:#dafbe1 }
.chroma .go { color:#1f2328 }
.chroma .gl { text-decoration:underline }
.chroma .w { color:#fff }

/* ---- Dark mode (monokai) ---- */
[data-theme="dark"] {
  .chroma { color:#f8f8f2; }
  .chroma .err { color:#960050;background-color:#1e0010 }
  .chroma .hl { background-color:#3c3d38 }
  .chroma .lnt { color:#7f7f7f }
  .chroma .ln { color:#7f7f7f }
  .chroma .k { color:#66d9ef }
  .chroma .kc { color:#66d9ef }
  .chroma .kd { color:#66d9ef }
  .chroma .kn { color:#f92672 }
  .chroma .kp { color:#66d9ef }
  .chroma .kr { color:#66d9ef }
  .chroma .kt { color:#66d9ef }
  .chroma .na { color:#a6e22e }
  .chroma .nc { color:#a6e22e }
  .chroma .no { color:#66d9ef }
  .chroma .nd { color:#a6e22e }
  .chroma .ne { color:#a6e22e }
  .chroma .nx { color:#a6e22e }
  .chroma .nt { color:#f92672 }
  .chroma .nf { color:#a6e22e }
  .chroma .fm { color:#a6e22e }
  .chroma .l { color:#ae81ff }
  .chroma .ld { color:#e6db74 }
  .chroma .s { color:#e6db74 }
  .chroma .sa { color:#e6db74 }
  .chroma .sb { color:#e6db74 }
  .chroma .sc { color:#e6db74 }
  .chroma .dl { color:#e6db74 }
  .chroma .sd { color:#e6db74 }
  .chroma .s2 { color:#e6db74 }
  .chroma .se { color:#ae81ff }
  .chroma .sh { color:#e6db74 }
  .chroma .si { color:#e6db74 }
  .chroma .sx { color:#e6db74 }
  .chroma .sr { color:#e6db74 }
  .chroma .s1 { color:#e6db74 }
  .chroma .ss { color:#e6db74 }
  .chroma .m { color:#ae81ff }
  .chroma .mb { color:#ae81ff }
  .chroma .mf { color:#ae81ff }
  .chroma .mh { color:#ae81ff }
  .chroma .mi { color:#ae81ff }
  .chroma .il { color:#ae81ff }
  .chroma .mo { color:#ae81ff }
  .chroma .o { color:#f92672 }
  .chroma .ow { color:#f92672 }
  .chroma .or { color:#f92672 }
  .chroma .p { color:#f8f8f2 }
  .chroma .c { color:#75715e }
  .chroma .ch { color:#75715e }
  .chroma .cm { color:#75715e }
  .chroma .c1 { color:#75715e }
  .chroma .cs { color:#75715e }
  .chroma .cp { color:#75715e }
  .chroma .cpf { color:#75715e }
  .chroma .gd { color:#f92672 }
  .chroma .ge { font-style:italic }
  .chroma .gi { color:#a6e22e }
  .chroma .gs { font-weight:bold }
  .chroma .gu { color:#75715e }
}
