/* Main Wrapper */
.news-listing-wrapper {
  display: flex;
  flex-direction: column;
  padding: 4.375rem 0 3.125rem 0;
  border-top: 1px solid var(--color-dark-blue);
}

@media (min-width: 68.75rem) {
  .news-listing-wrapper {
    flex-direction: row;
    align-items: flex-start;
    padding: 8.75rem 0 0 0;
    justify-content: space-between;
    gap: 1rem;
  }
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
}

@media (min-width: 64rem) {
  .sidebar {
    width: 31.25rem;
    flex-shrink: 0;
    gap: 3.125rem;
  }
}

/* Header Section */
.header-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.header-title {
  font-family: "Kanit", sans-serif;
  font-size: 2.188rem;
  font-weight: 400;
  line-height: 2.5rem;
  color: var(--color-text);
  text-transform: capitalize;
}

@media (min-width: 48rem) {
  .header-title {
    font-size: 3.75rem;
    font-weight: 500;
    line-height: 4.25rem;
  }
}

.header-description {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-grey);
}

/* Category Filters */
.category-filters {
  display: flex;
  flex-direction: column;
  gap: 1.875rem;
  align-items: flex-start; /* Prevent full width stretch */
}

.category-filters .btn-primary {
  /* display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  gap: 1rem;
  height: auto; 
  min-height: 3.125rem;
  border-radius: 0.3125rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
  border: 1px solid var(--color-light-blue);
  background-color: transparent;
  width: auto;
  text-transform: uppercase; */
  font-family: var(--font-family-base) !important;
}

/* @media (min-width: 48rem) {
  .category-filters .btn-primary {
    width: auto;
    min-width: auto;
  }
} */

.category-filters .btn-primary.active {
  background-color: var(--color-light-blue);
  border-color: var(--color-light-blue);
}

/* .category-filters .btn-primary:hover {
  background-color: var(--color-light-blue);
  border-color: var(--color-light-blue);
}

.category-filters .btn-primary.active:hover {
  background-color: var(--color-light-blue);
} */

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  width: 100%;
}

@media (min-width: 64rem) {
  .main-content {
    padding-top: 0.625rem;
    width: 100%;
  }
}

@media (max-width: 47.938rem) {
  .main-content {
    margin-top: 3.75rem;
  }
}

@media (min-width: 48rem) and (max-width: 68.75rem) {
  .main-content {
    margin-top: 3.75rem;
  }

  .news-listing-wrapper {
    padding: 4.375rem 0 0 0;
  }
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 3.125rem;
  width: 100%;
}

@media (min-width: 64rem) {
  .main-content {
    width: 100%;
    max-width: 41.25rem;
  }
  
  .articles-list {
    max-width: 41.25rem;
  }
}

@media (min-width: 100rem) {
  .main-content {
    width: 100%;
    max-width: 56.25rem;
  }

  .articles-list {
    max-width: 56.25rem !important; /* 900px */
    margin-left: auto;
  }
}

.article-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative; /* Needed for card-full-link overlay */
}

/* Full-card clickable overlay via title link */
.article-item .card-full-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Keep image link and arrow link above the overlay */
.article-item .article-content > a,
.article-item .article-link {
  position: relative;
  z-index: 2;
}

.article-content {
  display: flex;
  flex-direction: column;
  gap: 3.125rem;
}

.article-content > a {
  display: block;
  position: relative;
  overflow: hidden;
}

.article-content > a .o-media {
  padding-bottom: 62.5% !important;
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

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

@media (min-width: 48rem) {
  .article-content {
    flex-direction: row;
    gap: 3.125rem;
    align-items: stretch;
  }

  .article-content > a {
    display: block;
    width: 13.75rem;
    flex-shrink: 0;
  }

  .article-content > a .o-media {
    padding-bottom: 80.909090909090909090909090909091% !important;
  }
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 1.875rem;
  flex: 1;
  width: 100%;
}

@media (min-width: 64rem) {
  .article-body {
    flex: 1;
    width: 100%;
    min-width: 0; /* Prevents flex from overflowing parent */
    gap: 3.125rem;
  }
}

@media (min-width: 100rem) {
  .article-body {
    flex: 0 0 39.375rem; /* Exactly 630px */
    width: 39.375rem;
  }
}
.article-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-date {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.625rem;
  color: var(--color-grey-2);
}

.article-title,
.article-title a {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 2rem;
  min-height: 4rem;
  text-decoration: none;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.article-category {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.625rem;
  color: var(--color-blue-3);
  flex-shrink: 0;
}

.article-arrow {
  width: 1.3125rem;
  height: auto;
  flex-shrink: 0;
}

.article-link img {
  transition: transform 0.5s ease;
}

.article-item:hover .article-link img {
  transform: translateX(-15px);
}

.article-divider {
  position: relative;
  margin-top: 3.125rem;
  transition: background-color 0.5s ease;
}

.article-item:last-child .article-divider {
  opacity: 0 !important;
  visibility: hidden !important;
  margin-top: 0 !important;
  height: 0 !important;
}

.article-item:hover .article-divider {
  background-color: var(--color-light-blue);
}

@media (max-width: 47.938rem) {
  .article-content > a {
    display: none;
  }

  .article-title,
  .article-title a {
    min-height: auto;
    font-size: 1.125rem;
    line-height: 1.625rem;
  }

  .category-filters {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    gap: 2.5rem;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }

  .category-filters::-webkit-scrollbar {
    display: none;
  }

  .category-filters .btn-primary {
    flex-shrink: 0;
  }

  .article-date {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .article-category {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .article-category {
    font-size: 1rem;
    line-height: 1.5rem;
  }
}
