/* ============================================================
   NEXUS GUARDIA — MOBILE & RESPONSIVE CSS
   Breakpoints:
   - Tablet:  max-width 1024px
   - Mobile:  max-width 768px
   - Small:   max-width 480px
   ============================================================ */

/* ── TABLET (up to 1024px) ── */
@media (max-width: 1024px) {

  /* Nav */
  nav { padding: 0 28px; }
  nav ul a { padding: 10px 10px; font-size: 11px; }
  .nav-cta { padding: 10px 18px; font-size: 10.5px; }

  /* Sections */
  .sec { padding: 64px 32px; }
  .page-hero-content { padding: 36px; }

  /* Grids */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .div-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .pillars-4 { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; gap: 40px; }
  .why-photo { position: static; }
  .two-col { gap: 40px; }
  .two-col-3-2 { gap: 40px; }

  /* Photo content */
  .photo-content { grid-template-columns: 1fr; gap: 40px; }
  .photo-content.reverse { grid-template-columns: 1fr; }
  .photo-content.reverse img { order: 0; }
  .photo-content.reverse .photo-text { order: 0; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 60px; }
  .about-right { margin-top: 20px; }
  .about-badge { bottom: -16px; left: -12px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }
  .contact-l { padding: 48px 36px; }
  .contact-r { padding: 48px 36px; }

  /* Locations */
  .locbar { padding: 0 28px; }

  /* Image band */
  .imgband { height: 360px; }
  .imgband-text { padding: 0 36px; }

}


/* ── MOBILE (up to 768px) ── */
@media (max-width: 768px) {

  /* ── HAMBURGER NAV ── */
  nav {
    padding: 0 20px;
    height: 64px;
    position: sticky; top: 0; z-index: 1000;
  }

  /* Hide desktop nav links and CTA */
  nav ul { display: none; }
  .nav-cta { display: none; }

  /* Hamburger button */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    margin-left: auto;
  }
  .nav-hamburger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--bronze);
    transition: all 0.25s;
    transform-origin: center;
  }

  /* Mobile menu open state */
  nav.open ul {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--gold2);
    box-shadow: 0 8px 32px rgba(61,36,16,0.15);
    padding: 12px 0 20px;
    z-index: 999;
    gap: 0;
  }
  nav.open ul a {
    padding: 14px 24px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    border-left: none;
    display: block;
  }
  nav.open ul a:last-child { border-bottom: none; }
  nav.open ul a:hover { background: var(--goldbg); }

  /* Show get in touch inside mobile menu */
  nav.open .nav-cta {
    display: block;
    margin: 16px 24px 0;
    text-align: center;
    padding: 14px;
  }

  /* Hamburger X state */
  nav.open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.open .nav-hamburger span:nth-child(2) { opacity: 0; }
  nav.open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Logo */
  .logo-text-wrap small { display: none; }
  .logo-img { height: 44px; width: 44px; }

  /* Sections */
  .sec { padding: 52px 20px; }

  /* Page hero */
  .page-hero { height: 260px; }
  .page-hero-content { padding: 24px 20px; }
  .page-hero h1 { font-size: clamp(28px, 7vw, 40px); }

  /* Headings */
  .sh2 { font-size: clamp(26px, 7vw, 36px); }

  /* Locations bar */
  .locbar { padding: 10px 20px; gap: 0; flex-wrap: wrap; }
  .locbar-label { display: none; }
  .locbar-item { font-size: 11px; padding: 5px 12px 5px 0; }

  /* Ticker */
  .ticker { padding: 10px 0; }
  .tick-i { font-size: 9px; padding: 0 18px; letter-spacing: 1.5px; }

  /* Grids → single column */
  .services-grid { grid-template-columns: 1fr; }
  .div-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .pillars-4 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .two-col-3-2 { grid-template-columns: 1fr; gap: 32px; }
  .frow { grid-template-columns: 1fr; gap: 0; }

  /* Hero (homepage) */
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-photo { min-height: 520px; }
  .hero-text { padding: 40px 20px 32px; }
  .hero-text h1 { font-size: clamp(34px, 9vw, 52px); letter-spacing: -1px; margin-bottom: 16px; }
  .hero-text p { font-size: 15px; margin-bottom: 28px; }
  .hero-btns { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-panel { border-left: none; border-top: 4px solid var(--gold2); padding: 32px 20px; }
  .hero-panel-logo { height: 60px; width: 60px; }
  .hst-num { font-size: 38px; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-right img { height: 300px; }
  .about-badge { bottom: -12px; left: -8px; padding: 14px 18px; }
  .about-badge-num { font-size: 32px; }
  .about-btns { flex-direction: column; gap: 12px; }
  .about-btns a { text-align: center; }

  /* Photo content */
  .photo-content { grid-template-columns: 1fr; gap: 32px; }
  .photo-content.reverse { grid-template-columns: 1fr; }
  .photo-content img { height: 240px; }

  /* Why section */
  .why-grid { grid-template-columns: 1fr; gap: 32px; }
  .why-photo { position: static; }
  .why-photo img { height: 260px; }
  .why-resp { grid-template-columns: 1fr 1fr; }

  /* Image band */
  .imgband { height: 300px; }
  .imgband-over {
    background: linear-gradient(180deg, rgba(26,18,8,0.85) 0%, rgba(26,18,8,0.75) 100%);
  }
  .imgband-text { padding: 0 20px; max-width: 100%; }
  .imgband-text h2 { font-size: clamp(22px, 6vw, 32px); }
  .imgband-text p { font-size: 13px; }

  /* Quote band */
  .quote-band { padding: 36px 20px; }
  .quote-band p { font-size: 17px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }
  .contact-l { padding: 40px 20px; }
  .contact-l h2 { font-size: 28px; }
  .contact-r { padding: 36px 20px; }
  .contact-r h3 { font-size: 20px; margin-bottom: 24px; }
  .frow { grid-template-columns: 1fr; }

  /* Buttons */
  .btn-bronze, .btn-gold, .btn-outline { padding: 13px 24px; font-size: 11px; }

  /* Divisions intro */
  .div-intro { grid-template-columns: 1fr; }
  .div-count { display: none; }

  /* Division CTA card */
  .dcard-cta { padding: 32px 24px; }
  .dcard-cta > div { flex-direction: column !important; gap: 20px !important; }

  /* FinTech page specifics */
  .fintech-intro-grid { grid-template-columns: 1fr !important; gap: 40px; }
  .fintech-stat-panel { position: static !important; }
  .usecase-grid { grid-template-columns: 1fr !important; }
  .pillars-4 .pillar { border-right: none; border-bottom: 1px solid var(--border); }
  .pillars-4 .pillar:last-child { border-bottom: none; }

  /* RPA stats band */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Footer */
  footer { flex-direction: column; align-items: flex-start; gap: 16px; padding: 28px 20px; }
  .foot-links { flex-wrap: wrap; gap: 12px; }
  .foot-links a { font-size: 11px; }

  /* Pillars border fix on mobile */
  .pillars .pillar { border-right: none; border-bottom: 1px solid var(--border); }
  .pillars .pillar:last-child { border-bottom: none; }

}


/* ── SMALL MOBILE (up to 480px) ── */
@media (max-width: 480px) {

  .sec { padding: 40px 16px; }
  .page-hero-content { padding: 20px 16px; }
  .locbar { padding: 8px 16px; }

  .hero-text { padding: 32px 16px 28px; }
  .hero-text h1 { font-size: clamp(30px, 10vw, 44px); }
  .hero-panel { padding: 28px 16px; }

  .contact-l { padding: 32px 16px; }
  .contact-r { padding: 28px 16px; }

  .quote-band { padding: 28px 16px; }
  .quote-band p { font-size: 15px; }

  .imgband-text { padding: 0 16px; }

  .about-badge { display: none; }

  footer { padding: 24px 16px; }

  /* Services grid stays single col */
  .services-grid { grid-template-columns: 1fr; }

  /* Page hero smaller */
  .page-hero { height: 220px; }
  .page-hero h1 { font-size: clamp(24px, 8vw, 34px); }

  /* Why response stats */
  .why-resp { gap: 12px; }
  .why-resp-num { font-size: 28px; }

}

/* ── ADDITIONAL FIXES FROM MOBILE SCREENSHOTS ── */

/* Prevent ANY element from exceeding viewport width */
@media (max-width: 768px) {
  * { max-width: 100%; }
  img { max-width: 100%; height: auto; }

  /* Force div-grid to single column — higher specificity */
  .div-grid,
  div.div-grid { 
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* CTA card full width — no span needed in single col */
  .dcard-cta {
    grid-column: 1 !important;
  }

  /* Ticker — prevent page blowout */
  .ticker { overflow: hidden !important; max-width: 100vw !important; }

  /* Services grid single column */
  .services-grid,
  div.services-grid {
    grid-template-columns: 1fr !important;
  }

  /* Pillars single column */
  .pillars,
  div.pillars {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .div-grid,
  div.div-grid {
    grid-template-columns: 1fr !important;
  }
}
