/* 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;
}


/* HEADER_LANGUAGE_REPAIR_v01 — bounded responsive-header correction.
   Applies only to existing homepage and School navigation families. */
@media (max-width:1100px){
  .site-header .navlinks.open{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-content:start;
    gap:.35rem .5rem;
    padding:.55rem .75rem;
    max-block-size:calc(100vh - 73px);
    overflow-y:auto;
  }
  .site-header .navlinks.open>a,
  .site-header .navlinks.open>button{min-inline-size:0;inline-size:100%;}
  .site-header .navlinks.open>.btn,
  .site-header .navlinks.open>.lang{grid-column:1 / -1;}
  .site-header .navlinks.open>.lang{
    border-left:0;
    border-top:1px solid var(--line,#dfe5eb);
    padding:.25rem 0 0;
  }

  .topbar .topbar-inner{
    min-height:61px;
    display:grid;
    grid-template-columns:minmax(44px,auto) minmax(88px,1fr) max-content;
    align-items:center;
    gap:.35rem;
  }
  .topbar .topnav{min-width:0;justify-content:center;}
  .topbar .topnav .lbl{
    position:absolute!important;
    inline-size:1px!important;
    block-size:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0 0 0 0)!important;
    white-space:nowrap!important;
    border:0!important;
  }
  .topbar .lang-switch{
    width:auto!important;
    margin:0!important;
    justify-content:flex-end!important;
    flex-wrap:nowrap!important;
    gap:.25rem!important;
  }
  .advisory-strip .inner{
    padding:.35rem .75rem;
    font-size:.78rem;
    line-height:1.25;
  }
}
@media (max-width:760px){
  .topbar .brand .bt b{display:none!important;}
  body:has(.topbar) section.block{scroll-margin-top:130px!important;}
}


/* HEADER_LANGUAGE_H1_H2_M1_REPAIR_v01 - language controls must retain a 44px hit area. */
.topbar .lang-switch a{
  min-inline-size:44px!important;
  min-block-size:44px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
}
