/* ==========================================================================
   Blog Preview Section (Mobile First)
   ========================================================================== */

.af-blog-preview-section {
  padding: var(--spacing-section) 0;
  background-color: var(--bg-color);
}

/* --- Header Styling --- */
.af-section-header-row-blog {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--spacing-2xl);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.af-section-heading-wrapper {
  display: flex;
  flex-direction: column;
}

.af-section-heading {
  color: var(--primary-color);
  font-size: 2.25rem;
  /* Scaled down for mobile */
  font-family: var(--font-heading);
  text-transform: uppercase;
  margin: 0 0 8px 0;
  line-height: 1;
}

.af-heading-divider {
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
}

.af-view-all-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
  transition: color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
}

.af-view-all-link:hover {
  color: var(--primary-color);
  transform: translateX(4px);
}

/* --- Blog Cards Layout (Premium & Animated) --- */
.af-blog-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Ensures the image respects the card's rounded corners */
  box-shadow: var(--shadow-md);
  cursor: pointer;
  height: 100%;
  /* Ensures cards in the grid stretch to equal heights */

  /* Smooth animation for the lift effect */
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Hover State: The card floats up, shadow deepens */
.af-blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.af-blog-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

.af-blog-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  /* Slower, elegant zoom */
}

/* Hover State: Image zooms in slightly */
.af-blog-card:hover .af-blog-image {
  transform: scale(1.08);
}

.af-blog-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--spacing-lg);
  /* Padding inside the card */
  flex-grow: 1;
  /* Pushes the button to the bottom if titles are different lengths */
}

.af-blog-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
}

.af-blog-title {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-size: 1.35rem;
  /* Mobile typography */
  font-weight: 600;
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: var(--spacing-lg);
}

.af-blog-btn {
  margin-top: auto;
  /* Forces button to align to the bottom of the card */
  align-self: flex-start;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
}

/* ==========================================================================
   Desktop & Tablet Media Queries
   ========================================================================== */

@media (min-width: 768px) {
  .af-section-heading {
    font-size: 2.75rem;
    /* Larger heading for tablets/desktops */
  }

  .af-heading-divider {
    width: 80px;
  }

  .af-view-all-link {
    font-size: 1.1rem;
  }

  .af-blog-content {
    padding: var(--spacing-xl);
    /* More generous padding on larger screens */
  }

  .af-blog-title {
    font-size: 1.5rem;
    /* Larger title on tablets/desktops */
  }
}