/* Base Styles - Muted 80s Retro Theme */
:root {
  --primary-color: #d566c5;     /* Softer magenta instead of hot pink */
  --secondary-color: #5bc8eb;   /* Softer teal/cyan */
  --text-color: #e6e6e6;        /* Slightly off-white text */
  --background-color: #2a2040;  /* More muted purple background */
  --light-gray: #3d3050;        /* Muted light accent */
  --medium-gray: #5d4a8c;       /* Muted medium purple */
  --dark-gray: #8860c2;         /* Muted bright purple */
  --accent-color: #5dde90;      /* Softer mint green for accents */
  --link-hover: #edde59;        /* Muted yellow for hover states */
  --max-width: 1200px;
}

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

body {
  font-family: "VT323", "Press Start 2P", monospace, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

p {
  margin-bottom: 1.5rem; /* Adds space after paragraphs */
}

p:last-child {
  margin-bottom: 0;
}

/* List Styles */
ul, ol {
  margin-bottom: 1.5rem; /* Adds space after lists, matching paragraphs */
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: none;
  text-shadow: 0 0 8px var(--link-hover);
}

/* Header Styles */
header {
  padding: 2rem 0;
  /* border-bottom: 2px solid var(--primary-color); */
  margin-bottom: 2rem;
  /* box-shadow: 0 0 15px var(--primary-color); */
}

header h1 {
  margin-bottom: 1rem;
  font-family: "Press Start 2P", "VT323", monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

header h1 a {
  color: var(--primary-color);
  text-decoration: none;
  text-shadow: 3px 3px 0px var(--dark-gray);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  border: 2px solid var(--secondary-color);
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.3);
}

/* Main Content Styles */
main {
  min-height: calc(100vh - 200px);
}

section {
  margin-bottom: 3rem;
  border: 1px solid var(--medium-gray);
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.2);  /* Reduced background darkness */
  box-shadow: 0 0 7px rgba(213, 102, 197, 0.2);  /* Reduced and more muted shadow */
}

h1, h2, h3 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  text-shadow: 1px 1px var(--dark-gray);  /* Reduced shadow */
  letter-spacing: 1px;
}

/* Code block styling */
pre {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--accent-color);
  overflow-x: auto;
  border-radius: 3px;
}

code, pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', 'Courier New', Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--secondary-color);
}

/* Inline code styling */
:not(pre) > code {
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* Add a subtle visual cue that the code snippet is scrollable */
pre::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, var(--background-color, #2a2040));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

pre::-webkit-scrollbar {
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: var(--medium-gray);
  border-radius: 4px;
}

/* Post List Styles */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--medium-gray);
  position: relative;
  transition: transform 0.2s;
}


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

.post-item time {
  display: block;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-family: "VT323", monospace;
  letter-spacing: 1px;
}

.post-item p {
  margin-bottom: 1rem;
}

.read-more {
  display: inline-block;
  font-weight: 500;
  background-color: var(--dark-gray);
  color: var(--background-color);
  padding: 0.3rem 1rem;
  border: 1px solid var(--accent-color);  /* Thinner border */
  transition: all 0.3s;
}

.read-more:hover {
  background-color: var(--accent-color);
  color: var(--background-color);
  text-shadow: none;
  box-shadow: 0 0 6px var(--accent-color);  /* Reduced glow */
  transform: scale(1.03);  /* Reduced scale effect */
}

.view-all {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 500;
  border: 2px solid var(--primary-color);
  padding: 0.5rem 1rem;
  background-color: transparent;
}

/* Tags */
.tags {
  margin: 0.5rem 0;
}

.tag {
  display: inline-block;
  background-color: var(--light-gray);
  color: var(--primary-color);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--primary-color);
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
}

.tag:hover {
  background-color: var(--primary-color);
  color: var(--background-color);
  box-shadow: 0 0 8px var(--primary-color);
}

/* Archive Page Styles */
.archive-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.year-filter, .tag-filter {
  flex: 1;
}

.year-list {
  list-style: none;
}

.year-item {
  margin-bottom: 0.5rem;
}

.tag-list {
  list-style: none;
  column-count: 5;
  column-gap: 1rem;
}

.tag-item {
  margin-bottom: 0.5rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Return to single column on mobile */
@media (max-width: 600px) {
  .tag-list {
    column-count: 1;
  }
}

.year-navigation, .tag-navigation {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--medium-gray);
}

.post-count {
  color: var(--dark-gray);
  font-size: 0.9rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.tag-current {
  background-color: var(--primary-color);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0;
  justify-content: center;
  align-items: center;
}

.pagination-previous, .pagination-next, .pagination-link, .pagination-current {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--medium-gray);
  border-radius: 3px;
}

.pagination-current {
  background-color: var(--primary-color);
  color: white;
}

.pagination-disabled {
  color: var(--medium-gray);
  cursor: not-allowed;
}

/* On This Day Section */
.on-this-day {
  background-color: rgba(91, 200, 235, 0.08);  /* More muted transparency */
  padding: 1.5rem;
  border: 2px solid var(--secondary-color);
  position: relative;
  overflow: hidden;
}

.on-this-day::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
  animation: neonGlow 4s infinite;  /* Slowed down animation */
}

@keyframes neonGlow {
  0% { opacity: 0.4; }  /* Reduced opacity range */
  50% { opacity: 0.7; }
  100% { opacity: 0.4; }
}

/* Footer Styles */
footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-color);
  border-top: 2px solid var(--primary-color);
  margin-top: 2rem;
  background-color: rgba(0, 0, 0, 0.3);
  font-family: "VT323", monospace;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

/* Post Thumbnail 80s Style - Muted */
.post-thumbnail-container {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-color);  /* Thinner border */
  position: relative;
}

.post-thumbnail-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(213, 102, 197, 0.15) 0%, rgba(91, 200, 235, 0.15) 100%);  /* Reduced opacity and more muted colors */
  pointer-events: none;
}

.post-thumbnail-container img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s;
  filter: contrast(1.05) saturate(1.1);  /* Reduced filter intensity */
}

/* Image sizing for posts on homepage and lists - Muted */
.latest-posts .post-item img,
.post-list .post-item img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  margin: 1rem 0;
  display: block;
  border: 2px solid var(--primary-color);  /* Thinner border */
  filter: contrast(1.05) saturate(1.1);  /* Reduced filter intensity */
}

.post-thumbnail-container:hover img {
  transform: scale(1.05);
}

/* Responsive image styling */
main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 4px;
}

/* Optional: Add a subtle border and shadow for better presentation */
.post-content img {
  border: 1px solid #eaeaea;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive image sizing */
@media (max-width: 768px) {
  .latest-posts .post-item img,
  .post-list .post-item img {
    max-height: 200px;
  }
  
  .post-thumbnail-container,
  .post-thumbnail-container img {
    height: 150px;
  }
  
  .archive-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .pagination {
    flex-wrap: wrap;
  }
}
