/* 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;
  }
}