@media (min-width: 992px) {
  .navbar .dropdown:hover > .dropdown-menu,
  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
    animation: dropdownFade 0.18s ease both;
  }

  @keyframes dropdownFade {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1199.98px) {
  .navbar .nav-link {
    padding-right: 0.38rem; /* Scaled down vertical/horizontal space */
    padding-left: 0.38rem;
    font-size: 0.72rem; /* Compact tablet font size */
  }

  .school-title {
    font-size: 2.15rem;
  }
}

@media (max-width: 991.98px) {
  .top-strip .container,
  .site-header .container {
    max-width: 100%;
  }

  .site-header .header-actions {
    margin-top: 1rem;
    justify-content: flex-start;
    max-width: none;
  }

  .navbar-collapse {
    max-height: 78vh;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  .navbar .nav-link {
    padding: 0.8rem 0;
    font-size: 0.92rem;
  }

  .dropdown-menu {
    padding-left: 0.75rem;
    background: #9e1c25; /* Dark red matching red navigation header */
    box-shadow: none;
  }

  .dropdown-item {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .dropdown-submenu > .dropdown-menu {
    position: static;
    margin-left: 0;
  }

  .dropdown-submenu > .dropdown-item::after {
    content: "";
  }

  .hero-carousel .carousel-item {
    min-height: 320px;
  }

  .hero-content {
    padding: 2.5rem 0;
  }

  .portal-sidebar,
  .portal-shell {
    min-height: auto;
  }
}

@media (max-width: 767.98px) {
  .top-strip {
    font-size: 0.78rem;
  }

  .school-logo {
    width: 72px;
    height: 72px;
    font-size: 1rem;
  }

  .school-title {
    font-size: 1.55rem;
  }

  .school-subtitle {
    font-size: 0.82rem;
  }

  .school-motto {
    font-size: 0.82rem;
  }

  .quick-action-strip .container {
    overflow-x: auto;
  }

  .notice-ticker {
    display: block;
  }

  .notice-label {
    justify-content: center;
  }

  .hero-carousel .carousel-item {
    min-height: 260px;
  }

  .hero-content {
    padding: 1.8rem 0;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section-padding {
    padding: 8px 0; /* Compact mobile padding */
  }

  .section-padding-sm {
    padding: 4px 0; /* Compact mobile padding */
  }

  .page-hero {
    padding: 16px 0;
  }

  .gallery-item img,
  .teacher-photo {
    height: 220px;
  }

  .counter-number {
    font-size: 2.25rem;
  }

  .topper-card {
    grid-template-columns: 104px 1fr;
    width: 330px;
    flex-basis: 330px;
  }

  .topper-photo {
    width: 104px;
    min-height: 162px;
  }

  .topper-details {
    padding: 15px;
  }

  .topper-details strong {
    font-size: 1.65rem;
  }
}

@media (max-width: 575.98px) {
  .hero-title,
  .page-title {
    font-size: 2.05rem;
  }

  .level-panel,
  .info-card {
    padding: 22px;
  }

  .message-card {
    padding: 16px 20px;
  }

  .date-box {
    width: 48px;
    min-width: 48px;
    height: 52px;
  }
}
