/* CSS Variables for theming - matching ashwch.com */
:root {
  --bg-color: #ffffff;
  --text-color: #1a202c;
  --text-secondary: #4a5568;
  --link-color: #3b82f6;
  --link-hover: #2563eb;
  --border-color: #e2e8f0;
  --code-bg: #f7fafc;
  --header-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-color: #1a202c;
  --text-color: #e2e8f0;
  --text-secondary: #a0aec0;
  --link-color: #60a5fa;
  --link-hover: #93bbfc;
  --border-color: #2d3748;
  --code-bg: #2d3748;
  --header-bg: rgba(26, 32, 44, 0.9);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
}

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

.author-link {
  color: var(--link-color);
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .moon,
[data-theme="dark"] .sun {
  display: none;
}

/* Main content */
.page-content {
  min-height: calc(100vh - 120px);
  padding: 3rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

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

p {
  margin-bottom: 1.5rem;
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.8;
}

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

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

/* Code blocks */
pre, code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
}

code {
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

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

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

/* Lists */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}

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

th {
  background-color: var(--code-bg);
  font-weight: 600;
}

/* Footer */
.site-footer {
  background-color: var(--bg-color);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--link-color);
}

/* Home page specific */
.home h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.home .badges {
  margin-bottom: 2rem;
}

/* Alternatives page readability */
.page-alternatives .wrapper {
  max-width: 1120px;
}

.page-alternatives p,
.page-alternatives li {
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
}

.page-alternatives h2 {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.page-alternatives code {
  white-space: nowrap;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
  .site-header .wrapper {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
  }

  .page-link {
    font-size: 0.875rem;
  }

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

  .home h1 {
    font-size: 2.5rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}
