body {
  background-color: #1a1a1a;
  color: #e2e2e2;
  font-family: monospace;
  padding: 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 1rem;
}

h1, h2 {
  border-bottom: 1px dashed #ffcc66;
  padding-bottom: 0.4rem;
  text-align: center;
  color: #ffcc66;
  word-wrap: break-word;
}

a {
  color: #ffcc66;
  text-decoration: none;
  display: inline-block;
  margin: 0.5rem 0;
  padding: 6px 10px;
  border: 1px dashed #ffcc66;
  white-space: nowrap;
}

a:hover {
  background-color: #333;
  color: #fff;
  border-color: #fff;
}

.block {
  border: 1px dashed #ffcc66;
  padding: 1rem;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  margin-top: 2rem;
  word-wrap: break-word;
}

.menu {
  text-align: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #ffcc66;
  text-decoration: none;
  margin: 0 6px;
}

.footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
  body {
    padding: 1rem;
    font-size: 1.1rem;
  }

  .menu a, .footer-nav a {
    display: block;
    margin: 0.4rem auto;
    width: fit-content;
  }

  .block {
    padding: 0.8rem;
  }

  /* Adjust grid layout for tablets */
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .grid-item {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  /* Adjust font size and padding for mobile */
  body {
    padding: 1rem;
    font-size: 1rem;
  }

  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller grid items */
    gap: 1rem;
    padding: 0.5rem;
  }

  /* Make the blog items occupy full width */
  .grid-item {
    max-width: 100%;
  }

  .blog-thumb {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Ensures images stay square */
    object-fit: cover;
    margin-bottom: 0.5rem;
  }

  .grid-item h3 {
    font-size: 1rem;
  }

  .excerpt {
    font-size: 0.85rem;
    line-height: 1.3;
    max-height: 3.6em; /* ~2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .resurgitag, .blog-date {
    font-size: 0.8rem;
    color: #f6e7c1;
  }
}

/* Grid Layout for Blog Posts */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Default grid for larger screens */
  gap: 2rem;
  padding: 1rem;
}

/* Individual Blog Post Card */
.grid-item {
  background-color: #111;
  border: 1px dotted #facc15;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-width: 100%;
  overflow: hidden;  /* Ensures nothing overflows outside the item */
}

.blog-thumb {
  width: 100%;  /* Ensures the image is 100% width of the container */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid #facc15;
  margin-bottom: 0.5rem;
  max-height: 150px;  /* Shrinks the image to allow more space for the title */
}

.grid-item h3 {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  color: #f6e7c1;
  word-wrap: break-word;  /* Make sure long words or titles wrap */
  overflow-wrap: break-word;
  white-space: normal;  /* Allows wrapping */
  flex-grow: 1;  /* Ensures the title takes up available space */
  margin-bottom: 0.5rem; /* Adds some spacing below the title */
}

.blog-date {
  font-size: 0.85rem;
  color: #888;
}

.excerpt {
  font-size: 0.9rem;
  line-height: 1.4;
  max-height: 3.6em; /* ~2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
}

.resurgitag {
  font-size: 0.9rem;
  margin: 0.25rem 0;
  color: #f6e7c1;
}

.resurgitag a {
  color: #facc15;
  text-decoration: none;
}

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

