/* The whole look (preview spec §8): quiet and plain, more a well-made letter than an app.
   Colours are tokens; tests/test_style.py checks every text pairing for WCAG AA in both
   schemes. Nothing here loads anything from anywhere. */

:root {
  --bg: #faf7f2;
  --fg: #1f1d1a;
  --muted: #5c5750;
  --accent: #2f5d62;
  --accent-fg: #ffffff;
  --line: #ddd5c8;
  --field-line: #968e81;
  --card: #ffffff;
  --banner-bg: #f6e7b4;
  --banner-fg: #3a3020;
  --danger: #8a2c2c;
  --danger-fg: #ffffff;
  --notice-bg: #e6efe9;
  --notice-fg: #1f3a2c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b19;
    --fg: #ece7df;
    --muted: #b3aca1;
    --accent: #8fc1c4;
    --accent-fg: #102426;
    --line: #3a3732;
    --field-line: #706d68;
    --card: #252320;
    --banner-bg: #4a3f1c;
    --banner-fg: #f6ecd0;
    --danger: #e59a9a;
    --danger-fg: #2a1010;
    --notice-bg: #213328;
    --notice-fg: #d6eadc;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* One readable column */
.site-header, main, .feedback, .site-footer, .preview-banner > * {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Long strings (calendar links, emails) wrap on a 320px phone instead of scrolling sideways */
main, .card, .meetup, .notice, .cal-url, .feedback {
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
}

.lede {
  font-size: 1.25rem;
}

.steps li {
  margin-bottom: 0.75rem;
}

/* Header and navigation */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.site-name {
  margin: 0;
  font-weight: 700;
}

.site-name a {
  color: var(--fg);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

/* Every link people tap is at least 48px tall: TOS makes fine movements painful */
.site-nav a, .preview-nav a, .crisis-lines a, .quiet a, .site-name a, .card a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.25rem;
}

/* Buttons */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-fg);
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  text-decoration: none;
  cursor: pointer;
}

button.secondary, .button.secondary, button.maybe {
  color: var(--accent);
  background: transparent;
}

button.danger {
  color: var(--danger-fg);
  background: var(--danger);
  border-color: var(--danger);
}

button.maybe[aria-pressed="true"] {
  color: var(--accent-fg);
  background: var(--accent);
}

/* The mark is decoration, as aria-pressed already says it: empty alt text where the browser allows */
button.maybe[aria-pressed="true"]::before {
  content: "\2713\00a0";
  content: "\2713\00a0" / "";
}

/* Forms: labels above fields, big boxes that work with voice dictation */
.field {
  margin: 0 0 1.25rem;
}

.field label, fieldset legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.hint, .optional {
  color: var(--muted);
  font-weight: 400;
}

.hint {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

input[type="text"], input[type="tel"], input[type="email"], input[type="datetime-local"], textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--card);
  border: 2px solid var(--field-line);
  border-radius: 0.5rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0 0 0.75rem;
}

.check input[type="checkbox"] {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0.6rem 0 0;
}

.check label {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0.75rem 0.5rem 0;
}

/* Cards and meetups */
.cards, .meetups {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.card, .meetup {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  margin: 0 0 1rem;
}

.card h2, .meetup h2 {
  font-size: 1.25rem;
  margin: 0.25rem 0;
}

.card p, .meetup p {
  margin: 0.25rem 0;
}

.where, .who {
  color: var(--muted);
}

.when, .safety, .count {
  font-weight: 600;
}

.count {
  font-size: 1.25rem;
}

.tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  vertical-align: middle;
}

.quiet {
  font-size: 1rem;
}

.quiet a {
  color: var(--muted);
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-fg);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.small-room {
  font-style: italic;
}

.cal-url code {
  font-size: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

.crisis-lines {
  padding-left: 1.25rem;
}

.crisis-lines a {
  font-weight: 700;
}

/* Preview only: the banner and the feedback box (preview spec §4.1, §6.1) */
.preview-banner {
  background: var(--banner-bg);
  color: var(--banner-fg);
  padding: 0.5rem 0;
}

.preview-banner p {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.preview-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.5rem;
}

.preview-nav a {
  color: var(--banner-fg);
  font-weight: 600;
}

.preview-inside {
  font-weight: 600;
  margin-left: 0.5rem;
}

.feedback {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
}

/* The bot trap: off-screen for people, still in the form for bots */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
