:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --button-register-login-bg: #C30808;
    --button-register-login-text: #FFFF00;
}

.page-resources {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default text color for light body background */
    background-color: var(--secondary-color); /* Matches shared body background */
}

/* Fixed header offset */
.page-resources__hero-section {
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
    background: linear-gradient(135deg, var(--primary-color) 0%, #0c8a49 100%); /* A subtle gradient with primary color */
    color: var(--text-light);
    text-align: center;
    padding-bottom: 60px;
}

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

.page-resources__hero-content {
    padding: 40px 20px;
}

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

.page-resources__intro-text {
    font-size: 1.2em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-light);
}

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

.page-resources__btn-primary,
.page-resources__btn-secondary,
.page-resources__btn-link {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box; /* Crucial for mobile width */
}

.page-resources__btn-primary {
    background-color: var(--button-register-login-bg); /* Custom color #C30808 */
    color: var(--button-register-login-text); /* Custom color #FFFF00 */
    border: 2px solid var(--button-register-login-bg);
}

.page-resources__btn-primary:hover {
    background-color: #e00b0b; /* Slightly darker red */
    border-color: #e00b0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.page-resources__btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-resources__btn-link {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    font-size: 0.9em;
}

.page-resources__btn-link:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

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

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

.page-resources__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-dark);
}

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

.page-resources__card {
    background-color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-dark); /* Ensure dark text on light card background */
}

.page-resources__card:hover {
    transform: translateY(-5px);
}

.page-resources__card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    /* No filter allowed */
}

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

.page-resources__card-title a {
    color: inherit;
    text-decoration: none;
}

.page-resources__card-title a:hover {
    text-decoration: underline;
}

.page-resources__card-text {
    font-size: 1em;
    padding: 0 20px 20px 20px;
    flex-grow: 1; /* Makes sure button is at the bottom */
}

/* FAQ Section */
.page-resources__faq-area {
    background-color: var(--primary-color); /* Dark section background */
    color: var(--text-light); /* Light text on dark background */
}

.page-resources__dark-section .page-resources__section-title,
.page-resources__dark-section .page-resources__section-description {
    color: var(--text-light); /* Ensure light text on dark background */
}

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

.page-resources__faq-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
    background-color: var(--secondary-color); /* FAQ item background */
}

.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: var(--text-dark); /* Dark text for answer */
}

.page-resources__faq-item.active .page-resources__faq-answer {
    max-height: 2000px !important; /* Sufficiently large */
    padding: 20px 15px !important;
    opacity: 1;
    background: #f9f9f9; /* Slightly off-white for contrast */
    border-radius: 0 0 5px 5px;
}

.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color);
    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;
}

.page-resources__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none;
    color: var(--primary-color); /* FAQ question title color */
}

.page-resources__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none;
    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); /* Maintain primary color */
    transform: rotate(45deg); /* Rotate to form an 'X' or just change to '-' */
}

/* Latest News Section */
.page-resources__latest-news {
    background-color: #f8f8f8; /* Light grey background */
}

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

.page-resources__news-card {
    background-color: var(--secondary-color);
    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;
}

.page-resources__news-card:hover {
    transform: translateY(-5px);
}

.page-resources__news-image {
    width: 100%;
    height: 220px; /* Consistent height for news images */
    object-fit: cover;
    display: block;
    /* No filter allowed */
}

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

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

.page-resources__news-title a {
    color: inherit;
    text-decoration: none;
}

.page-resources__news-title a:hover {
    text-decoration: underline;
}

.page-resources__news-excerpt {
    font-size: 0.95em;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-resources__view-all {
    text-align: center;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-resources__main-title {
        font-size: 2.5em;
    }
    .page-resources__intro-text {
        font-size: 1.1em;
    }
    .page-resources__section-title {
        font-size: 2em;
    }
    .page-resources__card-title {
        font-size: 1.3em;
    }
    .page-resources__news-title {
        font-size: 1.2em;
    }
}

@media (max-width: 768px) {
    .page-resources__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Mobile fixed header offset */
        padding-bottom: 40px;
    }

    .page-resources__main-title {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .page-resources__intro-text {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .page-resources__cta-group {
        flex-direction: column; /* Stack buttons vertically on mobile */
        gap: 15px;
        padding: 0 15px; /* Add padding to container */
    }

    .page-resources__btn-primary,
    .page-resources__btn-secondary,
    .page-resources__btn-link {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 20px;
        font-size: 1em;
        white-space: normal !important; /* Allow text wrapping */
        word-wrap: break-word !important; /* Allow long words to break */
    }

    .page-resources__container {
        padding: 0 15px; /* Adjust container padding for mobile */
    }

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

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

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

    .page-resources__grid,
    .page-resources__news-grid {
        grid-template-columns: 1fr; /* Single column layout for cards */
        gap: 20px;
    }

    .page-resources__card-image,
    .page-resources__news-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important; /* Ensure images scale */
    }

    .page-resources__card,
    .page-resources__news-card {
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .page-resources__faq-question {
        padding: 15px;
    }

    .page-resources__faq-question h3 {
        font-size: 1em;
    }

    .page-resources__faq-item.active .page-resources__faq-answer {
        padding: 15px !important;
    }
}