/* style/blog.css */
/* body đã padding-top: var(--header-offset) từ shared.css; trang này không cần thêm */

:root {
  --page-blog-primary-color: #11A84E;
  --page-blog-secondary-color: #22C768;
  --page-blog-text-main: #F2FFF6;
  --page-blog-text-secondary: #A7D9B8;
  --page-blog-background: #08160F;
  --page-blog-card-bg: #11271B;
  --page-blog-border-color: #2E7A4E;
  --page-blog-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--page-blog-text-main); /* Default text color for dark background */
  background-color: var(--page-blog-background);
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: var(--page-blog-text-main);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

.page-blog__description {
  font-size: 1.1em;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 30px auto;
  color: var(--page-blog-text-secondary);
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* Ensure button adapts to container width */
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow long words to break */
  text-align: center;
}

.page-blog__btn-primary {
  background: var(--page-blog-btn-gradient);
  color: #ffffff; /* White text for primary button */
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.page-blog__btn-secondary {
  background: #ffffff;
  color: var(--page-blog-primary-color); /* Brand green text for secondary button */
  border: 2px solid var(--page-blog-primary-color);
}

.page-blog__btn-secondary:hover {
  background: var(--page-blog-primary-color);
  color: #ffffff;
  transform: translateY(-2px);
}

/* Card Styling */
.page-blog__card {
  background-color: var(--page-blog-card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 25px;
  color: var(--page-blog-text-main);
  border: 1px solid var(--page-blog-border-color);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-top: 10px; /* Small top padding, body handles header offset */
  padding-bottom: 60px;
  background-color: var(--page-blog-background);
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  margin-bottom: 30px;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Minimum size requirement */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 0 20px;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size for H1 */
  color: var(--page-blog-text-main);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.page-blog__hero-section .page-blog__description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: var(--page-blog-text-secondary);
}

.page-blog__hero-section .page-blog__btn-primary {
  font-size: 1.1em;
  padding: 15px 35px;
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: #0A1C14; /* Slightly lighter dark background for contrast */
  color: var(--page-blog-text-main);
}

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

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

.page-blog__post-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  min-height: 200px; /* Minimum size requirement */
}

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

.page-blog__post-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-blog__post-title a {
  color: var(--page-blog-text-main);
  text-decoration: none;
}

.page-blog__post-title a:hover {
  color: var(--page-blog-primary-color);
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-blog__post-date {
  font-size: 0.85em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 15px;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--page-blog-primary-color);
  text-decoration: none;
  font-weight: bold;
  margin-top: auto; /* Push to bottom */
}

.page-blog__read-more:hover {
  text-decoration: underline;
}

.page-blog__view-all-button-wrapper {
  text-align: center;
  margin-top: 50px;
}

/* Featured Article Section */
.page-blog__featured-article {
  padding: 80px 0;
  background-color: var(--page-blog-background);
  color: var(--page-blog-text-main);
}

.page-blog__featured-content {
  display: flex;
  gap: 40px;
  align-items: center;
}

.page-blog__featured-text {
  flex: 1;
}

.page-blog__featured-title {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--page-blog-text-main);
}

.page-blog__featured-text p {
  font-size: 1.1em;
  margin-bottom: 20px;
  color: var(--page-blog-text-secondary);
}

.page-blog__featured-image {
  flex: 1;
  max-width: 50%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  min-width: 200px; /* Minimum size requirement */
  min-height: 200px;
}

/* Categories Section */
.page-blog__categories {
  padding: 80px 0;
  background-color: #0A1C14; /* Slightly lighter dark background for contrast */
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.page-blog__category-card {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  text-decoration: none;
  color: var(--page-blog-text-main);
  transition: background-color 0.3s ease;
}

.page-blog__category-card:hover {
  background-color: var(--page-blog-primary-color);
  color: #ffffff;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--page-blog-background);
}

.page-blog__cta-section .page-blog__description {
  max-width: 700px;
  margin-bottom: 40px;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: #0A1C14; /* Slightly lighter dark background for contrast */
}

.page-blog__faq-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-blog__faq-item {
  border-radius: 12px;
  overflow: hidden;
  color: var(--page-blog-text-main);
  background-color: var(--page-blog-card-bg);
  border: 1px solid var(--page-blog-border-color);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  background-color: #11271B; /* Darker background for question summary */
  color: var(--page-blog-text-main);
  list-style: none; /* Remove default marker */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for webkit browsers */
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: var(--page-blog-primary-color);
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  line-height: 1.6;
  color: var(--page-blog-text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__featured-content {
    flex-direction: column;
  }
  .page-blog__featured-image {
    max-width: 100%;
    margin-top: 30px;
  }
}

@media (max-width: 768px) {
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 6vw, 2.5em);
  }
  .page-blog__hero-section,
  .page-blog__latest-posts,
  .page-blog__featured-article,
  .page-blog__categories,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 40px 0;
  }

  .page-blog__container {
    padding: 0 15px; /* Add padding for mobile containers */
  }

  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__hero-image {
    height: 250px;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr;
  }

  .page-blog__featured-title {
    font-size: 1.6em;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  .page-blog__card {
    padding: 20px;
  }

  .page-blog__faq-question {
    font-size: 1.1em;
    padding: 15px 20px;
  }

  .page-blog__faq-answer {
    padding: 0 20px 15px;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: clamp(1.5em, 7vw, 2em);
  }
  .page-blog__section-title {
    font-size: 1.8em;
  }
  .page-blog__hero-section .page-blog__description {
    font-size: 1em;
  }
}