/* Phone and tablet fixes for the Ankur site (desktop layout untouched: everything is inside max-width queries). */

/* Safety net: never let the page scroll sideways on small screens. */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  body img { max-width: 100%; height: auto; }
}

/* ---------- Tablet and phone (up to 1024px) ---------- */
@media (max-width: 1024px) {
  /* About section: photo must stay inside its column; text reads left-aligned */
  body .elementor-690 .elementor-element.elementor-element-4ceb5b0 { width: 100%; max-width: 100%; --container-widget-width: 100%; }
  body .elementor-690 .elementor-element.elementor-element-4ceb5b0 img { width: 100%; height: auto; }
  body .elementor-690 .elementor-element.elementor-element-9fccf6b { width: 100%; max-width: 100%; --container-widget-width: 100%; }
  body .elementor-690 .elementor-element.elementor-element-9fccf6b,
  body .elementor-690 .elementor-element.elementor-element-9fccf6b * { text-align: left; }
  body .elementor-690 .elementor-element.elementor-element-egwwsgn { margin-top: 56px; padding-top: 48px; padding-bottom: 48px; }

  /* Material Portfolio: 3 per row instead of 5 squeezed tiles */
  body .elementor-690 .elementor-element.elementor-element-df39a99 { flex-wrap: wrap; justify-content: center; gap: 16px; }
  body .elementor-690 .elementor-element.elementor-element-df39a99 > .e-con {
    width: calc(33.333% - 11px); --width: calc(33.333% - 11px); flex: 0 0 calc(33.333% - 11px); max-width: calc(33.333% - 11px); margin: 0;
  }

  /* Stellar Quartz block: stack instead of overflowing to the right */
  body .elementor-690 .elementor-element.elementor-element-126c381 { flex-direction: column; align-items: center; justify-content: center; margin-top: 56px; min-height: 0; padding-top: 40px; padding-bottom: 40px; }
  body .elementor-690 .elementor-element.elementor-element-d52724c { width: min(100%, 560px); --width: min(100%, 560px); max-width: 100%; margin-left: auto; margin-right: auto; }
  body .elementor-690 .elementor-element.elementor-element-6b01d5d { display: none; }

  /* Calmer spacing between sections */
  body .elementor-690 .elementor-element.elementor-element-6defb60 { margin-top: 56px; }
  body .elementor-690 .elementor-element.elementor-element-460ba1b { margin-top: 72px; }
  body .elementor-690 .elementor-element.elementor-element-6c75afc { margin-top: 72px; margin-bottom: 56px; }
  body .elementor-690 .elementor-element.elementor-element-49b6c61 { margin-top: 72px; padding-top: 80px; padding-bottom: 80px; }
}

/* ---------- Phone (up to 767px) ---------- */
@media (max-width: 767px) {
  body .elementor-690 .elementor-element.elementor-element-egwwsgn { margin-top: 24px; padding-top: 32px; padding-bottom: 32px; }

  /* Material Portfolio: one column, shorter tiles */
  body .elementor-690 .elementor-element.elementor-element-df39a99 { flex-direction: column; flex-wrap: nowrap; gap: 14px; }
  body .elementor-690 .elementor-element.elementor-element-df39a99 > .e-con {
    width: 100%; --width: 100%; flex: 0 0 auto; max-width: 100%; min-height: 170px; height: 170px;
  }

  body .elementor-690 .elementor-element.elementor-element-6defb60 { margin-top: 32px; }
  body .elementor-690 .elementor-element.elementor-element-126c381 { margin-top: 40px; padding-top: 24px; padding-bottom: 24px; }
  body .elementor-690 .elementor-element.elementor-element-460ba1b { margin-top: 48px; padding-top: 24px; }
  body .elementor-690 .elementor-element.elementor-element-2e25413 { padding-top: 16px; }
  body .elementor-690 .elementor-element.elementor-element-6c75afc { margin-top: 48px; margin-bottom: 40px; }
  body .elementor-690 .elementor-element.elementor-element-49b6c61 { margin-top: 48px; padding-top: 56px; padding-bottom: 56px; }

  /* Header social icons: comfortable tap size */
  body .elementor-social-icons-wrapper .elementor-social-icon,
  body .elementor-social-icons-wrapper a.elementor-icon { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ---------- Header menu bar and footer on phones ---------- */
@media (max-width: 1024px) {
  /* Menu button and social icons on one row instead of a tall stacked band */
  body .elementor-881 .elementor-element.elementor-element-15825688 {
    flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: center; padding: 8px 16px; min-height: 0;
  }
  body .elementor-881 .elementor-element.elementor-element-15825688 > .elementor-element { width: auto; --container-widget-width: auto; margin: 0; flex: 0 0 auto; }
}

@media (max-width: 767px) {

  /* Footer contact block reads left-aligned, like the column above it */
  body .elementor-483 .elementor-element.elementor-element-d6a5b03 { align-items: flex-start; }
  body .elementor-483 .elementor-element.elementor-element-d6a5b03,
  body .elementor-483 .elementor-element.elementor-element-d6a5b03 * { text-align: left; }
  body .elementor-483 .elementor-element.elementor-element-d6a5b03 .elementor-icon-list-item,
  body .elementor-483 .elementor-element.elementor-element-d6a5b03 .elementor-icon-list-items { justify-content: flex-start; }

  body .elementor-690 .elementor-element.elementor-element-6defb60 { margin-top: 8px; }
}

/* Keep the back-to-top button clear of the footer social icons on phones */
@media (max-width: 767px) {
  body #ast-scroll-top { bottom: 76px; }
}

/* ---------- Inner pages on phones ---------- */
@media (max-width: 767px) {
  /* About Us: stats stack instead of squeezing three across */
  /* the original site forces 3 columns with !important, so this one block needs it too */
  body.page-id-25 .elementor-element-64fd50e { grid-template-columns: 1fr !important; row-gap: 28px !important; }
  body .elementor-25 .elementor-element.elementor-element-64fd50e > .e-con { width: 100%; --width: 100%; max-width: 100%; flex: 0 0 auto; }
  /* About Us: justified paragraph leaves wide gaps on narrow screens */
  body .elementor-25 .elementor-element.elementor-element-39f5100,
  body .elementor-25 .elementor-element.elementor-element-39f5100 * { text-align: left; }
  /* Project gallery: oversized headings no longer get cut off */
  body .elementor-338 .elementor-element.elementor-element-5fa620a .elementor-heading-title,
  body .elementor-338 .elementor-element.elementor-element-054763b .elementor-heading-title { font-size: 44px; line-height: 1.1; }
}
