/* style/news.css */

:root {
  --primary-color: #E53935;
  --secondary-color: #FF5A4F;
  --text-main-color: #333333;
  --card-bg-color: #FFFFFF;
  --background-color: #F5F7FA;
  --border-color: #E0E0E0;
}

.page-news {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main-color); /* Default text color for the page */
  background-color: var(--background-color); /* Page background */
}

/* Hero Section */
.page-news__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Ensure image is above content */
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding-bottom: 40px; /* Space below hero content */
  padding-top: 10px; /* Small top padding, relying on body for header offset */
}

.page-news__hero-image-wrapper {
  width: 100%;
  max-height: 675px; /* Max height for desktop hero image */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-news__hero-image {
  width: 100%;
  height: auto;
  object-fit: cover; /* Covers the area, may crop */
  display: block;
}

.page-news__hero-content {
  position: relative;
  z-index: 10;
  padding: 40px 20px;
  max-width: 960px;
  margin-top: -100px; /* Overlap slightly with the image for visual flow */
  background: var(--card-bg-color); /* White background for content */
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.page-news__main-title {
  font-size: clamp(2em, 3.5vw, 2.8em); /* Responsive font size for H1 */
  color: var(--primary-color);
  margin-bottom: 15px;
  line-height: 1.2;
  font-weight: bold;
}

.page-news__subtitle {
  font-size: 1.1em;
  color: var(--text-main-color);
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-news__btn-primary,
.page-news__btn-secondary,
.page-news__read-more-btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping by default */
}

.page-news__btn-primary {
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  color: #ffffff;
  border: 2px solid transparent;
}

.page-news__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(229, 57, 53, 0.4);
}

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

.page-news__btn-secondary:hover {
  background: var(--primary-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(229, 57, 53, 0.2);
}

/* General Section Styles */
.page-news__section {
  padding: 60px 0;
  background-color: var(--background-color);
}

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

.page-news__section-description {
  font-size: 1.05em;
  color: var(--text-main-color);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

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

/* Latest Articles Section */
.page-news__latest-articles {
  background-color: var(--card-bg-color);
}

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

.page-news__article-card {
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  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 6px 20px rgba(0,0,0,0.1);
}

.page-news__article-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for article images */
  overflow: hidden;
}

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

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

.page-news__article-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-news__article-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-news__article-link:hover {
  text-decoration: underline;
  color: var(--secondary-color);
}

.page-news__article-meta {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 15px;
}

.page-news__article-excerpt {
  font-size: 1em;
  color: var(--text-main-color);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-news__read-more-btn {
  align-self: flex-start;
  padding: 8px 15px;
  font-size: 0.9em;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 5px;
}

.page-news__read-more-btn:hover {
  background: var(--secondary-color);
}

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

.page-news__view-all-btn {
  min-width: 200px;
}

/* Categories Section */
.page-news__categories-section {
  background-color: var(--background-color);
}

.page-news__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  justify-items: center;
}

.page-news__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px 10px;
  text-decoration: none;
  color: var(--text-main-color);
  font-weight: bold;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 150px;
  box-sizing: border-box;
}

.page-news__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  color: var(--primary-color);
}

.page-news__category-icon {
  width: 80px; /* Display width */
  height: 80px; /* Display height */
  object-fit: contain; /* Ensure the image fits within the bounds */
  margin-bottom: 10px;
  display: block;
}

.page-news__category-name {
  font-size: 1em;
}

/* About Section */
.page-news__about-section {
  background-color: var(--card-bg-color);
}

.page-news__about-content {
  display: flex;
  gap: 40px;
  align-items: center;
}

.page-news__about-image {
  flex: 1;
  max-width: 50%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: block;
}

.page-news__about-text {
  flex: 1;
  max-width: 50%;
}

.page-news__about-text p {
  margin-bottom: 20px;
  color: var(--text-main-color);
}

/* CTA Section */
.page-news__cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  padding: 80px 0;
}

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

.page-news__cta-section .page-news__section-description {
  color: #ffffff;
  margin-bottom: 50px;
}

.page-news__cta-section .page-news__cta-buttons {
  gap: 20px;
}

/* General image responsive styles */
.page-news img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Responsive Styles --- */
@media (max-width: 1024px) {
  .page-news__hero-content {
    margin-top: -50px;
    padding: 30px 20px;
  }
  .page-news__main-title {
    font-size: 2.5em;
  }
  .page-news__section-title {
    font-size: 2em;
  }
  .page-news__about-content {
    flex-direction: column;
    text-align: center;
  }
  .page-news__about-image,
  .page-news__about-text {
    max-width: 100%;
  }
  .page-news__about-image {
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  /* Hero Section */
  .page-news__hero-section {
    flex-direction: column;
    padding-top: 10px !important; /* Small top padding, relying on body for header offset */
    padding-bottom: 20px;
  }
  .page-news__hero-image-wrapper {
    max-height: 400px; /* Adjust max height for mobile */
  }
  .page-news__hero-image {
    object-fit: contain !important; /* Ensure image is fully visible, no cropping */
    aspect-ratio: unset !important; /* Remove aspect ratio constraint */
    max-height: none !important; /* Allow height to adjust freely */
    width: 100% !important;
  }
  .page-news__hero-content {
    margin-top: -40px;
    padding: 25px 15px;
    border-radius: 8px;
    max-width: calc(100% - 30px) !important; /* Account for padding */
    width: calc(100% - 30px) !important;
  }
  .page-news__main-title {
    font-size: 1.8em !important; /* Smaller H1 for mobile */
    line-height: 1.3 !important;
  }
  .page-news__subtitle {
    font-size: 1em !important;
    margin-bottom: 20px !important;
  }

  /* Buttons and Button Containers */
  .page-news__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 15px !important; /* Add padding to container */
  }
  .page-news__btn-primary,
  .page-news__btn-secondary,
  .page-news__read-more-btn,
  .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 !important;
    padding-right: 15px !important;
    text-align: center;
  }
  .page-news__view-all-button-wrapper {
    padding: 0 15px !important; /* Ensure button wrapper has padding */
  }

  /* General Section Styles */
  .page-news__section {
    padding: 40px 0 !important;
  }
  .page-news__section-title {
    font-size: 1.8em !important;
    margin-bottom: 15px !important;
  }
  .page-news__section-description {
    font-size: 0.95em !important;
    margin-bottom: 30px !important;
    padding: 0 15px;
  }
  .page-news__container {
    padding: 0 15px !important;
  }

  /* Latest Articles Section */
  .page-news__article-grid {
    grid-template-columns: 1fr !important; /* Single column for articles */
    gap: 20px !important;
  }
  .page-news__article-image-wrapper {
    height: 180px !important; /* Adjust height for mobile article images */
  }
  .page-news__article-title {
    font-size: 1.2em !important;
  }

  /* Categories Section */
  .page-news__categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important; /* Adjust columns for categories */
    gap: 15px !important;
  }
  .page-news__category-card {
    padding: 15px 5px !important;
    max-width: 100% !important;
  }
  .page-news__category-icon {
    width: 60px !important; /* Scale down icons for mobile display */
    height: 60px !important;
  }
  .page-news__category-name {
    font-size: 0.9em !important;
  }

  /* About Section */
  .page-news__about-content {
    flex-direction: column !important;
    gap: 20px !important;
  }
  .page-news__about-image,
  .page-news__about-text {
    max-width: 100% !important;
  }
  .page-news__about-image {
    margin-bottom: 20px !important;
  }

  /* General image responsive styles for content area */
  .page-news img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-news__section,
  .page-news__card,
  .page-news__container,
  .page-news__hero-content,
  .page-news__article-card,
  .page-news__category-card,
  .page-news__about-content,
  .page-news__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Remove padding for the hero-section itself if it's full width */
  .page-news__hero-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Image filter restriction */
.page-news img {
  filter: none !important; /* Ensure no filters are applied */
}