/* BLOG PAGE STYLES */

/* General Layout */
#area-box.ourBlog {
  background: radial-gradient(ellipse at top left, #2a003e 0%, #0b0b2c 100%);
  padding-top: 20px;
  padding-bottom: 50px;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
}

body .ourBlog .container {
  max-width: 1100px !important;
  margin-left: auto;
  margin-right: auto;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* Page Title and Subtitle */
/* Wrapper with underline */
.ourBlog-header {
  border-bottom: 2px solid #B14CFF;
  padding-bottom: 40px;
  padding-top: 30px;
  margin-bottom: 2rem;
  width: 100%;
}

/* Flex layout */
.ourBlog-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  width: 100%;
}

@media (max-width: 767px) {
  .ourBlog-header-row {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .blog-subtitle {
    text-align: center;
  }
  
  .blog-title {
    font-size: 40px;
  }
}

/* Title */
.blog-title {
  font-family: 'Poppins', sans-serif;
  font-size: 60px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

/* Subtitle */
.blog-subtitle {
  font-size: 1.8rem;
  color: #bdbaff;
  margin: 0;
  text-align: right;
}

/* Featured Post */
.feature-post-title {
  color: #fff;
  font-weight: 600;
  font-size: 2.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.3em * 2); /* 2 lines */
}

.feature-post-title:hover {
  text-decoration: none;
  color: #B14CFF;
}

.ourBlog h2 {
  margin-bottom: 2rem;
}

/* Featured post container */
.featured-post-container {
  margin-bottom: 40px;
  width: 100%;
}

/* Responsive styles for featured post */
@media (max-width: 991px) {
  .featured-post-container .row {
    flex-direction: column;
    width: 100%;
    margin: 0;
  }
  
  .featured-post-container .row .col-md-6 {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0 15px;
  }
  
  .featured-post-container .row .col-md-6:first-child {
    margin-bottom: 20px;
  }
  
  .featured-post-container .row .img-fluid {
    max-height: 350px;
    width: 100%;
    object-fit: cover;
  }
  
  .featured-post-container {
    padding: 0;
  }
  
  .featured-post-container .row {
    padding: 0;
  }
  
  .feature-post-title {
    font-size: 1.8rem;
  }
  
  .feature-post-excerpt {
    font-size: 1.4rem;
  }
  
  .featured-post-meta {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .featured-post-meta .badge {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .feature-post-title {
    font-size: 1.8rem;
  }
  
  .feature-post-excerpt {
    font-size: 1.2rem;
  }
  
  .featured-post-container .row .img-fluid {
    max-height: 250px;
  }
  
  .ourBlog .container {
    padding: 0;
  }
  
  .featured-post-container .row .col-md-6 {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Featured post row styling */
.featured-post-container .row.mb-5 {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Featured post metadata layout */
.featured-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.featured-post-meta .small.text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
  margin: 0;
}

#blogTabsContent {
  margin-top: 30px;
}

/* Image styling */
.featured-post-container .row .img-fluid {
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

/* Right column content styling */
.featured-post-container .row .col-md-6.d-flex {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding-left: 15px;
}

.feature-post-excerpt {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  font-size: 1.6rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.5em * 3); /* 3 lines */
}

.ourBlog .badge-secondary {
  background: #B14CFF;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}

/* Đảm bảo columns trong featured post không bị wrap */
@media (min-width: 992px) {
  .featured-post-container .row .col-md-6 {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 991px) {
  .ourBlog .container {
    max-width: 100%;
    width: 100%;
  }
}

/* Category Nav */
.ourBlog .nav-item {
  margin: 0 1px;
}

/* Blog Grid */
#all-posts-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px 5px;
}


/* Blog Card */
.card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #1A1A3F;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1 1 336px;
  max-width: 336px;
  min-width: 250px;
  height: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  margin-top: 10px;
  box-sizing: border-box;
}


.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(177, 76, 255, 0.2);
}

.card-img-top {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

/* Card Body */
.card-body {
  height: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0.75rem;
}

.card-title {
  margin: 0.5rem 0;
  display: flex;
  align-items: flex-start;
}

.card-title a {
  font-size: var(--font-size-medium);
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.3em * 2); /* 2 lines */
}

.card-title a:hover {
  color: #B14CFF;
}

.card-text {
  font-size: var(--font-size-small) !important;
  color: rgba(255, 255, 255, 0.708);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.5em * 3); /* 3 lines */
  flex-grow: 1;
}

@media (max-width: 767px) {
  .blog-title {
    font-size: 40px !important;
  }
}

@media (max-width: 768px) {
  .card-title a {
    font-size: 18px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .card-text {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

.badge-light {
  background-color: #f9f9f9;
  color: #121629;
  font-weight: 600;
  font-size: var(--font-size-badge);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  text-transform: uppercase;
  margin-bottom: 12px;
  max-width: fit-content;
}

/* Date and Reading Time */
.card-body .text-muted {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6) !important;
  text-align: left;
  margin-bottom: 5px;
}

/* Load More Button */
#loadMoreBtn {
  background: linear-gradient(90deg, #B14CFF 0%, #2714A6 100%);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: none;
  padding: 10px 28px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(177, 76, 255, 0.3);
}

#loadMoreBtn:hover {
  background: linear-gradient(90deg, #A337E9 0%, #1D127B 100%);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
  #all-posts-container {
    justify-content: center;
  }
  .card {
    flex: 1 1 90vw;
    max-width: 336px;
    min-width: 250px;
  }
}

@media (max-width: 991px) {
  .ourBlog .container {
    max-width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 576px) {
  .ourBlog .container {
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (max-width: 768px) {
  .ourBlog h1.display-4 {
    font-size: 2.2rem;
  }

  .ourBlog-header {
    padding-bottom: 20px;
  }

  .ourBlog-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .blog-subtitle {
    text-align: left;
  }

  .nav-tabs .nav-link {
    padding: 8px 12px;
    font-size: 14px;
  }

  .ourBlog .row {
    row-gap: 20px;
    column-gap: 10px;
  }

  .card-title a {
    font-size: 2rem;
  }

  .card-text {
    font-size: 14px !important;
    min-height: 4rem;
  }
}
