/* Realtor007.ai REPAIR-05 v4 — Width-Preserving Tap Targets + Inline Hit Areas
   Standalone interactive controls receive a 44x44 minimum target.
   Existing block/flex/inline-block widths and alignment are preserved.
   Running-text links remain unchanged under the WCAG 2.5.8 inline-text exception.
   Inline standalone anchors use an invisible pseudo-element hit area instead of a display change.
*/

:root {
  --r007-tap-target-min: 44px;
}

/* Standalone anchors: enforce minimum target dimensions where the element already
   has a measurable box. No generic display override is used. */
nav a,
footer a,
body a:not(p a):not(li a):not(.r007-inline-link):not(.skip-nav),
a.r007-sidecard-link,
a.bottom-cta-contact-val,
a.pc-nav-link {
  min-inline-size: var(--r007-tap-target-min) !important;
  min-block-size: var(--r007-tap-target-min) !important;
  box-sizing: border-box;
}

/* Compact navigation controls that genuinely need a measurable inline box. */
nav a,
.r007-lang-switch a,
a.footer-social-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* r007-inline-link contexts classified as standalone controls. Preserve their
   native display/width unless they are compact nav/footer controls below. */
nav a.r007-inline-link,
footer a.r007-inline-link,
div[style*="flex-direction:column"] > a.r007-inline-link,
.toc a.r007-inline-link,
.mortgage-links a.r007-inline-link,
.review-lessons-grid a.r007-inline-link,
.r007-about-sidecard__actions a.r007-inline-link,
.glh-related-guides a.r007-inline-link,
.card a.r007-inline-link,
.hub-return a.r007-inline-link,
.r007-about-sidecard__links a.r007-inline-link,
td > a.r007-inline-link {
  min-inline-size: var(--r007-tap-target-min) !important;
  min-block-size: var(--r007-tap-target-min) !important;
  box-sizing: border-box;
}

nav a.r007-inline-link,
footer a.r007-inline-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Inline standalone-anchor fallback.
   These measured v3 residue families can compute to display:inline, where CSS
   min-size properties are inert. Preserve their display and baseline geometry,
   then expand the clickable area with an invisible generated box.
   Full-width/flex variants are not shrink-wrapped because display is untouched. */
footer a,
a.bottom-cta-contact-val,
a.r007-contact-link,
a.btn,
a.cta-btn,
body a:not([class]):not(p a):not(li a):not(.skip-nav),
body a.r007-inline-link:not(p a):not(li a):not(.skip-nav) {
  position: relative;
}

footer a::after,
a.bottom-cta-contact-val::after,
a.r007-contact-link::after,
a.btn::after,
a.cta-btn::after,
body a:not([class]):not(p a):not(li a):not(.skip-nav)::after,
body a.r007-inline-link:not(p a):not(li a):not(.skip-nav)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: var(--r007-tap-target-min);
  min-block-size: var(--r007-tap-target-min);
  pointer-events: auto;
}

/* Native standalone controls. Keep their existing display mode. */
button,
input:not([type="hidden"]),
select,
textarea,
summary {
  min-block-size: var(--r007-tap-target-min) !important;
  box-sizing: border-box;
}

button,
input:not([type="hidden"]) {
  min-inline-size: var(--r007-tap-target-min) !important;
}

/* Checkbox/radio controls need a physical 44x44 target box. */
input[type="checkbox"],
input[type="radio"] {
  inline-size: var(--r007-tap-target-min) !important;
  block-size: var(--r007-tap-target-min) !important;
  min-inline-size: var(--r007-tap-target-min) !important;
  min-block-size: var(--r007-tap-target-min) !important;
  flex: 0 0 var(--r007-tap-target-min) !important;
}

/* Preserve native summary/list-item disclosure markers. No display override. */
summary {
  min-block-size: var(--r007-tap-target-min) !important;
}

/* Skip-nav controls are intentionally off-screen while idle. Once keyboard
   focus makes them visible, provide the same minimum target. */
a.skip-nav:focus,
a.skip-nav:focus-visible {
  min-inline-size: var(--r007-tap-target-min) !important;
  min-block-size: var(--r007-tap-target-min) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
