/* Hana — phone-first styles (T036, FR-026, NFR-1, NFR-2). Base styles target phones; wider screens are layered on. */

:root {
  --text: #1b1b1f;
  --muted: #4a4a55;
  --bg: #ffffff;
  --surface: #f5f4f0;
  --accent: #8a3b00;      /* contrast 7.0:1 on white */
  --focus: #0b57d0;
  --border: #d4d2cc;
  --space: 1rem;
  --max-width: 60rem;
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: anywhere; /* long names and titles never force horizontal scrolling */
}

img { max-width: 100%; height: auto; }

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

/* Visible focus for keyboard users on every interactive element (WCAG 2.4.7, 2.4.11). */
:focus-visible, a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space); }

/* Skip link: hidden until focused, then shown at the top of the page. */
.skip-link {
  position: absolute;
  left: var(--space);
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--accent);
  z-index: 10;
}
.skip-link:focus { top: var(--space); }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem var(--space);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand { font-weight: 700; font-size: 1.375rem; color: var(--text); text-decoration: none; }

.nav-list { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }

/* Touch targets at least 24×24 CSS px (WCAG 2.5.8). */
.nav-list a, .link-button { display: inline-block; min-height: 44px; padding: 0.625rem 0; }

.inline-form { display: inline; margin: 0; }

.link-button {
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

main { padding-top: 1.5rem; padding-bottom: 2rem; }
main:focus { outline: none; } /* focus target for the skip link; not interactive */

.site-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 1rem 0; }
.site-footer p { margin: 0; }

h1 { font-size: 1.75rem; line-height: 1.2; }

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

/* Forms and messages (US1). */
.stack > * + * { margin-top: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  width: 100%;
  max-width: 28rem;
}
.hint { color: var(--muted); font-size: 0.9375rem; }
.field-error { color: #a4001d; font-weight: 600; }
.field-error:empty { display: none; }

.button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.notice { padding: 0.75rem 1rem; border-left: 4px solid var(--focus); background: #eef3fd; }
.notice-error { border-left-color: #a4001d; background: #fdeeee; }
.notice:empty { display: none; }
.validation-summary-valid { display: none; }

.banner { background: #fff4d6; border-bottom: 1px solid #e0c46c; }
.banner .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.banner p { margin: 0; }

/* FR-031 honeypot: off-screen for people; still present for bots that fill every field. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Profile form (US3). */
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; padding: 0; margin-bottom: 0.25rem; }
.check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 400; }
.check input { width: 1.25rem; height: 1.25rem; min-height: 0; }
.field-label { font-weight: 600; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--surface); }

/* Events (US4). */
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.row .field { flex: 1 1 9rem; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.badge { display: inline-block; margin-left: 0.5rem; padding: 0 0.5rem; border-radius: 4px; background: #a4001d; color: #fff; font-size: 0.875rem; font-weight: 600; }
a.button { display: inline-block; text-decoration: none; }

/* Public listing (US5). */
.event-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.event-card { border: 1px solid var(--border); border-radius: 6px; padding: 1rem; background: var(--bg); }
.event-card p { margin: 0.25rem 0 0; }
.event-card-title { font-size: 1.25rem; margin: 0; }
.event-card-when { font-weight: 600; }
.empty-state { border: 1px dashed var(--border); border-radius: 6px; padding: 1.25rem; background: var(--surface); }
.empty-state h2 { margin-top: 0; font-size: 1.25rem; }
@media (min-width: 48rem) { .event-cards { grid-template-columns: repeat(2, 1fr); } }

/* Event page (US6). */
.event-image { width: 100%; border-radius: 6px; margin-bottom: 1rem; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 1rem 0; }
.details dt { font-weight: 600; }
.details dd { margin: 0; }
.description { white-space: pre-line; }
.lineup { padding-left: 1.25rem; }
.lineup a { display: inline-block; min-height: 44px; padding: 0.625rem 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Public profile (US7). */
.profile-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.profile-header h1 { margin: 0; }
.profile-meta { margin: 0.25rem 0 0; color: var(--muted); }
.profile-events { list-style: none; padding: 0; margin: 0; }
.profile-events a { display: inline-block; min-height: 24px; }

/* Location filter (US8). */
.filter { margin: 1rem 0 1.5rem; }
.filter label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter select { font: inherit; min-height: 44px; padding: 0.5rem; border: 1px solid var(--muted); border-radius: 4px; flex: 1 1 14rem; max-width: 28rem; }

/* Manage an event (US9). */
.button-secondary { background: var(--bg); color: var(--accent); border: 2px solid var(--accent); }
.button-danger { background: #a40e26; border-color: #a40e26; color: #fff; } /* contrast 7.3:1 with white */
.manage-actions { display: grid; gap: 0.75rem; justify-items: start; }
.manage-actions form p { margin: 0 0 0.5rem; }
