/* Help Is Near — design system.
   Derived from the approved mock-up, with WCAG 2.2 AA fixes applied:
   - visible focus rings restored everywhere (never outline: transparent)
   - body text contrast raised to meet 4.5:1 on white/pale backgrounds
   - all situation buttons styled identically (no colour cue singling out
     the domestic-abuse-related option — see Pages/Index.cshtml)
   - touch targets kept at 44px+ */

:root {
  --ink: #17233b;
  --ink-soft: #3d4a5c;   /* raised from mock's #526170 to clear 4.5:1 on white */
  --blue: #245c73;
  --pale: #eef7f6;
  --warm: #fffaf1;
  --green: #1f6350;      /* darkened slightly from mock's #24735b for AA on white */
  --line: #d8e3e3;
  --white: #fff;
  --danger: #7b2637;
  --focus: #0b4f6c;
  --focus-ring: 0 0 0 3px rgba(11, 79, 108, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Standard accessible-hiding pattern — visually hidden but still available to screen
   readers. Used instead of any inline hiding style (which the site's CSP blocks). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

a { color: var(--focus); }
a:not(.btn):not(.choice):not(.exit) { text-underline-offset: 2px; }

.wrap { max-width: 1120px; margin: auto; padding: 0 24px; }

/* Focus visibility — applied globally, never suppressed */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Header */
header.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  /* Focus outline should hug the logo image, not an invisible text box. */
  border-radius: 4px;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}
.head-actions { display: flex; gap: 10px; align-items: center; }
.urgent-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 12px;
  color: var(--danger);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Quick exit — persistent, keyboard reachable, on every page */
.quick-exit-btn {
  border: 0;
  border-radius: 9px;
  background: #303944;
  color: #fff;
  font-weight: 800;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 15px;
  min-height: 44px;
}
.quick-exit-btn:hover { background: #212831; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--pale), var(--warm)); padding: 56px 0 48px; }
.hero-inner { max-width: 860px; }
.eyebrow { font-weight: 750; color: var(--green); margin-bottom: 10px; }
.hero h1 {
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 0 0 16px;
}
.hero-inner > p {
  font-size: 19px;
  max-width: 720px;
  margin: 0 0 26px;
  color: var(--ink-soft);
}

.journey {
  background: #fff;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(28, 57, 67, 0.08);
}
.journey h2 { font-size: 18px; margin: 0 0 16px; }

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid #b9c9ca;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  width: 100%;
  min-height: 44px;
}
.choice:hover { border-color: var(--green); background: #f7fbfa; }
.choice[aria-pressed="true"] {
  border-color: var(--green);
  background: #f0f8f5;
  box-shadow: inset 0 0 0 1px var(--green);
}
.choice .ico {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pale);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 15px;
}
/* Deliberately identical styling for every situation button, including the
   safety-related one — no visual cue should single it out on a shared screen. */

/* Always visible — the location field and submit button must work with JS disabled
   (fix #8, 2026-09-21 review). ".show" is kept as a marker class for clarity/history. */
.location { display: block; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.location label { font-weight: 700; display: block; margin-bottom: 7px; }
.locrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.location input {
  height: 50px;
  border: 1px solid #9fb0b2;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  width: 100%;
}
.btn {
  height: 50px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  padding: 0 24px;
  cursor: pointer;
}
.btn:hover { background: #184f40; }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid #9fb0b2;
}
.btn-secondary:hover { background: #f7f9f8; }

.privacy-note { font-size: 14px; color: var(--ink-soft); margin: 14px 2px 0; }
.privacy-note a { font-weight: 700; }

section { padding: 52px 0; }
.situation h2, .how h2, .trust h2 { font-size: 30px; letter-spacing: -0.6px; margin: 0 0 12px; }
.situation p, .trust p { font-size: 17px; color: var(--ink-soft); max-width: 730px; }

.example {
  margin-top: 24px;
  padding: 22px;
  border-radius: 16px;
  background: #f7f9f8;
  border: 1px solid var(--line);
}
.example strong { display: block; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; list-style: none; padding: 0; }
.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
}

.how { background: #f7f9f8; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 30px; }
.step-num { font-size: 14px; font-weight: 800; color: var(--green); }
.step h3 { font-size: 20px; margin: 8px 0; }
.step p { color: var(--ink-soft); margin: 0; }

.trustgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.safetybox {
  background: var(--warm);
  border-left: 4px solid #b8863b;
  padding: 20px;
  border-radius: 8px;
}
.safetybox h3 { margin: 0 0 8px; }
.safetybox p { font-size: 15px; margin: 7px 0; color: var(--ink); }

#urgent { background: #fff6f7; border-top: 1px solid #e6c3c9; border-bottom: 1px solid #e6c3c9; }
.urgentgrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.urgentgrid h2 { margin: 0 0 10px; font-size: 27px; }
.urgentgrid p { color: var(--ink-soft); }
.emergency { background: #fff; border: 1px solid #dcb0b7; border-radius: 14px; padding: 20px; }
.emergency strong { color: var(--danger); }

footer.site-footer { background: var(--ink); color: #fff; padding: 38px 0; }
.foot { display: flex; justify-content: space-between; gap: 26px; align-items: flex-end; flex-wrap: wrap; }
.foot small { color: #c7d1dc; display: block; margin-top: 7px; line-height: 1.5; }
.foot small a { color: #cfe3e0; font-weight: 700; text-decoration-thickness: 1px; }
.foot small a:hover { color: #fff; }
.foot-links { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.foot-links a { color: #e2e8ee; }

/* Result cards */
.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
}
.result-card h3 { margin: 0 0 6px; font-size: 19px; }
.result-meta { color: var(--ink-soft); font-size: 14px; margin-bottom: 10px; }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; list-style: none; padding: 0; }
.freshness { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

.zero-results {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
}

/* Bootstrap-free forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9fb0b2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
}

/* Generic page-body layout, replacing what used to be repeated inline styles across
   .cshtml files (see fix #4 — inline style="..." attributes are blocked by the CSP). */
.page-section { padding: 44px 0; }
.page-section.narrow { max-width: 640px; }
.page-section.prose { max-width: 760px; }
.org-detail { max-width: 760px; }
.back-link { margin: 0 0 6px; }
.muted { color: var(--ink-soft); }
.result-count { color: var(--ink-soft); font-size: 15px; }
.results-list { margin-top: 20px; }
.result-card-title { font-size: 19px; margin: 0 0 6px; }
.result-card-link { text-decoration: none; color: inherit; }
.result-desc { margin: 0 0 8px; }
.result-card-action { margin-top: 12px; }
.btn-view-details { display: inline-flex; align-items: center; text-decoration: none; height: auto; padding: 10px 18px; }
.btn-inline { display: inline-flex; align-items: center; text-decoration: none; margin-right: 10px; }
.btn-secondary-link { display: inline-flex; align-items: center; text-decoration: none; }
.inline-form { display: inline-block; margin: 0; }
.inline-form .btn { height: auto; padding: 10px 18px; font-size: inherit; font-family: inherit; }
.zero-results-heading { font-size: 19px; }
.zero-results-actions { margin-top: 14px; }

.org-summary { font-size: 18px; }
.org-contact-card { margin-top: 20px; }
.org-contact-title { font-size: 18px; margin-top: 0; }
.org-services-title { font-size: 20px; margin-top: 32px; }
.org-services-list { display: grid; gap: 14px; }
.org-service-title { font-size: 17px; margin: 0 0 6px; }
.org-service-status { margin: 0; }
.status-accepting { color: var(--green); font-weight: 700; }
.freshness-spaced { margin-top: 24px; }
.org-footer-note { margin-top: 28px; color: var(--ink-soft); font-size: 14px; }
.error-reference { color: var(--ink-soft); font-size: 14px; }

/* Long contact links (websites/emails) must not overflow their container on mobile. */
.long-link { overflow-wrap: break-word; word-break: break-word; }

/* Homepage journey extras */
.journey-browse-link { margin-top: 18px; }
.journey-browse-link .btn-secondary { display: inline-flex; align-items: center; text-decoration: none; }

/* Situation picker — native radio-group baseline styled to look like button cards,
   works fully without JavaScript (fix #8). */
.choice-option { position: relative; }
.choice-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice-option label.choice {
  cursor: pointer;
}
.choice-option input[type="radio"]:checked + label.choice {
  border-color: var(--green);
  background: #f0f8f5;
  box-shadow: inset 0 0 0 1px var(--green);
}
.choice-option input[type="radio"]:focus-visible + label.choice {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Browse page */
.browse-empty { margin-top: 24px; }
.browse-categories { margin-top: 32px; display: grid; gap: 32px; }
.browse-category-title { font-size: 22px; margin: 0 0 14px; }
.browse-category-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.browse-card { display: block; text-decoration: none; color: inherit; height: 100%; }
.browse-card-title { font-size: 16px; }
.browse-card-desc { margin: 0; color: var(--ink-soft); font-size: 14px; }
.browse-intro { color: var(--ink-soft); max-width: 640px; font-size: 17px; }

/* Quick exit — real anchor styled as a button (fix #5) */
a.quick-exit-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 800px) {
  .choices, .steps, .trustgrid, .urgentgrid { grid-template-columns: 1fr; }
  .hero { padding: 42px 0; }
  .foot { display: block; }
  .foot-links { margin-top: 20px; }
  .head-actions .urgent-link {
    font-size: 0;
    padding: 10px;
    width: 44px;
    justify-content: center;
  }
  .head-actions .urgent-link::before {
    content: "!";
    font-size: 18px;
    font-weight: 800;
  }
}

@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .hero-inner > p { font-size: 17px; }
  .journey { padding: 16px; }
  .choice { padding: 12px; }
  .locrow { grid-template-columns: 1fr; }
  .brand-logo { height: 28px; }
}
