/* style/resources.css */

/* Base styles for the resources page */
.page-resources {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light backgrounds */
    background-color: var(--background-color, #FFFFFF); /* Inherit from shared or default to white */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

/* 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, #017439, #005f2f); /* Darker green gradient for hero background */
    color: #ffffff; /* White text for dark background */
    overflow: hidden;
}

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

.page-resources__hero-image {
    width: 100%;
    margin-bottom: 30px;
    max-width: 800px; /* Constrain image width for better presentation */
}

.page-resources__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

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

.page-resources__hero-title {
    font-size: 3.2em;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: bold;
    color: #FFFF00; /* Use custom color for title */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

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

.page-resources__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #C30808; /* Custom color for registration/login */
    color: #FFFF00; /* Custom font color */
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-resources__cta-button:hover {
    background: #e02020;
    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;
}

.page-resources__section-title {
    font-size: 2.2em;
    color: #017439;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

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

/* Intro Section */
.page-resources__intro-section {
    padding: 60px 0;
    background-color: #FFFFFF; /* Light background */
    color: #333333;
}

.page-resources__intro-section .page-resources__section-title {
    color: #017439;
}

.page-resources__intro-section .page-resources__section-description {
    color: #555555;
}

/* Featured Articles Section */
.page-resources__featured-articles {
    padding: 60px 0;
    background-color: #017439; /* Dark background */
    color: #ffffff;
}

.page-resources__featured-articles .page-resources__section-title {
    color: #ffffff;
}

.page-resources__featured-articles .page-resources__section-description {
    color: #f0f0f0;
}

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

.page-resources__article-card {
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent white on dark background */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-resources__article-image {
    width: 100%;
    height: 220px; /* Fixed height for article images */
    overflow: hidden;
}

.page-resources__article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.page-resources__article-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #FFFF00; /* Custom color for titles */
    font-weight: bold;
}

.page-resources__article-title a {
    color: #FFFF00;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-resources__article-title a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.page-resources__article-excerpt {
    font-size: 0.95em;
    color: #f0f0f0;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-resources__read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background: #C30808; /* Custom button color */
    color: #FFFF00; /* Custom font color */
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

.page-resources__read-more-button:hover {
    background: #e02020;
}

/* General Tips Section */
.page-resources__general-tips {
    padding: 60px 0;
    background-color: #FFFFFF; /* Light background */
    color: #333333;
}

.page-resources__general-tips .page-resources__section-title {
    color: #017439;
}

.page-resources__general-tips .page-resources__section-description {
    color: #555555;
}

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

.page-resources__tip-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__tip-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-resources__tip-title {
    font-size: 1.3em;
    color: #017439;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-resources__tip-item p {
    font-size: 0.95em;
    color: #555555;
}

/* FAQ Section */
.page-resources__faq-section {
    padding: 60px 0;
    background-color: #017439; /* Dark background */
    color: #ffffff;
}

.page-resources__faq-section .page-resources__section-title {
    color: #ffffff;
}

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

/* FAQ container styles */
.page-resources__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 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 20px;
    opacity: 0;
    background: #f0f0f0; /* Light background for answer */
    color: #333333; /* Dark text for light background */
}

/* 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, large enough value for any content */
    padding: 20px !important;
    opacity: 1;
    background: #f0f0f0;
    border-radius: 0 0 8px 8px;
}

/* Question styles */
.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: #005f2f; /* Darker green for question background */
    border: 1px solid #017439;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    color: #ffffff; /* White text for dark background */
}

.page-resources__faq-question:hover {
    background: #004a25;
    border-color: #008c47;
}

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

/* Question title styles */
.page-resources__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Prevent h3 from blocking click event */
    color: #ffffff; /* White text for dark background */
}

/* Toggle icon */
.page-resources__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #FFFF00; /* Custom 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.1);
}

.page-resources__faq-item.active .page-resources__faq-toggle {
    color: #ffffff; /* White when active */
    transform: rotate(45deg); /* Optional: rotate for 'X' effect */
}

/* CTA Section */
.page-resources__cta-section {
    padding: 80px 0;
    background-color: #FFFFFF; /* Light background */
    color: #333333;
    text-align: center;
}

.page-resources__cta-section .page-resources__section-title {
    color: #017439;
}

.page-resources__cta-section .page-resources__section-description {
    color: #555555;
}

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

.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;
    border: 2px solid transparent;
    cursor: pointer;
    box-sizing: border-box; /* Ensure padding and border are included in width */
}

.page-resources__btn-primary {
    background: #C30808; /* Custom color for registration/login */
    color: #FFFF00; /* Custom font color */
    border-color: #C30808;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.page-resources__btn-secondary {
    background: #017439; /* Brand primary color */
    color: #ffffff; /* White text */
    border-color: #017439;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-resources__btn-secondary:hover {
    background: #005f2f;
    border-color: #005f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .page-resources__hero-title {
        font-size: 2.8em;
    }
    .page-resources__section-title {
        font-size: 2em;
    }
    .page-resources__articles-grid,
    .page-resources__tips-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

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

    /* General mobile padding */
    .page-resources__container {
        padding: 30px 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Hero Section */
    .page-resources__hero-section {
        padding: 40px 15px;
    }
    .page-resources__hero-title {
        font-size: 2.2em;
        margin-bottom: 15px;
    }
    .page-resources__hero-description {
        font-size: 1em;
        margin-bottom: 20px;
    }
    .page-resources__cta-button {
        padding: 12px 30px;
        font-size: 1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    /* Section titles and descriptions */
    .page-resources__section-title {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
}