/* Reclaim — accessibility, responsive and print layer.
   The design lives in inline styles carried over from the source design.
   This sheet only adds what inline styles cannot express: media queries,
   focus states, motion preferences and skip navigation. */

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: #C9A227;
  color: #08130F;
  font-family: Mulish, system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 0 0 4px 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Focus visibility (WCAG 2.4.7, 2.4.11) ----------
   The source design removed outlines on inputs. Restore a focus indicator
   that meets 3:1 contrast against both the dark and bone grounds. */
:focus-visible {
  outline: 3px solid #8FE6DA;
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #8FE6DA;
  outline-offset: 2px;
}
/* On the bone (light) ground the mint ring is too light — darken it. */
.ground-bone :focus-visible {
  outline-color: #0A4A43;
}

/* ---------- Screen-reader-only utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Target size (WCAG 2.5.8 AA — 24×24 minimum) ---------- */
header nav a,
footer a,
button {
  min-height: 24px;
}
.nav-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* ---------- Responsive navigation ----------
   Replaces the JS-measured viewport logic from the design tool. */
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .primary-nav {
    display: none !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    padding: 16px 0 8px;
  }
  .primary-nav[data-open="true"] {
    display: flex !important;
  }
}

/* ---------- Reduced motion (WCAG 2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Forced colours / high contrast ---------- */
@media (forced-colors: active) {
  .skip-link,
  button,
  a {
    forced-color-adjust: auto;
  }
}

/* ---------- Text spacing resilience (WCAG 1.4.12) ---------- */
p, li, dd {
  overflow-wrap: break-word;
}

/* ---------- Form validation messaging ---------- */
.field-error {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #F0A08F;
  margin-top: 6px;
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-bottom-color: #F0A08F !important;
}

/* ---------- No-JS fallbacks ---------- */
.no-js .js-only { display: none !important; }
.no-js .no-js-note { display: block !important; }
.no-js-note { display: none; }

/* ---------- Print ---------- */
@media print {
  header, footer, .skip-link, .nav-toggle { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  main { color: #000 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; }
}

/* ---------- Territory map dots ----------
   The visible dot stays 10px; the interactive target is 24×24 (WCAG 2.5.8). */
.map-dot {
  position: absolute;
  display: block;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.map-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--dot-size, 10px);
  height: var(--dot-size, 10px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--dot, #8FA3A0);
  border: var(--dot-ring, 1px solid rgba(244, 246, 245, 0.25));
  transition: box-shadow .2s ease, transform .2s ease;
}
.map-dot:hover::before,
.map-dot:focus-visible::before {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 0 4px rgba(143, 230, 218, 0.28);
}

/* ---------- Form controls ----------
   The design uses underlined, transparent fields. Enforced here so the style
   cannot be lost to inline-style serialisation, and so autofill matches. */
form[name="territory-application"] input[type="text"],
form[name="territory-application"] input[type="email"],
form[name="territory-application"] input[type="tel"],
form[name="territory-application"] textarea {
  background-color: transparent;
  color: #F4F6F5;
  -webkit-text-fill-color: #F4F6F5;
}
form[name="territory-application"] input:-webkit-autofill,
form[name="territory-application"] input:-webkit-autofill:hover,
form[name="territory-application"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #F4F6F5;
  -webkit-box-shadow: 0 0 0 1000px #06322D inset;
  caret-color: #F4F6F5;
  transition: background-color 9999s ease-in-out 0s;
}
form[name="territory-application"] input:focus,
form[name="territory-application"] textarea:focus {
  border-bottom-color: #0DA89B;
}
form[name="territory-application"] input[type="checkbox"] {
  accent-color: #0DA89B;
}

/* ---------- Hero: mobile fold ----------
   The full 24-row ledger collapses to one column below ~760px, which pushed the
   headline roughly 1100px down the page. On small screens the ledger is trimmed
   to six rows with a link to the full register, and hero padding is tightened,
   so the headline and the zip lookup land inside the first viewport. */
.ledger-more { display: none; }

@media (max-width: 760px) {
  .hero-inner {
    padding-top: 26px !important;
  }
  .ledger-grid > div:nth-child(n+7) {
    display: none;
  }
  .ledger-more {
    display: inline-block;
    margin-top: 14px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: #8FE6DA;
    text-decoration: none;
    min-height: 24px;
    padding: 4px 0;
  }
  .ledger-more:hover,
  .ledger-more:focus-visible {
    text-decoration: underline;
  }
  .hero-copy {
    padding: 26px 0 76px !important;
  }
  .hero-copy h1 {
    font-size: clamp(2.5rem, 12vw, 4rem) !important;
  }
  .hero-copy p {
    font-size: 16px !important;
    margin-top: 22px !important;
  }
}
