/* The admin site: the public site's tokens and form styles (assets/css/
   main.css), cut down to what one form and one list need. Navy, paper,
   gold; square corners, hairline rules, no shadows. */

:root {
  --navy: #040442;
  --navy-60: #5B5B7C;
  --navy-40: #9191A6;
  --paper: #FFFFFF;
  --paper-2: #F3F3F7;
  --gold: #E0A526;
  --gold-deep: #C48C18;
  --gold-ink: #8A6310;
  --rule: #D5D6E2;
  --danger: #A3261B;

  --display: "Frank Ruhl Libre", "Hoefler Text", Georgia, serif;
  --sans: "Assistant", -apple-system, "Segoe UI", system-ui, sans-serif;

  --t-xl: clamp(1.5rem, 2.6vw, 2.125rem);
  --t-lg: 1.3125rem;
  --t-md: 1.0625rem;
  --t-sm: 0.9375rem;
  --t-xs: 0.8125rem;
  --t-label: 0.6875rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --column: 46rem;
  --wide: 100rem;
  --edit: 36rem;
  --preview-h: 80vh;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--navy);
  background: var(--paper-2);
}

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--navy); text-decoration-color: var(--gold); }
img { max-width: 100%; display: block; height: auto; }

.bar { background: var(--navy); color: var(--paper); }
.bar__inner, .page {
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.bar__inner { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 1rem; }
.bar__name { font-family: var(--display); font-size: var(--t-lg); font-weight: 700; }
.bar__out {
  font: inherit;
  font-size: var(--t-xs);
  background: none;
  border: 0;
  padding: 0;
  color: var(--paper);
  opacity: 0.8;
  text-decoration: underline;
  cursor: pointer;
}
.bar__out:hover { opacity: 1; }

.signin { max-width: 26rem; }

.page { display: flex; flex-direction: column; gap: 2.5rem; padding-block: clamp(2rem, 5vw, 3.5rem); }

/* the form on the left, the preview on the right; stacked on a phone */
.page--split, .bar__inner { max-width: calc(var(--wide) + 2 * var(--gutter)); }
/* the two headings share the top row, so the form and the preview start level */
.split { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "edit" "previewintro" "preview" "list"; gap: 2.5rem; }
.split__intro { grid-area: intro; }
.split__previewintro { grid-area: previewintro; }
.split__edit { grid-area: edit; min-width: 0; }
.split__preview { grid-area: preview; }
.split__list { grid-area: list; }

.preview { display: flex; flex-direction: column; min-width: 0; height: var(--preview-h); }
.preview__tabs { display: flex; border-bottom: 1px solid var(--rule); }
.preview__tab {
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--navy-60);
  cursor: pointer;
}
.preview__tab:hover { color: var(--navy); }
.preview__tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--gold); }
.preview__frame { flex: 1; width: 100%; border: 1px solid var(--rule); border-top: 0; background: var(--paper); }
.preview__note { font-size: var(--t-xs); color: var(--navy-60); padding-top: 0.5rem; }

@media (min-width: 64rem) {
  .split { grid-template-columns: minmax(0, var(--edit)) minmax(0, 1fr); grid-template-areas: "intro previewintro" "edit preview" "list preview"; align-items: start; }
  .split__preview { position: sticky; top: 1rem; height: calc(100vh - 2rem); }
}

.intro { display: flex; flex-direction: column; gap: 0.6rem; }
.intro h1, .intro h2 { font-size: var(--t-xl); }
.intro p { color: var(--navy-60); }

.btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: var(--t-md);
  font-weight: 600;
  padding: 0.95rem 2rem;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  cursor: pointer;
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field__label {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-60);
}
.field__optional { font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--navy-40); margin-left: 0.35rem; }
.field input, .field textarea, .field select {
  font: inherit;
  font-size: var(--t-md);
  color: var(--navy);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
  width: 100%;
}
.field input[type="file"] { padding: 0.55rem 0.6rem; font-size: var(--t-sm); }
.field textarea { resize: vertical; min-height: 4rem; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--navy-60) 50%), linear-gradient(135deg, var(--navy-60) 50%, transparent 50%); background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2rem; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--navy); }

.admin__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
}
.admin__heading { font-size: var(--t-lg); }
.admin__hint { font-size: var(--t-xs); color: var(--navy-60); }
.admin__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.5rem; }
.admin__poster { display: flex; flex-direction: column; align-items: start; gap: 0.6rem; }
.admin__poster img { max-width: 14rem; border: 1px solid var(--rule); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 0.4rem; }
.choice { display: flex; gap: 1.5rem; padding-block: 0.55rem; }
.choice__item { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; }
.choice__item input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--navy); }
[data-paid] { margin-top: 0.6rem; }
.admin__span { grid-column: 1 / -1; }
.admin__notice { font-size: var(--t-sm); font-weight: 600; color: var(--gold-ink); }
.admin__notice--clash { color: var(--danger); }
.admin__error { font-size: var(--t-sm); font-weight: 600; color: var(--danger); }
.admin__saved { font-size: var(--t-sm); font-weight: 600; }
.admin__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

.admin__link {
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy-60);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.admin__link:hover { color: var(--navy); }

.admin__list { display: flex; flex-direction: column; gap: 1rem; }
.admin__events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.admin__event {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.admin__what { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.admin__when { font-size: var(--t-xs); color: var(--gold-ink); font-weight: 600; }
.admin__title { font-weight: 700; }
.admin__rowactions { display: flex; gap: 1rem; flex-shrink: 0; }

[hidden] { display: none !important; }

@media (max-width: 40rem) {
  .admin__pair { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; justify-content: center; }
}
