/* Updated to use modern design system with red/amber palette and DM Sans typography */

:root {
  --primary: #dc2626; /* red-600 */
  --primary-hover: #b91c1c; /* red-700 */
  --accent: #f59e0b; /* amber-500 */
  --accent-light: #fef3c7; /* amber-100 */
  --text-primary: #111827; /* gray-900 */
  --text-secondary: #6b7280; /* gray-500 */
  --text-muted: #9ca3af; /* gray-400 */
  --border: #e5e7eb; /* gray-200 */
  --border-light: #f3f4f6; /* gray-100 */
  --background: #ffffff;
  --background-soft: #f9fafb; /* gray-50 */
  --background-card: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.layout-2col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 968px) {
  .layout-2col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.post-content {
  min-width: 0;
}

/* Enhanced back link with modern styling */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--primary-hover);
  transform: translateX(-2px);
}

.back-link svg {
  transition: transform 0.2s ease;
}

.back-link:hover svg {
  transform: translateX(-2px);
}

/* Added category badge styling */
.post-category {
  margin-bottom: 1rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.category-badge:hover {
  background: var(--accent);
  color: white;
}

/* Post Title & Meta */
.post-title {
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.meta-separator {
  color: var(--text-muted);
}

.author {
  font-weight: 500;
}

/* Enhanced featured image with modern styling */
.post-hero {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--background-soft);
}

.post-hero img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* Article Content */
.post-article {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.post-article p {
  margin: 0 0 1.5rem;
}

.post-article h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.post-article h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.post-article ul,
.post-article ol {
  padding-left: 1.5rem;
  margin: 0 0 1.5rem;
}

.post-article li {
  margin: 0.5rem 0;
}

.post-article a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.post-article a:hover {
  color: var(--primary-hover);
  text-decoration-thickness: 3px;
}

/* Blockquotes */
.post-article blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
  background: var(--background-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  font-size: 1.1em;
  color: var(--text-primary);
}

/* Code */
.post-article code {
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  color: var(--primary);
}

.post-article pre {
  background: #1f2937;
  color: #e5e7eb;
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-article pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* Added share section styling */
.post-share {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}

.post-share h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--background-card);
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.share-btn.twitter {
  color: #1da1f2;
  border-color: #1da1f2;
}

.share-btn.twitter:hover {
  background: #1da1f2;
  color: white;
}

.share-btn.linkedin {
  color: #0077b5;
  border-color: #0077b5;
}

.share-btn.linkedin:hover {
  background: #0077b5;
  color: white;
}

.share-btn.facebook {
  color: #1877f2;
  border-color: #1877f2;
}

.share-btn.facebook:hover {
  background: #1877f2;
  color: white;
}

/* Enhanced sidebar with modern styling */
.sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-section {
  background: var(--background-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--text-primary);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.sidebar-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-card {
  display: flex;
  gap: 0.75rem;
  text-decoration: none;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-card:hover {
  background: var(--background-soft);
  border-color: var(--border);
  transform: translateY(-1px);
}

.sidebar-card-image {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-light);
}

.sidebar-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-card-content {
  flex: 1;
  min-width: 0;
}

.sidebar-card-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.sidebar-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .post-article {
    font-size: 1rem;
  }

  .share-buttons {
    justify-content: center;
  }

  .sidebar-section {
    padding: 1rem;
  }
}
