/* ==========================================================================
   News Page Layout & Hero Section
   ========================================================================== */

/* Outer Page Container */
.news-page {
  width: 100%;
  box-sizing: border-box;
}

/* Hero Container with Background Image */
.news {
  position: relative;
  max-width: 1440px;
  min-height: 480px;
  margin: 0 auto 48px auto;
  border-radius: 24px;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: flex-end; /* Aligns content block at the bottom */
  box-sizing: border-box;
}

/* Gradient Overlay for Text Contrast */
.news__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 30, 63, 0.85) 0%,
    rgba(0, 30, 63, 0.4) 50%,
    rgba(0, 30, 63, 0.1) 100%
  );
  z-index: 1;
}

/* Text Container at Bottom */
.news__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px;
  text-align: left;
  box-sizing: border-box;
}

/* News Title Label */
.news__title {
  display: block;
  color: #ffffff;
  font-size: 64px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  line-height: 1.1;
}

/* Description Text */
.news__description {
  color: #ffffff;
  font-size: 24px;
  line-height: 1.4;
  max-width: 800px;
  margin: 0;
}

/* Extra Content Area (Article Grid / Views Area) */
.news__extra-content {
  margin: 0 auto;
}

/* Responsive Scaling for Mobile & Tablet */
@media (max-width: 992px) {
  .news__title {
    font-size: 48px;
  }

  .news__description {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .news {
    min-height: 360px;
    border-radius: 16px;
  }

  .news__content {
    padding: 24px;
  }

  .news__title {
    font-size: 36px;
  }

  .news__description {
    font-size: 1.125rem;
  }
}

/* ==========================================================================
   News Page Specific: 35% Image Allocation / 65% Content Allocation
   ========================================================================== */

.news-page .feature-card,
.node--type-news .feature-card {
  display: flex;
  align-items: stretch; /* Stretches card height evenly */
  gap: 24px;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 42px;
  padding: 0; /* Remove padding from outer container */
  box-shadow: none;
  width: 100%;
  overflow: hidden; /* Ensures inner radiuses don't bleed out */
  box-sizing: border-box;
}

/* Image Wrapper (35% Width, Direct Flush Border) */
.news-page .feature-card__logo-wrapper,
.node--type-news .feature-card__logo-wrapper {
  flex: 0 0 35%;
  max-width: 35%;
  padding: 0;
  margin: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.news-page .feature-card__logo,
.node--type-news .feature-card__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content Container (Calculated 65% minus gap) */
.news-page .feature-card__content,
.node--type-news .feature-card__content {
  flex: 0 0 calc(65% - 24px);
  max-width: calc(65% - 24px);
  min-width: 0; /* Critical: Allows flex child text truncation without overflow */
  color: #001E3F;
  padding: 32px 32px 32px 0;
  box-sizing: border-box;
  overflow: hidden;
}

/* Metadata Block: Tag & Date */
.feature-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

/* Metadata Block: Tag & Date */
.feature-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.feature-card__tag,
.feature-card__date {
  color: #FFBE00;
  border: 1px solid #FFBE00;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  line-height: 1.2;
}

/* Title Styling */
.feature-card__title {
  color: #001E3F !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  margin: 0 0 12px 0 !important;
  line-height: 1.3 !important;
}

/* Ensure inner Drupal body text wraps and clamps properly */
.news-page .feature-card__description,
.node--type-news .feature-card__description,
.feature-card__description .field,
.feature-card__description .field--name-body,
.feature-card__description .field__item,
.feature-card__description p {
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

.feature-card__description p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .news-page .feature-card,
  .node--type-news .feature-card {
    flex-direction: column;
  }

  .news-page .feature-card__logo-wrapper,
  .node--type-news .feature-card__logo-wrapper,
  .news-page .feature-card__content,
  .node--type-news .feature-card__content {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .news-page .feature-card__content,
  .node--type-news .feature-card__content {
    padding: 24px;
  }
}

/* ==========================================================================
   Khmer (km) Language Overrides
   ========================================================================== */

html[lang="km"] .feature-section {
  padding: 0px;
}

/* Header Text Overrides */
html[lang="km"] .feature-section .section__label {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

html[lang="km"] .feature-section .section__title {
  font-size: 2.25rem;
  line-height: 1.4;
  font-weight: 700;
}

html[lang="km"] .feature-section .section__description {
  font-size: 1.15rem;
  line-height: 1.8;
}

/* Multi-Card Grid & Layout Overrides */
html[lang="km"] .feature-section__cards {
  gap: 16px;
  margin-top: 32px;
  display: flex;
}

html[lang="km"] .feature-section__cards .feature-card {
  padding: 0px; /* Maintains no-padding override for Khmer cards */
}

/* Base Title Styling (All Languages) */
.feature-card__title,
.feature-card__title a,
.feature-card__title .field--name-title {
  color: #001E3F !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  text-decoration: none;
}

.feature-card__title a:hover {
  text-decoration: none;
}

/* Khmer (km) Title Overrides */
html[lang="km"] .feature-section__cards .feature-card__title,
html[lang="km"] .feature-section__cards .feature-card__title a,
html[lang="km"] .feature-section__cards .feature-card__title .field--name-title {
  color: #001226 !important;
  font-size: 1.5rem !important; /* 24px */
  line-height: 1.4 !important;
}

html[lang="km"] .feature-section__cards .feature-card__description {
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
}


/* Read More Link */
.feature-card__read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: #001E3F;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: underline;
  transition: color 0.2s ease, transform 0.2s ease;
}

.feature-card__read-more-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

/* Hover Animation */
.feature-card__read-more:hover {
  color: #FFBE00;
}

.feature-card__read-more:hover .feature-card__read-more-icon {
  transform: translateX(4px);
}

/* Khmer Overrides for Read More Link */
html[lang="km"] .feature-card__read-more {
  color: #001226;
  font-size: 1rem;
}


/* Articles Grid Container */
.news-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Individual Card Styling */
.article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Image with Top Border Radius */
.article-card__image-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.article-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Content Container */
.article-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Tag | Date Row */
/* Meta Row Container */
.article-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Category Tag and Date Styling */
.article-card__tag,
.article-card__date {
  background-color: #ffffff;
  color: #FFBE00;
  border: 1px solid #FFBE00;
  padding: 4px 12px;
  border-radius: 14px;
  font-weight: 600;
  display: inline-block;
  line-height: 1;
}

/* Article Title */
.article-card__title {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.article-card__title a {
  color: #001226;
  text-decoration: none;
  font-weight: 700;
}

.article-card__title a:hover {
  color: #ffbe00;
}

/* 20 Char Description */
.article-card__description p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

/* Read More Link with Line Arrow Head Right Icon */
.article-card__read-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #001226;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-card__read-more:hover {
  color: #ffbe00;
}

.article-card__read-more-icon {
  transition: transform 0.2s ease;
}

.article-card__read-more:hover .article-card__read-more-icon {
  transform: translateX(4px);
}

/* 2-Column Flex Header Layout */
.news-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  width: 100%;
}

/* Column 1: Categories Container */
.news-section__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1; /* Takes available space on the left */
}

/* Category Button Base Styling */
.category-btn {
  background-color: #ffffff;
  border: 1px solid #001226;
  color: #001E3F;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* Active & Hover States */
.category-btn.active,
.category-btn:hover {
  background-color: #001E3F;
  color: #fff; /* Primary brand highlight color */
  border-color: #001E3F;
}

/* Column 2: Search Bar Container */
.news-section__search {
  flex-shrink: 0; /* Prevents input from shrinking unnaturally */
}

.news-section__search input {
  padding: 10px 16px;
  border: 1px solid #001226;
  border-radius: 8px;
  min-width: 280px;
  font-size: 0.95rem;
  color: #001E3F;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.news-section__search input:focus {
  border-color: #FFBE00;
}

/* Responsive Mobile Stacking */
@media (max-width: 768px) {
  .news-section__header {
    flex-direction: column;
    align-items: stretch;
  }

  .news-section__search input {
    width: 100%;
    min-width: unset;
  }
}

/* Search Container Wrapper */
.news-section__search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Position Lens Icon on the Right */
.news-section__search-wrapper .search-icon {
  position: absolute;
  right: 14px; /* Positioned on the right side */
  pointer-events: none; /* Passes clicks directly to the input */
  transition: stroke 0.2s ease;
}

/* Search Input Styling with Right Padding for Icon */
.news-section__search input {
  padding: 10px 40px 10px 16px; /* 40px right padding prevents text overlapping icon */
  border: 1px solid #001226;
  border-radius: 8px;
  min-width: 280px;
  font-size: 0.95rem;
  color: #001E3F;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

/* Hover & Focus Interactions */
.news-section__search input:focus {
  border-color: #FFBE00;
}

.news-section__search-wrapper:focus-within .search-icon {
  stroke: #FFBE00;
}

/* Pagination Container */
.news-section__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

/* Base Styles for Pagination Buttons */
.pagination-btn,
.pagination-num {
  background-color: #ffffff;
  border: 1px solid #99ACC0;
  color: #99ACC0;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Active Page Number */
.pagination-num.active {
  background-color: #ffffff;
  color: #001E3F;
  border-color: #001E3F;
}

/* Hover States for Active Buttons */
.pagination-num:hover:not(.active),
.pagination-btn:hover:not(:disabled) {
  background-color: #FFFFFF;
  color: #001E3F;
  border-color: #001E3F;
}

/* Disabled State for Arrow Buttons */
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #CBD5E1;
  color: #94A3B8;
}

.page-node-type-news .section-contact-banner {
    padding: 0 !important;
}