/* style/news.css */

/* Root variables for consistent spacing and colors */
:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --background-light: #f8f9fa;
    --background-dark: #26A9E0; /* Using primary color for dark sections */
    --button-login: #EA7C07;
}

/* Base styles for the news page, assuming a light body background from shared.css */
.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); /* Fallback, but body will use shared var */
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding as body handles header offset */
    overflow: hidden;
    background-color: var(--background-dark);
    color: var(--text-light);
}

.page-news__hero-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin-bottom: 30px; /* Space between image and content */
    border-radius: 8px;
}

.page-news__hero-content {
    max-width: 900px;
    text-align: center;
    z-index: 1; /* Ensure content is above image if any overlap */
}

.page-news__hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-light);
}

.page-news__hero-description {
    font-size: 1.15rem;
    margin-bottom: 30px;
    color: var(--text-light);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

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

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

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

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

/* Buttons */
.page-news__btn-primary,
.page-news__btn-secondary,
.page-news__btn-download {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

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

.page-news__btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
    border-color: darken(var(--primary-color), 10%);
}

.page-news__btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.page-news__btn-download {
    background-color: var(--button-login); /* Specific color for download */
    border-color: var(--button-login);
}

.page-news__btn-download:hover {
    background-color: darken(var(--button-login), 10%);
    border-color: darken(var(--button-login), 10%);
}

.page-news__button-wrapper {
    text-align: center;
    margin-top: 40px;
}

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

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

.page-news__news-card {
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.page-news__card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.page-news__card-content {
    padding: 25px;
    flex-grow: 1;
}

.page-news__card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.page-news__card-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.page-news__card-excerpt {
    font-size: 1rem;
    color: var(--text-dark);
}

/* Industry Insights Section */
.page-news__industry-insights-section {
    padding: 80px 0;
    background-color: var(--background-dark);
    color: var(--text-light);
}

.page-news__article-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-news__article-card {
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-news__article-card .page-news__card-image {
    height: 280px;
}

.page-news__article-card .page-news__card-title {
    color: var(--text-light);
}

.page-news__article-card .page-news__card-excerpt {
    color: rgba(255, 255, 255, 0.8);
}

.page-news__text-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--secondary-color); /* White color for links on dark background */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-news__text-link:hover {
    color: var(--primary-color);
}

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

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

.page-news__guide-card {
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-news__guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.page-news__guide-card .page-news__card-image {
    height: 200px;
}

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

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

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

.page-news__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    background-color: var(--secondary-color);
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
    list-style: none; /* For details/summary */
}

.page-news__faq-item[open] .page-news__faq-question {
    background-color: var(--background-light);
    border-bottom: none;
}

.page-news__faq-question::-webkit-details-marker {
    display: none;
}

.page-news__faq-qtext {
    flex-grow: 1;
}

.page-news__faq-toggle {
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 15px;
    color: var(--text-dark);
}

.page-news__faq-answer {
    padding: 15px 25px 20px;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--background-light);
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-title {
        font-size: clamp(2rem, 4.5vw, 3rem);
    }
    .page-news__section-title {
        font-size: 2rem;
    }
    .page-news__news-grid,
    .page-news__guide-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .page-news__article-row {
        flex-direction: column;
        align-items: center;
    }
    .page-news__article-card {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .page-news {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-news__hero-section {
        padding: 40px 15px;
        padding-top: 10px !important;
    }
    .page-news__hero-image {
        height: 300px;
    }
    .page-news__hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }
    .page-news__hero-description {
        font-size: 1rem;
    }
    .page-news__hero-cta-buttons,
    .page-news__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }
    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news__btn-download {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 20px;
        font-size: 1rem;
    }
    .page-news__section-title {
        font-size: 1.8rem;
        padding: 0 15px;
    }
    .page-news__section-description {
        font-size: 0.95rem;
        padding: 0 15px;
    }
    .page-news__latest-news-section,
    .page-news__industry-insights-section,
    .page-news__guides-section,
    .page-news__faq-section,
    .page-news__cta-section {
        padding: 50px 0;
    }
    .page-news__container {
        padding: 0 15px;
    }
    .page-news__news-grid,
    .page-news__guide-grid {
        grid-template-columns: 1fr;
    }
    .page-news__card-image {
        height: 180px;
    }
    .page-news__card-title {
        font-size: 1.2rem;
    }
    .page-news__faq-question {
        font-size: 1rem;
        padding: 15px 20px;
    }
    .page-news__faq-answer {
        padding: 10px 20px 15px;
    }
    /* Image responsiveness */
    .page-news img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    /* Container responsiveness for images/videos/buttons */
    .page-news__section,
    .page-news__card,
    .page-news__container,
    .page-news__video-section,
    .page-news__video-container,
    .page-news__video-wrapper,
    .page-news__cta-buttons,
    .page-news__button-group,
    .page-news__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .page-news__hero-section .page-news__hero-image {
        height: auto;
        max-height: 300px; /* Cap hero image height on mobile */
    }
}

/* Ensure color contrast on dark sections */
.page-news__dark-section {
    background-color: var(--background-dark);
    color: var(--text-light);
}

.page-news__dark-section .page-news__card-title {
    color: var(--text-light);
}

.page-news__dark-section .page-news__card-excerpt {
    color: rgba(255, 255, 255, 0.8);
}

.page-news__light-bg {
    background-color: var(--background-light);
    color: var(--text-dark);
}

.page-news__light-bg .page-news__card-title {
    color: var(--primary-color);
}

.page-news__light-bg .page-news__card-excerpt {
    color: var(--text-dark);
}

/* Ensure images maintain original color */
.page-news img {
    filter: none; /* Ensure no CSS filter changes image color */
}

/* Desktop video container width */
.page-news__video-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Utility for darkening colors in SASS-like way */
@function darken($color, $percentage) {
  @return mix(black, $color, $percentage);
}