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

:root {
  --accent-color: #a78bfa;
  --text-color: #e4e4e7;
  --text-muted: #a1a1aa;
  --background-color: #18181b;
  --content-bg: #27272a;
  --header-text: #fafafa;
  --border-color: #3f3f46;
  --link-color: #60a5fa;
  --link-hover: #93c5fd;
  --code-bg: #1e1e1e;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Header */
header {
  background: linear-gradient(135deg, #5BCEFA 0%, #F5A9B8 25%, #FFFFFF 50%, #F5A9B8 75%, #5BCEFA 100%);
  /* Uncomment and add your image path when ready:
  background-image: url('/images/header-bg.jpg');
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  */
  border-bottom: 4px solid var(--accent-color);
  padding: 3rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Optional: add a dark overlay for better text readability over images */
header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 0;
}

header > * {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

header h1 a {
  text-decoration: none;
  color: white;
  transition: color 0.2s ease;
}

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

/* Main navigation */
header .main-nav {
  margin-bottom: 1rem;
}

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

header .main-nav a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.95;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

header .main-nav a:hover {
  border-bottom-color: white;
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Social navigation */
header .social-nav ul {
  gap: 1.5rem;
}

header .social-nav a {
  text-decoration: none;
  color: white;
  font-weight: 400;
  font-size: 0.95rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
  background-color: rgba(255, 255, 255, 0.05);
}

header .social-nav a:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background-color: var(--content-bg);
  min-height: 60vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--header-text);
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

ul, ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Blog Post Styles */
.blog-post {
  margin-top: 2rem;
}

.post-header {
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.post-header h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--header-text);
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background-color: var(--accent-color);
  color: var(--background-color);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.post-content {
  font-size: 1.05rem;
}

/* Blog List Styles */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
}

.post-preview {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.post-preview:last-child {
  border-bottom: none;
}

.post-preview h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.post-preview h2 a {
  color: var(--header-text);
  border-bottom: none;
}

.post-preview h2 a:hover {
  color: var(--accent-color);
}

.post-preview .post-meta {
  margin-bottom: 0.75rem;
}

.post-preview p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

code {
  background-color: var(--code-bg);
  color: #e4e4e7;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border: 1px solid var(--border-color);
}

pre code {
  background-color: transparent;
  padding: 0;
  border: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

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

th {
  background-color: var(--code-bg);
  font-weight: 600;
  color: var(--header-text);
}

td {
  color: var(--text-color);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background-color: var(--content-bg);
}

footer p {
  margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  header {
    padding: 2rem 1.5rem;
    min-height: 180px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header .main-nav ul,
  header .social-nav ul {
    flex-direction: column;
    gap: 0.75rem;
  }

  header .main-nav {
    margin-bottom: 1.5rem;
  }

  main {
    padding: 2rem 1.5rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  footer {
    padding: 1.5rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
