/* style/blog.css */

/* General page styling */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #1F2D3D; /* Text Main */
  background-color: #F4F7FB; /* Background */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px; /* Space below content */
  padding-top: 10px; /* Small top padding, body handles header offset */
  overflow: hidden; /* Ensure image doesn't overflow */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 500px; /* Limit height for hero image */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.page-blog__hero-content {
  max-width: 900px;
  padding: 30px 20px 0;
  margin-top: -100px; /* Overlap slightly for visual flow, but text is below image */
  position: relative;
  z-index: 1; /* Ensure text is above any background elements */
  background-color: #FFFFFF; /* Card BG */
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding-bottom: 40px;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive H1 font size */
  font-weight: 700;
  color: #2F6BFF; /* Primary color */
  margin-bottom: 15px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.page-blog__intro-text {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #1F2D3D; /* Text Main */
}

/* Section for blog posts */
.page-blog__posts-section {
  padding: 60px 20px;
  background-color: #F4F7FB; /* Background */
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: #2F6BFF; /* Primary color */
  text-align: center;
  margin-bottom: 40px;
}

.page-blog__posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-blog__post-card {
  background-color: #FFFFFF; /* Card BG */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__post-thumbnail {
  width: 100%;
  height: 220px; /* Fixed height for thumbnails */
  object-fit: cover;
  display: block;
}

.page-blog__post-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #1F2D3D; /* Text Main */
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: #1F2D3D; /* Text Main */
  margin-bottom: 15px;
  flex-grow: 1; /* Push date to bottom */
}

.page-blog__post-date {
  font-size: 0.85em;
  color: #6FA3FF; /* Secondary color */
  text-align: right;
  display: block;
  margin-top: auto; /* Push to bottom */
}

/* CTA container for "Xem Thêm Bài Viết" */
.page-blog__cta-container {
  text-align: center;
  margin-top: 50px;
}

/* Call to Action Section */
.page-blog__cta-section {
  background: linear-gradient(135deg, #2F6BFF 0%, #6FA3FF 100%); /* Using brand colors for a dark background */
  color: #ffffff; /* White text on dark background */
  padding: 80px 20px;
  text-align: center;
}

.page-blog__cta-title {
  font-size: 2.8em;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 40px;
  color: #f0f0f0;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap; /* Prevent text wrapping on desktop */
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button gradient */
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.3);
}

.page-blog__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.4);
}

.page-blog__btn-secondary {
  background-color: #ffffff;
  color: #2F6BFF; /* Primary color */
  border: 2px solid #2F6BFF; /* Border color */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-blog__btn-secondary:hover {
  background-color: #f0f5ff; /* Lighter hover background */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Responsive styles */
@media (max-width: 992px) {
  .page-blog__hero-content {
    margin-top: -60px;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 3em);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__cta-title {
    font-size: 2.2em;
  }
  .page-blog__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  /* General mobile adjustments */
  .page-blog__hero-section {
    padding-bottom: 40px;
    padding-top: 10px !important; /* body handles header offset, small top padding here */
  }

  .page-blog__hero-image-wrapper {
    max-height: 300px;
  }

  .page-blog__hero-content {
    margin-top: -40px;
    padding: 20px 15px 30px;
  }

  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
  }

  .page-blog__intro-text {
    font-size: 1em;
  }

  .page-blog__posts-section,
  .page-blog__cta-section {
    padding: 40px 15px;
  }

  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-blog__section-title {
    font-size: 1.8em;
  }

  .page-blog__post-thumbnail {
    height: 180px;
  }

  .page-blog__post-title {
    font-size: 1.2em;
  }

  .page-blog__post-excerpt {
    font-size: 0.9em;
  }

  .page-blog__cta-title {
    font-size: 1.8em;
  }

  .page-blog__cta-description {
    font-size: 1em;
  }

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    width: 100%; /* Ensure container takes full width */
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Add padding to container */
  }

  /* Mobile button responsiveness */
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog a[class*="button"],
  .page-blog a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important; /* Allow text wrap */
    word-wrap: break-word !important; /* Allow text break */
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile image responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Specific containers that hold images/buttons/videos must also be responsive */
  .page-blog__hero-image-wrapper,
  .page-blog__post-card,
  .page-blog__post-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}