/* Mobile/tablet performance and overflow safeguards. */
@media (max-width: 820px), (pointer: coarse) {
  html, body {
    scroll-behavior: auto !important;
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
  }
  body {
    background-attachment: scroll !important;
  }
  #particles-canvas { display: none !important; }
  body::before { display: none !important; }
  .glass-ambience .light-orb {
    animation: none !important;
    filter: none !important;
    opacity: .10 !important;
  }
  .shape, .orbit-ring, .orbit-chip, .banner-visual::before, .banner-visual::after,
  .banner-visual-core, .hero-scroll-cue, .cursor-halo {
    animation: none !important;
  }
  .header, .header.scrolled, .nav-menu, .mobile-bottom-nav,
  .chatbot-container, .theme-toggle, .early-bird-content {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .stories-gallery-section { overflow: clip; }
  .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  body { padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important; }
  /* Keep the floating WhatsApp action visible above TEC BOT on touch/mobile screens. */
  .chatbot-widget {
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    right: 12px !important;
    z-index: 9997 !important;
  }
  .whatsapp-float {
    display: flex !important;
    position: fixed !important;
    width: 56px !important;
    height: 56px !important;
    right: 12px !important;
    bottom: calc(76px + 60px + 14px + env(safe-area-inset-bottom)) !important;
    z-index: 9996 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  [data-story-gallery] .story-gallery-card { transform: none; }
  [data-story-gallery] .story-gallery-card:active { transform: scale(.985); }
  [data-story-gallery] .story-img-wrap img { transition: none !important; }
  .hero-banner, .hero-home { background-attachment: scroll !important; }
}
@media (max-width: 1024px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .contact-grid > * { min-width: 0; }
}
@media (max-width: 768px) {
  .admissions-form-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px !important;
  }
  .admissions-form-layout > * { min-width: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .footer-grid > * { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .newsletter-container { min-width: 0; max-width: 100%; }
  .newsletter-form { width: 100%; max-width: 100%; min-width: 0; align-items: stretch; }
  .newsletter-form input { min-width: 0 !important; width: 100%; max-width: 100%; }
  .newsletter-form button { width: 100%; max-width: 100%; }
}
@media (max-width: 420px) {
  .container { width: min(100% - 28px, 100%) !important; }
  .hero-banner .container { padding-left: 16px !important; padding-right: 16px !important; }
  .stories-gallery-cta .btn { width: min(100%, 280px); }
}

/* Extra protection for very narrow phones (320px and similar). */
@media (max-width: 360px) {
  .before-after-section .section-title {
    font-size: 1.45rem !important;
    line-height: 1.2 !important;
    padding-inline: 0 !important;
    overflow-wrap: anywhere;
  }
  .before-after-section .section-title span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .ux-course-explorer {
    min-width: 0;
    padding: 18px !important;
  }
  .ux-explorer-heading,
  .ux-explorer-heading > * {
    min-width: 0;
    max-width: 100%;
  }
  .ux-explorer-heading h2 {
    font-size: 1.5rem !important;
    overflow-wrap: anywhere;
  }
  .ux-explorer-heading .ux-text-link {
    display: inline-flex;
    flex-wrap: wrap;
    white-space: normal;
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .contact-info-card,
  .contact-info-item,
  .contact-info-item > div {
    min-width: 0;
    max-width: 100%;
  }
  .contact-info-item p,
  .contact-info-item a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .chatbot-input-area {
    min-width: 0;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }
  .chatbot-input-area .chatbot-input {
    min-width: 0 !important;
    width: 0 !important;
    flex: 1 1 0 !important;
  }
}
.whatsapp-float-icon {
  display: block;
  width: 24px;
  height: 27.43px;
  flex: 0 0 24px;
  color: currentColor;
  fill: currentColor;
  overflow: visible;
}

@media (max-width: 480px) {
  .chatbot-widget {
    right: 12px !important;
  }
  .chatbot-widget .chatbot-container {
    left: auto !important;
    right: 0 !important;
    width: min(380px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    height: min(500px, calc(100vh - 190px)) !important;
    max-height: calc(100vh - 190px) !important;
    box-sizing: border-box !important;
  }
}


/* Contact banner: keep both actions compact, aligned and on one line. */
.banner-contact .hero-banner-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100%;
  min-width: 0;
}
.banner-contact .hero-banner-buttons > .contact-hero-action {
  display: inline-flex !important;
  flex: 0 1 auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 22px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  font-size: .92rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-align: center !important;
  overflow: hidden !important;
}
.banner-contact .hero-banner-buttons .contact-action-icon {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}
/* Match the footer WhatsApp glyph to the inherited color used by sibling social icons. */
.footer-social a[href^="https://wa.me/"] .whatsapp-float-icon {
  color: inherit !important;
}
@media (max-width: 768px) {
  .banner-contact .hero-banner-buttons { gap: 10px !important; }
  .banner-contact .hero-banner-buttons > .contact-hero-action {
    min-height: 42px !important;
    height: 42px !important;
    padding-inline: 16px !important;
    font-size: .88rem !important;
  }
}
@media (max-width: 420px) {
  .banner-contact .hero-banner-buttons { gap: 8px !important; }
  .banner-contact .hero-banner-buttons > .contact-hero-action {
    min-height: 40px !important;
    height: 40px !important;
    padding-inline: 12px !important;
    gap: 6px !important;
    font-size: .82rem !important;
  }
}
@media (max-width: 360px) {
  .banner-contact .hero-banner-buttons { gap: 7px !important; }
  .banner-contact .hero-banner-buttons > .contact-hero-action {
    padding-inline: 9px !important;
    font-size: .78rem !important;
  }
}


/* One consistent, official WhatsApp brand glyph across every page.
   Match the floating WhatsApp mark to the 24px TEC BOT robot glyph. */
.whatsapp-float > .whatsapp-float-icon {
  width: 24px !important;
  height: 27.43px !important;
  flex: 0 0 24px !important;
}
.footer-social .whatsapp-float-icon {
  width: 18px !important;
  height: 20.57px !important;
  flex: 0 0 18px !important;
}
.mobile-bottom-nav .whatsapp-float-icon {
  width: 19.2px !important;
  height: 21.94px !important;
  flex: 0 0 19.2px !important;
}
.banner-contact .contact-action-icon {
  width: 16px !important;
  height: 18.29px !important;
  flex: 0 0 16px !important;
}
.contact-info-card .whatsapp-float-icon,
.contact-card .whatsapp-float-icon {
  width: 21px;
  height: 24px;
  flex: 0 0 21px;
}
.whatsapp-float-icon path { fill: currentColor; }
