:root {
  --bg-primary: #fefefe;
  --bg-secondary: #f8f8f8;
  --bg-accent: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #767676;
  --border-color: #e0e0e0;
  --accent-color: #c41e3a;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
}

[data-theme="dark"] {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-accent: #252525;
  --text-primary: #e8e8e8;
  --text-secondary: #b8b8b8;
  --text-muted: #888888;
  --border-color: #333333;
  --accent-color: #ef4444;
  --link-color: #60a5fa;
  --link-hover: #93c5fd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header / Masthead */
.masthead {
  border-bottom: 4px solid var(--text-primary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0 1.5rem;
  margin: 2rem 0;
  text-align: center;
  position: relative;
}

.masthead-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.masthead-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.masthead-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-accent);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
}

/* Navigation */
nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

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

/* Featured Edition */
.featured-edition {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-accent) 100%);
  border: 2px solid var(--border-color);
  padding: 2.5rem;
  margin-bottom: 3rem;
  border-radius: 2px;
}

.featured-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.featured-edition h2 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.featured-edition .edition-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.featured-edition .edition-summary {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.btn-read-edition {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 0.75rem 2rem;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.btn-read-edition:hover {
  background-color: #a01828;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

/* Archive Section */
.archive-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.archive-section h2 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.archive-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.archive-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.archive-card h3 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.archive-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.archive-card h3 a:hover {
  color: var(--accent-color);
}

.archive-card .edition-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.archive-card .edition-excerpt {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Edition Page Styles */
.edition-header {
  text-align: center;
  margin: 2rem 0 3rem;
  padding-bottom: 2rem;
  border-bottom: 3px solid var(--border-color);
}

.edition-header h1 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.edition-header .edition-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

.section {
  margin-bottom: 4rem;
}

.section-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title .emoji {
  font-size: 1.5rem;
}

.article {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-color);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.article:hover {
  background-color: var(--bg-accent);
  border-left-color: #a01828;
}

.article-header {
  margin-bottom: 1rem;
}

.article-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.article-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.article-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.article-content p {
  margin-bottom: 0.75rem;
}

.article-content .why-care {
  background-color: var(--bg-accent);
  border-left: 3px solid var(--accent-color);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-style: italic;
}

.article-content .why-care strong {
  color: var(--accent-color);
  font-weight: 600;
}

.article-link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.article-link a {
  color: var(--link-color);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Footer */
footer {
  border-top: 2px solid var(--border-color);
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Back to Home Link */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--link-color);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .masthead-title {
    font-size: 2.25rem;
  }

  .masthead-subtitle {
    font-size: 0.75rem;
  }

  .theme-toggle {
    position: static;
    display: block;
    margin: 1rem auto 0;
    width: fit-content;
  }

  nav ul {
    gap: 1rem;
  }

  .featured-edition {
    padding: 1.5rem;
  }

  .featured-edition h2 {
    font-size: 1.75rem;
  }

  .archive-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .edition-header h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .article {
    padding: 1.25rem;
  }

  .article-title {
    font-size: 1.25rem;
  }
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-accent: #252525;
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --border-color: #333333;
    --accent-color: #ef4444;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
  }
}
