/* style/news.css */

/* Custom properties for colors */
:root {
    --primary-color: #C80000;
    --secondary-color: #FFD700;
    --text-dark: #333333;
    --text-light: #ffffff;
    --background-light: #f9f9f9;
    --background-dark: #222222; /* A slightly darker background for contrast */
    --border-color: #e0e0e0;
}

.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default text color for light background */
    background-color: #ffffff; /* Default body background is white, so text should be dark */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

.page-news__section {
    padding: 60px 0;
    overflow: hidden; /* Prevent content overflow */
}

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

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

.page-news__section-title--light {
    color: var(--secondary-color); /* Lighter color for dark backgrounds */
}

.page-news__section-description {
    font-size: 18px;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__section-description--light {
    color: var(--text-light);
}

/* HERO Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 60px; /* Adjust padding-bottom for hero */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); /* Example gradient */
}

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

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.page-news__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: cover;
    filter: none; /* Ensure no filter is applied */
}

.page-news__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    color: var(--text-light); /* Text on hero should be light */
}

.page-news__hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-news__hero-description {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--text-light);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    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);
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__cta-button:hover {
    background: #e6c200; /* Darker shade of FFD700 */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Article Grid */
.page-news__article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.page-news__article-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    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 consistency */
    overflow: hidden;
}

.page-news__article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: none; /* Ensure no filter is applied */
}

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

.page-news__article-title {
    font-size: 22px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

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

.page-news__article-title a:hover {
    color: var(--secondary-color);
}

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

.page-news__article-date {
    font-size: 14px;
    color: #888888;
    margin-bottom: 20px;
    display: block;
}

.page-news__read-more-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__read-more-button:hover {
    background: #a00000; /* Darker shade of C80000 */
}

.page-news__view-all-button-container {
    text-align: center;
    margin-top: 40px;
}

.page-news__view-all-button {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 18px 45px;
    font-size: 20px;
}

.page-news__view-all-button:hover {
    background: #a00000; /* Darker shade of C80000 */
}

/* Categories Section */
.page-news__dark-bg {
    background-color: var(--primary-color);
    color: var(--text-light);
}

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

.page-news__category-card {
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent white for dark background */
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-light);
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block; /* Make the whole card clickable */
}

.page-news__category-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.page-news__category-title {
    font-size: 24px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.page-news__category-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* CTA Banner */
.page-news__cta-banner {
    background-color: var(--background-light);
    text-align: center;
    padding: 80px 0;
}

.page-news__cta-container {
    max-width: 900px;
}

.page-news__cta-title {
    font-size: 38px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.page-news__cta-description {
    font-size: 18px;
    color: #555555;
    margin-bottom: 40px;
}

.page-news__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 16px 35px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
    max-width: 100%; /* Ensure buttons don't overflow */
}

.page-news__btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.page-news__btn-primary:hover {
    background: #a00000; /* Darker shade */
    border-color: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-news__btn-secondary {
    background: var(--text-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* FAQ Section */
.page-news__faq-section {
    background-color: #ffffff; /* Explicitly white for contrast */
}

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

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

.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 20px;
    opacity: 0;
}

.page-news__faq-item.active .page-news__faq-answer {
    max-height: 2000px !important; /* Ensure enough height for content */
    padding: 20px 20px !important;
    opacity: 1;
    background: var(--background-light);
    border-radius: 0 0 5px 5px;
}

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

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

.page-news__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none;
    color: var(--text-dark);
}

.page-news__faq-toggle {
    font-size: 28px; /* Larger for better tap target */
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color); /* Use brand color for toggle */
    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: 32px; /* Larger tap area */
    height: 32px;
}

.page-news__faq-item.active .page-news__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' effect */
    color: var(--secondary-color);
}

/* About Section */
.page-news__about-section {
    background-color: var(--primary-color); /* Use primary color as dark background */
    color: var(--text-light);
    padding: 80px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-content h1 {
        font-size: 42px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__article-card {
        height: auto;
    }
    .page-news__article-image {
        height: 200px;
    }
}

@media (max-width: 768px) {
    /* Mobile Header Offset */
    .page-news {
        padding-top: var(--header-offset, 120px) !important;
    }
    
    .page-news__section {
        padding: 40px 0;
    }

    .page-news__container {
        padding: 0 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__hero-content h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .page-news__hero-description {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .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;
    }

    .page-news__section-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .page-news__section-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    /* Images responsiveness */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        filter: none; /* Ensure no filter is applied */
    }
    
    .page-news__article-image {
        height: 180px;
    }

    .page-news__article-card {
        margin-bottom: 20px;
    }

    .page-news__article-title {
        font-size: 18px;
    }

    .page-news__article-summary {
        font-size: 15px;
    }

    .page-news__read-more-button {
        font-size: 14px;
        padding: 8px 15px;
    }

    .page-news__category-card {
        padding: 20px;
    }

    .page-news__category-title {
        font-size: 20px;
    }

    .page-news__cta-title {
        font-size: 28px;
    }

    .page-news__cta-description {
        font-size: 16px;
    }

    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 15px; /* Add padding to container of buttons */
    }

    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 25px;
        font-size: 16px;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-news__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .page-news__faq-question h3 {
        font-size: 16px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    
    .page-news__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }
    
    .page-news__faq-answer {
        padding: 0 15px;
    }
    
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }
}