/* ===========================
  Filter Styles
=========================== */

/* Wrapper */
/* ==== Filter Bar (responsive, no floats) ==== */
.news-filter-form {
	display: flex;
	justify-content: center;
	align-items: center;
}
.news-filter-form.nf .nf-bar {
  max-width: 900px;
  display: grid;
  grid-template-columns:
    minmax(260px, 1fr)           /* search */
    minmax(170px, max-content)   /* type */
    minmax(130px, max-content);  /* year */
  gap: clamp(10px, 2vw, 18px);
  align-items: center;
      margin: 30px 0px 0px 0px;
}

/* ---- Search control ---- */
.news-filter-form.nf .nf-search {
  position: relative;
  overflow: hidden;              /* prevent icon circle from bleeding */
}

.news-filter-form.nf .nf-search input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 6px rgba(0,0,0,.04);
  font-size: 16px;               /* prevent iOS zoom */
  line-height: 48px;
  padding: 0 64px 0 18px;        /* reserve room for the 40px icon */
  color: #111827;
  outline: none;
}

.news-filter-form.nf .nf-search input::placeholder {
  color: #6b7280;
  opacity: 1;
}

.news-filter-form.nf .nf-search-btn {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}
.news-filter-form.nf .nf-search-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: #4b5563;
}

/* ---- Selects (Type/Year) ---- */
.news-filter-form.nf .nf-select {
  position: relative;
}
.news-filter-form.nf .nf-select select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 100%;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 6px rgba(0,0,0,.04);
  font-size: 16px;
  line-height: 48px;
  padding: 0 42px 0 18px;        /* space for custom chevron */
  color: #111827;
  outline: none;
}
.news-filter-form.nf .nf-select::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  pointer-events: none;
}

/* ---- Focus states ---- */
.news-filter-form.nf .nf-control input[type="search"]:focus,
.news-filter-form.nf .nf-control select:focus {
  background: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

/* ---- Responsive layout ---- */
@media (max-width: 900px) {
  .news-filter-form.nf .nf-bar {
    grid-template-columns: 1fr 1fr;     /* search + one pill per row */
  }
  /* let search span both columns for breathing room */
  .news-filter-form.nf .nf-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .news-filter-form.nf .nf-bar {
    grid-template-columns: 1fr;         /* stacked */
  }
  .news-filter-form.nf .nf-select,
  .news-filter-form.nf .nf-search {
    grid-column: 1;
  }
}

/* ===== Grid & Cards ===== */
.news-filter-wrap .news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (max-width: 1024px) {
  .news-filter-wrap .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .news-filter-wrap .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-filter-wrap .news-card {
  position: relative;
  border-radius: 20px;
  border: 1px solid #1F449559;
  overflow: hidden;
  background: transparent; /* remove gradient */
  color: #111827;
}
.news-filter-wrap .news-card__link {
  display: block;
  color: inherit;
  text-decoration: none !important;
  height: 100%;
}
.news-filter-wrap .news-card__media {
  position: relative;
  aspect-ratio: 1/1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.news-filter-wrap .news-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: all .3s ease-in-out;
}
.news-filter-wrap .news-card__link:hover .news-card__media img {
  transform: scale(1.1);
}
.news-filter-wrap .news-card__date {
  position: absolute;
  top: .75rem;
  left: .75rem;
  font-size: .85rem;
  opacity: .9;
  z-index: 2;
  font-weight: 600;
  display: none;
}
.news-filter-wrap .news-card__icon {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2;
  line-height: 1;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.news-filter-wrap .news-card__title {
position: relative;
    z-index: 2;
    margin: 0;
    font-size: var(--nf-card-title-size);
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
	padding: 16px 32px; 
    background: linear-gradient(90deg, #1F4495 0%, rgba(0, 168, 142, 0.6) 100%);
    display: inline-block;
	min-width: 100%;
	text-align: center;
	min-height: 95px;
}

/* ===== Pagination ===== */
.news-filter-wrap .pagination {
  margin-top: 1.5rem;
  text-align: center;
}
.news-filter-wrap .pagination .page-numbers {
  display: inline-block;
  margin: 0 .25rem;
  padding: .5rem .75rem;
  border-radius: .5rem;
  background: #f3f4f6;
}
.news-filter-wrap .pagination .page-numbers.current {
  background: #111827;
  color: #fff;
}

/* --- Per Page Dropdown --- */
.nf-perpage-wrapper select,
#nf-per-page {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 6px rgba(0,0,0,.04);
  font-size: 16px;
  line-height: 48px;
  padding: 0 42px 0 18px;
  color: #111827;
  outline: none;
  cursor: pointer;
  position: relative;
  max-width: 160px;
}

.nf-perpage-wrapper {
  position: relative;
}

.nf-perpage-wrapper::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  pointer-events: none;
}

/* Focus state consistent with filter bar */
#nf-per-page:focus {
  background: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

/* --- Pagination Buttons --- */
.nf-pagination {
  margin-top: 1.5rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nf-pagination button {
  display: inline-block;
  min-width: 40px;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.nf-pagination button:hover:not(:disabled) {
  background: #008e87;
}

.nf-pagination button[aria-current="page"] {
  background: #008e87; 
  border-color: #008e87;
  color: #fff;
  box-shadow: 0 1px 3px rgba(31,68,149,.4), 0 2px 8px rgba(0,0,0,.2);
}

.nf-pagination button[aria-current="page"]:hover {
  background: #008e87; 
  border-color: #008e87;
}

.nf-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


@media (max-width: 640px) {
  .news-filter-form {
    margin: 0px 0 20px 0 !important;
    position: relative;
    z-index: 10;
    clear: both;
  }
  
  .news-filter-wrap {
    padding: 0px 15px 30px 15px !important;
    position: relative;
    clear: both;
    overflow: visible !important;
  }
  
  /* Fix grid - add bottom padding */
  .news-filter-wrap .news-grid {
    gap: 2rem !important;
    width: 100%;
    max-width: 100%;
    padding-bottom: 40px !important;
    margin-bottom: 40px !important;
  }
  
  /* Fix card dimensions */
  .news-filter-wrap .news-card {
    margin-bottom: 20px !important;
    overflow: hidden !important;
    position: relative;
    height: auto !important;
  }
  
  /* Lower dropdown height on mobile */
  .news-filter-form.nf .nf-select select,
  .nf-perpage-wrapper select,
  #nf-per-page {
    height: 38px;
    line-height: 1.2;
    padding: 8px 42px 8px 16px;
    font-size: 15px;
  }
  .news-filter-form.nf .nf-search input[type="search"] {
  height:33px;
  }
  /* Adjust chevron position */
  .news-filter-form.nf .nf-select::after,
  .nf-perpage-wrapper::after {
    right: 16px;
  }
  
}