/* ==========================================================================
   mobile-redesign-v78.css
   Purpose : Safe, ADDITIVE mobile-UX pass loaded LAST (after audit-closure-v77.css)
             on every page, so it wins the cascade without touching or deleting
             any existing file. Nothing here fights the compiled React bundle's
             own classes — it only adds missing behaviour and fixes two real,
             verifiable mobile bugs described below.
   Scope   : All pages (static shell pages AND the interactive homepage).
   ========================================================================== */

@media (max-width: 1023px) {

  /* ---------------------------------------------------------------------
     1) iOS "zoom on focus" bug fix.
     Any text input, select or textarea rendered below 16px triggers
     Safari's automatic zoom-in when a visitor taps into it — this is a
     well-documented iOS behaviour, not a design choice, and it jars the
     visitor out of the page right at the exact moment they're filling in
     a consultation/contact form. Forcing 16px removes the zoom without
     changing how the field looks (16px is already close to the site's
     existing form-field sizing).
     --------------------------------------------------------------------- */
  input, select, textarea, button {
    font-size: 16px !important;
  }

  /* ---------------------------------------------------------------------
     2) Consistent 48px minimum tap targets.
     WCAG / Google's mobile-usability guidance both call for 48x48px
     touch targets. Most buttons/links on the shell nav already hit this;
     this is a safety net for any that don't (inline nav links, footer
     links, chips, badges) without changing their visual size — the extra
     hit-area is added via padding-based min-height, not layout-shifting
     transforms.
     --------------------------------------------------------------------- */
  a[href], button, .shell-menu a, .shell-bottom a, .shell-bottom button {
    min-height: 44px;
  }

  /* ---------------------------------------------------------------------
     3) Prevent accidental horizontal scroll from any element that ignores
     the viewport (a stray fixed-width table, wide image, or long URL in
     copy). This is a pure safety net — it does nothing if nothing is
     overflowing.
     --------------------------------------------------------------------- */
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  img, table, iframe, video {
    max-width: 100%;
    height: auto;
  }

  /* ---------------------------------------------------------------------
     4) Readability floor. Body copy under ~15px is hard to read one-
     handed on a phone and hurts dwell time (a ranking-adjacent metric).
     Only raises text that is currently smaller than this floor.
     --------------------------------------------------------------------- */
  body, p, li {
    font-size: max(15px, 1em);
    line-height: 1.6;
  }

  /* ---------------------------------------------------------------------
     5) Sticky bottom action bar (shell-bottom) — reinforce that page
     content never sits underneath it, on ANY page that includes the bar,
     even if a future page forgets to add the body padding itself.
     --------------------------------------------------------------------- */
  body:has(.shell-bottom) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---------------------------------------------------------------------
     6) Faster-feeling tap response across the whole site.
     --------------------------------------------------------------------- */
  a, button {
    -webkit-tap-highlight-color: rgba(184, 134, 36, .15);
  }
  a:active, button:active {
    opacity: .85;
  }

  /* ---------------------------------------------------------------------
     7) Click-to-call / WhatsApp visibility floor: if a page has a phone
     or WhatsApp link in its content but no sticky bar (older/simpler
     pages), give the FIRST such link on the page a persistent, thumb-
     reachable style so mobile visitors are never more than one tap from
     contact even on pages that predate the shell-bottom bar.
     --------------------------------------------------------------------- */
  body:not(:has(.shell-bottom)) a[href^="tel:"]:first-of-type,
  body:not(:has(.shell-bottom)) a[href^="https://wa.me/"]:first-of-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
  }
}

/* Respect reduced-motion preference for the new active-state affordance above. */
@media (prefers-reduced-motion: reduce) {
  a:active, button:active { opacity: 1; }
}

/* ==========================================================================
   v82 addition — "Choose the closest legal concern" now has two labelled
   groups (Individuals & Families / Businesses & Corporates) instead of one
   undifferentiated grid. This styles the new group labels and gives the
   corporate group its own subtle accent so a business visitor immediately
   recognises "this site handles my kind of matter too" instead of only
   seeing divorce/family cards.
   ========================================================================== */
.v76-group-label {
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--v76-muted, #cad4ee);
  margin: 22px 2px 10px;
  font-size: .85rem;
  text-transform: uppercase;
}
.v76-group-label:first-of-type {
  margin-top: 4px;
}
.v76-group-label-corp {
  color: var(--v76-gold, #ffd45d);
}
.v76-service-grid-corp a {
  border-color: var(--v76-gold, #ffd45d) !important;
  background: linear-gradient(145deg, rgba(184,134,36,.16), #14254f) !important;
}

@media (max-width: 1023px) {
  .v76-service-grid { grid-template-columns: repeat(2, 1fr); }
  .v76-service-grid-corp { grid-template-columns: repeat(2, 1fr); }
}


/* ==========================================================================
   v83 — Reported bugs from live screenshots, fixed directly:
   1) "Free WhatsApp Consultation — Advocate Aayush Agarwal" button text was
      running off the edge of the screen in the digital business card.
   2) Body paragraphs on content pages (e.g. labour-law page) were rendering
      in a colour close to invisible against their background.
   3) WhatsApp actions weren't in WhatsApp's own recognisable green anywhere
      on the site — a missed trust cue (people trust the colour they already
      associate with the app).
   4) No persistent, always-visible WhatsApp entry point — added a genuine
      floating button below, independent of scroll position or which page
      template is active.
   ========================================================================== */

/* --- Fix 1: business-card action buttons must wrap, never overflow --- */
.aa-business-card-v55__actions a {
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  min-width: 0 !important;
  line-height: 1.3 !important;
  font-size: 13px !important;
  height: auto !important;
}
.aa-business-card-v55, .aa-business-card-v55__actions {
  max-width: 100%;
  box-sizing: border-box;
}

/* --- Fix 2: guaranteed-readable body copy on content/article pages --- */
html[data-shell-v75] section p,
html[data-shell-v75] section li,
html[data-shell-v75] article p,
html[data-shell-v75] article li,
.local-service-page p,
.local-service-page li,
.v76-article-page p,
.v76-article-page li {
  color: #18243b !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #18243b !important;
}

/* --- Fix 3: WhatsApp actions get WhatsApp's own green everywhere --- */
.shell-bottom a[href*="wa.me"],
.shell-bottom a[href*="whatsapp"],
.aa-business-card-v55__actions a[href*="wa.me"],
.aa-business-card-v55__actions a[href*="whatsapp"],
nav[aria-label] a[href*="wa.me"] {
  background: #25D366 !important;
  color: #ffffff !important;
  border-color: #25D366 !important;
}
.shell-bottom a[href*="wa.me"] svg,
.shell-bottom a[href*="whatsapp"] svg {
  color: #ffffff !important;
}

/* --- Fix 4: persistent floating WhatsApp button, every page --- */
.aa-wa-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 1300;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  animation: aa-wa-breathe 2.6s ease-in-out infinite;
  text-decoration: none;
}
.aa-wa-fab svg { width: 30px; height: 30px; display: block; }
@keyframes aa-wa-breathe {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,.35), 0 0 0 0 rgba(37,211,102,.55); }
  50%      { box-shadow: 0 6px 20px rgba(0,0,0,.35), 0 0 0 14px rgba(37,211,102,0); }
}
@media (min-width: 1024px) {
  .aa-wa-fab { bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .aa-wa-fab { animation: none; }
}
/* Never let the FAB sit on top of an open menu/dialog surface */
body.v80-footer-visible .aa-wa-fab { opacity: 0; pointer-events: none; }
