/* ==========================================================================
   Referral Diamond Club — Flagler County, FL
   Monochrome (black / white / graphite) + a single "diamond ice" accent,
   matching the club's black-and-white diamond logo.
   Type: Cinzel (display) · Fauna One (lead prose) · Open Sans (UI + data)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Neutrals */
  --ink:        #0B0B0D;   /* hero / footer ground */
  --ink-2:      #16161A;   /* raised dark surface */
  --ink-3:      #24242B;   /* dark hairline */
  --graphite:   #3A3A44;
  --slate:      #5C6270;   /* secondary text on light — 5.3:1 on white */
  --silver:     #D9DBE0;   /* hairline on light */
  --silver-2:   #E8EAEE;
  --mist:       #F4F5F7;   /* page ground */
  --paper:      #FFFFFF;   /* card ground */

  /* Diamond ice accent */
  --ice:        #1F6F94;   /* links + buttons on light — 5.6:1 on white */
  --ice-deep:   #17566F;   /* hover */
  --ice-soft:   #E7F1F6;   /* tint fill */
  --ice-line:   #B9D6E4;
  --ice-lite:   #7FC4E3;   /* links on dark — 10:1 on ink */

  /* Semantic */
  --text:       var(--ink);
  --text-muted: var(--slate);
  --bg:         var(--mist);
  --surface:    var(--paper);
  --border:     var(--silver);
  --focus:      var(--ice);

  /* Type */
  --f-display: "Cinzel", "Times New Roman", Georgia, serif;
  --f-lead:    "Fauna One", Georgia, "Times New Roman", serif;
  --f-ui:      "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm — 4/8 scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(11,11,13,.05), 0 1px 3px rgba(11,11,13,.04);
  --shadow-2: 0 4px 12px rgba(11,11,13,.07), 0 2px 4px rgba(11,11,13,.04);
  --shadow-3: 0 12px 32px rgba(11,11,13,.12), 0 4px 8px rgba(11,11,13,.05);

  --wrap: 1180px;
  --header-h: 68px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: 220ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 96px); }
body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ice-deep); }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 700; line-height: 1.15; letter-spacing: .005em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--ice-lite); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Utilities ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-5); }
@media (max-width: 640px) { .wrap { padding-inline: var(--s-4); } }

.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;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 200;
  background: var(--ink); color: #fff; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s-3); color: #fff; }

/* ---------- Diamond mark ----------
   Stroke/fill live as presentation attributes on the <symbol> paths: CSS
   descendant selectors do not cross the <use> shadow boundary, but `color`
   does inherit, so currentColor still tracks the surrounding text colour. */
.diamond { display: block; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid var(--ink-3);
}
.site-header .wrap {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: var(--s-5);
}
.brand {
  display: flex; align-items: center; gap: var(--s-3);
  color: #fff; text-decoration: none; margin-right: auto; padding: var(--s-2) 0;
}
.brand:hover { color: #fff; }
.brand .diamond { width: 30px; height: 30px; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--f-display); font-weight: 700;
  font-size: 15px; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap;
}
.brand-sub {
  font-family: var(--f-ui); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-top: 4px; white-space: nowrap;
}
.site-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 var(--s-3);
  color: rgba(255,255,255,.6); text-decoration: none;
  font-size: 13px; font-weight: 600; border-radius: var(--r-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-link:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (max-width: 560px) {
  .site-link span, .brand-sub { display: none; }
  .site-link { font-size: 0; padding: 0 var(--s-2); }
  .site-link svg { width: 16px; height: 16px; }
}

/* ---------- Controls ----------
   .dir-scope is the sticky containing block: the filter bar follows you while
   you are in the directory, then releases once the member grid ends, instead
   of hanging over Open Seats / Leadership / Join. */
.dir-scope { position: relative; }

.controls {
  position: sticky; top: var(--header-h); z-index: 90;
  background: rgba(244,245,247,.94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: var(--s-5) 0 var(--s-4);
}
.tool-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  margin-bottom: var(--s-4);
}
.search-field { position: relative; width: 100%; min-width: 0; }
.search-field .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--slate); pointer-events: none;
}
#search {
  width: 100%; min-height: 56px;
  padding: 0 44px 0 42px;
  background: var(--paper);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 16px; /* 16px avoids iOS zoom */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#search::placeholder { color: var(--slate); }
#search:focus { border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-soft); outline: none; }
.clear-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: none; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer; color: var(--slate);
}
.clear-btn:hover { background: var(--silver-2); color: var(--ink); }
.clear-btn.show { display: flex; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.chip {
  min-height: 38px; padding: 0 var(--s-4);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); color: var(--graphite);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--graphite); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
/* .6 blended --graphite down to #89898f on white = 3.48:1. .75 keeps the count
   clearly de-emphasised while passing in BOTH chip states: 5.28:1 unpressed and
   11.04:1 when aria-pressed flips the chip to white-on-ink. Opacity is used
   rather than a fixed colour precisely so it works against both grounds. */
.chip .count { font-variant-numeric: tabular-nums; opacity: .75; font-weight: 700; }

/* On phones the wrapped chip rows made the sticky block ~300px tall and ate
   the viewport. Collapse them to one swipeable row instead. */
@media (max-width: 760px) {
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* bleed to the viewport edges so chips scroll past the gutter */
    margin-inline: calc(var(--s-4) * -1);
    padding-inline: var(--s-4);
    padding-bottom: var(--s-1);
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { scroll-snap-align: start; }
  .result-line { margin-top: var(--s-3); }
}

.result-line {
  margin-top: var(--s-4); font-size: 14px; color: var(--text-muted);
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.result-line strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Member grid ---------- */
.results { padding: var(--s-6) 0 var(--s-8); }

.grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
@media (max-width: 460px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); border-color: #C4C8D0; transform: translateY(-2px); }

.card-top { display: flex; align-items: flex-start; gap: var(--s-3); }
.monogram {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: .04em;
}
.card-cat {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ice); margin-bottom: 4px; line-height: 1.4;
}
.card-biz { font-family: var(--f-display); font-size: 1.14rem; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.card-person { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.card-blurb { font-size: 14.5px; line-height: 1.62; color: var(--graphite); }

.lead-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--ice-soft); border: 1px solid var(--ice-line); color: var(--ice-deep);
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  margin-top: var(--s-2);
}
.lead-badge .diamond { width: 10px; height: 10px; }

.card-contact {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--silver-2);
}
.contact-row {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 40px; padding: 0 var(--s-2); margin-inline: calc(var(--s-2) * -1);
  border-radius: var(--r-sm); text-decoration: none; color: var(--ink);
  font-size: 14px; transition: background var(--dur) var(--ease);
}
.contact-row:hover { background: var(--mist); color: var(--ink); }
.contact-row .ico { flex: none; width: 16px; height: 16px; color: var(--slate); }
.contact-row .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-row .val.num { font-variant-numeric: tabular-nums; }
.contact-row .tag {
  flex: none; margin-left: auto;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate);
}

/* One action per card: grab the whole block to pass along. */
.copy-all {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: 44px; margin-top: var(--s-3);
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink); border-radius: var(--r-md);
  font-family: var(--f-ui); font-size: 13.5px; font-weight: 700; letter-spacing: .01em;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.copy-all svg { width: 15px; height: 15px; }
.copy-all:hover { background: var(--ice-deep); border-color: var(--ice-deep); }
.copy-all.copied { background: var(--ice); border-color: var(--ice); }

/* ---------- Uncovered categories ---------- */
.gaps {
  background: var(--paper);
  border-top: 1px solid var(--border);
  padding: var(--s-7) 0;
}
.gaps h2 { font-size: 1.15rem; margin-bottom: var(--s-2); }
.gaps-note { font-size: 14px; color: var(--text-muted); max-width: 64ch; margin-bottom: var(--s-5); line-height: 1.6; }
.gap-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.gap {
  padding: 6px var(--s-3);
  background: var(--mist); border: 1px solid var(--silver-2); border-radius: var(--r-sm);
  font-size: 13px; color: var(--graphite);
}

/* ---------- Empty state ---------- */
.empty {
  grid-column: 1 / -1; text-align: center;
  padding: var(--s-8) var(--s-5);
  background: var(--paper); border: 1px dashed var(--border); border-radius: var(--r-lg);
}
.empty .diamond { width: 30px; height: 30px; margin: 0 auto var(--s-4); color: var(--silver); }
.empty h3 { font-size: 1.15rem; margin-bottom: var(--s-2); }
.empty p { color: var(--text-muted); font-size: 14.5px; max-width: 46ch; margin: 0 auto var(--s-4); }
.text-link { font-size: 14px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.6);
  padding: var(--s-6) 0; border-top: 1px solid var(--ink-3);
  font-size: 13.5px; line-height: 1.65;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }
.colophon { margin-top: 6px; color: rgba(255,255,255,.45); font-size: 12.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  z-index: 300; pointer-events: none;
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--ink); color: #fff;
  padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-3);
  opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--ice-lite); }

/* ---------- Print: a clean paper roster ---------- */
@media print {
  .site-header, .controls, .site-footer, .toast, .copy-all, .skip-link { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .results { padding: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8pt; }
  .card { break-inside: avoid; box-shadow: none; border-color: #999; padding: 8pt; }
  .gaps { background: #fff; border-color: #999; padding: 12pt 0; }
  .gap-list { gap: 4pt; }
  .gap { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
}

/* ---------- Touch sizing ----------
   Desktop keeps the denser 38-40px controls (mouse precision); anything
   driven by a finger gets the 44px minimum. */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .contact-row { min-height: 44px; }
}
