/* Modern Blog Design - Clean and Professional */

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --secondary: #f97316;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-white: #ffffff;
  --bg-light: #f9fafb;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --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: 0.5rem;
  --radius-lg: 0.75rem;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override theme wrapper styles */
.u-padding {
  padding: 2rem 1.5rem !important;
}

/* Navigation Bar - Match main site */
nav.u-background {
  padding: 1rem 0 !important;
}

.u-wrapper {
  max-width: 1200px !important;
  margin: 0 auto;
  padding: 0 2rem !important;
}

/* Override the base theme's reversed flex layout */
nav .Banner,
.Banner {
  background: white;
  border-bottom: none;
  margin-bottom: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-flow: row !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  list-style: none !important;
  gap: 2rem !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

/* Force correct order - override theme's reversed order */
nav .Banner-item,
.Banner-item {
  margin: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Explicitly set order for each item to override theme */
nav .Banner-item:nth-child(1),
.Banner-item:nth-child(1) {
  order: 1 !important;
}

nav .Banner-item:nth-child(2),
.Banner-item:nth-child(2) {
  order: 2 !important;
}

nav .Banner-item:nth-child(3),
.Banner-item:nth-child(3) {
  order: 3 !important;
}

nav .Banner-item:nth-child(4),
.Banner-item:nth-child(4) {
  order: 4 !important;
}

.Banner-item:first-child {
  margin-right: 2rem !important;
}

/* Force navigation items to stay on left */
.Banner-item:not(:first-child) {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.Banner-link {
  color: #666 !important;
  font-weight: 400;
  font-size: 1rem !important;
  padding: 0 !important;
  transition: all 0.2s ease;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px !important;
  line-height: 1.5;
}

.Banner-link:hover {
  color: var(--primary) !important;
  border-bottom-color: var(--primary);
}

/* Logo/Brand styling - match main site */
.Banner-item--title .Banner-link {
  font-weight: bold !important;
  font-size: 1.125rem !important;
  color: #3b82f6 !important;
  padding: 0 !important;
  text-decoration: none !important;
  border-bottom: none !important;
}

.Banner-item--title .Banner-link:hover {
  color: #3b82f6 !important;
  border-bottom: none !important;
}

/* Remove button styling since we don't have a Sign In button anymore */

/* Override background - white nav like main site */
nav.u-background,
.u-background {
  background: white !important;
}

nav.u-background {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Main Heading */
.Heading-title {
  color: var(--text-primary);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 3rem 0 2rem;
  text-align: center;
}

.Heading-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.Heading-link:hover {
  color: var(--primary);
}

/* Hide the link icon */
.Heading-link::after {
  display: none !important;
}

/* Article/Post Cards */
article {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

article:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* Post Title */
article h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

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

article h2 a:hover {
  color: var(--primary);
}

/* Post Date/Time */
article time {
  display: block;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Post Content Preview */
article p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

article > p:last-of-type {
  margin-bottom: 1.5rem;
}

/* Code Blocks in Preview */
article pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  border: none;
}

article code {
  background: var(--bg-light);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: var(--primary-dark);
  font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Lists in Articles */
article ul, article ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

article li {
  margin-bottom: 0.5rem;
}

/* Article Headings */
article h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: var(--text-primary);
}

article h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-primary);
}

/* Strong text */
article strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Emphasis */
article em {
  color: var(--text-secondary);
  font-style: italic;
}

/* Categories - Styled as small colored labels */
article > ul:nth-last-child(2) {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 1rem 0;
  flex-wrap: wrap;
}

article > ul:nth-last-child(2) li {
  margin: 0;
}

article > ul:nth-last-child(2) a {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: background 0.2s;
}

article > ul:nth-last-child(2) a:hover {
  background: var(--primary-dark);
}

/* Tags - Modern Chip Style with Better Visibility */
.Tags {
  margin: 0 !important;
  padding: 0 !important;
}

article > ul:last-child {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}

article > ul:last-child li {
  margin: 0;
}

article > ul:last-child a {
  display: inline-block;
  background: #e8f4fd;
  color: #0066cc;
  padding: 0.375rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #b8daff;
  transition: all 0.2s;
}

article > ul:last-child a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Remove the divider/separator */
.Divider {
  display: none !important;
}

/* Tags on dedicated tags page */
.Tags-item {
  background: transparent !important;
  border: 1px solid var(--border);
  margin: 0.5rem !important;
  padding: 0 !important;
  border-radius: 1rem !important;
  transition: all 0.2s;
}

.Tags-item:hover {
  background: var(--bg-white) !important;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.Tags-link {
  color: var(--text-secondary) !important;
  padding: 0.5rem 1.25rem !important;
  display: block;
  font-weight: 500;
  transition: color 0.2s;
}

.Tags-item:hover .Tags-link {
  color: var(--primary) !important;
}

/* Pagination */
.Pagination {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.Pagination--right {
  float: right;
}

.Pagination:hover {
  color: var(--primary);
}

/* Footer */
.Footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-light);
  padding: 2rem 1rem;
  margin-top: 4rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.Footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.Footer a:hover {
  text-decoration: underline;
}


/* Single Post Page Styles */
main article {
  max-width: 720px;
  margin: 0 auto 2rem;
  padding: 2.5rem;
}

main article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Blockquotes */
article blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Horizontal Rule */
article hr {
  border: none;
  height: 1px;
  background: var(--border-light);
  margin: 2rem 0;
}

/* Links in content */
article a:not(h2 a):not(h3 a):not(ul:last-child a):not(ul:nth-last-child(2) a) {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s;
}

article a:not(h2 a):not(h3 a):not(ul:last-child a):not(ul:nth-last-child(2) a):hover {
  color: var(--primary-dark);
  text-decoration-thickness: 2px;
}

/* Improve readability on mobile */
@media (max-width: 768px) {
  .u-padding {
    padding: 1rem !important;
  }
  
  article {
    padding: 1.5rem;
  }
  
  .Heading-title {
    font-size: 2rem;
  }
  
  article h2 {
    font-size: 1.5rem;
  }
  
  main article {
    padding: 1.5rem;
  }
  
  main article h1 {
    font-size: 2rem;
  }
}

/* Add smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection colors */
::selection {
  background: var(--primary);
  color: white;
}

::-moz-selection {
  background: var(--primary);
  color: white;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Make images responsive */
article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Tables */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

article th,
article td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

article th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-primary);
}

article tbody tr:hover {
  background: var(--bg-light);
}