/* Colours from the Chevra Hatzolah Melbourne logo. */
:root {
  --navy: #2b3190;
  --navy-dark: #1f2470;
  --red: #cc3a33;
  --amber: #c77700;
  --green: #4f7d24;
  --fg: #1d1f2b;
  --muted: #5f6377;
  --line: #dfe1ea;
  --bg: #f2f3f8;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--fg);
  line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--navy); }

/* The header: logo on white, a navy rule, and a red stripe under it. */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 4px solid var(--navy);
  box-shadow: 0 3px 0 var(--red);
}
header.site img { display: block; height: 3rem; width: auto; }
header.site span {
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}
main.wide { max-width: 64rem; }
@media (min-width: 44rem) {
  header.site { padding: 0.75rem 2rem; }
  header.site img { height: 3.75rem; }
  main {
    margin: 1.5rem auto 3rem;
    padding: 1.5rem 2rem 2.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(20, 24, 70, 0.06);
  }
}

h1 { font-size: 1.45rem; margin: 0.25rem 0 1rem; color: var(--navy); overflow-wrap: anywhere; }
h2 {
  font-size: 0.8rem;
  margin: 1.75rem 0 0.6rem;
  color: var(--navy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; font-weight: 600; }

input[type=text], input[type=search], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming in */
  padding: 0.65rem 0.75rem;
  border: 1px solid #c9ccd9;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--fg);
}
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(43, 49, 144, 0.25);
  border-color: var(--navy);
}
select { width: auto; }
label { display: block; }

button {
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid #c9ccd9;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--fg);
  cursor: pointer;
}
button:hover { border-color: var(--navy); }
button.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; margin-top: 1rem; }
button.primary:hover { background: var(--navy-dark); }
button.big { width: 100%; padding: 1rem; font-size: 1.1rem; margin-top: 1.75rem; }
button.link { border: 0; background: none; padding: 0; text-decoration: underline; color: var(--muted); }
button:disabled { opacity: 0.5; cursor: default; }

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.choices button { min-height: 3rem; flex: 1 1 auto; }
.choices button[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.severity button { text-transform: capitalize; }
.severity button[aria-pressed=true]:nth-child(2) { background: var(--amber); border-color: var(--amber); }
.severity button[aria-pressed=true]:nth-child(3) { background: var(--red); border-color: var(--red); }

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.1em;
  background: #e6e8f2;
  color: var(--muted);
}
.badge.urgent { background: var(--amber); color: #fff; }
.badge.critical { background: var(--red); color: #fff; }
.badge.open { background: var(--green); color: #fff; }
.badge.resolved { background: #8a8ea3; color: #fff; }

.quiet, .meta, time { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--red); font-weight: 600; }
.facts { color: var(--muted); }

.answers {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 0.5rem;
}
.answers dt { color: var(--muted); }
.answers dd { margin: 0; font-weight: 500; }
.description, .comment p { white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.timeline .comment p { margin: 0.35rem 0 0; }
.timeline .change { color: var(--muted); font-size: 0.9rem; }
.timeline img { display: block; max-width: 100%; max-height: 20rem; margin: 0.5rem 0; border-radius: 0.5rem; border: 1px solid var(--line); }
.reply { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--line); }
.reply .files { margin-top: 0.75rem; color: var(--muted); }

.done {
  background: #f4f5fc;
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  border-radius: 0.5rem;
  padding: 0.25rem 1.25rem 0.75rem;
}
.done h2 { font-size: 1.2rem; letter-spacing: 0; text-transform: none; }
.token-link { overflow-wrap: anywhere; font-weight: 600; }

.mine, .tickets { list-style: none; padding: 0; margin: 0; }
.mine li, .tickets li { border-top: 1px solid var(--line); }
.mine a, .tickets a { display: block; padding: 0.8rem 0.5rem; text-decoration: none; color: var(--fg); border-radius: 0.4rem; }
.mine a:hover, .tickets a:hover { background: var(--bg); }

.filters, .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.filters label { text-transform: capitalize; }

.reporter-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-bottom: 1rem; }
.reporter-link span { flex-basis: 100%; font-size: 0.8rem; }
.reporter-link a { overflow-wrap: anywhere; font-size: 0.9rem; }
.reporter-link button { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
