/* style/news.css */

/* Base styles for the news page */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text on light background */
    background-color: #ffffff; /* Default background for main content */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

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

.page-news__section-title {
    font-size: 36px;
    color: #017439; /* Brand primary color for titles */
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    line-height: 1.2;
}

/* Hero Article Section */
.page-news__hero-article-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.page-news__hero-article-content {
    text-align: center;
}

.page-news__hero-article-title {
    font-size: 42px;
    color: #017439;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: bold;
}

.page-news__hero-article-intro {
    font-size: 18px;
    color: #555555;
    margin-bottom: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__hero-article-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    margin-bottom: 40px;
    object-fit: cover;
}

/* Article Body */
.page-news__article-body {
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.page-news__article-body p {
    margin-bottom: 1em;
    font-size: 17px;
    color: #333333;
}

.page-news__article-heading {
    font-size: 28px;
    color: #017439;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

.page-news__article-subheading {
    font-size: 22px;
    color: #017439;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.page-news__article-list,
.page-news__article-steps {
    list-style-type: disc;
    margin-left: 25px;
    margin-bottom: 20px;
    padding: 0;
    color: #333333;
}

.page-news__article-steps {
    list-style-type: decimal;
}

.page-news__article-list li,
.page-news__article-steps li {
    margin-bottom: 10px;
    font-size: 17px;
}

.page-news__article-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
    object-fit: cover;
}

/* CTA Buttons */
.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    width: 100%; /* Ensure container takes full width */
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.page-news__cta-buttons--centered {
  justify-content: center;
}

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%; /* Ensure buttons adapt to container width */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
    background-color: #C30808; /* Red for primary action (Register/Login) */
    color: #FFFF00; /* Yellow text for contrast */
    border: 2px solid #C30808;
}

.page-news__btn-primary:hover {
    background-color: #a00606;
    border-color: #a00606;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
    background-color: #017439; /* Brand primary color */
    color: #FFFFFF;
    border: 2px solid #017439;
}

.page-news__btn-secondary:hover {
    background-color: #005a2e;
    border-color: #005a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Recent Articles Section */
.page-news__recent-articles-section {
    padding: 60px 0;
    background-color: #ffffff;
}

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

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

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

.page-news__article-card-image {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

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

.page-news__article-card-title {
    font-size: 22px;
    margin-bottom: 10px;
    line-height: 1.3;
    font-weight: bold;
}

.page-news__article-card-title a {
    color: #017439; /* Brand primary color for link */
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__article-card-title a:hover {
    color: #005a2e;
    text-decoration: underline;
}

.page-news__article-card-date {
    font-size: 14px;
    color: #777777;
    margin-bottom: 15px;
}

.page-news__article-card-summary {
    font-size: 16px;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-news__read-more-link {
    display: inline-block;
    color: #C30808; /* Red for action link */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom */
}

.page-news__read-more-link:hover {
    color: #a00606;
    text-decoration: underline;
}

/* FAQ Section */
.page-news__faq-section {
    padding: 60px 0;
    background-color: #f0f0f0;
}

/* FAQ container styles */
.page-news__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ default state - answer hidden */
.page-news__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-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough to accommodate any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #ffffff; /* Light background for answer */
  border-radius: 0 0 5px 5px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

/* Question styles */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #017439; /* Brand primary color for question background */
  color: #FFFFFF; /* White text for contrast */
  border: 1px solid #005a2e;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-news__faq-question:hover {
  background: #005a2e;
  border-color: #004a25;
}

.page-news__faq-question:active {
  background: #004a25;
}

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

/* Toggle icon */
.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #FFFFFF; /* White color for toggle icon */
  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;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2); /* Slightly transparent white circle */
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: #FFFFFF;
  transform: rotate(45deg); /* Rotate for 'x' effect, or just change text to '−' */
  background-color: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-article-title {
        font-size: 38px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-news {
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific padding-top */
        font-size: 16px;
        line-height: 1.6;
    }
    .page-news__container {
        padding: 0 15px;
    }
    .page-news__hero-article-section {
        padding: 40px 0;
    }
    .page-news__hero-article-title {
        font-size: 30px;
        margin-bottom: 15px;
    }
    .page-news__hero-article-intro {
        font-size: 16px;
        margin-bottom: 20px;
    }
    .page-news__article-body {
        padding: 0 10px;
    }
    .page-news__article-body p,
    .page-news__article-list li,
    .page-news__article-steps li {
        font-size: 16px;
    }
    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    .page-news__article-heading {
        font-size: 24px;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    .page-news__article-subheading {
        font-size: 20px;
        margin-top: 25px;
        margin-bottom: 10px;
    }

    /* Image responsiveness for mobile */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-news__hero-article-image,
    .page-news__article-image,
    .page-news__article-card-image {
        border-radius: 4px;
    }
    .page-news__article-card-image {
        height: 200px; /* Adjust height for mobile cards */
    }

    /* Button responsiveness for mobile */
    .page-news__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
        padding: 0 10px; /* Add some padding to the sides */
    }
    .page-news__btn-primary,
    .page-news__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        font-size: 16px;
        padding: 12px 20px;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      flex-wrap: wrap !important;
      gap: 10px;
    }

    .page-news__articles-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 20px;
    }
    .page-news__article-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    .page-news__article-card-content {
        padding: 20px;
    }
    .page-news__article-card-title {
        font-size: 20px;
    }
    .page-news__article-card-summary {
        font-size: 15px;
    }

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