/* ============================================
   A.B.C. Alma Mater — School theme (logo palette)
   Primary: Royal blue | Accents: orange, magenta, purple
   Fonts: Poppins, Inter
   ============================================ */

:root {
    --primary: #2e3192;
    --primary-dark: #1e2168;
    --accent: #f15a24;
    --accent-magenta: #ed1e79;
    --accent-purple: #92278f;
    --accent-teal: #17a2b8;
    --bg-light: #f4f6fb;
    --text-muted: #5c6570;
    --shadow: 0 4px 24px rgba(46, 49, 146, 0.1);
    --shadow-hover: 0 16px 40px rgba(46, 49, 146, 0.16);
    --transition: 0.3s ease;
    --radius: 0.875rem;
    --radius-lg: 1.25rem;
}

* {
  scroll-behavior: smooth;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: #212529;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.hero-title,
.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* ----- Header / Navbar ----- */
/* Navbar: always dark blue — never white */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 1030;
  background: var(--primary) !important;
  transition: box-shadow 0.35s ease, padding 0.35s ease;
  /* Desktop: clip horizontal bleed only (see mobile override — overflow hidden clips nav + dropdowns) */
  /*overflow-x: hidden;*/
  overflow-y: visible;
}

.site-header .navbar-collapse,
.site-header .navbar-nav {
  overflow: visible;
}

.site-header.scrolled {
  background: var(--primary-dark) !important;
  box-shadow: var(--shadow);
}

.site-header .navbar {
  padding: 0.75rem 0;
  background: transparent !important;
  transition: padding 0.35s ease;
 /* overflow-x: hidden;*/
  max-width: 100%;
}

.site-header.scrolled .navbar {
  padding: 0.5rem 0;
}

.site-header .navbar-nav .nav-link,
.site-header .navbar .navbar-brand {
  color: rgba(255, 255, 255, 0.95) !important;
}

.site-header .navbar-brand {
  word-break: normal;
  white-space: normal;
  text-align: left;
}

.site-header .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.site-header .navbar-toggler-icon {
  filter: brightness(0) invert(1);
}

.navbar-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.35rem;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 0.65rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.navbar-brand-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
}

@media (max-width: 575.98px) {
  .navbar-brand-logo {
    height: 44px;
    max-width: 44px;
  }

  .brand-text {
    font-size: 1.05rem;
    max-width: 11rem;
  }
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff !important;
}

.nav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 0.5rem 0.75rem !important;
  position: relative;
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff !important;
}

/* Underline uses ::after — same element Bootstrap uses for the dropdown caret, so exclude .dropdown-toggle */
.nav-link-underline:not(.dropdown-toggle)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease, left 0.25s ease;
}

.nav-link-underline:not(.dropdown-toggle):hover::after,
.nav-link-underline:not(.dropdown-toggle).active::after {
  width: 80%;
  left: 10%;
}

/* Dropdown: ensure nested ul is visible and not clipped */
.site-header .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-hover);
  border-radius: var(--radius);
  padding: 0.5rem;
  z-index: 1055;
  background: #fff;
  margin-top: 0.25rem;
}

.site-header .dropdown-item {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: #212529;
}

.site-header .dropdown-item:hover {
  background: rgba(46, 49, 146, 0.08);
  color: var(--primary);
}

.site-header .dropdown-toggle.nav-link::after {
  margin-left: 0.35em;
  vertical-align: 0.2em;
  border-top-color: rgba(255, 255, 255, 0.9);
}

.btn-cta {
  background: var(--accent) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241, 90, 36, 0.45);
  color: #fff !important;
}

/* ----- Hero ----- */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('/www.abcalmamater.com/slider/img1.jpg') center/cover no-repeat;
  opacity: 0.55;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(46, 49, 146, 0.82) 0%,
    rgba(30, 33, 104, 0.78) 45%,
    rgba(146, 39, 143, 0.35) 100%
  );
}

/* Fallback hero image (inline img) so image shows when path is valid */
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.5;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.btn-hero-cta {
  background: var(--accent) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(241, 90, 36, 0.5);
  color: #fff !important;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-down {
  display: inline-block;
  width: 28px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  position: relative;
}

.scroll-down span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: #fff;
  border-radius: 50%;
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(12px); }
}

/* ----- Main content ----- */
.main-content {
  padding-top: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.section-padding {
  padding: 4rem 0;
}

@media (min-width: 768px) {
  .section-padding { padding: 5rem 0; }
}

.section-title {
  color: var(--primary);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.page-hero {
  padding: 3.25rem 0;
  margin-top: 76px;
  position: relative;
  overflow: hidden;
}

.page-hero.bg-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, #3d2a7a 100%) !important;
}

.page-hero.bg-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(237, 30, 121, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(241, 90, 36, 0.12), transparent 50%);
  pointer-events: none;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

/* ----- Cards ----- */
.card-hover {
  transition: transform var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* Student-friendly: softer focus, bigger tap targets */
.btn-lg, .btn-cta, .btn-hero-cta {
  min-height: 44px;
}

@media (max-width: 991.98px) {
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
  }
}

.feature-icon {
  font-size: 2rem;
  line-height: 1;
}

/* ----- Home: school highlights ----- */
.school-highlights {
  background: linear-gradient(180deg, #fff 0%, var(--bg-light) 100%);
  border-bottom: 1px solid rgba(46, 49, 146, 0.08);
  margin-top: -1px;
}

.highlight-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.15rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(46, 49, 146, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.highlight-card-icon {
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
  line-height: 1;
}

.highlight-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.highlight-card-value {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  line-height: 1.35;
}

/* ----- Home: aims grid ----- */
.aims-section {
  background: linear-gradient(180deg, #fff 0%, #fafbff 50%, #fff 100%);
}

.aim-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem 1.5rem 1.5rem;
  border: 1px solid rgba(46, 49, 146, 0.08);
  box-shadow: 0 2px 16px rgba(46, 49, 146, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.aim-card:hover {
  border-color: rgba(241, 90, 36, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.aim-card-num {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-magenta), var(--accent-purple));
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  margin-bottom: 0.75rem;
}

.aim-card-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #3a4048;
}

/* ----- Home: events + notice board ----- */
.event-list-date {
  min-width: 4.5rem;
}

.notice-board {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 50%, #2a1f5c 100%);
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.notice-board-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(241, 90, 36, 0.35);
  animation: noticePulse 2.5s ease-in-out infinite;
}

@keyframes noticePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(241, 90, 36, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(241, 90, 36, 0.15); }
}

/* ----- Home: gallery preview ----- */
.home-gallery-preview {
  background: #fff;
}

.gallery-preview-tile {
  position: relative;
  aspect-ratio: 4 / 3;
}

.gallery-preview-img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-preview-tile:hover .gallery-preview-img {
  transform: scale(1.06);
}

.gallery-preview-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gallery-preview-tile:hover .gallery-preview-shine {
  opacity: 1;
}

/* ----- Home: CTA ----- */
.cta-banner {
  background: linear-gradient(120deg, var(--primary) 0%, #252973 40%, var(--accent-purple) 100%);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(241, 90, 36, 0.25) 0%, transparent 65%);
  pointer-events: none;
}

.cta-banner .container {
  position: relative;
  z-index: 1;
}

.cta-banner .section-title {
  color: #fff !important;
}

/* ----- Content body (HTML from JSON) ----- */
.content-body p {
  margin-bottom: 1rem;
}

.content-body p:last-child {
  margin-bottom: 0;
}

.content-body ul,
.content-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

/* ----- Buttons ----- */
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46, 49, 146, 0.35);
}

/* ----- Gallery ----- */
.gallery-item {
  position: relative;
  overflow: hidden;
}

.gallery-item .gallery-img {
  transition: transform 0.4s ease;
  object-fit: cover;
  min-height: 180px;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(46, 49, 146, 0.45), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* ----- Footer ----- */
.site-footer {
  background: linear-gradient(180deg, var(--primary-dark) 0%, #151838 100%);
  color: #fff;
  margin-top: auto;
}

.footer-brand {
  font-weight: 700;
  color: #fff;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

.social-link {
  display: inline-block;
  margin-right: 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: var(--accent);
}

.footer-map iframe {
  border: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ----- Scroll to top ----- */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
  z-index: 1020;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  color: #fff;
}

/* ----- AOS delay utilities ----- */
[data-aos] {
  pointer-events: auto;
}

/* ----- Form ----- */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(46, 49, 146, 0.2);
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
  /* Let the open menu and dropdowns paint outside — overflow hidden on header clips them */
  .site-header,
  .site-header .navbar {
    overflow: visible;
  }

  .site-header .navbar-collapse {
    padding: 0.75rem 0 1rem;
    flex-basis: 100%;
    width: 100%;
    max-height: min(75vh, calc(100vh - 5rem));
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
  }

  .site-header .navbar-collapse.collapsing {
    overflow: hidden;
  }

  .site-header .navbar-nav {
    width: 100%;
    margin-left: 0 !important;
    align-items: stretch !important;
    flex-direction: column;
  }

  .site-header .navbar-nav .nav-item {
    width: 100%;
  }

  .site-header .navbar-nav .nav-link {
    padding: 0.65rem 0 !important;
  }

  /* In-flow submenus on small screens (no clipping / off-screen Popper menus) */
  .site-header .navbar-nav .dropdown-menu {
    position: static !important;
    float: none;
    transform: none !important;
    inset: auto !important;
    margin: 0.25rem 0 0.5rem !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.98);
  }

  .site-header .navbar-nav .dropdown-menu[data-bs-popper] {
    top: auto;
    left: auto;
    right: auto;
    margin-top: 0.25rem;
  }

  .site-header .navbar-nav .nav-item.ms-lg-2 {
    margin-left: 0 !important;
    margin-top: 0.75rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .site-header .navbar-nav .btn-cta {
    width: 100%;
    text-align: center;
  }

  .nav-link-underline:not(.dropdown-toggle)::after {
    display: none;
  }

  .page-hero {
    margin-top: 66px;
  }

  .scroll-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
}
