/* =============================================================================
   Blog Detail Page Layout Fix - Title Section
   ============================================================================= */

/* Blog post header improvements */
.post-meta {
  max-width: 100%;
  margin: 0 auto;
}

/* Category badges styling */
.meta-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem !important;
}

.badge-category {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-category i {
  font-size: 0.8rem;
}

/* Title section container */
.title-section {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem !important;
}

/* Title styling improvements */
.post-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 2.5rem !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin-bottom: 1rem !important;
  text-align: center;
  width: 100%;
  display: block;
}

/* Summary styling */
.post-summary {
  font-family: 'Inter', sans-serif;
  max-width: 700px;
  margin: 0 auto !important;
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
  color: #6b7280 !important;
  text-align: center;
  width: 100%;
  display: block;
  clear: both;
}

/* Author info section */
.post-author-meta {
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  border: 1px solid #e2e8f0;
  margin: 0 auto;
  max-width: 100%;
}

.author-info {
  align-items: center;
  gap: 0.875rem;
  justify-content: flex-start;
}

.author-details {
  text-align: left;
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
  padding-right: 0.5rem;
}

/* Author avatar styling - both image and placeholder */
.author-avatar,
.author-avatar-placeholder {
  width: 55px !important;
  height: 55px !important;
  border-radius: 50% !important;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-avatar {
  object-fit: cover;
  object-position: center;
}

.author-avatar-placeholder {
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.author-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.075rem;
  color: #1f2937;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.author-title {
  font-size: 0.925rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Post meta inline styling */
.post-byline {
  gap: 0.875rem;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.875rem;
  flex-wrap: wrap;
}

.post-byline span {
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: fit-content;
}

.post-byline i {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-right: 0.25rem;
}


/* Responsive improvements */
@media (max-width: 768px) {
  /* Header mobile adjustments */
  #post-header {
    padding: 1.5rem 0 !important;
  }
  
  #post-header .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Featured image mobile responsiveness */
  .post-image img {
    max-height: 250px !important;
    border-radius: 6px !important;
    height: auto !important;
  }
  
  .post-image img[style*="height"] {
    height: auto !important;
    max-height: 250px !important;
  }
  
  .title-section {
    margin-bottom: 1.5rem !important;
  }
  
  .post-title {
    font-size: 2rem !important;
    line-height: 1.3 !important;
  }
  
  .post-summary {
    font-size: 1rem !important;
    margin: 0 auto !important;
  }
  
  .post-author-meta {
    padding: 1rem 1.25rem;
    margin: 0 -15px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .author-info {
    flex-direction: column;
    text-align: center;
  }
  
  .author-details {
    text-align: center;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
    word-wrap: break-word;
  }
  
  .author-avatar,
  .author-avatar-placeholder {
    margin-bottom: 0.5rem;
  }
  
  .post-byline {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .post-byline span {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  /* iPhone and small mobile optimizations */
  #post-header {
    padding: 1rem 0 !important;
  }
  
  #post-header .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  
  /* Featured image iPhone optimizations */
  .post-image {
    margin-bottom: 1.5rem !important;
  }
  
  .post-image img {
    max-height: 200px !important;
    border-radius: 4px !important;
    height: auto !important;
  }
  
  .post-image img[style*="height"] {
    height: auto !important;
    max-height: 200px !important;
  }
  
  .post-title {
    font-size: 1.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .post-summary {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    padding: 0 0.5rem;
  }
  
  .meta-badges {
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem !important;
  }
  
  .badge-category {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .post-author-meta {
    margin: 0 -15px;
    padding: 0.75rem;
  }
}

/* iPhone landscape and very small screens */
@media (max-width: 480px) {
  #post-header {
    padding: 0.75rem 0 !important;
  }
  
  .post-image img {
    max-height: 180px !important;
    height: auto !important;
  }
  
  .post-image img[style*="height"] {
    height: auto !important;
    max-height: 180px !important;
  }
  
  .post-title {
    font-size: 1.5rem !important;
    padding: 0 0.25rem;
  }
  
  .post-summary {
    font-size: 0.9rem !important;
    padding: 0 0.25rem;
  }
  
  .post-author-meta {
    margin: 0 -15px;
    padding: 0.5rem;
  }
  
  .author-details {
    padding: 0 0.25rem;
  }
  
  .post-byline {
    gap: 0.5rem;
    line-height: 1.6;
  }
}

/* Badge consistency */
.badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.bg-info {
  background-color: #3b82f6 !important;
}

.bg-secondary {
  background-color: #6b7280 !important;
}

/* Enhanced hover effects */
.post-author-meta {
  transition: all 0.3s ease;
}

.post-author-meta:hover {
  background: rgba(248, 250, 252, 1);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}


/* Blog Banner/Header Mobile Responsiveness */
#post-header {
  padding: 2rem 0 !important;
}

#post-header .container {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Featured Image Mobile Responsiveness */
.post-image {
  margin-bottom: 2rem !important;
}

.post-image img {
  width: 100% !important;
  height: auto !important;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px !important;
  /* Override inline style from template */
  height: auto !important;
}

/* Force override of inline styles */
.post-image img[style*="height"] {
  height: auto !important;
  max-height: 300px !important;
}

/* Typography hierarchy */
.post-meta h1,
.post-meta .author-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Improved accessibility */
.post-byline time {
  font-variant-numeric: tabular-nums;
}

/* Container width fix */
@media (min-width: 992px) {
  .col-lg-8 {
    max-width: 66.66667%;
    flex: 0 0 66.66667%;
  }
  .col-lg-10 {
    max-width: 83.33333%;
    flex: 0 0 83.33333%;
  }
  .col-lg-4 {
    max-width: 33.33333%;
    flex: 0 0 33.33333%;
  }
}

/* Center alignment for smaller screens */
@media (max-width: 991.98px) {
  .post-meta {
    text-align: center !important;
  }
  
  .author-info {
    justify-content: center;
  }
}