/* Everyday Lore - Enhanced Typography & Dark Mode */
:root {
  /* Light theme colors */
  --bg: #fefefe;
  --bg-secondary: #f8f9fa;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: rgba(0, 0, 0, 0.1);
  
  /* Typography scale */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.8rem;
  --font-size-sm: 0.9rem;
  --font-size-base: 1.1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --text: #e8e8e8;
    --text-light: #a1a1aa;
    --text-muted: #71717a;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --border: #2a2a2a;
    --border-light: #1f1f1f;
    --shadow: rgba(0, 0, 0, 0.3);
  }
}

/* Manual dark theme override */
[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --text: #e8e8e8;
  --text-light: #a1a1aa;
  --text-muted: #71717a;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --border: #2a2a2a;
  --border-light: #1f1f1f;
  --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg: #fefefe;
  --bg-secondary: #f8f9fa;
  --text: #1a1a1a;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-xl);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

p {
  margin-bottom: var(--space-lg);
  color: var(--text);
}

p:last-child {
  margin-bottom: 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent-hover);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-xl);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.title-section {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

header h1 {
  font-size: var(--font-size-2xl);
  margin: 0;
}

.tagline {
  color: var(--text-light);
  font-style: italic;
  margin: 0;
  font-size: var(--font-size-sm);
}

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

nav a {
  font-weight: 500;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Theme toggle emoji button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-lg);
  padding: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  line-height: 1;
}

.theme-toggle:hover {
  opacity: 0.7;
}

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

.post-item {
  padding: var(--space-sm) 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-lg);
}

.post-item:first-child {
  padding-top: 0;
}

.post-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  flex-grow: 1;
}

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

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

.post-date {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Article styles */
article {
  line-height: 1.8;
}

article h1 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

article .meta {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

article p {
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

article blockquote {
  border-left: 3px solid var(--accent);
  margin: var(--space-xl) 0;
  padding: var(--space-md) 0 var(--space-md) var(--space-xl);
  background-color: var(--bg-secondary);
  font-style: italic;
  color: var(--text-light);
  border-radius: 0 4px 4px 0;
}

article blockquote p {
  margin: 0;
}

article img {
  max-width: 100%;
  height: auto;
  margin: var(--space-2xl) 0;
  border-radius: 8px;
  box-shadow: 0 4px 6px var(--shadow);
}

article em {
  font-style: italic;
  color: var(--text-light);
}

article strong {
  font-weight: 600;
  color: var(--text);
}

/* Navigation */
.navigation {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.navigation a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--bg-secondary);
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: var(--font-size-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.navigation a:hover {
  background-color: var(--border-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Footer */
footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.6;
}

footer p {
  margin-bottom: var(--space-sm);
}

footer p:last-child {
  margin-bottom: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: var(--space-lg);
    font-size: var(--font-size-base);
  }
  
  h1 {
    font-size: var(--font-size-2xl);
  }
  
  article h1 {
    font-size: var(--font-size-2xl);
  }
  
  /* Keep header horizontal on mobile - title+emoji left, About right */
  .header-main {
    /* Use default flex-row layout */
    justify-content: space-between;
    align-items: center;
  }
  
  .post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  
  .post-date {
    align-self: flex-start;
  }
  
  .navigation {
    flex-direction: column;
    align-items: center;
  }
  
  .navigation a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: var(--space-md);
  }
  
  .post-item {
    padding: var(--space-xs) 0;
  }
  
  h1 {
    font-size: var(--font-size-xl);
  }
  
  article h1 {
    font-size: var(--font-size-2xl);
  }
}