/* ============================================================
   CONTECH — MOBILE.CSS
   Loaded separately — maximum specificity override
   Breakpoint: 900px
   ============================================================ */

/* ── GLOBAL OVERFLOW LOCK ── */
html { overflow-x: hidden !important; }
body { overflow-x: hidden !important; max-width: 100vw !important; }

/* ── FOOTER ── */
.footer-social-inline {
  display: flex !important; align-items: center; gap: 16px;
  margin-top: 24px; flex-wrap: wrap; padding: 20px 56px 0;
}
.footer-social-icon-plain {
  color: rgba(255,255,255,0.5) !important; transition: color 0.2s;
  display: flex; align-items: center;
}
.footer-social-icon-plain:hover { color: #ffffff !important; }
.footer-bottom {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center;
  padding: 14px 56px;
  border-top: 1px solid rgba(255,255,255,0.07);
  gap: 16px; max-width: 100%;
}
.footer-copy { font-size: 11.5px; color: rgba(255,255,255,0.28); justify-self: start; }
.footer-bottom-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-bottom-links a { font-size: 11.5px; color: rgba(255,255,255,0.38); transition: color 0.2s; }
.footer-bottom-links a:hover { color: #ffffff; }
.footer-noox { display: flex; align-items: center; gap: 8px; justify-self: end; }
.footer-noox-label {
  font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: rgba(255,255,255,0.25); white-space: nowrap;
}

/* ============================================================
   MOBILE — 900px AND BELOW
   ============================================================ */
@media screen and (max-width: 900px) {

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

  /* NAV */
  :root { --nav-height: 60px !important; }
  body { padding-top: 60px !important; }
  .nav-top { display: none !important; }
  .nav-main { padding: 0 16px !important; height: 60px !important; }
  .nav-logo-img { height: 32px !important; }
  .nav-links { display: none !important; }
  .nav-hamburger { display: flex !important; }

  /* Mobile nav open state — drawer slides in BELOW the main nav
     so the logo and hamburger close button remain visible at top.
     v14c fix: was top:0 which covered the nav, leaving no way to close. */
  .nav-links.mobile-open {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: var(--nav-height) !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: #111 !important;
    z-index: 999 !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    padding-bottom: 48px !important;
  }

  /* Mobile nav header with logo */
  .mobile-nav-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 20px !important;
    background: #1a1a1a !important;
    border-bottom: 2px solid #D03030 !important;
    position: sticky !important; top: 0 !important; z-index: 10 !important;
    flex-shrink: 0 !important;
  }
  .mobile-nav-logo img { height: 32px !important; width: auto !important; display: block !important; }
  .mobile-nav-close {
    background: none !important; border: none !important;
    color: rgba(255,255,255,0.8) !important; font-size: 24px !important;
    cursor: pointer !important; padding: 4px 8px !important; line-height: 1 !important;
  }

  /* Nav items */
  .nav-links.mobile-open > li { border-bottom: 1px solid rgba(255,255,255,0.07) !important; }
  .nav-links.mobile-open li.nav-sep-item { display: none !important; }
  .nav-links.mobile-open > li > a,
  .nav-links.mobile-open .has-mega > a,
  .nav-links.mobile-open .nav-plain-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px 20px !important;
    height: auto !important; line-height: 1.4 !important;
    font-size: 13px !important; font-weight: 600 !important;
    text-transform: uppercase !important; letter-spacing: 0.5px !important;
    color: rgba(255,255,255,0.85) !important; border: none !important;
  }
  .nav-links.mobile-open .nav-cta-btn {
    margin: 20px !important; padding: 14px 20px !important;
    font-size: 12px !important; text-align: center !important;
    display: block !important; height: auto !important;
    background: #D03030 !important; border-radius: 2px !important;
  }

  /* Mobile sub-menu section heading (red, uppercase, no link behaviour) */
  .nav-links.mobile-open .mobile-sub-heading {
    display: block !important;
    padding: 14px 20px 4px 28px !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: #D03030 !important;
    border-bottom: none !important;
    background: transparent !important;
  }
  .nav-links.mobile-open .mobile-sub-heading + a {
    border-top: 1px solid rgba(255,255,255,0.05) !important;
  }

  /* Mobile sub-menus */
  .mobile-sub { display: none !important; background: #0d0d0d !important; border-left: 3px solid #D03030 !important; }
  .mobile-sub.open { display: block !important; }
  .mobile-sub a {
    display: block !important; padding: 11px 20px 11px 28px !important;
    font-size: 13px !important; color: rgba(255,255,255,0.6) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  }

  /* SECTIONS */
  section { padding: 48px 20px !important; }
  .section-inner { max-width: 100% !important; }
  .stats-bar { padding: 28px 20px !important; }
  .cta-band { padding: 48px 20px !important; }
  .cta-band-actions { flex-direction: column !important; align-items: stretch !important; }
  .cta-band-actions .btn { width: 100% !important; text-align: center !important; }

  /* HERO */
  .page-hero { height: 240px !important; }
  .page-hero-content { padding: 0 20px 28px !important; }
  .page-hero h1 { font-size: clamp(24px, 7vw, 40px) !important; }
  .page-hero-sub { font-size: 13px !important; }

  /* SECTION TYPOGRAPHY */
  .section-title { font-size: clamp(22px, 5vw, 32px) !important; }
  .section-lead { font-size: 15px !important; }
  .section-header-row { flex-direction: column !important; gap: 12px !important; }

  /* STATS */
  .stats-bar-inner { grid-template-columns: repeat(2,1fr) !important; }
  .stat-item { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.12) !important; padding: 16px 10px !important; }
  .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.12) !important; }
  .stat-item:nth-last-child(-n+2) { border-bottom: none !important; }
  .stat-num { font-size: 30px !important; }

  /* ALL GRIDS → SINGLE COLUMN */
  .card-grid-3, .card-grid-4, .card-grid-2 { grid-template-columns: 1fr !important; }
  .about-grid, .lead-grid, .gov-grid { grid-template-columns: 1fr !important; }
  .cert-grid { grid-template-columns: repeat(2,1fr) !important; }
  .culture-grid { grid-template-columns: 1fr !important; }
  .life-grid { grid-template-columns: 1fr !important; }
  .grad-grid { grid-template-columns: 1fr !important; }
  .news-main-grid { grid-template-columns: 1fr !important; }
  .news-with-sidebar { grid-template-columns: 1fr !important; }
  .featured-article { grid-template-columns: 1fr !important; }
  .partner-type-grid { grid-template-columns: 1fr !important; }
  .jv-steps { grid-template-columns: 1fr 1fr !important; }
  .donor-grid { grid-template-columns: 1fr 1fr !important; }
  .benefits-grid { grid-template-columns: 1fr !important; }
  .process-steps { grid-template-columns: 1fr 1fr !important; }
  .coc-grid { grid-template-columns: 1fr !important; }
  .industry-grid { grid-template-columns: 1fr !important; }
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .job-card { grid-template-columns: 1fr !important; }

  /* ESG & CULTURE */
  .esg-block { grid-template-columns: 1fr !important; gap: 24px !important; padding: 40px 0 !important; }
  .esg-block.reverse .esg-img,
  .esg-block.reverse .esg-text { order: 0 !important; }
  .esg-img { height: 200px !important; }

  /* SERVICES */
  .svc-section { padding: 40px 20px !important; }
  .svc-layout, .svc-layout.reverse { grid-template-columns: 1fr !important; gap: 28px !important; }
  .svc-layout.reverse .svc-sidebar { order: 0 !important; }
  .svc-layout.reverse .svc-body { order: 1 !important; }
  .svc-img { height: 200px !important; }
  .svc-list { grid-template-columns: 1fr !important; }
  .svc-num-large { font-size: 56px !important; }

  /* INDUSTRY PAGES */
  .scope-grid { grid-template-columns: 1fr !important; }
  .img-pair { grid-template-columns: 1fr !important; }
  .img-pair-item { height: 180px !important; }

  /* PROJECTS */
  .proj-grid { grid-template-columns: 1fr !important; }
  .proj-card-full:nth-child(1) { grid-column: span 1 !important; }
  .pc-img { height: 200px !important; }

  /* INLINE STYLE OVERRIDES */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* FOOTER */
  .footer-top { grid-template-columns: 1fr !important; padding: 36px 20px 28px !important; gap: 28px !important; }
  .footer-social-inline { padding: 0 !important; gap: 18px !important; margin-top: 20px !important; }
  .footer-bottom {
    grid-template-columns: 1fr !important;
    padding: 14px 20px !important; gap: 12px !important;
  }
  .footer-bottom-links { justify-content: flex-start !important; gap: 12px !important; }
  .footer-noox { justify-self: start !important; }
}

@media screen and (max-width: 480px) {
  .cert-grid { grid-template-columns: 1fr 1fr !important; }
  .donor-grid { grid-template-columns: 1fr !important; }
  .jv-steps { grid-template-columns: 1fr !important; }
  .process-steps { grid-template-columns: 1fr !important; }
}

/* ============================================================
   INDEX HOMEPAGE — MOBILE OVERRIDES (v13)
   These cover the previously missing class names so they
   collapse cleanly to single column on mobile viewports.
   ============================================================ */
@media screen and (max-width: 900px) {

  /* ── HARD-HIDE DESKTOP MEGA-DROP ON MOBILE ──
     Higher specificity than the runtime-injected style in
     components.js (li.has-mega.mega-open>div.mega-drop). */
  nav#main-nav li.has-mega .mega-drop,
  nav#main-nav li.has-mega.mega-open > .mega-drop,
  nav#main-nav .mega-drop,
  .mega-drop { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
  nav#main-nav .mega-overlay,
  .mega-overlay { display: none !important; }

  /* ── WHO WE ARE ── */
  .who-inner { grid-template-columns: 1fr !important; gap: 32px !important; }
  .who-visual { display: none !important; }
  .who-text { padding-left: 0 !important; }
  .who-text > p { font-size: 15px !important; max-width: 100% !important; }
  .who-offices { margin-top: 24px !important; gap: 14px !important; }
  .who-office-name { font-size: 12px !important; }
  .who-office-addr { font-size: 12.5px !important; }

  /* ── SERVICES GRID ── */
  .services-grid {
    grid-template-columns: 1fr !important;
    border: none !important; gap: 1px !important;
  }
  .svc-card { min-height: auto !important; padding: 32px 24px !important; }
  .svc-no { font-size: 38px !important; }
  .svc-title { font-size: 19px !important; }
  .svc-desc { font-size: 14px !important; }

  /* ── WHY CHOOSE US ── */
  .why-inner { grid-template-columns: 1fr !important; gap: 32px !important; }
  .why-left > p { max-width: 100% !important; font-size: 15px !important; }
  .why-item { grid-template-columns: 60px 1fr !important; gap: 14px !important; padding: 20px 0 !important; }
  .why-no { font-size: 32px !important; }
  .why-content h4 { font-size: 16px !important; }
  .why-content p { font-size: 14px !important; }

  /* ── PROJECTS MOSAIC ── */
  .projects-mosaic {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 4px !important;
  }
  .projects-mosaic .proj-card,
  .projects-mosaic .proj-card:nth-child(1) {
    grid-column: span 1 !important; grid-row: auto !important;
    height: 220px !important;
  }
  .projects-mosaic .proj-card:nth-child(1) .proj-title { font-size: 20px !important; }
  .proj-info { padding: 18px 22px !important; }
  .proj-title { font-size: 18px !important; }

  /* ── GLOBAL PRESENCE ── */
  .presence-inner { grid-template-columns: 1fr !important; gap: 32px !important; }
  .presence-map-panel { min-height: 280px !important; }
  .pres-office { grid-template-columns: 44px 1fr !important; gap: 14px !important; padding: 14px 0 !important; }
  .pres-flag { width: 44px !important; height: 44px !important; font-size: 20px !important; }
  .pres-name { font-size: 16px !important; }
  .pres-addr { font-size: 12.5px !important; }

  /* ── PARTNERS STRIP ── */
  .partners-strip { padding: 28px 20px !important; }
  .partners-logos { flex-wrap: wrap !important; gap: 0 !important; }
  .partner-logo {
    flex: 0 0 33.333% !important; min-width: 0 !important;
    font-size: 12px !important; padding: 12px 8px !important;
    border-bottom: 1px solid var(--grey-line) !important;
  }
  .partner-logo:nth-child(3n) { border-right: none !important; }
  .partner-logo:nth-last-child(-n+3):nth-child(3n+1),
  .partner-logo:nth-last-child(-n+3):nth-child(3n+1) ~ .partner-logo { border-bottom: none !important; }

  /* ── NEWS GRID ── */
  .news-grid-home { grid-template-columns: 1fr !important; gap: 28px !important; }
  .nh-img { height: 180px !important; }
  .nh-title { font-size: 18px !important; }
  .nh-excerpt { font-size: 14px !important; }

  /* ── SECTION HEADER ROW: stack with full-width children ── */
  .section-header-row { align-items: flex-start !important; }
  .section-header-row > * { width: 100% !important; }
  .section-header-row .view-all { white-space: normal !important; }

  /* ── HERO ACTIONS ── */
  .hero-actions { gap: 12px !important; }
  .hero-actions .btn { width: 100% !important; max-width: 320px !important; text-align: center !important; }

  /* ── PARTNERS LABEL ── */
  .partners-label { margin-bottom: 16px !important; font-size: 9.5px !important; }
}

@media screen and (max-width: 480px) {
  .partner-logo { flex: 0 0 50% !important; font-size: 11px !important; }
  .partner-logo:nth-child(3n) { border-right: 1px solid var(--grey-line) !important; }
  .partner-logo:nth-child(2n) { border-right: none !important; }
  .svc-no { font-size: 32px !important; }
  .why-no { font-size: 28px !important; }
}

/* ============================================================
   SERVICE / DELIVERY / APPROACH PAGE — MOBILE (v14)
   ============================================================ */
@media screen and (max-width: 900px) {
  /* Service nav bar — horizontal scroll, with edge gradients */
  .service-nav-inner {
    padding: 0 16px !important;
  }
  .service-nav {
    gap: 0 !important;
  }
  .service-nav a {
    padding: 12px 14px !important;
    font-size: 10.5px !important;
    letter-spacing: 1.2px !important;
  }

  /* Intro grid — collapse to single column */
  .service-intro-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .service-intro-lead { font-size: 15px !important; }
  .service-intro-body { font-size: 14.5px !important; }

  /* Capability list — single column */
  .capability-list {
    grid-template-columns: 1fr !important;
    margin-top: 24px !important;
  }
  .capability-list li { font-size: 14px !important; padding: 12px 0 !important; }

  /* Value cards — single column */
  .value-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .value-card { padding: 28px 24px !important; }
  .value-card h4 { font-size: 16px !important; }
  .value-card p { font-size: 13.5px !important; }
}

@media screen and (max-width: 480px) {
  .service-nav a { padding: 11px 10px !important; font-size: 10px !important; }
  .capability-list li { font-size: 13.5px !important; }
}


/* ============================================================
   OUR SERVICES INDEX — MOBILE (v14)
   ============================================================ */
@media screen and (max-width: 900px) {
  .service-grid,
  .service-grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .sgc-img { height: 180px !important; }
  .sgc-body { padding: 24px 20px !important; }
  .sgc-body-only { padding: 28px 22px !important; min-height: auto !important; }
  .sgc-title { font-size: 17px !important; }
  .sgc-desc { font-size: 13.5px !important; }
}

@media screen and (min-width: 600px) and (max-width: 900px) {
  /* On tablet portrait, show 2 columns to use horizontal space */
  .service-grid,
  .service-grid-4 {
    grid-template-columns: 1fr 1fr !important;
  }
}
