/* style/resources.css */

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

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

/* 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, #005f2c); /* Darker green gradient for hero background */
    color: #ffffff; /* Light 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: 1;
}

.page-resources__hero-image {
    width: 100%;
    margin-bottom: 30px;
    max-width: 800px; /* Limit image width in hero for better composition */
}

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

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

.page-resources__hero-title {
    font-size: 3.2em;
    margin-bottom: 20px;
    font-weight: bold;
    color: #FFFF00; /* Use specified font color for titles if it provides good contrast */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

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

.page-resources__hero-cta-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Section general styles */
.page-resources__section {
    padding: 60px 0;
    border-bottom: 1px solid #e0e0e0;
}

.page-resources__section:last-of-type {
    border-bottom: none;
}

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

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

.page-resources__text-block {
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: justify;
}

.page-resources__text-block--light {
    color: #f0f0f0;
}

.page-resources__list {
    list-style-type: disc;
    margin-left: 25px;
    margin-bottom: 20px;
    font-size: 1.05em;
    color: #333333;
}

.page-resources__list li {
    margin-bottom: 10px;
}

.page-resources__list-ordered {
    list-style-type: decimal;
    margin-left: 25px;
    margin-bottom: 20px;
    font-size: 1.05em;
    color: #333333;
}

.page-resources__list-ordered li {
    margin-bottom: 10px;
}

.page-resources__subsection-title {
    font-size: 1.8em;
    color: #017439;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Image with text block for download guide */
.page-resources__image-text-block {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 40px;
}

.page-resources__image-text-block img {
    width: 45%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-width: 200px; /* Ensure minimum size */
}

.page-resources__image-text-block ol {
    flex-grow: 1;
}

/* Buttons */
.page-resources__btn-primary,
.page-resources__btn-secondary {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}

.page-resources__btn-primary {
    background: #017439; /* Primary brand color */
    color: #ffffff;
    border: 2px solid #017439;
}

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

.page-resources__btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.page-resources__btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Specific button colors for register/login - OVERRIDE for contrast */
.page-resources__btn-register,
.page-resources__btn-login {
    background: #C30808; /* Red for register/login */
    color: #FFFFFF; /* Override font color to ensure WCAG AA contrast (4.6:1) */
    border-color: #C30808;
    margin-top: 20px;
}

.page-resources__btn-register:hover,
.page-resources__btn-login:hover {
    background: #a30606;
    border-color: #a30606;
}

/* FAQ Section */
.page-resources__faq-section {
    background-color: #f9f9f9;
}

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

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

.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.3s ease;
    padding: 0 15px;
    opacity: 0;
}

.page-resources__faq-item.active .page-resources__faq-answer {
    max-height: 2000px !important;
    padding: 20px 15px !important;
    opacity: 1;
    background: #ffffff;
    border-radius: 0 0 5px 5px;
    border-top: 1px solid #e0e0e0;
}

.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #017439; /* Dark green background for FAQ question */
    color: #ffffff; /* White text for FAQ question */
    border: 1px solid #017439;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.page-resources__faq-question:hover {
    background: #005f2c;
    border-color: #005f2c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-resources__faq-question:active {
    background: #004a23;
}

.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: #ffffff; /* Ensure white text */
}

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

.page-resources__faq-item.active .page-resources__faq-toggle {
    color: #017439; /* Dark green for active toggle */
    background-color: #ffffff;
    transform: rotate(45deg); /* Plus to X effect */
}


/* Related Articles Section */
.page-resources__related-articles {
    background-color: #f0f5f0; /* Light green background */
}

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

.page-resources__article-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    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 25px rgba(0, 0, 0, 0.12);
}

.page-resources__article-card img {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Ensure minimum size */
    min-height: 200px;
}

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

.page-resources__card-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.4;
}

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

.page-resources__card-title a:hover {
    color: #005f2c;
    text-decoration: underline;
}

.page-resources__card-description {
    font-size: 0.95em;
    color: #555555;
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-resources__card-link {
    display: inline-block;
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #017439;
    padding: 8px 15px;
    border-radius: 5px;
    align-self: flex-start;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-resources__card-link:hover {
    background-color: #017439;
    color: #ffffff;
}

/* Bottom CTA Section */
.page-resources__cta-bottom {
    padding: 80px 0;
    text-align: center;
}

.page-resources__dark-bg {
    background: #017439; /* Primary brand color background */
    color: #ffffff;
    padding: 40px 20px;
    border-radius: 12px;
}

/* Global image styles for content area */
.page-resources img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-resources__hero-title {
        font-size: 2.8em;
    }
    .page-resources__hero-description {
        font-size: 1.1em;
    }
    .page-resources__section-title {
        font-size: 2em;
    }
    .page-resources__subsection-title {
        font-size: 1.6em;
    }
    .page-resources__image-text-block {
        flex-direction: column;
        align-items: center;
    }
    .page-resources__image-text-block img {
        width: 80%;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .page-resources {
        padding-top: var(--header-offset, 120px) !important; /* Mobile padding for fixed header */
        font-size: 16px;
        line-height: 1.6;
    }
    .page-resources__container {
        padding: 15px;
    }
    .page-resources__hero-section {
        padding: 40px 15px;
    }
    .page-resources__hero-title {
        font-size: 2.2em;
    }
    .page-resources__hero-description {
        font-size: 1em;
    }
    .page-resources__hero-cta-group {
        flex-direction: column;
        gap: 15px;
    }
    .page-resources__btn-primary,
    .page-resources__btn-secondary,
    .page-resources__btn-register,
    .page-resources__btn-login,
    .page-resources a[class*="button"],
    .page-resources a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-resources__section {
        padding: 40px 0;
    }
    .page-resources__section-title {
        font-size: 1.8em;
        margin-bottom: 25px;
    }
    .page-resources__subsection-title {
        font-size: 1.4em;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    .page-resources__image-text-block img {
        width: 100%;
        max-width: 100% !important;
        height: auto !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }
    .page-resources__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-resources__faq-question h3 {
        font-size: 1em;
        width: calc(100% - 40px);
    }
    .page-resources__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-resources__faq-item.active .page-resources__faq-answer {
        padding: 15px !important;
    }
    .page-resources__articles-grid {
        grid-template-columns: 1fr;
    }
    .page-resources__article-card img {
        height: 200px; /* Adjust height for mobile */
    }
    .page-resources__dark-bg {
        padding: 30px 15px;
        border-radius: 8px;
    }

    /* Ensure all images and their containers are responsive */
    .page-resources img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-resources__section,
    .page-resources__card,
    .page-resources__container,
    .page-resources__hero-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-resources__hero-section {
        padding-left: 0;
        padding-right: 0;
    }
    .page-resources__hero-content {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Smallest mobile adjustments */
@media (max-width: 480px) {
    .page-resources__hero-title {
        font-size: 1.8em;
    }
    .page-resources__section-title {
        font-size: 1.5em;
    }
    .page-resources__subsection-title {
        font-size: 1.2em;
    }
    .page-resources__hero-image img {
        border-radius: 4px;
    }
    .page-resources__faq-question h3 {
        font-size: 0.95em;
    }
}