/* Responsive overrides for the Aqua Restoration site.
   Page layouts are authored with inline styles, so these rules target
   inline style patterns and need !important to take effect. */

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
img, svg, video, iframe { max-width: 100%; }

.ars-menu summary { list-style: none; }
.ars-menu summary::-webkit-details-marker { display: none; }

/* ---------- Tablet & small laptop ---------- */
@media (max-width: 1100px) {
  .ars-header { padding: 8px 20px !important; gap: 16px !important; }
  .ars-logo-img { height: 88px !important; width: 88px !important; }
  .ars-brand { font-size: 20px !important; white-space: normal !important; }
  .ars-nav { display: none !important; }
  .ars-menu { display: block !important; }
  .ars-header-actions { display: flex !important; align-items: center; gap: 10px; margin-left: auto; }
}

@media (max-width: 900px) {
  /* Multi-column grids */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns: 2fr 1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  [style*="grid-template-columns: 2fr 1fr 1fr 1fr"] > :first-child { grid-column: 1 / -1; }

  [style*="gap: 80px"], [style*="gap: 64px"], [style*="gap: 60px"] { gap: 40px !important; }
  [style*="position: sticky; top: 100px"] { position: static !important; }

  h1[style] { font-size: 48px !important; }
  h2[style*="font-size: 4"] { font-size: 36px !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  /* Top announcement bar */
  .ars-topbar { justify-content: center !important; padding: 6px 16px !important; font-size: 13px !important; }
  .ars-topbar-meta { display: none !important; }

  /* Header */
  .ars-header { padding: 6px 14px !important; gap: 10px !important; }
  .ars-header > a:first-child { gap: 10px !important; min-width: 0; }
  .ars-logo-img { height: 56px !important; width: 56px !important; }
  .ars-brand { font-size: 15px !important; line-height: 1.15 !important; }
  .ars-call { padding: 12px !important; }
  .ars-call-label { display: none; }

  /* Section spacing */
  [style*="px 32px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding: 72px"], [style*="padding: 80px"], [style*="padding: 96px"] {
    padding-top: 56px !important; padding-bottom: 56px !important;
  }
  [style*="padding: 56px"], [style*="padding: 40px"] { padding: 24px !important; }
  [style*="padding: 32px;"] { padding: 22px !important; }
  [style*="margin-bottom: 56px"], [style*="margin-bottom: 48px"] { margin-bottom: 32px !important; }
  [style*="gap: 40px"] { gap: 24px !important; }

  /* All grids stack (icon + text rows keep their shape) */
  [style*="grid-template-columns: repeat("],
  [style*="grid-template-columns: 2fr 1fr 1fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Type scale */
  h1[style] { font-size: 36px !important; line-height: 1.1 !important; }
  h2[style*="font-size: 4"], h2[style*="font-size: 3"] { font-size: 30px !important; line-height: 1.15 !important; }
  [style*="font-size: 48px"], [style*="font-size: 52px"], [style*="font-size: 56px"],
  [style*="font-size: 60px"], [style*="font-size: 64px"], [style*="font-size: 68px"] { font-size: 36px !important; }
  p[style*="font-size: 20px"], p[style*="font-size: 19px"] { font-size: 17px !important; }

  /* Buttons fill the width when they'd otherwise squeeze */
  [style*="padding: 20px 28px"], [style*="padding: 18px 28px"] {
    padding: 16px 22px !important; font-size: 17px !important; justify-content: center;
  }

  /* Wide coverage maps get taller so pins and labels don't collide */
  [style*="aspect-ratio: 21/9"] { aspect-ratio: 4/3 !important; }

  /* Avoid iOS zoom-on-focus */
  input, select, textarea { font-size: 16px !important; }

  /* Decorative glows shouldn't widen the page */
  [style*="width: 500px; height: 500px"], [style*="width: 400px; height: 400px"] {
    width: 280px !important; height: 280px !important;
  }
}

/* ---------- Mobile menu ---------- */
.ars-menu > summary {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 8px;
  border: 1px solid #eae6dc; background: #fff; color: #0f1c3f; cursor: pointer;
}
.ars-menu .ars-icon-close { display: none; }
.ars-menu[open] .ars-icon-open { display: none; }
.ars-menu[open] .ars-icon-close { display: block; }
.ars-menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-bottom: 1px solid #eae6dc;
  box-shadow: 0 16px 32px rgba(15, 28, 63, 0.12);
  padding: 8px 20px 20px; display: flex; flex-direction: column;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.ars-menu-panel a {
  color: #1f2a44; font-size: 17px; font-weight: 600;
  padding: 14px 4px; border-bottom: 1px solid #f1eee6;
}
.ars-menu-panel a.ars-menu-call {
  margin-top: 16px; border: 0; border-radius: 8px; background: #e05d2a; color: #fff;
  text-align: center; padding: 16px;
}
.ars-menu-panel a.ars-menu-call:hover { color: #fff; background: #b84718; }
