/* style/resources.css */

/* Base styles for the page-resources scope */
.page-resources {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #ffffff; /* Assuming --dark-bg is dark, main text color is white */
    background-color: var(--dark-bg); /* Use shared dark background variable */
}

.page-resources__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-offset, 120px); /* Apply header offset for desktop */
    padding-bottom: 80px; 
    padding-left: 20px;
    padding-right: 20px;
    background-color: #26A9E0; /* Brand primary color for hero background */
    color: #ffffff;
    gap: 40px;
}

.page-resources__hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-resources__hero-title {
    font-size: 2.8em;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #ffffff;
}

.page-resources__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.page-resources__btn-primary,
.page-resources__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    text-align: center;
    box-sizing: border-box; /* Ensure padding is included in width */
    max-width: 100%; /* Ensure button doesn't overflow */
}

.page-resources__btn-primary {
    background-color: #EA7C07; /* Login color for primary action */
    color: #ffffff;
    border: 2px solid #EA7C07;
}

.page-resources__btn-primary:hover {
    background-color: #d46a00;
    border-color: #d46a00;
}

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

.page-resources__btn-secondary:hover {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
}

.page-resources__hero-image-wrapper {
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

.page-resources__introduction-section,
.page-resources__featured-articles,
.page-resources__video-section,
.page-resources__guides-tips,
.page-resources__faq-section,
.page-resources__call-to-action {
    padding: 60px 0;
    background-color: var(--dark-bg); /* Use shared dark background */
    color: #ffffff; /* Light text for dark background */
}

.page-resources__section-title {
    font-size: 2.2em;
    text-align: center;
    margin-bottom: 20px;
    color: #26A9E0; /* Brand primary color for titles */
}

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

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

.page-resources__grid-item {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.page-resources__article-card {
    background-color: rgba(255, 255, 255, 0.08); /* Slightly lighter background for cards */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-resources__article-title {
    font-size: 1.4em;
    margin: 20px 20px 10px 20px;
    color: #26A9E0; /* Brand primary color for article titles */
    flex-grow: 1; /* Allow title to take available space */
}

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

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

.page-resources__article-excerpt {
    font-size: 0.95em;
    margin: 0 20px 15px 20px;
    color: #f0f0f0;
}

.page-resources__read-more {
    display: inline-flex;
    align-items: center;
    margin: 0 20px 20px 20px;
    color: #EA7C07; /* Login color for read more link */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-resources__read-more:hover {
    color: #ffffff;
}

.page-resources__arrow {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.page-resources__read-more:hover .page-resources__arrow {
    transform: translateX(5px);
}

.page-resources__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    margin: 40px auto;
    box-sizing: border-box;
}

.page-resources__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    cursor: pointer; /* Indicate clickable */
}

.page-resources__video-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.page-resources__video-caption {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    color: #f0f0f0;
}

.page-resources__guides-tips {
    padding-top: 60px;
    padding-bottom: 60px;
}

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

.page-resources__guide-item {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__guide-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.page-resources__guide-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #26A9E0;
}

.page-resources__guide-text {
    font-size: 1em;
    color: #f0f0f0;
}

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

.page-resources__faq-item {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.15);
    transition: background-color 0.3s ease;
}

.page-resources__faq-question:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.page-resources__faq-title {
    font-size: 1.2em;
    margin: 0;
    color: #ffffff;
}

.page-resources__faq-toggle {
    font-size: 1.5em;
    font-weight: bold;
    color: #EA7C07;
    transition: transform 0.3s ease;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
    transform: rotate(45deg);
}

.page-resources__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #f0f0f0;
}

.page-resources__faq-item.active .page-resources__faq-answer {
    max-height: 1000px !important; /* Sufficiently large to show content */
    padding: 20px;
}

.page-resources__faq-answer p {
    margin: 0;
    padding-bottom: 10px; /* Add some padding for paragraph */
    color: #f0f0f0; /* Ensure text color is light */
}


/* Responsive styles */
@media (max-width: 1024px) {
    .page-resources__hero-title {
        font-size: 2.4em;
    }

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

@media (max-width: 768px) {
    /* Main page content padding for mobile */
    .page-resources__container {
        padding: 0 15px;
    }

    /* Hero section adjustments */
    .page-resources__hero-section {
        padding: 60px 15px;
        padding-top: var(--header-offset, 120px) !important; /* Apply header offset to hero on mobile */
    }
    
    .page-resources__hero-title {
        font-size: 2em;
    }

    .page-resources__hero-description {
        font-size: 1em;
    }

    /* Buttons responsive */
    .page-resources__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .page-resources__btn-primary,
    .page-resources__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 20px;
        font-size: 1em;
        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.6em;
        padding: 0 15px;
    }

    .page-resources__section-description {
        font-size: 0.95em;
        padding: 0 15px;
    }

    /* Images responsive */
    .page-resources img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    /* Image containers responsive */
    .page-resources__image-grid,
    .page-resources__article-grid,
    .page-resources__guide-grid,
    .page-resources__video-wrapper,
    .page-resources__faq-list,
    .page-resources__hero-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Prevent overflow */
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Article card specific image styling */
    .page-resources__article-image {
        height: auto !important; /* Allow height to adjust */
    }

    /* Video responsive */
    .page-resources__video-section {
        padding-top: 60px !important; /* Adjust if hero has header offset */
    }

    .page-resources__video-wrapper {
        padding-bottom: 56.25% !important; /* Ensure aspect ratio is maintained */
        height: 0 !important;
    }
    .page-resources__video {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important; /* Use 100% for height within the wrapper */
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }

    /* FAQ responsive */
    .page-resources__faq-question {
        padding: 15px;
    }

    .page-resources__faq-title {
        font-size: 1.1em;
    }

    .page-resources__faq-answer {
        padding: 0 15px;
    }

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

/* Color Contrast Enforcement */
/* Main text on dark background from shared.css */
.page-resources p,
.page-resources li,
.page-resources__hero-description,
.page-resources__section-description,
.page-resources__article-excerpt,
.page-resources__guide-text,
.page-resources__faq-answer p,
.page-resources__video-caption {
    color: #f0f0f0; /* Light gray for readability on dark background */
}

/* Titles using brand color, contrast with dark background is good */
.page-resources__section-title,
.page-resources__guide-title {
    color: #26A9E0;
}

/* Article titles, also using brand color */
.page-resources__article-title a {
    color: #26A9E0;
}

.page-resources__article-title a:hover {
    color: #ffffff; /* Hover to white for better contrast */
}

/* Primary button has orange background, white text. Contrast is good. */
/* Secondary button has white background, brand color text. Contrast is good. */

/* FAQ question background is rgba(255, 255, 255, 0.15) on dark-bg, text is white. Contrast is good. */
/* FAQ toggle color is orange. Contrast is good. */