@font-face {
  font-family: gbnFont;
  src: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/fonts/gbnFont.woff2);
  font-display: swap;
}
@font-face {
  font-family: florensa;
  src: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/fonts/florensa.ttf);
  font-display: swap;
}
@font-face {
  font-family: kanit;
  src: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/fonts/kanit.woff2);
  font-display: swap;
}
@font-face {
  font-family: outfit;
  src: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/fonts/outfit.woff2);
  font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,500;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Math&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
  cursor: url(/cursors/pointer.cur), auto;
}

a {
  text-decoration: none;
  color: inherit;
}

iframe {
  width: 100%;
  height: 100vh;
  border: none;
}

i {
  overflow: auto;
}

::selection {
  background-color: rgba(0, 0, 0, 0.5);
}

.preloader {
  background: rgba(56, 56, 61, 1) no-repeat center center;
  background-size: 18%;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 100;
}

.preloaderHolder {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 100vw;
}

.bgimgMain {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/main.avif) no-repeat center center;
  /*background-color: rgba(56, 56, 61, 1);*/
  background-size: cover;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -100;
}

.bgimgSub {
  /*background: url(Desktop06.png) no-repeat center center;
  background-color: rgba(56, 56, 61, 1);*/
  background-size: cover;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -100;
}
.bgimg-bio {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/bio.avif) no-repeat center center;
}
.bgimg-chem {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/chem.avif) no-repeat center center;
}
.bgimg-hm {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/hm.avif) no-repeat center center;
}
.bgimg-ict {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/ict.avif) no-repeat center center;
}
.bgimg-phy {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/phy.avif) no-repeat center center;
}
.bgimg-info {
  background: url(https://cdn.jsdelivr.net/gh/ifgglobal/practicals@main/bgImage/info.avif) no-repeat center center;
}

.header {
  padding: 1.5rem;
  text-align: center;
}

.mainID {
  font-family: kanit, sans-serif;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: 0.1rem;
  color: white;
}

.main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  list-style: none;
  width: 100%;
  justify-content: center;
  align-items: stretch; /* Ensure all cards match tallest height */
}

.cards_item {
  transition: transform 0.3s ease;
}

.cards_item:hover {
  transform: translateY(-5px);
}

/* Two-column layout with centered fifth card */
@media (min-width: 600px) and (max-width: 950px) {
  .cards {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  } /* this comments the code for the hacky fix on grid tablet
  .cards_item:nth-child(5) {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
  }
  .cards_item:nth-child(5) .card {
    width: 100%;
    max-width: calc(50% - 1.5rem / 2);
  } */
}

/* Three-column layout for wide screens */
@media (min-width: 951px) {
  .cards {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
  } /* this comments the code for the hacky fix on grid desktop
  .cards_item:nth-child(4) {
    grid-column: 1 / 2;
  }
  .cards_item:nth-child(5) {
    grid-column: 3 / 3;
  }
  .cards_item:nth-child(4) {
    transform: translateX(33.3333333333%);
  }
  .cards_item:nth-child(5) {
    transform: translateX(-33.3333333333%);
  } */
  .cards_item:nth-child(4) .card, .cards_item:nth-child(5) .card {
    width: 100%;
  }
}
.card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: block;
  height: 100%;
}

.card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}

.cardBody {
  min-height: 280px; /* Allow growth beyond 280px */
  height: auto; /* Let content determine height */
  max-height: 400px; /* Prevent excessive growth */
  overflow-y: auto; /* Scroll if text overflows */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  scrollbar-width: thin; /* Styled scrollbar for Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2);
  cursor: url(/cursors/select.cur), auto;
}

.cardBody::-webkit-scrollbar {
  width: 6px; /* Styled scrollbar for Chrome/Safari */
}

.cardBody::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

.cardIcon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.card:hover .cardIcon {
  transform: scale(1.1);
}

.subjectID {
  font-family: florensa, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: 0.05rem;
  color: white;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  white-space: normal; /* Allow text wrapping */
  max-width: 100%; /* Stay within container */
}

.cardSubtitle {
  font-family: outfit, sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: white;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  max-width: 100%; /* Stay within container */
}

.card:hover .cardSubtitle {
  opacity: 1;
}

.footer {
  padding: 1rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.1);
  width: 100%;
}

.footID {
  font-family: outfit, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05rem;
  color: white;
  margin: 0.5rem 0;
}


@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cardBody {
    min-height: 220px; /* Allow growth beyond 220px */
    max-height: 320px;
    padding: 0.75rem;
    font-size: clamp(1.2rem, 3vw, 1.5rem); /* Smaller .subjectID */
  }
  .subjectID {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
  }
  .cardSubtitle {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  }
  .main {
    padding: 1.5rem 0.5rem;
  }
  .subjectID {
    font-size: 2.2rem; /* mobile small card name fix */
  }
  .cardSubtitle {
    font-size: 1rem;
  }
  .mainID {
    font-size: 2.8rem; /* mobile small header name fix */
  }
}

.sitesUL {
  list-style: none;
  display: grid;
  justify-content: space-evenly;
  flex-direction: row;
  flex-wrap: wrap;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
  justify-content: center;
  align-items: stretch; /* Ensure all cards match tallest height */
}

.sites {
  font-family: Montserrat, gbnFont, "Noto Sans Math", sans-serif;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  place-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-align: center;
  /*min-height: 120px; Allow growth beyond 120px */
  height: auto; /* Let content determine height */
  max-height: 300px; /* Prevent excessive growth */
  white-space: normal; /* Allow text wrapping */
  overflow: hidden; /* Scroll if text overflows */
  /*scrollbar-width: thin;  Styled scrollbar for Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2);
  cursor: url(/cursors/select.cur), auto;
}

.sites:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}

.sites::-webkit-scrollbar {
  width: 6px; /* Styled scrollbar for Chrome/Safari */
}

.sites::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

/* Responsive styles for sitesUL */
@media (max-width: 600px) {
  .sitesUL {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .sites {
    /* font-size: clamp(1rem, 2vw, 1.2rem); Smaller font to reduce height */
    /* min-height: 100px;  Allow growth beyond 100px */
    
    padding: 0.75rem;
  }
}

@media (min-width: 600px) and (max-width: 950px) {
  .sitesUL {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  } /*
  .sites {
    min-height: 110px;  Allow growth beyond 110px
    
  } */
}

@media (min-width: 951px) {
  .sitesUL {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
  }
  .divider {
    font-size: clamp(1rem, 2vw, 1.2rem);
  }
}

.divider {
  font-family: outfit, gbnFont, sans-serif;
  font-size: clamp(2rem, 4vw, 2.5rem);
  text-align: center;
  color: white;
  width: 100%;
  height: 50px;
  overflow: hidden;
}

.inactiveClassA {
  pointer-events: none;
  cursor: default;
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
  flex: 0 0 100%;
}

.hideall {
  display: none;
}

.fax-col1 {
  color: white;
  margin-bottom: 4px;
  overflow: hidden;
}
.fax-col2 {
  color: white;
  overflow: hidden;
}
