/* Article Single Page Styling - Clean Minimal Design */

.article-single {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.article-header {
  /* margin-bottom: 4rem; */
  text-align: center;
  margin-bottom: 0;
  padding-bottom: 0;
}

.article-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  color: #6b7280;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.back-link {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: #374151;
}

.article-date {
  color: #6b7280;
}

.article-title {
  font-size: 2.25rem;
  /* font-weight: 400; */
  font-weight: 600;
  margin: 2rem 0;
  color: #111827;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-align: center;
}

.article-excerpt {
  font-size: 1.125rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 2rem;
  font-style: italic;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.article-tags .tag {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.article-featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 3rem;
}

/* Article Body Styling - Clean Typography */
.article-body {
  line-height: 1.7;
  color: #374151;
  font-size: 1.125rem;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.article-body h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #111827;
  margin: 3rem 0 1.5rem 0;
  line-height: 1.2;
  letter-spacing: -0.025em;
  border-bottom: none;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 2.5rem 0 1rem 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 2rem 0 1rem 0;
  line-height: 1.4;
}

.article-body h4, .article-body h5, .article-body h6 {
  font-weight: 600;
  color: #111827;
  margin: 1.5rem 0 1rem 0;
  line-height: 1.4;
}

.article-body p {
  margin: 1.75rem 0;
  text-align: left;
  color: #374151;
  line-height: 1.7;
}

.article-body ul, .article-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
  color: #374151;
}

.article-body li {
  margin-bottom: 0.5rem;
  color: #374151;
  line-height: 1.7;
}

/* Clean Table Styling */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.article-body th,
.article-body td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.article-body th {
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
}

.article-body td {
  font-size: 0.875rem;
  color: #374151;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover {
  background: #f9fafb;
}

/* Other Elements */
.article-body hr {
  border: none;
  height: 1px;
  background: #e5e7eb;
  /* margin: 3rem 0; */
  margin: 0;
}

.article-body strong {
  color: #111827;
  font-weight: 600;
}

.article-body em {
  color: #374151;
  font-style: italic;
}

.article-body a {
  color: #111827;
  text-decoration: underline;
  text-decoration-color: #d1d5db;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.article-body a:hover {
  text-decoration-color: #111827;
}

/* Drop cap class for manual use with span */
.article-body .drop-cap {
  font-family: 'Georgia', serif;
  font-size: 3.5em;
  line-height: 0.75;
  float: left;
  margin: 0.08em 0.08em 0 0;
  font-weight: 500;
  color: #374151;
  text-align: center;
  vertical-align: top;
}

.article-body blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: #f9fafb;
  border-left: 4px solid #d1d5db;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #6b7280;
  position: relative;
}

.article-body blockquote p {
  margin: 0;
}

/* Clean Code Styling */
.article-body code {
  background: #f3f4f6;
  color: #374151;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.875em;
  font-weight: 500;
  border: none;
  box-shadow: none;
}

.article-body pre {
  background: #f8fafc;
  border: none !important;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  position: relative;
  box-shadow: none !important;
}

.article-body pre::before {
  display: none !important;
}

.article-body pre .copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-body pre .copy-button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.article-body pre .copy-button:active {
  transform: scale(0.9);
}

.article-body pre .copy-button svg {
  width: 16px;
  height: 16px;
  stroke: #6b7280;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.article-body pre .copy-button:hover svg {
  stroke: #374151;
}

.article-body pre .copy-button .check-icon {
  stroke: #059669;
}


.article-body pre code {
  background: none;
  padding: 0;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 400;
  border: none;
  line-height: 1.6;
}

/* Article Footer */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  display: block;
  text-align: center;
}

.article-author {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  width: 100%;
}

.article-author > p {
  text-align: left;
}

/* Article Social Section */
.article-social-section {
  margin: 0 auto 2rem auto;
  text-align: center;
  max-width: 600px;
  width: 100%;
  padding: 0 1rem;
}

.follow-me-section {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.follow-me-text {
  color: #111827;
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.social-links-simple {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.social-link-simple {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link-simple:hover {
  background: #111827;
  color: white;
  border-color: #111827;
}

.social-icon {
  width: 20px;
  height: 20px;
}

/* Substack Subscription Section */
.substack-subscription {
  padding: 1.5rem;
  background: none;
  border: none;
  text-align: center;
}

.substack-subscription h4 {
  color: #111827;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.substack-subscription p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 1.5rem 0;
}

.substack-subscription iframe {
  max-width: 100%;
  border: none;
  margin: 0 auto;
  display: block;
}

/* Article Navigation */
.article-navigation {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  width: 100%;
}

.article-navigation .btn {
  background: #111827;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.article-navigation .btn:hover {
  background: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
  .article-single {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }
  
  .article-body {
    font-size: 1.1rem;
  }
  
  .article-meta-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .article-title {
    font-size: 1.875rem;
    line-height: 1.1;
  }
  
  .article-excerpt {
    font-size: 1.1rem;
  }
  
  .article-body h1 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1.25rem 0;
  }
  
  .article-body h2 {
    font-size: 1.375rem;
    margin: 2rem 0 1rem 0;
  }
  
  .article-body h3 {
    font-size: 1.125rem;
    margin: 1.75rem 0 0.75rem 0;
  }
  
  .article-body p {
    margin: 1.5rem 0;
  }
  
  .article-body blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
  }
  
  .article-body table {
    font-size: 0.875rem;
    overflow-x: auto;
    display: block;
    margin: 1.5rem 0;
  }
  
  .article-body th,
  .article-body td {
    padding: 0.75rem;
    white-space: nowrap;
  }
  
  .article-body pre {
    padding: 1rem;
    margin: 1.5rem 0;
  }
  
  .follow-me-section {
    padding: 1rem;
  }
  
  .social-links-simple {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .substack-subscription {
    padding: 1rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .article-meta-header {
    color: #9ca3af;
  }
  
  .back-link {
    color: #9ca3af;
  }
  
  .back-link:hover {
    color: #d1d5db;
  }
  
  .article-date {
    color: #9ca3af;
  }
  
  .article-title {
    color: #f9fafb;
  }
  
  .article-excerpt {
    color: #9ca3af;
  }
  
  .article-tags .tag {
    background: #374151 !important;
    color: #9ca3af !important;
  }
  
  .article-body {
    color: #d1d5db;
  }
  
  .article-body h1,
  .article-body h2,
  .article-body h3,
  .article-body h4,
  .article-body h5,
  .article-body h6 {
    color: #f9fafb;
  }
  
  .article-body p,
  .article-body ul,
  .article-body ol,
  .article-body li {
    color: #d1d5db;
  }
  
  .article-body table {
    border-color: #4b5563;
  }
  
  .article-body th {
    background: #374151;
    color: #f9fafb;
    border-color: #6b7280;
  }
  
  .article-body td {
    color: #d1d5db;
    border-color: #4b5563;
  }
  
  .article-body tbody tr:hover {
    background: #374151;
  }
  
  .article-body hr {
    background: #374151;
  }
  
  .article-body strong {
    color: #f9fafb;
  }
  
  .article-body em {
    color: #d1d5db;
  }
  
  .article-body a {
    color: #f9fafb;
    text-decoration-color: #6b7280;
  }
  
  .article-body a:hover {
    text-decoration-color: #f9fafb;
  }
  
  .article-body .drop-cap {
    color: #d1d5db;
  }
  
  .article-body blockquote {
    background: #374151;
    border-left-color: #6b7280;
    color: #9ca3af;
  }
  
  .article-body code {
    background: #374151;
    color: #d1d5db;
  }
  
  .article-body pre {
    background: #1f2937;
  }
  
  .article-body pre code {
    color: #d1d5db;
  }
  
  .article-body pre .copy-button {
    background: rgba(249, 250, 251, 0.9);
  }
  
  .article-body pre .copy-button:hover {
    background: rgba(249, 250, 251, 1);
  }
  
  .article-body pre .copy-button svg {
    stroke: #374151;
  }
  
  .article-body pre .copy-button:hover svg {
    stroke: #111827;
  }
  
  .article-footer {
    border-top-color: #374151;
  }
  
  .article-author {
    color: #9ca3af;
  }
  
  .follow-me-section {
    background: #374151;
    border-color: #4b5563;
  }
  
  .follow-me-text {
    color: #f9fafb;
  }
  
  .social-link-simple {
    background: #4b5563;
    border-color: #6b7280;
    color: #9ca3af;
  }
  
  .social-link-simple:hover {
    background: #f9fafb;
    color: #111827;
    border-color: #f9fafb;
  }
  
  .substack-subscription h4 {
    color: #f9fafb;
  }
  
  .substack-subscription p {
    color: #9ca3af;
  }
  
  .article-navigation {
    border-top-color: #374151;
  }
  
  .article-navigation .btn {
    background: #f9fafb;
    color: #111827;
  }
  
  .article-navigation .btn:hover {
    background: #d1d5db;
  }
}