/* ========== BLOG PAGE ========== */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0 3rem;
}

.post-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 0.9rem;
  padding: 1.2rem 1.5rem 1rem;
  transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.2s ease;
  outline: none;
}

.post-card:focus-within,
.post-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.post-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #232327;
  padding: 0 0.25rem 0.6rem;
  margin-bottom: 0.8rem;
}

.post-title {
  font-size: 1.25rem;
  color: #fff;
  margin-left: 0.25rem;
}

.post-date {
  font-size: 0.9rem;
  color: #a1a1aa;
  white-space: nowrap;
  margin-right: 0.25rem;
}

.post-body p {
  color: #c9c9d1;
  margin-bottom: 0.8rem;
}

/* --- IMAGE GRID: centered, consistent height --- */
.post-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.post-images figure {
  margin: 0;
  background: #0f0f10;
  border: 1px solid #232327;
  border-radius: 0.4rem;
  overflow: hidden;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.post-images img {
  display: block;
  height: auto;
  max-height: 300px;      /* ✅ keeps reasonable height */
  width: auto;
  max-width: 100%;
  object-fit: contain;    /* ensures proportional scaling */
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.post-images img:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.blog-error {
  background: #3f1f1f;
  border: 1px solid #7a2e2e;
  border-radius: 0.6rem;
  padding: 1rem;
  text-align: center;
  color: #ffdcdc;
}

/* two-column layout on larger screens */
@media (min-width: 800px) {
  .blog-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-grid .post-card:first-child {
    grid-column: 1 / -1;
  }
}

.post-body a {
  color: #7dd3fc;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.post-body a:hover {
  color: #3b82f6;
}

/* ========== LIGHTBOX (click-to-enlarge) ========== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: zoom-out;
  animation: lbFadeIn 0.15s ease;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.6rem;
  border: 1px solid #333;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== Blog controls ========== */
.blog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  background: #151517;
  border: 1px solid #232327;
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  margin: 0.5rem 0 1.2rem;
}

#blog-search {
  flex: 1;
  min-width: 220px;
  background: #0f0f10;
  color: #e5e7eb;
  border: 1px solid #26262a;
  border-radius: 0.45rem;
  padding: 0.55rem 0.75rem;
  outline: none;
}

#blog-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.blog-meta {
  color: #a1a1aa;
  font-size: 0.9rem;
}

/* ========== Load more ========== */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 2.5rem;
}

.load-more-wrap .button {
  cursor: pointer;
}