/* ============================================
   Grid CSS System - No Flex, Clean & Simple
   ============================================ */

/* Container (uses your existing style) */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Main page spacing */
#mainPage {
  padding: 2rem 0;
  min-height: 60vh;
}

/* Grid Container */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr); /* Default: 1 column for phones */
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Large screens: 4 across */
@media (min-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}
/* 2FIX when have more than 2, need to review switching repeat(2 to repeat(3 or 4 */
/* Tablets: 3 across */
@media (min-width: 768px) and (max-width: 1199px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
}

/* Card styles - optimized for grid */
.blog-card {
  background: var(--background);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%; /* Ensures all cards in same row have equal height */
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.b-shadow {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Card image */
.card-image {
  overflow: hidden;
  height: 300px;
  background: var(--background-alt);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.blog-card:hover .card-image img {
  transform: scale(1.05);
}

/* Card content */
.card-content {
  padding: 1.5rem;
  flex-grow: 1; /* Makes content area fill available space */
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.card-content .date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 1rem;
}

.card-content p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  flex-grow: 1; /* Pushes action to bottom */
}

/* Card action */
.card-action {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--background-alt);
  margin-top: auto; /* Ensures action stays at bottom */
}

.card-action a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}

.card-action a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.card-action a::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.card-action a:hover::after {
  transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .container {
    padding: 0 1rem;
  }

  .blog-grid {
    gap: 1rem;
  }

  .card-image {
    height: 180px;
  }

  .card-content {
    padding: 1.25rem;
  }

  .card-content h3 {
    font-size: 1.125rem;
  }

  .card-action {
    padding: 0.875rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .card-image {
    height: 160px;
  }

  .card-content {
    padding: 1rem;
  }

  .blog-grid {
    gap: 0.75rem;
  }
}