/* WebTech Core — universal mobile fix (nav + overflow safety net). Linked on every page. */

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Site-wide content grids — collapses every template's grid classes without
   needing per-page overrides (class names vary by Canva-export template). */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr !important;
  }

  .ceo-grid, .chal-grid, .contact-grid, .cov-grid, .cs-grid, .cta-grid,
  .district-card, .feat-grid, .footer-grid, .footer-top, .ft-grid,
  .inc-grid, .mv-grid, .photo-grid, .post-grid, .proc-grid, .process-grid,
  .result-box, .results-case, .services-grid, .stats-grid, .story-grid,
  .svc-grid, .svc-grid2, .team-grid, .val-grid, .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .ceo-grid, .chal-grid, .contact-grid, .cov-grid, .cs-grid, .cta-grid,
  .district-card, .feat-grid, .footer-grid, .footer-top, .ft-grid,
  .inc-grid, .mv-grid, .photo-grid, .post-grid, .proc-grid, .process-grid,
  .result-box, .results-case, .services-grid, .stats-grid, .story-grid,
  .svc-grid, .svc-grid2, .team-grid, .val-grid, .why-grid {
    grid-template-columns: 1fr !important;
  }

  .hero, .stats, .section, .cta-sec, footer, .sec-split, .sec-header {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .hero h1 {
    font-size: clamp(28px, 8.5vw, 40px) !important;
    line-height: 1.12 !important;
  }

  .sec-h2, .cta-h2 {
    font-size: clamp(24px, 7vw, 30px) !important;
  }

  .hero-sub, .hero-desc {
    max-width: 100% !important;
  }

  .sec-header, .sec-split {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .hero-ctas, .hero-btns {
    flex-direction: column !important;
  }

  .hero-ctas a, .hero-btns a {
    width: 100%;
    text-align: center;
  }

  .testimonial {
    flex-direction: column !important;
    padding: 24px !important;
  }
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  z-index: 60;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #e9ebf2;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav,
  #main-nav {
    position: relative;
    flex-wrap: nowrap !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    width: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 4px !important;
    background: rgba(7, 9, 18, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
    z-index: 55;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-link,
  .nav-a,
  .nav-btn,
  .nav-dropdown-btn,
  .nav-cta {
    width: 100%;
    justify-content: space-between !important;
    padding: 12px 10px !important;
    font-size: 15px !important;
    border-radius: 10px;
  }

  .nav-link:hover,
  .nav-a:hover,
  .nav-btn:hover,
  .nav-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .nav-cta {
    text-align: center;
    margin-top: 6px;
  }

  .nav-dropdown,
  .dd-wrap {
    width: 100%;
  }

  .dropdown-panel,
  .dd-panel {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px 0 0 !important;
    box-shadow: none;
  }

  .dd-grid4,
  .dd-grid1,
  .dd-grid,
  .panel-grid-4,
  .panel-grid-1 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .nav,
  #main-nav {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .nav-links {
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }
}
