/* Thrive Together Connect — base styles.
   Brand tokens are placeholders until Nora's palette/logo land: swap values in :root only. */
:root {
  --brand: #0f5c5c;          /* primary (deep teal) */
  --brand-ink: #ffffff;
  --brand-soft: #e3efee;
  --accent: #c8553d;         /* warm accent */
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1f2a2e;
  --ink-muted: #4f5b5f;      /* ≥ 4.5:1 on --bg and --surface */
  --line: #d9d4cb;
  --ok: #1d6b3a;
  --ok-soft: #e2f1e6;
  --warn: #8a5300;
  --warn-soft: #fbefd9;
  --danger: #a3261b;
  --danger-soft: #f9e1de;
  --focus: #1a56db;
  --radius: 12px;
  --gap: 1rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;          /* respects user/OS text size */
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }
.wrap-wide { max-width: 72rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }

/* Header */
.site-header { background: var(--brand); color: var(--brand-ink); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--brand-ink); text-decoration: none; font-size: 1.05rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a { color: var(--brand-ink); text-decoration: none; padding: .4rem .6rem; border-radius: 8px; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255,255,255,.16); }

main { padding-top: 1.25rem; padding-bottom: 2rem; }
.site-footer { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; color: var(--ink-muted); font-size: .9rem; padding-bottom: 2rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.25rem; margin: 1.75rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--ink-muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.1rem; }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Cards & lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.card + .card { margin-top: .75rem; }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.person-card { display: grid; gap: .35rem; }
.person-card .meta { color: var(--ink-muted); font-size: .95rem; }
.reason { margin: .25rem 0 0; padding-left: .75rem; border-left: 3px solid var(--accent); }
.empty { text-align: center; color: var(--ink-muted); padding: 1.5rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); }

/* Badges / chips — track color is always paired with a text label */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--brand-soft); color: var(--ink); border: 1px solid transparent; }
.chip-track { border-color: rgba(0,0,0,.15); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-muted { background: #eee; color: var(--ink-muted); }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.hint { display: block; font-weight: 400; color: var(--ink-muted); font-size: .9rem; margin-top: .15rem; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=search], input[type=date], input[type=file], select, textarea {
  width: 100%; font: inherit; color: inherit; padding: .65rem .75rem; border: 1.5px solid #8c938f; border-radius: 8px; background: var(--surface);
}
textarea { min-height: 5.5rem; resize: vertical; }
.field { margin-bottom: 1.1rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .6rem; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.counter { font-size: .85rem; color: var(--ink-muted); text-align: right; }

/* Buttons — min 44px tap targets */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem;
  font: inherit; font-weight: 700; border-radius: 10px; border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  text-decoration: none; cursor: pointer;
}
.btn-secondary { background: var(--surface); color: var(--brand); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Flash & banners */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; background: var(--brand-soft); }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }
.offline-banner { background: var(--warn-soft); color: var(--warn); padding: .6rem 1rem; text-align: center; font-weight: 600; }

/* Tables (organizer / lead) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat .num { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--ink-muted); font-size: .9rem; }

/* Tabs-ish sub nav */
.subnav { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.subnav a { padding: .5rem .75rem; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.subnav a[aria-current="page"] { border-color: var(--brand); color: var(--ink); }

@media (min-width: 48rem) {
  h1 { font-size: 1.9rem; }
}

@media print {
  .site-header, .site-footer, .offline-banner, .no-print, .skip-link { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
}
