:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-color-dark: #333333;
    --text-color-light: #ffffff;
    --background-light: #f9f9f9;
    --background-white: #ffffff;
    --border-color: #e0e0e0;

    /* Custom colors */
    --register-color: #C30808;
    --login-color: #C30808;
    --register-login-font-color: #FFFFFF; /* Adjusted for WCAG AA contrast */

    /* Header offset from shared.css */
    --header-offset: 120px; /* Default value, will be overridden by shared.css */
}

/* Base styles for page-news scope */
.page-news {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark); /* Default text color for light background */
    background-color: var(--background-white); /* Default body background is white */
}

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

.page-news__section-title {
    font-size: 36px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-news__section-description {
    text-align: center;
    font-size: 18px;
    margin-bottom: 50px;
    color: #555;
}

/* Hero Section */
.page-news__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); /* Ensure space for fixed header */
    background: linear-gradient(135deg, var(--primary-color), #34D399); /* Green gradient */
    color: var(--text-color-light);
}

.page-news__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

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

.page-news__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.2);
}

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

.page-news__main-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-color-light);
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-news__intro-text {
    font-size: 20px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-color-light);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow long words to break */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.page-news__btn-register {
    background: var(--register-color);
    color: var(--register-login-font-color);
    box-shadow: 0 4px 15px rgba(195, 8, 8, 0.3);
}

.page-news__btn-register:hover {
    background: #a30606; /* Darker red */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(195, 8, 8, 0.4);
}

.page-news__btn-login {
    background: var(--login-color);
    color: var(--register-login-font-color);
    box-shadow: 0 4px 15px rgba(195, 8, 8, 0.3);
    margin-left: 20px;
}

.page-news__btn-login:hover {
    background: #a30606; /* Darker red */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(195, 8, 8, 0.4);
}


/* Latest Articles Section */
.page-news__latest-articles {
    padding: 80px 0;
    background-color: var(--background-light); /* Light background for contrast */
}

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

.page-news__article-card {
    background: var(--background-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    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-image {
    width: 100%;
    height: 220px; /* Fixed height for consistent card appearance */
    overflow: hidden;
}

.page-news__article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.page-news__article-card:hover .page-news__article-image img {
    transform: scale(1.05);
}

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

.page-news__article-title {
    font-size: 22px;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--primary-color);
}

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

.page-news__article-title a:hover {
    color: #005f2c; /* Slightly darker primary color */
}

.page-news__article-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}

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

.page-news__read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__read-more:hover {
    color: #005f2c;
}


/* Call to Action Section */
.page-news__cta-section {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-color-light);
    text-align: center;
}

.page-news__cta-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-news__cta-title {
    font-size: 38px;
    margin-bottom: 20px;
    color: var(--text-color-light);
    line-height: 1.2;
}

.page-news__cta-description {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

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

.page-news__button-group .page-news__cta-button {
    margin: 0; /* Override default margin-top */
    flex-shrink: 0; /* Prevent buttons from shrinking */
    min-width: 180px; /* Minimum width for buttons */
}


/* FAQ Section */
.page-news__faq-section {
    padding: 80px 0;
    background-color: var(--background-white);
}

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

/* FAQ container style */
.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;
  color: var(--text-color-dark); /* Ensure text color contrast */
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height to ensure expansion */
.page-news__faq-item.active .page-news__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: var(--background-light); /* Light background for answer */
  border-radius: 0 0 5px 5px;
}

/* Question style */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--background-white);
  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-news__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

/* Question title style */
.page-news__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 events */
  color: var(--text-color-dark); /* Ensure text color contrast */
}

/* Toggle icon */
.page-news__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 events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Change from + to X for active state */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__main-title {
        font-size: 40px;
    }
    .page-news__intro-text {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__cta-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    /* Fixed header offset for mobile */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__main-title {
        font-size: 32px;
    }
    .page-news__intro-text {
        font-size: 16px;
    }
    .page-news__cta-button {
        padding: 12px 30px;
        font-size: 16px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        margin-top: 15px; /* Adjust margin for stacked buttons */
    }
    .page-news__btn-login {
        margin-left: 0; /* Remove left margin for stacked buttons */
    }
    .page-news__button-group {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px; /* Add padding to the button group */
    }
    .page-news__latest-articles,
    .page-news__cta-section,
    .page-news__faq-section {
        padding: 40px 0;
    }
    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }
    .page-news__article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-news__article-image {
        height: 180px;
    }
    .page-news__article-title {
        font-size: 18px;
    }
    .page-news__article-summary {
        font-size: 15px;
    }
    .page-news__cta-title {
        font-size: 28px;
    }
    .page-news__cta-description {
        font-size: 16px;
    }

    /* FAQ specific mobile styles */
    .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;
    }

    /* All images must be responsive */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}