/*
 * Admin application styling.
 *
 * Plain CSS against the tokens, no framework and no build step. The admin surface is small —
 * settings, two lists, metrics, billing — and a component framework would cost more in tooling
 * than it saves in markup.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink-body);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 2px solid var(--rule-strong);
  background: var(--page);
  padding: var(--space-5) var(--space-4) var(--space-4);
  text-align: center;
}

.masthead__eyebrow {
  font-family: var(--font-editorial);
  font-size: var(--text-xs);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--space-1);
}

.masthead__title {
  font-family: var(--font-editorial);
  font-size: var(--text-masthead);
  font-weight: normal;
  color: var(--ink);
  margin: 0;
}

/* ---------------------------------------------------------------- layout */

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  border-bottom: var(--border);
  padding: var(--space-3) var(--space-4);
  background: var(--page);
}

.nav a {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-soft);
}

.card__title {
  font-family: var(--font-editorial);
  font-size: var(--text-xl);
  font-weight: normal;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}

.card__hint {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-4);
}

/* ---------------------------------------------------------------- forms */

.field {
  margin-bottom: var(--space-4);
}

.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.field__hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: var(--space-1);
  font-weight: normal;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink-body);
  font-family: var(--font-ui);
  font-size: var(--text-base);
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field--invalid input,
.field--invalid select {
  border-color: var(--danger);
}

.field__error {
  display: block;
  color: var(--danger);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.row > * {
  /* 150px so cadence, day and hour fit on one line at the content width; they wrap to full
     width below 520px rather than squeezing into unreadable columns. */
  flex: 1 1 150px;
}

/* ---------------------------------------------------------------- buttons */

button {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.button--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button--secondary {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink-body);
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* An anchor that should read as an action. Browser-default link blue belongs to no part of
   this design, and a real <button> would be wrong for something that navigates. */
.link-button {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink-body);
  text-decoration: none;
}

.link-button:hover {
  border-color: var(--ink);
}

/* ---------------------------------------------------------------- people lists */

.people {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  border-top: var(--border);
}

.people__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: var(--border);
}

.people__who {
  font-size: var(--text-sm);
  color: var(--ink-body);
  overflow-wrap: anywhere;
}

.people__note {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  font-style: italic;
}

.people__remove {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
}

/* ---------------------------------------------------------------- unsubscribe */

.choices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
}

/* The two options are separated so the destructive one is never pressed by momentum. */
.choices button + p {
  margin: 0 0 var(--space-4);
}

.choices__keep {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: var(--border);
}

/* ---------------------------------------------------------------- figures */

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin: 0;
}

.figure dt {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.figure dd {
  margin: var(--space-1) 0 0;
  font-family: var(--font-editorial);
  font-size: 42px;
  line-height: 1.1;
  color: var(--ink);
}

.figure__note {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------- feedback */

.notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: var(--border);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.notice--success {
  border-color: var(--success);
  color: var(--success);
}

.notice--error {
  border-color: var(--danger);
  color: var(--danger);
}

.notice[hidden] {
  display: none;
}

.next-send {
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: var(--ink);
}

.muted {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

@media (max-width: 520px) {
  .row > * {
    flex-basis: 100%;
  }
}

/* ---------------------------------------------------------------- ending */

/* Used only for the two irreversible actions. Muted rather than alarming: this is a family
   newspaper, and a shouting red button would be out of key with everything around it. */
.button--danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.button--danger:hover:not([disabled]) {
  background: var(--danger);
  color: var(--accent-text);
}

.card--danger {
  border-color: var(--danger);
}

/* The sentence the readers will actually receive, shown as the thing it is rather than described.
   Nobody should have to guess what their family is about to be sent. */
.quoted-notice {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 2px solid var(--danger);
  background: var(--surface-raised);
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: var(--ink);
}

/* A list of consequences, not of navigation. Bullets would make it look like a menu. */
.plain-list {
  margin: var(--space-3) 0 var(--space-4);
  padding-left: var(--space-4);
  color: var(--ink-body);
}

.plain-list li {
  margin-bottom: var(--space-2);
}
