/* ==========================================================================
   db partners — mobile responsive patch
   Retrofits the existing inline-styled pages for phone/tablet screens.
   Uses attribute selectors to target repeated inline style patterns,
   plus a pure-CSS (no JS) checkbox-hack mobile nav.
   ========================================================================== */

/* ---------------------------- Mobile navigation --------------------------- */

.db-nav-toggle { display: none; }
.db-burger { display: none; }

@media (max-width: 900px) {

  .db-burger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex: none;
  }
  .db-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #F5F4F1;
    border-radius: 2px;
  }

  nav.db-nav {
    display: none !important;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #1D1D1B;
    border-bottom: 1px solid rgba(245,244,241,0.14);
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 20px 22px !important;
    gap: 2px !important;
    z-index: 40;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }

  .db-nav-toggle:checked ~ nav.db-nav {
    display: flex !important;
  }

  nav.db-nav a {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 6px !important;
    border-bottom: 1px solid rgba(245,244,241,0.08);
  }

  nav.db-nav a[style*="margin-left:8px"] {
    margin-left: 0 !important;
    margin-top: 12px !important;
    text-align: center;
    border-bottom: none;
  }

  nav.db-nav > span {
    margin-left: 0 !important;
    margin-top: 14px !important;
    justify-content: center !important;
  }
}

/* ------------------------------ Container padding -------------------------- */

@media (max-width: 640px) {
  [style*="padding:0 40px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* --------------------------------- Grids ----------------------------------- */

/* Tablet: ease 3/4-column grids down to 2 columns first */
@media (max-width: 900px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Phone: collapse every multi-column grid to a single column */
@media (max-width: 700px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns:2fr 1fr 1fr"],
  [style*="grid-template-columns:0.85fr 1.15fr"],
  [style*="grid-template-columns:0.9fr 1.1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* When the CTA/footer columns stack, drop the large fixed gap down a bit */
  [style*="grid-template-columns:2fr 1fr 1fr"] {
    gap: 32px !important;
  }
}

/* --------------------------- Section / hero padding ------------------------ */

@media (max-width: 640px) {
  section[style*="padding:88px 0"],
  section[style*="padding: 88px 0"] { padding: 56px 0 !important; }

  section[style*="padding:92px 0"] { padding: 56px 0 !important; }

  section[style*="padding:82px 0 100px"] { padding: 48px 0 64px !important; }

  header + section[style*="background:#1D1D1B"] { padding-top: 48px !important; }

  footer[style*="padding:64px 0 34px"] { padding: 40px 0 24px !important; }
}

/* --------------------------------- Contact --------------------------------- */

@media (max-width: 640px) {
  /* Name/email and company/subject side-by-side fields inside the contact form */
  form [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ---------------------------------- Misc ------------------------------------ */

@media (max-width: 480px) {
  /* Give primary/secondary button pairs a bit more breathing room stacked */
  a[style*="display:inline-flex"][style*="padding:15px 28px"] {
    justify-content: center;
  }
}
