/* style/news.css */

/* Variables */
:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --background-light: #f8f9fa; /* A slightly off-white for sections */
    --border-color: #e0e0e0;
    --button-login: #EA7C07; /* Custom color for login, though not explicitly used here, kept for consistency */
}

/* Base styles for the page content */
.page-news {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default text color for light backgrounds */
    background-color: var(--secondary-color); /* Default page background is white */
}

/* Header offset for fixed header */
.page-news__hero-banner {
    padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
    padding-bottom: 60px;
    background: linear-gradient(135deg, var(--primary-color), #5bc0de); /* Gradient from primary to a lighter blue */
    color: var(--text-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

.page-news__main-title {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--text-light);
    line-height: 1.2;
}

.page-news__intro-text {
    font-size: 1.2em;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-light);
}

.page-news__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--button-login); /* Using the custom login color for prominence */
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.page-news__cta-button:hover {
    background: #c76700; /* Darkened version of #EA7C07 */
    transform: translateY(-2px);
}

/* Section common styles */
.page-news__section-title {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-dark);
}

.page-news__dark-bg .page-news__section-title {
    color: var(--text-light);
}

/* Featured Articles Section */
.page-news__featured-articles {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background for this section */
}

.page-news__featured-articles .page-news__section-title {
    color: var(--text-light);
}

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

.page-news__card {
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Ensure cards have equal height */
}

.page-news__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-news__card-title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
}

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

.page-news__card-title a:hover {
    color: #007bff; /* A slightly different blue on hover */
    text-decoration: underline;
}

.page-news__card-description {
    font-size: 0.95em;
    color: var(--text-dark);
    line-height: 1.5;
}

/* Latest News Section */
.page-news__latest-news {
    padding: 80px 0;
    background-color: var(--background-light); /* Light background */
}

.page-news__articles-list {
    display: grid;
    grid-template-columns: 1fr; /* Single column for articles */
    gap: 40px;
}

.page-news__article-item {
    display: flex;
    background: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.page-news__article-image {
    width: 40%; /* Image takes 40% width */
    height: auto;
    object-fit: cover;
    min-width: 200px; /* Ensure minimum size */
}

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

.page-news__article-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-news__article-title {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 15px;
}

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

.page-news__article-title a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.page-news__article-summary {
    font-size: 1em;
    color: #666;
    margin-bottom: 20px;
}

.page-news__article-date {
    font-size: 0.9em;
    color: #999;
    margin-top: auto; /* Pushes date to bottom */
    display: block;
}

.page-news__read-more {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.page-news__read-more:hover {
    background: #1e88b9; /* Slightly darker primary color */
}

.page-news__pagination {
    text-align: center;
    margin-top: 50px;
}

.page-news__pagination-link {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-news__pagination-link:hover,
.page-news__pagination-link--active {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

/* Analysis &amp; Guides Section */
.page-news__analysis-guides {
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-light);
}

.page-news__analysis-guides .page-news__section-title,
.page-news__analysis-guides .page-news__article-subtitle,
.page-news__analysis-guides .page-news__article-subheading {
    color: var(--text-light);
}

.page-news__long-article {
    margin-bottom: 60px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent white background for readability */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-news__long-article:last-child {
    margin-bottom: 0;
}

.page-news__article-subtitle {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.3;
}

.page-news__article-subheading {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 35px;
    margin-bottom: 15px;
}

.page-news__long-article p {
    margin-bottom: 20px;
    font-size: 1.05em;
    line-height: 1.7;
    color: #f0f0f0; /* Lighter text for dark background */
}

.page-news__long-article ul {
    list-style-type: disc;
    margin-left: 25px;
    margin-bottom: 20px;
    color: #f0f0f0;
}

.page-news__long-article li {
    margin-bottom: 10px;
    font-size: 1.05em;
    line-height: 1.6;
}

/* FAQ Section */
.page-news__faq {
    padding: 80px 0;
    background-color: var(--background-light);
}

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

/* FAQ container styles */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ default state - answer hidden */
.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 15px;
  opacity: 0;
}

/* FAQ expanded state - ⚠️ Use !important and sufficiently large max-height to ensure it expands */
.page-news__faq-item.active .page-news__faq-answer {
  max-height: 2000px !important; /* ⚠️ Use !important to ensure priority, value large enough to contain any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

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

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

/* Question title styles */
.page-news__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 tag from blocking click events */
  color: var(--text-dark);
}

/* Toggle icon */
.page-news__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-news__faq-item.active .page-news__faq-toggle {
  color: var(--primary-color); /* Use primary color when active */
  transform: rotate(45deg); /* Rotate for 'x' effect, or keep as '-' */
}


/* Call to Action Section */
.page-news__call-to-action {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
}

.page-news__call-to-action .page-news__section-title {
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 992px) {
    .page-news__main-title {
        font-size: 2.5em;
    }
    .page-news__section-title {
        font-size: 2em;
    }
    .page-news__article-item {
        flex-direction: column;
    }
    .page-news__article-image {
        width: 100%;
        height: 250px; /* Fixed height for mobile article images */
    }
    .page-news__article-content {
        padding: 20px;
    }
    .page-news__article-title {
        font-size: 1.4em;
    }
    .page-news__long-article {
        padding: 20px;
    }
    .page-news__article-subtitle {
        font-size: 1.8em;
    }
    .page-news__article-subheading {
        font-size: 1.3em;
    }
}

@media (max-width: 768px) {
    .page-news__hero-banner {
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
        padding-bottom: 40px;
    }
    .page-news__main-title {
        font-size: 2em;
        margin-bottom: 15px;
    }
    .page-news__intro-text {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .page-news__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;
    }

    .page-news__section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    .page-news__featured-articles,
    .page-news__latest-news,
    .page-news__analysis-guides,
    .page-news__faq,
    .page-news__call-to-action {
        padding: 40px 0;
    }
    .page-news__container {
        padding: 0 15px; /* Add horizontal padding for mobile */
    }

    .page-news__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-news__card {
        padding: 20px;
    }
    .page-news__card-title {
        font-size: 1.2em;
    }

    .page-news__articles-list {
        gap: 30px;
    }
    .page-news__article-item {
        flex-direction: column;
    }
    .page-news__article-image {
        width: 100%;
        height: 200px; /* Adjust height for smaller screens */
    }
    .page-news__article-content {
        padding: 15px;
    }
    .page-news__article-title {
        font-size: 1.2em;
    }
    .page-news__article-summary {
        font-size: 0.9em;
    }

    .page-news__long-article {
        padding: 15px;
    }
    .page-news__article-subtitle {
        font-size: 1.5em;
    }
    .page-news__article-subheading {
        font-size: 1.2em;
    }
    .page-news__long-article p,
    .page-news__long-article li {
        font-size: 0.95em;
    }

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

    /* Global image and container responsiveness for mobile */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__hero-banner,
    .page-news__featured-articles,
    .page-news__latest-news,
    .page-news__analysis-guides,
    .page-news__faq,
    .page-news__call-to-action {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        /* Padding handled by .page-news__container for consistency */
    }

    /* Ensure multiple buttons wrap correctly if they appear */
    .page-news__button-group { /* If such a class exists for multiple buttons */
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Color contrast fixes based on body background (default white) */
.page-news {
    color: var(--text-dark); /* Default text color for light backgrounds */
}

/* Dark background elements should have light text */
.page-news__dark-bg {
    color: var(--text-light);
}

/* Light background elements should have dark text */
.page-news__light-bg {
    color: var(--text-dark);
}

/* Button primary style (dark background, light text) */
.page-news__btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    border: 2px solid transparent;
}

/* Button secondary style (light background, dark text) */
.page-news__btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.page-news__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Ensure images do not use filters */
.page-news img {
    filter: none !important;
}

/* Content area image size minimum for non-icon images */
.page-news__articles-list img,
.page-news__long-article img {
    min-width: 200px;
    min-height: 200px;
    object-fit: cover;
}