/* Shared layout safeguards for the public pages and the admin screens. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

img,
video {
  height: auto;
}

table {
  max-width: 100%;
}

pre,
code,
textarea,
input,
select,
button {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
th,
td {
  overflow-wrap: anywhere;
}

.container,
.container-fluid,
.row,
[class*="col-"] {
  min-width: 0;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.image-placeholder {
  min-height: 14rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.5rem;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(255, 230, 0, 0.13), transparent 48%), linear-gradient(145deg, #0b5131, #052719 74%);
  border-radius: 0.75rem;
}

.image-placeholder i {
  color: #ffe600;
  font-size: 2.4rem;
}

.image-placeholder span {
  font-size: 0.82rem;
}

@media (max-width: 1199.98px) {
  .navbar .navbar-brand {
    min-width: 0;
    white-space: normal;
  }

  .navbar .navbar-nav {
    gap: 0.15rem;
  }

  .navbar .nav-link {
    padding-inline: 0.55rem;
  }
}

@media (min-width: 1200px) {
  .navbar.navbar-expand-xl {
    padding-block: 0.35rem !important;
  }

  .navbar.navbar-expand-xl > .container-fluid {
    flex-wrap: nowrap !important;
    gap: 0.5rem;
  }

  .navbar.navbar-expand-xl .brand-wrapper {
    flex: 0 1 34%;
    max-width: 34%;
    min-width: 0;
    margin-right: 0.25rem !important;
  }

  .navbar.navbar-expand-xl .logo-img {
    height: 3.35rem;
    max-width: 3.35rem;
  }

  .navbar.navbar-expand-xl .main-title {
    font-size: clamp(1.12rem, 1.38vw, 1.45rem);
    line-height: 1.05;
  }

  .navbar.navbar-expand-xl .sub-title {
    font-size: clamp(0.72rem, 0.86vw, 0.9rem);
    line-height: 1.1;
  }

  .navbar.navbar-expand-xl .navbar-collapse {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar.navbar-expand-xl .navbar-nav {
    flex-wrap: nowrap;
    gap: 0;
  }

  .navbar.navbar-expand-xl .nav-item {
    flex: 0 0 auto;
  }

  .navbar.navbar-expand-xl .nav-link {
    padding-inline: clamp(0.22rem, 0.36vw, 0.4rem) !important;
    font-size: clamp(0.72rem, 0.95vw, 1rem) !important;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.2;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 0.96rem;
  }

  .container,
  .container-fluid {
    padding-inline: 1rem;
  }

  .navbar {
    padding-inline: 0.75rem !important;
  }

  .navbar .navbar-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 3.5rem);
    font-size: clamp(1rem, 4.5vw, 1.45rem) !important;
    line-height: 1.15;
  }

  .navbar .navbar-brand img,
  .navbar .logo-img {
    flex: 0 0 auto;
    max-width: 3.25rem;
    max-height: 3.25rem;
    object-fit: contain;
  }

  .navbar .navbar-toggler {
    flex: 0 0 auto;
    padding: 0.35rem 0.55rem;
  }

  .navbar .navbar-collapse {
    flex-basis: 100%;
    width: 100%;
    max-height: min(70vh, 34rem);
    overflow-y: auto;
  }

  .navbar .navbar-nav {
    align-items: stretch;
  }

  .navbar .nav-link {
    padding: 0.65rem 0.5rem;
  }

  .dropdown-menu {
    max-width: 100%;
  }

  .table:not(.dataTable) {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .card,
  .modal-content,
  .login-box,
  .login-container,
  .form-container {
    max-width: 100%;
  }

  #bot-toggle-btn {
    right: 1rem !important;
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    width: 3.5rem !important;
    height: 3.5rem !important;
  }

  footer {
    padding-inline: 1rem;
  }
}

@media (max-width: 575.98px) {
  .container,
  .container-fluid {
    padding-inline: 0.8rem;
  }

  h1 {
    font-size: clamp(1.65rem, 8vw, 2.4rem);
    line-height: 1.12;
  }

  h2 {
    font-size: clamp(1.35rem, 6.5vw, 2rem);
    line-height: 1.18;
  }

  .btn,
  button {
    min-height: 2.65rem;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Homepage hero: keep the welcome message and calls to action inside the screen. */
@media (max-width: 1199.98px) {
  #greeting-line1 {
    font-size: clamp(1.1rem, 2.8vw, 2.25rem) !important;
    line-height: 1.15;
  }

  #greeting-line2 {
    font-size: clamp(1.7rem, 4.6vw, 3.65rem) !important;
    line-height: 1.08;
  }

  .brand-wrapper {
    max-width: min(72vw, 40rem);
  }
}

@media (max-width: 767.98px) {
  #greeting-line1 {
    font-size: clamp(1rem, 5vw, 1.55rem) !important;
  }

  #greeting-line2 {
    font-size: clamp(1.65rem, 8vw, 2.7rem) !important;
    padding-inline: 0.25rem;
  }

  header.text-center {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    padding: 4.5rem 1rem !important;
  }

  header.text-center > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  header.text-center #greeting-line1,
  header.text-center #greeting-line2 {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .motto-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 2rem 0 1.25rem;
    padding-inline: 0.25rem;
  }

  .motto-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 1rem 1.1rem;
  }

  .glow-motto {
    display: block;
    width: auto !important;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: clamp(1rem, 4.5vw, 1.4rem);
    line-height: 1.4;
    animation: none;
    border: 0;
  }

  .enroll-container {
    width: 100%;
    max-width: 23rem;
    min-width: 0;
    margin-inline: auto;
    gap: 0.75rem;
  }

  .enroll-btn {
    justify-content: center;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.98rem;
  }

  .about-section {
    padding: 3.5rem 1rem;
  }

  .building-img {
    height: clamp(12rem, 62vw, 17rem);
  }
}

/* Enrollment page: keep its legacy navbar and hero clear at every viewport. */
.enrollment-procedures-page .navbar {
  padding-inline: 0.85rem !important;
}

.enrollment-procedures-page .navbar-brand {
  min-width: 0;
  white-space: normal;
}

.enrollment-procedures-page .navbar-brand img {
  flex: 0 0 auto;
  width: 3.75rem !important;
  height: 3.75rem !important;
  max-width: 3.75rem;
  object-fit: contain;
}

.enrollment-procedures-page .main-title {
  font-size: clamp(1.12rem, 1.45vw, 1.65rem) !important;
  line-height: 1.05;
}

.enrollment-procedures-page .sub-title {
  margin-top: 0.2rem;
  font-size: clamp(0.72rem, 0.88vw, 0.96rem) !important;
  line-height: 1.1;
  text-align: left;
}

.enrollment-procedures-page .announcement-ticker {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: 0.25rem 0 !important;
  overflow: hidden;
}

.enrollment-procedures-page .announcement-ticker marquee {
  line-height: 1.4;
  font-size: 0.95rem !important;
}

.enrollment-procedures-page .home-hero {
  display: grid;
  place-items: center;
  min-height: clamp(25rem, 58vh, 39rem);
  padding: clamp(4rem, 8vh, 7rem) 1.25rem !important;
}

.enrollment-procedures-page .home-hero-content {
  width: min(100%, 88rem);
  margin-inline: auto;
}

.enrollment-procedures-page #greeting-line1,
.enrollment-procedures-page #greeting-line2 {
  width: 100%;
  margin: 0 auto 0.65rem;
  padding-inline: 0.35rem;
  line-height: 1.08;
  overflow-wrap: normal;
  text-wrap: balance;
}

.enrollment-procedures-page #greeting-line1 {
  max-width: 72rem;
  font-size: clamp(1.55rem, 2.75vw, 2.8rem) !important;
}

.enrollment-procedures-page #greeting-line2 {
  max-width: 84rem;
  font-size: clamp(2rem, 3.7vw, 3.5rem) !important;
}

.enrollment-procedures-page .glowing-text {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  line-height: 1.4;
}

@media (min-width: 1400px) {
  .enrollment-procedures-page .navbar-expand-xxl > .container-fluid {
    flex-wrap: nowrap;
    gap: 0.65rem;
  }

  .enrollment-procedures-page .navbar-expand-xxl .navbar-brand {
    flex: 0 1 39%;
    max-width: 39%;
    margin-right: 0 !important;
  }

  .enrollment-procedures-page .navbar-expand-xxl .navbar-collapse {
    flex: 1 1 auto;
    min-width: 0;
  }

  .enrollment-procedures-page .navbar-expand-xxl .navbar-nav {
    flex-wrap: nowrap;
    gap: 0;
  }

  .enrollment-procedures-page .navbar-expand-xxl .nav-item {
    flex: 0 0 auto;
  }

  .enrollment-procedures-page .navbar-expand-xxl .nav-link {
    padding-inline: clamp(0.22rem, 0.32vw, 0.42rem) !important;
    font-size: clamp(0.72rem, 0.82vw, 0.88rem) !important;
    line-height: 1.2;
    white-space: nowrap;
  }

  .enrollment-procedures-page .navbar-expand-xxl .nav-item .btn {
    padding-inline: 0.75rem !important;
    font-size: 0.82rem;
    white-space: nowrap;
  }
}

@media (max-width: 1399.98px) {
  .enrollment-procedures-page .navbar-expand-xxl .navbar-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 4rem);
  }

  .enrollment-procedures-page .navbar-expand-xxl .navbar-collapse {
    flex-basis: 100%;
    width: 100%;
    max-height: min(70vh, 34rem);
    overflow-y: auto;
  }

  .enrollment-procedures-page .navbar-expand-xxl .navbar-nav {
    align-items: stretch;
    padding-top: 0.75rem;
  }

  .enrollment-procedures-page .navbar-expand-xxl .nav-link {
    padding: 0.65rem 0.5rem !important;
  }
}

@media (max-width: 767.98px) {
  .enrollment-procedures-page .navbar-brand {
    flex-direction: row !important;
    align-items: center;
    max-width: calc(100% - 4rem);
  }

  .enrollment-procedures-page .navbar-brand img {
    width: 3rem !important;
    height: 3rem !important;
    margin: 0 0.5rem 0 0 !important;
  }

  .enrollment-procedures-page .main-title {
    font-size: clamp(0.95rem, 3.6vw, 1.25rem) !important;
  }

  .enrollment-procedures-page .sub-title {
    font-size: clamp(0.66rem, 2.7vw, 0.82rem) !important;
  }

  .enrollment-procedures-page .home-hero {
    min-height: 0;
    padding: 4rem 0.85rem !important;
  }

  .enrollment-procedures-page #greeting-line1 {
    font-size: clamp(1.25rem, 5.5vw, 1.8rem) !important;
  }

  .enrollment-procedures-page #greeting-line2 {
    font-size: clamp(1.7rem, 7.5vw, 2.6rem) !important;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
