/* style/news.css */

/* Base styles for the page content */
.page-news {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333333;
    line-height: 1.6;
    background-color: #FFFFFF; /* Default body background is white */
}

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

.page-news__section-title {
    font-size: 36px;
    color: #26A9E0; /* Brand primary color for titles */
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-news__section-description {
    font-size: 18px;
    color: #555555;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    line-height: 1.8;
}

/* Hero Section */
.page-news__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
    background: linear-gradient(135deg, #e0f2f7, #ffffff); /* Light gradient background */
}

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

.page-news__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

.page-news__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.page-news__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.page-news__main-title {
    font-size: 48px;
    color: #000000;
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.2;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__intro-description {
    font-size: 20px;
    color: #333333;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-news__cta-button {
    display: inline-block;
    padding: 18px 45px;
    background: #26A9E0; /* Brand primary color */
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(38, 169, 224, 0.4);
}

.page-news__cta-button:hover {
    background: #1e87c0;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(38, 169, 224, 0.6);
}

/* General button styles */
.page-news__btn-primary {
    display: inline-block;
    padding: 15px 30px;
    background: #26A9E0;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(38, 169, 224, 0.3);
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__btn-primary:hover {
    background: #1e87c0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(38, 169, 224, 0.5);
}

.page-news__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    background: #ffffff;
    color: #26A9E0;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid #26A9E0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-news__btn-secondary:hover {
    background: #f0f8ff;
    color: #1e87c0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.page-news__button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Section specific styles */
.page-news__light-bg {
    background-color: #f8fcfd; /* Very light blue background */
    color: #333333;
    padding: 60px 0;
}

.page-news__dark-section {
    background-color: #26A9E0; /* Brand primary color background */
    color: #ffffff;
    padding: 60px 0;
}

.page-news__dark-section .page-news__section-title {
    color: #ffffff;
}

.page-news__dark-section .page-news__section-description {
    color: #e0f2f7;
}

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

.page-news__article-card {
    background: #ffffff;
    border-radius: 12px;
    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-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

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

.page-news__article-card h3 {
    font-size: 22px;
    margin: 20px 20px 10px 20px;
    font-weight: 700;
    line-height: 1.4;
}

.page-news__article-card h3 a {
    color: #26A9E0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-news__article-card h3 a:hover {
    color: #1e87c0;
}

.page-news__article-excerpt {
    font-size: 16px;
    color: #555555;
    margin: 0 20px 15px 20px;
}

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

/* Analysis Section */
.page-news__analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-news__analysis-item {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-bottom: 20px; /* Space for content below image */
}

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

.page-news__analysis-item img {
    width: 100%;
    height: 300px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 20px;
}

.page-news__analysis-title {
    font-size: 24px;
    margin: 0 20px 10px 20px;
    font-weight: 700;
    line-height: 1.3;
}

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

.page-news__analysis-title a:hover {
    color: #1e87c0;
}

.page-news__analysis-text {
    font-size: 16px;
    color: #555555;
    margin: 0 20px;
}

/* Tech Updates Section */
.page-news__feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-news__feature-item {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-bottom: 30px; /* Space for content below image */
    text-align: center;
}

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

.page-news__feature-item img {
    width: 100%;
    height: 300px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 20px;
}

.page-news__feature-title {
    font-size: 24px;
    margin: 0 20px 10px 20px;
    font-weight: 700;
    line-height: 1.3;
}

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

.page-news__feature-title a:hover {
    color: #1e87c0;
}

.page-news__feature-text {
    font-size: 16px;
    color: #555555;
    margin: 0 20px 25px 20px;
}

/* CTA Bottom Section */
.page-news__cta-bottom {
    text-align: center;
    padding: 80px 20px;
}

/* FAQ Section */
.page-news__faq-section {
    padding-top: 60px;
    padding-bottom: 60px;
}

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

/* FAQ container styles */
.page-news__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 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 20px; /* Adjusted padding */
  opacity: 0;
  background: #f9f9f9;
  color: #555555;
  font-size: 16px;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height to ensure expansion */
.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 !important; /* Adjusted padding */
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

/* Question styles */
.page-news__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px; /* Adjusted padding */
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px; /* Adjusted border-radius */
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-news__faq-item.active .page-news__faq-question {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #d0d0d0;
}

.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: 18px; /* Adjusted font size */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: #333333;
}

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

.page-news__faq-item.active .page-news__faq-toggle {
  color: #26A9E0; /* Brand primary color for active toggle */
  transform: rotate(45deg); /* Rotate for 'x' effect, if using '+' */
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-news__hero-image img {
        border-radius: 8px;
    }
    .page-news__main-title {
        font-size: 40px;
    }
    .page-news__intro-description {
        font-size: 18px;
    }
    .page-news__section-title {
        font-size: 32px;
    }
    .page-news__section-description {
        font-size: 16px;
    }
    .page-news__article-card,
    .page-news__analysis-item,
    .page-news__feature-item {
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    }
}

@media (max-width: 768px) {
    /* Mobile specific padding-top for hero section */
    .page-news__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-news__container {
        padding: 30px 15px;
    }

    .page-news__hero-image img {
        border-radius: 6px;
    }

    .page-news__main-title {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .page-news__intro-description {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .page-news__cta-button {
        padding: 14px 30px;
        font-size: 17px;
        margin-top: 15px;
    }

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

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

    /* Article Card Responsive */
    .page-news__article-card img,
    .page-news__analysis-item img,
    .page-news__feature-item img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important; /* Allow height to adjust */
        min-height: 200px; /* Ensure minimum height */
    }
    
    .page-news__article-grid,
    .page-news__analysis-grid,
    .page-news__feature-list {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 20px;
    }

    .page-news__article-card,
    .page-news__analysis-item,
    .page-news__feature-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-bottom: 20px;
    }

    .page-news__article-card h3,
    .page-news__analysis-title,
    .page-news__feature-title {
        font-size: 20px;
        margin: 15px 15px 8px 15px;
    }

    .page-news__article-excerpt,
    .page-news__analysis-text,
    .page-news__feature-text {
        font-size: 15px;
        margin: 0 15px 12px 15px;
    }

    .page-news__article-date {
        margin: 0 15px 15px 15px;
    }

    .page-news__btn-primary,
    .page-news__btn-secondary,
    .page-news a[class*="button"],
    .page-news a[class*="btn"] {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .page-news__button-group {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }

    /* FAQ Mobile */
    .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;
    }
}

/* Ensure all images within .page-news do not cause horizontal scroll */
.page-news img {
    max-width: 100%;
    height: auto;
    display: block;
}

.page-news__section,
.page-news__card,
.page-news__container,
.page-news__article-grid,
.page-news__analysis-grid,
.page-news__feature-list,
.page-news__faq-list {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent content overflow */
}

/* Image filter restriction */
.page-news img {
    filter: none; /* Ensure no filter is applied to change image color */
}

/* Content area image size restriction for mobile */
@media (max-width: 768px) {
    .page-news img {
        min-width: 200px !important; /* Enforce minimum size */
        min-height: 200px !important; /* Enforce minimum size */
    }
    .page-news__article-card img,
    .page-news__analysis-item img,
    .page-news__feature-item img {
        min-width: 200px !important;
        min-height: 200px !important;
    }
    /* Specific overrides for content area images to ensure minimum size */
    .page-news__latest-articles img,
    .page-news__in-depth-analysis img,
    .page-news__tech-updates img {
        width: 100% !important; /* Override width if needed, but ensure min-width applies */
        height: auto !important; /* Allow height to adjust, but ensure min-height applies */
        max-width: 100% !important;
        min-width: 200px !important;
        min-height: 200px !important;
    }
}