/* style/news.css */

/* Base styles for the news page */
.page-news {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light backgrounds */
    background-color: #ffffff; /* Default body background is white */
}

/* Container for consistent content width */
.page-news__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Section titles */
.page-news__section-title {
    font-size: 2.5em;
    color: #017439; /* Brand color for titles */
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Section descriptions/paragraphs */
.page-news__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: #555555;
}

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Break long words */
}

.page-news__btn-primary {
    background-color: #017439;
    color: #ffffff;
    border: 2px solid #017439;
}

.page-news__btn-primary:hover {
    background-color: #005a2e;
    border-color: #005a2e;
}

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

.page-news__btn-secondary:hover {
    background-color: #f0f0f0;
    color: #005a2e;
    border-color: #005a2e;
}

.page-news__btn-text {
    color: #017439;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.page-news__btn-text:hover {
    color: #005a2e;
    text-decoration: underline;
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Default height for desktop */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: var(--header-offset, 120px); /* Fixed header spacing */
}

.page-news__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.page-news__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
    z-index: 2;
}

.page-news__hero-content {
    position: relative;
    z-index: 3;
    color: #ffffff;
    max-width: 900px;
    padding: 20px;
}

.page-news__hero-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-news__hero-description {
    font-size: 1.3em;
    margin-bottom: 40px;
}

.page-news__hero-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Section specific styling */
.page-news__introduction-section,
.page-news__categories-section,
.page-news__analysis-section,
.page-news__promotions-section,
.page-news__cta-section {
    padding: 80px 0;
}

.page-news__latest-news-section,
.page-news__guides-section,
.page-news__faq-section {
    padding: 80px 0;
    background-color: #017439; /* Dark section background */
    color: #ffffff; /* White text for dark section */
}

.page-news__latest-news-section .page-news__section-title,
.page-news__latest-news-section .page-news__section-description,
.page-news__guides-section .page-news__section-title,
.page-news__guides-section .page-news__section-description,
.page-news__faq-section .page-news__section-title,
.page-news__faq-section .page-news__section-description {
    color: #ffffff;
}

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

.page-news__category-card,
.page-news__article-card,
.page-news__promotion-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    color: #333333; /* Ensure dark text on white card */
}

.page-news__category-card:hover,
.page-news__article-card:hover,
.page-news__promotion-card:hover {
    transform: translateY(-5px);
}

.page-news__category-image,
.page-news__article-image,
.page-news__analysis-image,
.page-news__promotion-image {
    width: 100%;
    height: 220px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-height: 200px; /* Ensure images are not too small */
}

.page-news__category-title,
.page-news__article-title,
.page-news__promotion-title {
    font-size: 1.5em;
    margin: 15px 15px 10px 15px;
    font-weight: bold;
    line-height: 1.3;
}

.page-news__category-title a,
.page-news__article-title a,
.page-news__promotion-title a {
    color: #017439; /* Brand color for card titles */
    text-decoration: none;
}

.page-news__category-title a:hover,
.page-news__article-title a:hover,
.page-news__promotion-title a:hover {
    color: #005a2e;
    text-decoration: underline;
}

.page-news__category-text,
.page-news__article-excerpt,
.page-news__promotion-text {
    font-size: 0.95em;
    margin: 0 15px 15px 15px;
    color: #555555;
}

.page-news__category-card .page-news__btn-secondary,
.page-news__promotion-card .page-news__btn-secondary {
    margin: 0 15px 15px 15px;
    width: calc(100% - 30px);
}

.page-news__article-content {
    padding: 15px;
}

.page-news__article-meta {
    font-size: 0.85em;
    color: #888888;
    margin-bottom: 10px;
}

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

/* Analysis Section */
.page-news__analysis-item {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    color: #333333;
}

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

.page-news__analysis-title {
    font-size: 1.4em;
    margin: 15px 15px 10px 15px;
    font-weight: bold;
    color: #017439;
}

.page-news__analysis-text {
    font-size: 0.95em;
    margin: 0 15px 15px 15px;
    color: #555555;
}

/* Guides Section */
.page-news__guides-list {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 40px auto;
}

.page-news__guides-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    transition: background-color 0.3s ease;
}

.page-news__guides-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.page-news__guides-item a {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.page-news__guides-item a:hover {
    text-decoration: underline;
    color: #FFFF00; /* Yellow for hover in dark section */
}

.page-news__guides-item p {
    font-size: 0.95em;
    color: #f0f0f0;
    margin-bottom: 0;
    text-align: left;
}

/* CTA Section */
.page-news__cta-content {
    text-align: center;
    padding: 60px 20px;
}

.page-news__cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

/* FAQ Section */
.page-news__faq-list {
    max-width: 800px;
    margin: 40px auto;
}

.page-news__faq-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.page-news__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.page-news__faq-item.active .page-news__faq-toggle {
    transform: rotate(45deg); /* Plus to X (minus) */
}

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

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

.page-news__faq-answer p {
    margin-bottom: 0;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: 3em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .page-news__container {
        padding: 0 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Hero section */
    .page-news__hero-section {
        height: auto;
        min-height: 400px;
        padding: 40px 0;
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile padding-top */
    }
    .page-news__hero-title {
        font-size: 2.2em;
    }
    .page-news__hero-description {
        font-size: 1em;
    }
    .page-news__hero-cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .page-news__btn-primary,
    .page-news__btn-secondary {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 15px !important;
    }

    /* Sections padding */
    .page-news__introduction-section,
    .page-news__categories-section,
    .page-news__analysis-section,
    .page-news__promotions-section,
    .page-news__cta-section,
    .page-news__latest-news-section,
    .page-news__guides-section,
    .page-news__faq-section {
        padding: 40px 0;
    }

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

    /* Grid layouts */
    .page-news__category-grid,
    .page-news__article-grid,
    .page-news__analysis-grid,
    .page-news__promotion-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Images responsiveness */
    .page-news img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-news__hero-image {
        max-width: 100% !important;
        height: 100% !important; /* Keep height for hero */
    }

    /* Cards */
    .page-news__category-card,
    .page-news__article-card,
    .page-news__promotion-card,
    .page-news__analysis-item {
        margin: 0;
    }
    .page-news__category-title,
    .page-news__article-title,
    .page-news__promotion-title,
    .page-news__analysis-title {
        font-size: 1.3em;
    }
    .page-news__category-text,
    .page-news__article-excerpt,
    .page-news__promotion-text,
    .page-news__analysis-text {
        font-size: 0.9em;
    }

    /* Guides and FAQ lists */
    .page-news__guides-list,
    .page-news__faq-list {
        margin-top: 30px;
    }
    .page-news__guides-item a,
    .page-news__faq-question {
        font-size: 1em;
    }
    .page-news__guides-item p,
    .page-news__faq-answer p {
        font-size: 0.85em;
    }
    .page-news__faq-answer {
        padding: 0 15px;
    }
    .page-news__faq-item.active .page-news__faq-answer {
        padding: 15px !important;
    }

    /* Ensure all containing elements for images/videos/buttons are responsive */
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-content,
    .page-news__category-grid,
    .page-news__article-grid,
    .page-news__analysis-grid,
    .page-news__promotion-grid,
    .page-news__hero-cta-buttons,
    .page-news__cta-buttons {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Prevent horizontal scroll */
    }
}

/* Specific color overrides for buttons (Register/Login) */
.page-news__hero-cta-buttons .page-news__btn-primary {
    background-color: #C30808;
    border-color: #C30808;
    color: #FFFF00;
}
.page-news__hero-cta-buttons .page-news__btn-primary:hover {
    background-color: #a30707;
    border-color: #a30707;
}

.page-news__hero-cta-buttons .page-news__btn-secondary {
    background-color: #C30808;
    border-color: #C30808;
    color: #FFFF00;
}
.page-news__hero-cta-buttons .page-news__btn-secondary:hover {
    background-color: #a30707;
    border-color: #a30707;
}