/* Shared responsive improvements for all pages */
html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

body {
  overflow-y: auto !important;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

.footer,
.footer-btm {
  width: 100%;
  flex-shrink: 0;
}

/* Ensure active menu item is visually highlighted on every page */
header .navbar-collapse .navbar-nav > .active > a,
header .navbar-collapse .navbar-nav > .active > a:hover,
header .navbar-collapse .navbar-nav > .active > a:focus,
header .navbar-collapse .navbar-nav > .open > a,
header .navbar-collapse .navbar-nav > .open > a:hover,
header .navbar-collapse .navbar-nav > .open > a:focus {
  background: #1a2f5b;
  color: #fff;
}

header .navbar-collapse .dropdown-menu > .active > a,
header .navbar-collapse .dropdown-menu > .active > a:hover,
header .navbar-collapse .dropdown-menu > .active > a:focus {
  background: #1a2f5b;
  color: #fff;
}

img,
video {
  max-width: 100%;
  height: auto;
}

main .container {
  padding-top: 24px;
  padding-bottom: 24px;
}

.panel {
  margin-bottom: 18px;
}

.panel .panel-body h2 {
  margin-top: 0;
}

.accordion-btn {
  margin-bottom: 12px;
}

.accordion-panel p:last-child {
  margin-bottom: 0;
}

.faq-list .accordion-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  white-space: normal;
  position: relative;
  padding-right: 34px;
}

.faq-list .accordion-btn::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.faq-list .accordion-btn[aria-expanded="true"]::after {
  content: "-";
}

.faq-list .accordion-panel {
  margin-bottom: 12px;
}

.infrastructure-page main {
  background: linear-gradient(180deg, #fff8ee 0%, #eef6ff 100%);
}

.infrastructure-page .infra-faq {
  border-radius: 10px;
}

.infrastructure-page .infra-intro {
  background: #fff;
  border-left: 4px solid #fe8100;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 600;
}

.infrastructure-page .faq-list .accordion-btn {
  background: linear-gradient(90deg, #fe8100 0%, #ffab43 100%);
  color: #fff;
  border-color: #d86c00;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.infrastructure-page .faq-list .accordion-btn:hover,
.infrastructure-page .faq-list .accordion-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  color: #fff;
}

.infrastructure-page .faq-list .accordion-btn[aria-expanded="true"] {
  background: linear-gradient(90deg, #1a2f5b 0%, #294c94 100%);
  border-color: #1a2f5b;
}

.infrastructure-page .faq-list .accordion-panel {
  border-radius: 8px;
  border: 1px solid #d7e7fb;
  background: #ffffff;
}

.infrastructure-page .faq-list .accordion-panel.open {
  animation: infraFaqFade 0.35s ease;
}

.infrastructure-page .faq-list .accordion-panel .img-thumbnail {
  margin-bottom: 12px;
  border-radius: 8px;
}

.infrastructure-page .infra-lab-card .img-thumbnail {
  width: 100%;
  height: 170px;
  object-fit: cover;
  margin-bottom: 10px;
}

.activities-page .activity-card .img-thumbnail {
  width: 100%;
  height: 170px;
  object-fit: cover;
  margin-bottom: 10px;
}

.gallery-page .gallery-card {
  background: #fff;
  border: 1px solid #dfe9f8;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 6px 16px rgba(26, 47, 91, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-page .gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 22px rgba(26, 47, 91, 0.16);
}

.gallery-page .gallery-card .img-thumbnail {
  width: 100%;
  height: 190px;
  object-fit: cover;
  margin-bottom: 8px;
  border-radius: 8px;
}

.gallery-page .gallery-card p {
  margin: 0;
  text-align: center;
  font-weight: 600;
  color: #1a2f5b;
}

.admission-page main {
  background: linear-gradient(180deg, #fff8ee 0%, #eef6ff 100%);
}

.admission-page .admission-card {
  border-radius: 10px;
  border: 1px solid #d8e8fb;
  box-shadow: 0 8px 18px rgba(26, 47, 91, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admission-page .admission-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(26, 47, 91, 0.15);
}

.admission-page .admission-card .img-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin: 4px 0 14px;
}

.admission-page .admission-media {
  display: flex;
  align-items: flex-start;
}

.admission-page .admission-media-left .img-thumbnail {
  width: 100%;
  max-width: 260px;
  height: 160px;
  object-fit: cover;
  margin: 0;
}

.admission-page .admission-media-right h2 {
  margin-top: 0;
}

.about-page .about-stats-wrap {
  overflow: hidden;
  border: 0;
  background: radial-gradient(circle at 10% 20%, #fff4e5 0%, #f8fbff 55%, #eef5ff 100%);
}

.about-page .about-stats-grid {
  margin-top: 4px;
}

.about-page .about-stat-card {
  height: 100%;
  min-height: 150px;
  border-radius: 14px;
  padding: 20px 14px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f9ff 100%);
  border: 1px solid #d8e8fb;
  box-shadow: 0 8px 20px rgba(26, 47, 91, 0.08);
  position: relative;
  transform: translateY(12px);
  opacity: 0;
  animation: aboutStatReveal 0.7s ease forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.about-page .about-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 5px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #fe8100 0%, #ffb14a 45%, #2d5fab 100%);
}

.about-page .about-stat-card h3 {
  margin: 10px 0 8px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #1a2f5b;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.about-page .about-stat-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #415d92;
}

.about-page .about-stat-card:hover {
  transform: translateY(-4px);
  border-color: #aacdf7;
  box-shadow: 0 14px 26px rgba(26, 47, 91, 0.16);
}

.about-page .about-stats-grid > div:nth-child(1) .about-stat-card {
  animation-delay: 0.06s;
}

.about-page .about-stats-grid > div:nth-child(2) .about-stat-card {
  animation-delay: 0.14s;
}

.about-page .about-stats-grid > div:nth-child(3) .about-stat-card {
  animation-delay: 0.22s;
}

.about-page .about-stats-grid > div:nth-child(4) .about-stat-card {
  animation-delay: 0.3s;
}

@keyframes aboutStatReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes infraFaqFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Keep dropdowns usable on touch devices */
@media (max-width: 991px) {
  .navbar-nav .open .dropdown-menu {
    background: #fe8100;
  }

  .navbar-nav .open .dropdown-menu > li > a {
    color: #fff;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .navbar-nav .open .dropdown-menu > li > a:hover,
  .navbar-nav .open .dropdown-menu > li > a:focus {
    background: #1a2f5b;
    color: #fff;
  }
}

/* Better mobile typography/spacing for homepage and all sections */
@media (max-width: 767px) {
  .banner {
    padding: 8px;
    margin: 10px 0;
  }

  .banner .home-slider .carousel-caption {
    right: 0;
    padding: 10px;
  }

  .banner .home-slider .carousel-caption h1 {
    font-size: 14px;
    line-height: 1.35;
  }

  .banner .news-container h1 {
    font-size: 18px;
  }

  .banner .news-container .news-list-container h2 {
    font-size: 18px;
  }

  .home-content-container .welcome-content h1 {
    font-size: 22px;
  }

  .home-content-container .welcome-content p {
    font-size: 15px;
    line-height: 1.65;
  }

  .about-container .bordered {
    border-left: 0;
    border-right: 0;
  }

  .widget-panel .widget-panel-container ul li {
    margin-bottom: 8px;
  }

  .about-page .about-stat-card {
    min-height: 128px;
    padding: 16px 10px;
  }

  .admission-page .admission-media {
    display: block;
  }

  .admission-page .admission-media-left .img-thumbnail {
    max-width: 100%;
    height: 190px;
    margin-bottom: 12px;
  }

  .about-page .about-stat-card h3 {
    font-size: 28px;
  }

  .about-page .about-stat-card p {
    font-size: 12px;
    letter-spacing: 0.4px;
  }

  main .container {
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

/* Improve readability on medium screens */
@media (min-width: 768px) and (max-width: 991px) {
  .banner .home-slider .carousel-caption h1 {
    font-size: 17px;
  }

  .home-content-container .welcome-content p {
    font-size: 15px;
  }
}
