/* ABOUTME: Thankathon's stylesheet: layout and components only, every colour and font taken from a theme token. */
/* ABOUTME: To restyle an instance, edit or add a file in ../themes/ — never put a literal colour or font here. */

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-heading);
}

a { color: var(--color-link); }

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

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

.site-header__inner,
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header__inner {
  /* Equal side columns keep the title at the page's centre. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .5rem 1rem;
  align-items: center;
  padding-block: .75rem;
}

.site-header h1 { margin: 0; font-size: 1.5rem; }
.site-brand { display: flex; align-items: center; justify-self: start; }
.site-title { text-align: center; }
.site-logo { height: 2.75rem; width: auto; }

.site-header__user {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: .75rem;
  align-items: center;
  color: var(--color-text-muted);
}

main { padding-block: 1.5rem 3rem; }

button, .button {
  display: inline-block;
  padding: .5rem 1.1rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { filter: brightness(1.1); }

.button--quiet, .site-header button {
  background: transparent;
  color: var(--color-primary);
}

label { display: block; font-weight: 600; }

input, select, textarea {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-top: .25rem;
  padding: .5rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
}

.messages { list-style: none; padding: 0; }

.messages li, .alert {
  padding: .6rem .9rem;
  margin-bottom: .5rem;
  border-radius: var(--radius);
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
}

.messages .success { border-left-color: var(--color-success); }
.messages .warning { background: var(--color-warning); color: var(--color-on-warning); border-left-color: var(--color-on-warning); }
.messages .error, .alert--error { border-left-color: var(--color-danger); color: var(--color-danger); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-family: var(--font-heading); }

.summary { color: var(--color-text-muted); }
.muted { color: var(--color-text-muted); font-size: .95rem; }

.task-list { list-style: none; padding: 0; }
.task-list li { padding: .6rem 0; border-bottom: 1px solid var(--color-border); }
.task-list--held li { color: var(--color-text-muted); }

.card {
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}
.card h2 { margin-top: 0; }
.gift-id { font-family: var(--font-body); font-weight: 600; }

.phone {
  margin: 0 0 1rem;
  padding: .6rem .9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.phone legend { font-weight: 600; font-size: 1.15rem; }
.choice { display: inline-flex; gap: .35rem; align-items: center; margin-right: 1.25rem; font-weight: 400; }
.choice input { display: inline; width: auto; margin: 0; }

.outcomes-label { font-weight: 600; margin-bottom: .5rem; }
.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; }
.outcome { padding: .8rem 1rem; }
.outcome--do_not_call { background: var(--color-danger); border-color: var(--color-danger); }
.outcome--no_answer, .outcome--wrong_number { background: transparent; color: var(--color-primary); }

/* An open call: the script beside the donor's details, stacked on narrow screens. */
.call-layout { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) {
  .call-layout:has(.call-script) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}
.call-script {
  position: sticky;
  top: 1rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 1.125rem;
  line-height: 1.6;
}
.call-script h3 { margin-top: 0; }

/* Narrow-screen overrides come last, so they win over the rules above. */
/* On a phone the three columns stack: logo and user on one row, the title centred beneath. */
@media (max-width: 40rem) {
  .site-header__inner { grid-template-columns: 1fr auto; }
  .site-title { grid-column: 1 / -1; grid-row: 2; }
  .site-header__user { grid-column: 2; }
}
