/* style/resources.css */

/* Custom CSS Variables for this page (optional, if needed) */
:root {
  --primary-color: #B80000;
  --secondary-color: #FFD700;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-light: #f9f9f9;
  --border-color: #e0e0e0;
}

/* Base styles for the page content, ensuring contrast with default body background (white) */
.page-resources {
  font-family: 'Arial', sans-serif;
  color: var(--text-dark); /* Default text color for light backgrounds */
  line-height: 1.6;
  padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page-resources__section {
  padding: 60px 0;
  text-align: center;
}

.page-resources__section-title {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: bold;
}

.page-resources__section-intro {
  font-size: 1.1em;
  color: #555;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* HERO Section */
.page-resources__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #a00000 100%); /* Slightly darker red gradient */
  color: var(--text-light);
  overflow: hidden; /* Ensure no overflow */
}

.page-resources__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.page-resources__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-resources__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-resources__main-title {
  font-size: 3em;
  margin-bottom: 15px;
  color: var(--secondary-color); /* Gold color for main title */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  line-height: 1.2;
}

.page-resources__intro-description {
  font-size: 1.25em;
  margin-bottom: 30px;
  color: #f0f0f0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__cta-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-resources__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  max-width: 100%; /* Ensure button adapts to container width */
  box-sizing: border-box;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-resources__btn-primary {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--secondary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-primary:hover {
  background: #f0c200; /* Slightly darker gold */
  border-color: #f0c200;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-resources__btn-secondary {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-secondary:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Guide Section */
.page-resources__guide-section {
  background: var(--bg-light);
}

.page-resources__card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  text-align: left;
}

.page-resources__card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 450px; /* Ensure cards have similar height */
}

.page-resources__card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__card img {
  width: 100%;
  height: 200px; /* Fixed height for consistent image display */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__card-title {
  font-size: 1.5em;
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: bold;
}

.page-resources__card p {
  font-size: 1em;
  color: #666;
  margin-bottom: 20px;
  flex-grow: 1; /* Allow paragraph to take available space */
}

.page-resources__card-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  padding: 8px 0;
  border-bottom: 2px solid var(--primary-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.page-resources__card-link:hover {
  color: #8a0000; /* Darker red on hover */
  border-color: #8a0000;
}

.page-resources__btn-container {
  margin-top: 50px;
}

/* Strategy Section */
.page-resources__strategy-section {
  background: var(--primary-color); /* Dark background */
  color: var(--text-light); /* Light text */
}

.page-resources__strategy-section .page-resources__section-title {
  color: var(--secondary-color); /* Gold title on dark background */
}

.page-resources__strategy-section .page-resources__section-intro {
  color: #f0f0f0;
}

.page-resources__grid-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  text-align: left;
}

.page-resources__content-block {
  background: rgba(255, 255, 255, 0.1); /* Semi-transparent white background */
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 550px; /* Ensure blocks have similar height */
}

.page-resources__content-block img {
  width: 100%;
  height: 250px; /* Fixed height for consistent image display */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__block-title {
  font-size: 1.4em;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-weight: bold;
}

.page-resources__content-block p {
  font-size: 1em;
  color: #f0f0f0;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-resources__block-link {
  display: inline-block;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  padding: 8px 0;
  border-bottom: 2px solid var(--secondary-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.page-resources__block-link:hover {
  color: #ffd000; /* Lighter gold on hover */
  border-color: #ffd000;
}

/* News Section */
.page-resources__news-section {
  background: #ffffff;
}

.page-resources__article-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 40px;
  text-align: left;
}

.page-resources__article-item {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__article-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.page-resources__article-item img {
  width: 300px; /* Fixed width for article image */
   /* Fixed height */
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 10px 0 0 10px;
  min-width: 200px; /* Enforce min image size */
  min- /* Enforce min image size */
}

.page-resources__article-content {
  padding: 25px;
  flex-grow: 1;
}

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

.page-resources__article-title a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-resources__article-title a:hover {
  color: #8a0000;
}

.page-resources__article-content p {
  color: #666;
  font-size: 0.95em;
  margin-bottom: 15px;
}

.page-resources__article-date {
  font-size: 0.85em;
  color: #999;
}

/* FAQ Section */
.page-resources__faq-section {
  background: var(--bg-light);
  padding-bottom: 80px;
}

.page-resources__faq-list {
  max-width: 900px;
  margin: 40px auto 0 auto;
  text-align: left;
}

/* FAQ容器样式 */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.page-resources__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
  color: #555; /* Ensure text color for FAQ answer */
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo có thể mở rộng */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 Sử dụng !important để đảm bảo ưu tiên, giá trị đủ lớn để chứa bất kỳ nội dung nào */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vấn đề kiểu dáng */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-resources__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.page-resources__faq-question:active {
  background: #eeeeee;
}

/* Vấn đề tiêu đề kiểu dáng */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn chặn thẻ h3 chặn sự kiện click */
  color: var(--text-dark); /* Ensure h3 color */
}

/* Chuyển đổi biểu tượng */
.page-resources__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color); /* Use primary color for toggle */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn chặn biểu tượng chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Xoay để tạo hiệu ứng 'x' */
}

.page-resources__faq-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  margin-top: 10px;
  border-bottom: 1px solid var(--primary-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.page-resources__faq-link:hover {
  color: #8a0000;
  border-color: #8a0000;
}

/* Contact Section */
.page-resources__contact-section {
  background: var(--primary-color); /* Dark background */
  color: var(--text-light); /* Light text */
  padding-bottom: 80px;
}

.page-resources__contact-section .page-resources__section-title {
  color: var(--secondary-color); /* Gold title on dark background */
}

.page-resources__contact-section .page-resources__section-intro {
  color: #f0f0f0;
}

.page-resources__contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  text-align: center;
}

.page-resources__contact-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 380px;
}

.page-resources__contact-item img {
   /* Smaller image for contact items */
  
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 4px solid var(--secondary-color);
  min-width: 200px; /* Enforce min image size */
  min-height: 200px; /* Enforce min image size */
}

.page-resources__contact-title {
  font-size: 1.5em;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-weight: bold;
}

.page-resources__contact-item p {
  color: #f0f0f0;
  font-size: 1em;
  margin-bottom: 25px;
  flex-grow: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-resources__main-title {
    font-size: 2.5em;
  }
  .page-resources__section-title {
    font-size: 2em;
  }
  .page-resources__hero-image img {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .page-resources {
    padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
    font-size: 16px;
    line-height: 1.6;
  }

  .page-resources__container {
    padding: 15px;
  }

  .page-resources__section {
    padding: 40px 0;
  }

  .page-resources__hero-section {
    padding: 40px 15px;
  }

  .page-resources__hero-image {
    margin-bottom: 20px;
  }

  .page-resources__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 4px;
    min-width: unset;
    min-height: unset;
  }

  .page-resources__main-title {
    font-size: 2em;
  }

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

  .page-resources__cta-group {
    flex-direction: column;
    gap: 15px;
  }

  .page-resources__cta-button,
  .page-resources__btn-primary,
  .page-resources__btn-secondary,
  .page-resources a[class*="button"],
  .page-resources a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 20px;
    font-size: 1em;
  }

  .page-resources__btn-container,
  .page-resources__cta-buttons,
  .page-resources__button-group {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }

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

  .page-resources__section-intro {
    font-size: 0.95em;
    margin-bottom: 30px;
  }

  .page-resources__card-grid,
  .page-resources__grid-columns,
  .page-resources__contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-resources__card,
  .page-resources__content-block,
  .page-resources__contact-item {
    min-height: unset; /* Allow height to adjust */
    padding: 20px;
  }

  .page-resources__card img,
  .page-resources__content-block img,
  .page-resources__contact-item img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset;
    min-height: unset;
    border-radius: 6px;
  }

  .page-resources__article-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-resources__article-item img {
    width: 100%;
    height: auto;
    border-radius: 10px 10px 0 0;
    min-width: unset;
    min-height: unset;
  }

  .page-resources__article-content {
    padding: 20px;
  }

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

  .page-resources__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-resources__faq-question h3 {
    font-size: 15px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  
  .page-resources__faq-answer {
    padding: 0 15px;
  }
  
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }
}

@media (max-width: 480px) {
  .page-resources__main-title {
    font-size: 1.8em;
  }
  .page-resources__section-title {
    font-size: 1.5em;
  }
}