/* style/resources.css */

/* Base styles for the page-resources scope */
.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light background */
  background-color: var(--secondary-color, #FFFFFF); /* Ensure light background */
}

/* 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;
  padding-top: var(--header-offset, 120px); /* Apply header offset here for desktop */
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); /* Brand colors */
  color: #ffffff; /* White text for gradient background */
}

.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;
  filter: none !important;
}

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

.page-resources__hero-title {
  font-size: 2.8em;
  margin-bottom: 15px;
  line-height: 1.2;
  color: #ffffff;
}

.page-resources__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  color: #f0f0f0;
}

.page-resources__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #EA7C07; /* Login color for CTA */
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__cta-button:hover {
  background: #d46a00;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* General Section Styles */
.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
  width: 100%;
}

.page-resources__section-title {
  font-size: 2.2em;
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color); /* Brand color for titles */
  font-weight: bold;
}

.page-resources__section-description {
  font-size: 1.1em;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px auto;
  color: #555555;
}

/* Introduction Section */
.page-resources__introduction-section {
  padding: 60px 0;
}

.page-resources__introduction-section .page-resources__section-description {
  text-align: left;
  max-width: 100%;
}

/* Featured Articles Section */
.page-resources__dark-section {
  background-color: var(--primary-color); /* Brand primary color for dark section */
  color: #ffffff;
  padding: 60px 0;
}

.page-resources__dark-section .page-resources__section-title,
.page-resources__dark-section .page-resources__section-description {
  color: #ffffff;
}

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

.page-resources__article-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-resources__article-card img {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  min-height: 200px; /* Enforce minimum height */
  object-fit: cover;
  display: block;
  filter: none !important;
}

.page-resources__article-card .page-resources__card-title {
  font-size: 1.4em;
  margin: 20px 20px 10px 20px;
  color: var(--primary-color);
  line-height: 1.3;
}

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

.page-resources__article-card .page-resources__card-title a:hover {
  color: #1a7fb3; /* Slightly darker primary color */
}

.page-resources__article-card .page-resources__card-excerpt {
  font-size: 1em;
  color: #555555;
  padding: 0 20px 20px 20px;
  flex-grow: 1;
}

.page-resources__btn-secondary {
  display: inline-block;
  padding: 10px 25px;
  background: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  margin: 0 20px 20px 20px;
  transition: all 0.3s ease;
  align-self: flex-start;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__btn-secondary:hover {
  background: var(--primary-color);
  color: #ffffff;
}

/* CTA Banner within Featured Articles */
.page-resources__cta-banner {
    background: rgba(255, 255, 255, 0.15); /* Semi-transparent white on dark background */
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-top: 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
}

.page-resources__cta-banner-title {
    font-size: 2em;
    margin-bottom: 15px;
    color: #ffffff;
}

.page-resources__cta-banner-description {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #f0f0f0;
}

.page-resources__cta-button--large {
    padding: 18px 50px;
    font-size: 20px;
}


/* Why Choose Us Section */
.page-resources__why-choose-us {
  padding: 60px 0;
}

.page-resources__feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  list-style: none;
  padding: 0;
  margin-top: 40px;
}

.page-resources__feature-item {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-resources__feature-text {
  font-size: 1em;
  color: #555555;
}

/* FAQ Section */
.page-resources__faq-section {
  padding: 60px 0;
}

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

/* FAQ container style */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* FAQ default state - answer hidden */
.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;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important to ensure priority, value large enough to contain any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #333333; /* Ensure dark text on light background */
}

/* Question style */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  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;
}

/* Question title style */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 tag from blocking click event */
  color: #333333; /* Ensure dark text */
}

/* Toggle icon */
.page-resources__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  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); /* Example for '-' icon */
}

/* CTA Section */
.page-resources__cta-section {
  padding: 80px 0;
  background-color: var(--primary-color); /* Brand primary color */
  color: #ffffff;
  text-align: center;
}

.page-resources__cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-resources__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-resources__cta-description {
  font-size: 1.1em;
  max-width: 800px;
  margin-bottom: 40px;
  color: #f0f0f0;
}

.page-resources__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  width: 100%; /* Ensure container takes full width for responsiveness */
  max-width: 500px; /* Max width for buttons group */
  box-sizing: border-box;
}

.page-resources__btn-primary,
.page-resources__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: bold;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  max-width: 100%; /* Ensure button adapts to container width */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-resources__btn-primary {
  background: #EA7C07; /* Login color */
  color: #ffffff;
  border: 2px solid transparent;
}

.page-resources__btn-primary:hover {
  background: #d46a00;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-secondary {
  background: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-resources__btn-secondary:hover {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-resources__hero-title {
    font-size: 2.4em;
  }
  .page-resources__section-title {
    font-size: 1.8em;
  }
  .page-resources__cta-title {
    font-size: 2em;
  }
}

@media (max-width: 768px) {
  /* Hero Section Mobile */
  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Re-apply for mobile */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
  }

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

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

  .page-resources__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    width: 100% !important; /* Ensure button adapts to container width */
    max-width: 300px !important; /* Limit max width for a single button */
  }

  /* General Section Titles and Descriptions */
  .page-resources__container {
    padding: 30px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .page-resources__section-title {
    font-size: 1.8em;
  }
  .page-resources__section-description {
    font-size: 1em;
  }

  /* Article Grid Mobile */
  .page-resources__article-grid {
    grid-template-columns: 1fr;
  }

  .page-resources__article-card img {
    height: 200px; /* Adjust height for mobile */
    min-height: 200px !important; /* Enforce minimum height */
    max-width: 100% !important;
    width: 100% !important;
  }

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

  /* CTA Banner Mobile */
  .page-resources__cta-banner {
    padding: 30px 20px;
  }

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

  .page-resources__cta-banner-description {
    font-size: 1em;
  }
  
  .page-resources__cta-button--large {
    padding: 15px 40px;
    font-size: 18px;
    width: 100% !important; /* Ensure button adapts to container width */
    max-width: 300px !important; /* Limit max width for a single button */
  }

  /* Why Choose Us Section Mobile */
  .page-resources__feature-list {
    grid-template-columns: 1fr;
  }

  /* FAQ Section Mobile */
  .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;
  }

  /* Final CTA Section Mobile */
  .page-resources__cta-title {
    font-size: 1.8em;
  }
  .page-resources__cta-description {
    font-size: 1em;
  }
  .page-resources__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    max-width: 300px !important; /* Limit width of stacked buttons */
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
  }
  .page-resources__btn-primary,
  .page-resources__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Global Image responsiveness for content area */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  .page-resources__section,
  .page-resources__card,
  .page-resources__hero-section,
  .page-resources__introduction-section,
  .page-resources__featured-articles,
  .page-resources__why-choose-us,
  .page-resources__faq-section,
  .page-resources__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Remove padding for the container itself if the section also has it, to avoid double padding */
  .page-resources__container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Ensure all content images meet minimum size requirements and no filter */
.page-resources img {
  min-width: 200px;
  min-height: 200px;
  filter: none !important;
}

/* Adjustments for text contrast on light background */
.page-resources__light-bg {
  background: var(--secondary-color, #FFFFFF);
  color: #333333;
}
.page-resources__light-bg .page-resources__section-title {
  color: var(--primary-color);
}
.page-resources__light-bg .page-resources__section-description {
  color: #555555;
}
.page-resources__light-bg .page-resources__feature-title {
  color: var(--primary-color);
}
.page-resources__light-bg .page-resources__feature-text {
  color: #555555;
}
.page-resources__light-bg a {
  color: var(--primary-color);
}
.page-resources__light-bg a:hover {
  color: #1a7fb3;
}
.page-resources__light-bg .page-resources__faq-question h3 {
  color: #333333;
}
.page-resources__light-bg .page-resources__faq-item.active .page-resources__faq-answer {
  color: #333333;
}

/* Adjustments for text contrast on dark background */
.page-resources__dark-section {
  background-color: var(--primary-color);
  color: #ffffff;
}
.page-resources__dark-section .page-resources__section-title,
.page-resources__dark-section .page-resources__section-description,
.page-resources__dark-section .page-resources__cta-banner-title,
.page-resources__dark-section .page-resources__cta-banner-description {
  color: #ffffff;
}
.page-resources__dark-section .page-resources__article-card {
  background: #ffffff; /* Card background is white */
}
.page-resources__dark-section .page-resources__article-card .page-resources__card-title a,
.page-resources__dark-section .page-resources__article-card .page-resources__card-excerpt {
  color: #333333; /* Card text is dark */
}
.page-resources__dark-section .page-resources__article-card .page-resources__card-title a:hover {
  color: var(--primary-color); /* Hover on link inside card */
}

/* Ensure button contrast */
.page-resources__btn-primary {
  background: #EA7C07; /* Login color */
  color: #ffffff;
}
.page-resources__btn-secondary {
  background: #ffffff;
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.page-resources__btn-secondary:hover {
  background: var(--primary-color);
  color: #ffffff;
}