/*=============== GOOGLE FONTS ===============*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --primary-green : #00796B;
  --darker-green : #00534a;
  --black-color: hsl(220, 24%, 12%);
  --black-color-light: hsl(220, 24%, 15%);
  --black-color-lighten: hsl(220, 20%, 18%);
  --gray: #A6A6A6;
  --white-color: #fff;
  --white-color-dark: hsl(0, 0%, 93%);
  --body-color: hsl(220, 100%, 97%);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: .938rem;

  /*========== Font weight ==========*/
  --font-regular: 200;
  --font-semi-bold: 350;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== Responsive typography ==========*/
@media screen and (min-width: 1024px) {
  :root {
    --normal-font-size: 1rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--white-color);
}

ul {
  list-style: none;
  /* Color highlighting when pressed on mobile devices */
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  max-width: 1250px;
  margin-inline: 1.5rem;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--white-color);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  z-index: var(--z-fixed);
}

/*=============== NAV ===============*/
.nav {
  height: var(--header-height);
}

.nav__logo, 
.nav__burger, 
.nav__close {
  color: var(--black-color);
}

.nav__data {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;  
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  column-gap: .50rem;
  font-weight: var(--font-semi-bold);
  /* Color highlighting when pressed on mobile devices */
  -webkit-tap-highlight-color: transparent;
}

.nav__logo i {
  font-weight: initial;
  font-size: 1.25rem;
}

.nav__toggle {
  position: relative;
  width: 32px;
  height: 32px;
}

.nav__burger, 
.nav__close {
  position: absolute;
  width: max-content;
  height: max-content;
  inset: 0;
  margin: auto;
  font-size: 1.25rem;
  cursor: pointer;
  transition: opacity .1s, transform .4s;
}

.nav__close {
  opacity: 0;
}

/* Navigation for mobile devices */
@media screen and (max-width: 1118px) {
  .nav__menu {
    position: absolute;
    left: 0;
    top: 2.5rem;
    width: 100%;
    height: calc(100vh - 3.5rem);
    overflow: auto;
    pointer-events: none;
    opacity: 0;
    transition: top .4s, opacity .3s;
  }
  .nav__menu::-webkit-scrollbar {
    width: 0;
  }
  .nav__list {
    background-color: var(--white-color);
    padding-top: 1rem;
  }
}

.nav__link {
  color: var(--black-color);
  background-color: var(--white-color);
  font-weight: var(--font-semi-bold);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color .3s;
}

.nav__link:hover {
  background-color: var(--white-color-dark);
}

/* Show menu */
.show-menu {
  opacity: 1;
  top: 3.5rem;
  pointer-events: initial;
}

/* Show icon */
.show-icon .nav__burger {
  opacity: 0;
  transform: rotate(90deg);
}
.show-icon .nav__close {
  opacity: 1;
  transform: rotate(90deg);
}

/*=============== DROPDOWN ===============*/
.dropdown__item {
  cursor: pointer;
}

.dropdown__arrow {
  font-size: 1.25rem;
  font-weight: initial;
  transition: transform .4s;
}

.dropdown__link, 
.dropdown__sublink {
  padding: 1.25rem 1.25rem 1.25rem 2.5rem;
  color: var(--black-color);
  background-color: var(--white-color);
  display: flex;
  align-items: center;
  column-gap: .5rem;
  font-weight: var(--font-semi-bold);
  transition: background-color .3s;
}

.dropdown__link i, 
.dropdown__sublink i {
  font-size: 1.25rem;
  font-weight: initial;
}

.dropdown__link:hover, 
.dropdown__sublink:hover {
  background-color: var(--white-color-dark);
}

.dropdown__menu, 
.dropdown__submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease-out;
}

/* Show dropdown menu & submenu */
.dropdown__item:hover .dropdown__menu, 
.dropdown__subitem:hover > .dropdown__submenu {
  max-height: 1000px;
  transition: max-height .4s ease-in;
}

/* Rotate dropdown icon */
.dropdown__item:hover .dropdown__arrow {
  transform: rotate(180deg);
}

/*=============== DROPDOWN SUBMENU ===============*/
.dropdown__add {
  margin-left: auto;
}

.dropdown__sublink {
  background-color: var(--white-color);
}

/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 340px) {
  .section .container {
    margin-inline: 1rem;
  }

  .nav__link {
    padding-inline: 1rem;
  }
}

/* For large devices */
@media screen and (min-width: 1118px) {
  .section .container {
    margin-inline: auto;
  }

  .nav {
    height: calc(var(--header-height) + 2rem);
    display: flex;
    justify-content: space-between;
  }
  .nav__toggle {
    display: none;
  }
  .nav__list {
    height: 100%;
    display: flex;
    column-gap: 3rem;
  }
  .nav__link {
    height: 100%;
    padding: 0;
    justify-content: initial;
    column-gap: .25rem;
  }
  .nav__link:hover {
    background-color: transparent;
  }

  .dropdown__item, 
  .dropdown__subitem {
    position: relative;
  }

  .dropdown__menu, 
  .dropdown__submenu {
    max-height: initial;
    overflow: initial;
    position: absolute;
    left: 0;
    top: 6rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, top .3s;
  }

  .dropdown__link, 
  .dropdown__sublink {
    padding-inline: 1rem 3.5rem;
  }

  .dropdown__subitem .dropdown__link {
    padding-inline: 1rem;
  }

  .dropdown__submenu {
    position: absolute;
    left: 100%;
    top: .5rem;
  }

  /* Show dropdown menu */
  .dropdown__item:hover .dropdown__menu {
    opacity: 1;
    top: 5.5rem;
    pointer-events: initial;
    transition: top .3s;
  }

  /* Show dropdown submenu */
  .dropdown__subitem:hover > .dropdown__submenu {
    opacity: 1;
    top: 0;
    pointer-events: initial;
    transition: top .3s;
  }
}

/*=============== OUR IMPACT SECTION ===============*/
.our_impact_section {
  width: 100%;
  overflow: hidden; /* Prevents overflow from bg-elipse */
}

.our-impact {
  position: relative;
  padding: clamp(10rem, 8vw, 11.5rem) clamp(2rem, 10vw, 12.5rem) clamp(1rem, 5vw, 3.125rem) clamp(2rem, 10vw, 12.5rem);
}

.our-impact h2 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  color: var(--primary-green);
  margin-bottom: clamp(1rem, 3vw, 2.5rem);
  text-align: left;
}

.stats-row {
  display: flex;
  justify-content: space-between; /* Distributes items on larger screens */
  gap: clamp(0.5rem, 2vw, 1.5rem);
  text-align: center;
  margin-bottom: clamp(1.5rem, 5vw, 3.75rem);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left-align by default on larger screens */
  text-align: left;
  flex: 1;
  min-width: 150px;
}

.stat .overline {
  font-size: clamp(2rem, 10vw, 8rem);
  line-height: 0.9;
  margin-bottom: clamp(-3rem, -8vw, -5rem);
  color: var(--black-color);
}

.stat .number {
  font-size: clamp(1.5rem, 4vw, 4rem);
  font-weight: 500;
  color: var(--black-color);
  margin-bottom: clamp(-0.5rem, -1vw, -0.625rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .label {
  font-size: clamp(0.875rem, 2.5vw, 1.5rem);
  color: var(--black-color);
  text-transform: lowercase;
}


/*=============== SEARCH AND FILTER SECTION ===============*/
.section {
  padding: 30px 200px 50px 200px;
}

.section .container {
  max-width: 1250px;
  margin-left: auto;
  margin-right: auto;
}

.filters {
  box-sizing: border-box;
  width: 100%;
  min-width: 0px;
  max-width: 1100px;
  flex: 0 0 auto;
  margin-bottom: 2rem;
  background-color: var(--white-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
  min-width: 0;
}

.filter-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  box-sizing: border-box;
  gap: 1rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-green);
  margin-bottom: 0.25rem;
}

.filter-input {
  padding: 0.75rem;
  border: 1px solid var(--primary-green);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
}

.filter-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 2px rgba(0, 162, 138, 0.2);
}

/*=============== MEDIA QUERIES ===============*/
@media screen and (max-width: 1000px) {
  .our-impact {
    padding: clamp(1.5rem, 6vw, 6rem) clamp(1.5rem, 8vw, 9.375rem);
  }
  .stats-row {
    justify-content: center; /* Center items on medium screens */
    gap: clamp(1rem, 3vw, 2rem);
  }
  .stat {
    width: 45%; /* Two columns on medium screens */
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
  }
  .filter-content {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.75rem, 2vw, 1rem);
  }
}

@media screen and (max-width: 1250px) {
  .our-impact {
    padding: clamp(1rem, 5vw, 3rem) clamp(1rem, 5vw, 3rem);
  }
  .stats-row {
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.5rem);
  }
  .stat {
    width: 100%; /* Single column on small screens */
    align-items: center; /* Center content within stat */
    text-align: center;
  }
  .stat .overline {
    margin-bottom: clamp(-1.5rem, -6vw, -3.75rem);
  }
  .filter-content {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.6rem, 3vw, 1rem);
  }
}

@media screen and (max-width: 1024px) {
  .filter-content {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: clamp(0.5rem, 3vw, 1rem);
  }
  .stat .number {
    font-size: clamp(1.1rem, 4.5vw, 2rem);
  }
}

@media (max-width: 767px) {  /* Changed from min-width: 768px to max-width: 767px */
  .stats-row {
    flex-direction: column;
    gap: clamp(0.75rem, 3.5vw, 1.25rem);
  }
  .stat {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    align-items: center;
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .number {
    white-space: normal;
    text-overflow: clip;
  }
}

@media screen and (max-width: 480px) {
   .our_impact_section {
    padding-top: calc(var(--header-height) + 3vh);
  }
  .filters {
    justify-self: center;
    width: 90vw;
  }
  label.filter-label {
    font-size: 1rem;
  }
  .our-impact h2 {
    font-size: clamp(1.25rem, 7vw, 2rem);
    margin-bottom: clamp(0.75rem, 8vw, 3rem);
    text-align: center;
  }
  .stat .overline {
    font-size: clamp(1.5rem, 15vw, 4rem);
  }
  .stat .number {
    font-size: clamp(1.25rem, 12vw, 3rem);
  }
  .stat .label {
    margin-top: 0.4rem;
    font-size: clamp(0.75rem, 10vw, 1rem);
  }
}
  /*=============== PUBLICATIONS SECTION ===============*/
  .section {
    padding-inline: 101px;
  }
  .content_publications {
    margin-top: 100px;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
  }
  
  .publications_card_container {
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns per row */
    gap: 10px; /* Space between cards */
    width: 100%; /* Ensure it uses full available width */
  }
  
  .publications_card {
    list-style: none;
    height: 450px;
    width: 230px;
    border-radius: 10px;
    display: flex;
    padding-bottom: 15px;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .publications_card:hover {
    transform: translateY(-10px);
  }

  .publications_card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

  
  .publications_card img {
    width: 140px;
    height: 200px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
  
  .publications_card h2 {
    font-weight: 500;
    font-size: 16px;
    color: var(--primary-green);
    margin: 10px 0 5px;
    text-align: justify;
  }
  
  .publications_card h3 {
    font-weight: 400;
    font-size: 16px;
    color: var(--black-color);
    margin: 5px 0 5px;
    text-align: justify;
  }
  
  .publications_metrics {
    font-weight: 400;
    font-size: 16px;
    color: var(--gray);
    text-align: justify;
  }

  @media screen and (max-width: 480px) {
    .content_publications {
      width: 90vw;
      justify-self: center;
    }
    .publications_card_container {
      grid-template-columns: repeat(1, 1fr); 
      width: 150%;
      place-items: center;
    }

    .publications_card {
      margin: 30px 0;
      width: 100%;
      height: 250px;
    }

    .publications_card a {
      display: flex;
      flex-direction: column;
      flex: 0 0 50%;
      flex-wrap: wrap;
      width: inherit;
      height: inherit;
    }
    .publications_card img {
      margin: 0;  
      height: 90%;
      transform: scale(90%);
    }
    .publications_card h3, .publications_card h2{
      max-width: 50%;
    }
    .publications_card h3, .publications_metrics span {
      font-size: clamp(0.95rem, 2vw, 1.05rem);
    }
  }
  /* Pagination Styles */
  .pagination {
    display: flex;
    justify-content: center;
    padding-bottom: 3rem;
    padding-top: 4rem;
  }
  
  .pagination a {
    color: #004d40;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .pagination a.active {
    background-color: #004d40;
    color: white;
    border: 1px solid #004d40;
  }
  
  .pagination a:hover:not(.active) {
    background-color: #ddd;
  }
  
  .pagination a.disabled {
    color: #ccc;
    cursor: not-allowed;
  }

  @media screen and (max-width: 480px) {
    .pagination {
      width: 70vw;
      justify-self: center;
    }
  }

/*=============== CONTACT US ===============*/
.contact_us {
  width: 100%;
  background: linear-gradient(to bottom, #00796B, #05897A);
  color: var(--white-color);
  padding: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact_content {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.contact_content h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.contact_content h2 {
  font-size: 1.2rem;
  margin: 30px 50px;
  font-weight: 300;
}

.contact_content h3 {
  font-size: 1.2rem;
  margin: 10px 0;
  font-weight: 300;
}

.contact_content h3 strong {
  font-weight: 700;
}

.divider {
  width: 1000px;
  height: 1px;
  background: var(--white-color);
  border: none;
  margin: 40px auto;
}

.social_icons {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.social_icons a {
  color: var(--white-color);
  font-size: 2rem;
  transition: color 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
  .social_icons a:hover {
    color: var(--gray);
    transform: scale(1.1);
  }
}

.footer_nav {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.footer_nav a {
  color: var(--white-color);
  text-decoration: none;
  margin: 0 5px;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .footer_nav a:hover {
    color: var(--gray);
  }
}

.copyright {
  font-size: 0.8rem;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .partners_and_collaborators {
    padding: 20px 0;
    margin-bottom: 80px;
  }

  .partners_and_collaborators .title_header {
    margin-top: 2rem;
    padding: 1.5rem 0;
  }

  .partners_and_collaborators .highlight-header {
    width: clamp(100px, 25vw, 150px);
    margin: -1.5rem auto 1.5rem;
  }

  .logo-track img {
    height: 40px;
    margin: 0 10px;
  }

  .contact_us {
    padding: 40px 0;
    height: clamp(550px, 90vh, 600px);
  }

  .contact_content h1 {
    font-size: 1.5rem;
  }

  .contact_content h2 {
    font-size: 1rem;
    margin: 20px 30px;
  }

  .contact_content h3 {
    font-size: 1rem;
  }

  .divider {
    width: 100%;
  }

  .social_icons {
    gap: 20px;
  }

  .social_icons a {
    font-size: 1.3rem;
  }

  .footer_nav {
    font-size: 0.8rem;
  }

  .copyright {
    font-size: 0.7rem;
  }
}

@media screen and (min-width: 1251px) {
    
  /* 1. Push the 3rd column (Conference & Patents) to the Right */
  .stats-row .stat:last-child {
    align-items: flex-end;
    text-align: right;
  }

  /* 2. (Optional) Center the middle column so it doesn't touch the left side either */
  .stats-row .stat:nth-child(2) {
    align-items: center;
    text-align: center;
  }
}