/* ==============================================================
   Nevada Desert Realty: accessibility layer (WCAG 2.1 AA)
   Loaded on every page AFTER the page's own styles.
   Visual changes are limited to: keyboard focus rings (keyboard only),
   the skip link (only visible when tabbed to), and the video pause button.
   Per-page colour-contrast fixes live in each page's <style id="nvdr-contrast">.
   ============================================================== */

/* -- Skip link: hidden until a keyboard user tabs to it ------- */
.nvdr-skip {
  position: absolute !important;
  top: -80px;
  left: 20px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 10px;
  background: #307c7c;
  color: #ffffff !important;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: top .2s;
}
.nvdr-skip:focus,
.nvdr-skip:focus-visible { top: 10px; outline: 3px solid #1f2a2a; outline-offset: 2px; }

/* -- Visible keyboard focus (only for keyboard navigation) ----- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid #307c7c !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .85) !important;
}
/* Text fields keep their existing focus border; add a clear ring for keyboard users */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #307c7c !important;
  outline-offset: 1px !important;
}

/* -- Invalid fields (set by nvdr-forms.js) --------------------- */
[aria-invalid="true"] { border-color: #e05252 !important; }

/* -- Links inside sentences must not rely on colour alone ------ */
.form-privacy a,
.cta-privacy a,
.form-note a,
.modal-privacy a,
p a[href*="privacy-policy"],
p a[href$="#footer"] { text-decoration: underline; text-underline-offset: 2px; }

/* -- Screen-reader-only helper --------------------------------- */
.nvdr-sr-only {
  position: absolute !important; width: 1px !important; height: 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;
}

/* -- Hero video pause / play control --------------------------- */
.nvdr-video-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50px;
  background: rgba(0, 0, 0, .55);
  color: #ffffff;
  font: 600 .75rem/1 'DM Sans', system-ui, sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.nvdr-video-toggle:hover { background: rgba(0, 0, 0, .75); }

/* -- hCaptcha widget spacing inside forms ---------------------- */
.nvdr-captcha { margin: 6px 0 14px; min-height: 0; max-width: 100%; }
.nvdr-captcha:empty { margin: 0; }

/* -- Respect "reduce motion" ----------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* -- Small-screen fix: link buttons in dark info boxes must wrap,
      otherwise they spill outside the box (unreadable) and cause sideways scrolling */
@media (max-width: 640px) {
  .internal-links-actions { min-width: 0; max-width: 100%; }
  .internal-link-btn { white-space: normal; max-width: 100%; }
}

/* ==============================================================
   Header auto-fit (set by nvdr-a11y.js). On laptop widths where the full menu
   doesn't fit, tighten it first; if it still doesn't fit, use the hamburger menu.
   Prevents the header from running off-screen and causing sideways scrolling.
   ============================================================== */
html.nvdr-nav-tight .header-phone { display: none !important; }
html.nvdr-nav-tight nav.main-nav a { padding-left: 8px; padding-right: 8px; }
html.nvdr-nav-tight .header-inner { gap: 14px; }
html.nvdr-nav-compact nav.main-nav { display: none !important; }
html.nvdr-nav-compact .hamburger { display: flex !important; }
/* Phone widths: shrink the logo and header button slightly when the header doesn't fit;
   on very narrow phones hide the header button (it is also in the menu) */
html.nvdr-nav-xs .site-logo img { height: 34px !important; width: auto; }
html.nvdr-nav-xs .header-cta { gap: 8px; }
html.nvdr-nav-xs .header-cta .btn { padding: 9px 12px; font-size: .78rem; }
html.nvdr-nav-xs .header-inner { gap: 10px; }
html.nvdr-nav-xxs .header-cta .btn { display: none !important; }

/* ==============================================================
   Footer legal disclosures + Equal Housing Opportunity mark (footer.js)
   ============================================================== */
.ndr-legal {
  display: grid; grid-template-columns: auto 1fr; column-gap: 22px; row-gap: 6px;
  padding: 22px 0 8px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .78rem; line-height: 1.55; color: rgba(255, 255, 255, .78);
}
.ndr-legal p { margin: 0; grid-column: 2; }
.ndr-legal strong { color: #ffffff; }
.ndr-eho {
  grid-row: 1 / span 4; align-self: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 86px;
  color: #ffffff; font-size: .58rem; font-weight: 700; letter-spacing: .06em; line-height: 1.25;
  text-transform: uppercase; text-align: center;
}
.ndr-eho .ndr-eho-logo { width: 44px; height: 44px; }
.ndr-eho-inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ndr-eho-inline .ndr-eho-logo { width: 18px; height: 18px; }
@media (max-width: 540px) {
  .ndr-legal { grid-template-columns: 1fr; text-align: center; }
  .ndr-legal p { grid-column: 1; }
  .ndr-eho { grid-row: auto; margin: 0 auto 6px; }
}
