/* Medium.com inspired theme with dark/light modes */

:root {
  /* Light mode colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f7;
  --text-primary: #0f0f0f;
  --text-secondary: #6B6B6B;
  --border-color: #e6e6e6;
  --accent-color: #1a8917;
  --link-color: #0f0f0f;
  --card-shadow: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  /* Dark mode colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --text-primary: #e6e6e6;
  --text-secondary: #a3a3a3;
  --border-color: #404040;
  --accent-color: #4d9c47;
  --link-color: #e6e6e6;
  --card-shadow: rgba(255, 255, 255, 0.03);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border-color 0.3s ease;
}

.header-content {
  max-width: 1336px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

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

.btn {
  padding: 8px 16px;
  border-radius: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background-color: #156d12;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Container */
.container {
  max-width: 1336px;
  margin: 0 auto;
  padding: 48px 24px;
}

.narrow-container {
  max-width: 728px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* Two Column Layout */
.two-column-layout {
  max-width: 1336px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 15px;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-link:hover {
  background-color: var(--bg-secondary);
}

.sidebar-link.active {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  min-width: 0;
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Article Card */
.article-card {
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  transition: opacity 0.2s;
}

.article-card:hover {
  opacity: 0.8;
}

.article-content-wrapper {
  flex: 1;
  min-width: 0;
}

.article-image {
  width: 200px;
  height: 134px;
  object-fit: cover;
  background-color: var(--bg-secondary);
  flex-shrink: 0;
  order: 2;
}

.article-card h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.article-excerpt {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.003em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.meta-divider {
  color: var(--border-color);
}

.tags {
  display: none;
}

/* Article Detail Page */
.article-header {
  margin-bottom: 48px;
}

.article-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.article-subtitle {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.003em;
  color: var(--text-primary);
  margin-bottom: 32px;
  line-height: 1.5;
  opacity: 0.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.article-author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.author-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.author-details h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.author-details p {
  font-size: 14px;
  color: var(--text-secondary);
}

.featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  margin-bottom: 48px;
}

/* Article Content */
.article-content {
  font-family: "Lora", Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.article-content h2 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 24px;
  line-height: 1.3;
}

.article-content h3 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin: 36px 0 20px;
  line-height: 1.3;
}

.article-content p {
  margin-bottom: 32px;
}

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

.article-content blockquote {
  border-left: 4px solid var(--text-primary);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 24px;
}

.article-content ul, .article-content ol {
  margin: 24px 0 32px 24px;
}

.article-content li {
  margin-bottom: 12px;
}

.article-content code {
  background-color: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 18px;
  font-family: "SF Mono", Monaco, monospace;
}

.article-content pre {
  background-color: var(--bg-secondary);
  padding: 24px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 32px 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  margin-top: 96px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .article-title {
    font-size: 32px;
  }

  .article-subtitle {
    font-size: 20px;
  }

  .article-content {
    font-size: 19px;
  }

  .article-content h2 {
    font-size: 28px;
  }

  .article-content h3 {
    font-size: 23px;
  }
}
