/* ==========================================================================
   Blog Detail Page Styles
   ========================================================================== */

.af-blog-detail-bg {
  background-color: var(--surface-color-alt); /* Light grey background to make the white card pop */
  padding-bottom: var(--spacing-3xl);
}

/* --- Entry Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { 
  animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; 
}

/* --- The Floating Article Card --- */
.af-blog-article-card {
  max-width: 900px;
  /* Changed to a positive margin using your CSS variables to create a gap */
  margin: var(--spacing-2xl) auto 0; 
  position: relative;
  z-index: 10;
  background-color: var(--surface-color);
  padding: 4rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-top: 6px solid var(--primary-color);
}

/* --- Meta Information --- */
.af-blog-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid #E5E7EB;
}

.af-blog-category-pill {
  color: var(--primary-color-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: var(--secondary-color);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.af-blog-meta-text {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* --- Featured Image --- */
.af-blog-featured-image-wrapper {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--spacing-2xl);
}

.af-blog-featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

/* --- Content Body --- */
.af-blog-content-body {
  max-width: 760px;
  margin: 0 auto;
}

.af-blog-detail-section {
  margin-bottom: var(--spacing-2xl);
}

.af-blog-detail-heading {
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 2.25rem;
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.af-blog-detail-text {
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: var(--spacing-md);
  font-size: 1.15rem; /* Slightly larger for editorial readability */
}

/* Make the first introduction paragraph slightly larger */
.af-lead-text:first-of-type {
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.7;
}

/* --- Custom List Styling --- */
.af-blog-detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.af-blog-detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.af-list-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Buying Tips Highlight Box --- */
.af-tips-box {
  background-color: #FFF3E0; /* Soft orange matching the accent color */
  border-left: 4px solid var(--accent-color);
  padding: var(--spacing-xl);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
  margin-top: var(--spacing-md);
}

.af-tips-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.af-tips-box .af-blog-detail-text {
  margin-bottom: 0; /* removes bottom margin for the last paragraph in the box */
  color: #7c2d12; /* Darker orange/brown text for readability */
}
.af-tips-box .af-blog-detail-text:not(:last-child) {
    margin-bottom: var(--spacing-sm);
}

/* --- Bottom Actions --- */
.af-blog-detail-actions {
  margin-top: var(--spacing-3xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid #E5E7EB;
  display: flex;
  justify-content: center;
}

.af-blog-back-btn {
  min-width: 200px;
}

/* --- 404 / Not Found State --- */
.af-blog-not-found {
  padding: 8rem 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.af-not-found-icon {
  width: 100px;
  height: 100px;
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

.af-not-found-text {
  color: var(--text-secondary);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-xl);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 767px) {
  .af-blog-article-card {
    padding: 2rem 1.5rem;
    /* Added a slightly smaller positive gap for mobile screens */
    margin-top: var(--spacing-lg); 
  }

  .af-blog-featured-image {
    max-height: 250px;
  }

  .af-blog-detail-heading {
    font-size: 1.75rem;
  }
  
  .af-tips-box {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}