/* ── Mobile responsive overrides for prerendered pages ── */

/* Hamburger button (visible on small screens) */
.nav-burger{display:none;background:none;border:none;cursor:pointer;padding:8px;margin-right:-8px;color:#fff;width:40px;height:40px;align-items:center;justify-content:center}
.nav-burger svg{width:22px;height:22px;display:block}

/* Mobile drawer */
.mobile-drawer{display:none;position:fixed;top:68px;left:0;right:0;bottom:0;z-index:498;background:rgba(31,26,46,.98);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:24px var(--pad) 40px;overflow-y:auto;flex-direction:column;gap:4px}
.mobile-drawer.open{display:flex}
.mobile-drawer a,.mobile-drawer button{display:flex;align-items:center;justify-content:space-between;padding:18px 4px;font-size:18px;font-weight:500;color:#fff;border:none;background:none;text-align:left;border-bottom:1px solid rgba(255,255,255,.08);width:100%;cursor:pointer;font-family:inherit}
.mobile-drawer .md-sub{font-size:15px;color:rgba(255,255,255,.7);padding:14px 12px;border-bottom:1px solid rgba(255,255,255,.05)}
.mobile-drawer .md-section-label{font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:rgba(255,255,255,.4);margin:20px 4px 6px}
.mobile-drawer .md-cta{display:inline-flex;justify-content:center;background:var(--grad);color:#fff;padding:16px 24px;border-radius:6px;font-weight:600;font-size:15px;margin-top:24px;border:none}

@media(max-width:880px){
  .nav-burger{display:flex}
  .nav-links,.nav-cta{display:none !important}
}

/* ── Broad mobile collapses for inline-styled layouts ── */
@media(max-width:768px){
  /* Collapse common multi-column grids to one column */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="gridTemplateColumns:'1fr 1fr'"],
  [style*="grid-template-columns:1fr 1.5fr"],
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns: repeat(2, 1fr)"],
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3,minmax(0,1fr))"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(5,1fr)"],
  [style*="grid-template-columns:200px 1fr 1fr"],
  [style*="grid-template-columns:240px 1fr 1fr"],
  [style*="grid-template-columns:80px 1fr"],
  [style*="grid-template-columns:120px 1fr"]{
    grid-template-columns:1fr !important;
  }
  /* Tighten huge gaps */
  [style*="gap:80px"]{gap:40px !important}
  [style*="gap:64px"]{gap:36px !important}
  [style*="gap:48px"]{gap:28px !important}
  /* Reduce monster top padding under fixed nav */
  [style*="padding:calc(68px + 80px)"],
  [style*="padding: calc(68px + 80px)"]{padding-top:calc(68px + 40px) !important}
  /* Reduce big horizontal/section padding when it's the whole padding shorthand */
  [style*="padding:80px"]{padding:48px var(--pad) !important}
  [style*="padding:96px"]{padding:56px var(--pad) !important}
  [style*="padding:64px 48px"]{padding:40px 24px !important}
  [style*="padding:40px"]:not(nav):not(.nav){padding:24px !important}
  /* Shrink large clamp-driven headlines a little more on phones */
  h1[style*="clamp(36px"],h1[style*="clamp(40px"],h1[style*="clamp(44px"]{font-size:clamp(30px,8vw,44px) !important}
  /* Side-scroll guard */
  body,html{overflow-x:hidden}
  img,video{max-width:100%;height:auto}
  /* Footer */
  .footer-inner{grid-template-columns:1fr !important;gap:32px !important;padding:48px var(--pad) 32px !important}
  .footer-bottom{padding:16px var(--pad) !important}
  /* Mega menu hidden on mobile (drawer takes over) */
  .mega{display:none !important}
  /* Work grid */
  .wk-grid{grid-template-columns:1fr !important}
  .wk-card{height:240px !important}
  /* Tables that overflow */
  table{display:block;overflow-x:auto;max-width:100%}
}

@media(max-width:480px){
  [style*="padding:64px 48px"]{padding:32px 20px !important}
  .shell-hero{padding:calc(68px + 48px) var(--pad) 48px !important}
}
