/* The band room: the public site's smoked perspex and stripe, set for work. Denser type,
   tables instead of sleeves, the index dividers of the Record Selector as the navigation.
   Layout: a rail of divider tabs on the left (a top strip on phones), the desk to the right. */
:root {
  --ground: #17110d;
  --perspex: #221813;
  --perspex-2: #2d2019;
  --ink: #f7ead0;
  --muted: #c4ab86;
  --gold: #f4b41a;
  --orange: #e8641c;
  --red: #c8321f;
  --brown: #7a4220;
  --green: #8fb04a;
  --line: #f7ead01f;
  --display: "Shrikhand", "Cooper Black", Georgia, serif;
  --caption: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.5 var(--body); }
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 700 2.4rem/1 var(--caption); text-transform: uppercase; letter-spacing: .02em; }
h2 { font: 700 1.35rem/1.1 var(--caption); text-transform: uppercase; letter-spacing: .04em; margin: 2rem 0 .8rem; }
p { margin: 0 0 .8rem; }
code, .mono { font-family: var(--mono); font-size: .88em; font-variant-numeric: tabular-nums; }
.small { font-size: .85rem; }
.quiet { color: var(--muted); }
.error { color: #ffb4a3; background: #c8321f33; border-left: 3px solid var(--red); padding: .5rem .75rem; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kicker { font: 600 .8rem/1 var(--caption); letter-spacing: .22em; text-transform: uppercase; color: var(--orange); margin-bottom: .4rem; }
.stripe { height: 8px; background: linear-gradient(var(--gold) 0 25%, var(--orange) 25% 50%, var(--red) 50% 75%, var(--brown) 75%); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ── Shell ───────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: calc(100vh - 8px); }
.rail { background: var(--perspex); padding: 1.2rem 0 1.2rem max(0px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 1.4rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; padding: 0 1rem; }
.brand span { font: 400 1.25rem/1 var(--display); color: var(--gold); }
.dividers { display: grid; gap: 3px; padding-left: .8rem; }
.dividers a {
  font: 700 1.05rem/1 var(--caption); text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
  color: var(--muted); padding: .7rem .9rem; background: var(--perspex-2); border-radius: 4px 0 0 4px;
}
.dividers a:hover { color: var(--ink); }
.dividers a.active { background: var(--gold); color: var(--ground); }
.who { margin-top: auto; padding: 0 1rem; display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
.who span { overflow-wrap: anywhere; color: var(--ink); }
.who .link { justify-self: start; text-align: left; }
.desk { padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 4rem clamp(16px, 3vw, 2.5rem); min-width: 0; max-width: 76rem; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { padding: .8rem max(16px, env(safe-area-inset-left, 0px)) 0; gap: .7rem; }
  .brand { padding: 0; }
  .dividers { display: flex; overflow-x: auto; padding: 0; }
  .dividers a { border-radius: 4px 4px 0 0; white-space: nowrap; padding: .6rem .7rem; }
  .who { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0 0 .6rem; order: -1; margin: 0; }
  .desk { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
}

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; margin-bottom: 1rem; }

/* ── Controls ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; text-decoration: none;
  font: 700 .98rem/1 var(--caption); text-transform: uppercase; letter-spacing: .08em;
  padding: .65rem 1.05rem; border-radius: 99px; border: 0; background: var(--orange); color: var(--ground);
}
.btn:hover:not(:disabled) { background: var(--gold); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: transparent; }
.btn.small { padding: .4rem .75rem; font-size: .85rem; }
.btn.danger { background: var(--red); color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.link:hover { color: var(--ink); }
.link.danger { color: #ff9a83; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }

input, select, textarea {
  font: 400 1rem/1.3 var(--body); color: var(--ink); background: var(--ground);
  border: 1px solid #f7ead040; border-radius: 4px; padding: .55rem .65rem; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px #f4b41a55; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--orange); }
textarea { resize: vertical; }

/* ── The editing panel ───────────────────────────────────────────────────── */
.panel {
  background: var(--ink); color: var(--ground); border-radius: 4px; padding: 1.2rem 1.3rem 1.3rem; margin: 0 0 1.6rem;
  box-shadow: 0 16px 40px #0008; border-top: 8px solid var(--orange);
}
.panel:focus { outline: none; }
.panel header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.panel h2 { margin: 0; font-size: 1.6rem; overflow-wrap: anywhere; }
.panel .quiet, .panel .hint { color: #6d5643; }
.panel .link { color: var(--brown); }
.panel .link:hover { color: var(--ground); }
.panel .link.danger { color: var(--red); }
.panel input, .panel select, .panel textarea { background: #fffaf0; color: var(--ground); border-color: #17110d40; }
.panel input:focus, .panel select:focus, .panel textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 2px #e8641c44; }
.panel .btn.ghost { color: var(--brown); }
.panel .error { color: var(--red); background: #c8321f1a; }
.panel code { background: #17110d14; padding: .05rem .3rem; border-radius: 2px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .9rem 1.1rem; }
.fields .wide { grid-column: 1 / -1; }
.f { display: grid; gap: .3rem; font: 600 .82rem/1.1 var(--caption); letter-spacing: .1em; text-transform: uppercase; }
.f .hint { text-transform: none; letter-spacing: 0; font: 400 .85rem var(--body); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.panel footer { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1.2rem; }
.panel footer .link.danger, .panel footer .confirm { margin-left: auto; }
.confirm { display: flex; gap: .6rem; align-items: center; font-weight: 600; }
.preview { max-height: 22rem; width: auto; max-width: 100%; border-radius: 3px; box-shadow: 0 8px 20px #0003; justify-self: start; }
audio.wide { width: 100%; }
form.panel .fields + .error { margin-top: 1rem; }

/* ABC.UI.Elements controls take the panel's cream card and the stripe's orange. */
.panel {
  --abc-accent: var(--orange); --abc-accent-hover: var(--red); --abc-on-accent: #fffaf0;
  --abc-text: var(--ground); --abc-muted: #6d5643; --abc-surface: #fffaf0; --abc-surface-subtle: #f4b41a33;
  --abc-border: #17110d40; --abc-focus: var(--orange); --abc-danger: var(--red); --abc-radius: 4px;
  --abc-font-family: var(--body);
}

/* The gig's night and times: the calendar beside the clock, stacking on a phone. */
.when-pick { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: start; font: 400 1rem/1.4 var(--body); letter-spacing: 0; text-transform: none; }
.when-pick .abc-calendar { flex: 0 1 20rem; background: #fffaf0; border: 1px solid #17110d26; border-radius: 4px; padding: .6rem .6rem .4rem; }
.when-pick .abc-calendar__header h3 { font: 700 1.15rem/1 var(--caption); text-transform: uppercase; letter-spacing: .06em; }
.when-pick .abc-calendar__header button { width: auto; color: var(--brown); background: transparent; border: 0; }
.when-pick .abc-calendar__day { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.when-pick .abc-calendar__day--selected { font-weight: 700; }
.when-times { display: grid; gap: .9rem; flex: 1 1 13rem; min-width: 0; }
.when-read { margin: 0; font-weight: 600; }

/* The venue box and its suggestions: the field label in the panel's caption style. */
.panel .abc-field-label { margin-bottom: .3rem; font: 600 .82rem/1.1 var(--caption); letter-spacing: .1em; text-transform: uppercase; color: inherit; }
.abc-option .venue-name { font-weight: 600; }
.abc-option .venue-where { margin-left: auto; color: var(--abc-muted); font-size: .85em; white-space: nowrap; }

/* ── Lists ───────────────────────────────────────────────────────────────── */
.grid { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.grid thead, .grid tbody { display: table; width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font: 700 .78rem/1 var(--caption); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: .6rem .6rem; border-bottom: 2px solid var(--gold); white-space: nowrap; }
.grid td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr:hover { background: #f7ead00a; }
.grid .end { text-align: right; white-space: nowrap; }
.grid .end .link + .link { margin-left: .8rem; }
.dim td { opacity: .55; }
.pill { display: inline-block; font: 700 .72rem/1 var(--caption); letter-spacing: .1em; text-transform: uppercase; padding: .22rem .45rem; border-radius: 2px; background: var(--perspex-2); color: var(--muted); margin: 0 .3rem .1rem 0; vertical-align: .1em; }
.pill.confirmed, .pill.ready { background: #8fb04a26; color: var(--green); }
.pill.tentative, .pill.learning { background: #f4b41a26; color: var(--gold); }
.pill.cancelled, .pill.retired, .pill.hidden { background: #c8321f33; color: #ff9a83; }
.pill.featured, .pill.admin { background: var(--orange); color: var(--ground); }
.segmented { display: flex; gap: 3px; margin-bottom: .2rem; flex-wrap: wrap; }
.segmented button { font: 700 .95rem/1 var(--caption); letter-spacing: .06em; text-transform: uppercase; padding: .55rem .8rem; border: 0; border-radius: 4px 4px 0 0; background: var(--perspex-2); color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--gold); color: var(--ground); }
.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: .6rem; }
.toolbar input { max-width: 18rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .8rem; margin: 1.4rem 0 .5rem; }
.tile { background: var(--perspex-2); border-radius: 4px; padding: 1rem; text-decoration: none; color: var(--muted); display: grid; gap: .2rem; border-bottom: 4px solid var(--orange); }
.tile b { font: 400 2.4rem/1 var(--display); color: var(--gold); }
.tile:hover { background: #3a2a20; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.rows .mono { color: var(--gold); min-width: 11rem; }
.links { padding-left: 1.1rem; display: grid; gap: .4rem; }
.links code { overflow-wrap: anywhere; color: var(--muted); }

.uploads { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .4rem; }
.uploads li { display: grid; grid-template-columns: minmax(0, 1fr) auto 10rem; gap: .8rem; align-items: center; background: var(--perspex-2); padding: .55rem .8rem; border-radius: 4px; }
.uploads li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads li.failed { background: #c8321f33; grid-template-columns: minmax(0, 1fr); }
.uploads progress { width: 100%; accent-color: var(--orange); }
@media (max-width: 560px) { .uploads li { grid-template-columns: minmax(0, 1fr); } }

.poster-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.2rem; }
.card { background: var(--perspex-2); border-radius: 4px; overflow: hidden; display: grid; align-content: start; }
.card img { display: block; width: 100%; height: auto; max-height: 24rem; object-fit: cover; object-position: top; }
.card .body { padding: .8rem .9rem 1rem; display: grid; gap: .5rem; }
.card h3 { font: 700 1.15rem/1.15 var(--caption); text-transform: uppercase; }
.card .mono { color: var(--muted); overflow-wrap: anywhere; margin: 0; }
.card.dim { opacity: .6; }

/* ── Signing in ──────────────────────────────────────────────────────────── */
.gate { max-width: 34rem; margin: 10vh auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: .4rem; }
.wordmark { font: 400 clamp(2.4rem, 8vw, 3.6rem)/1 var(--display); color: var(--gold); text-transform: none; text-shadow: .045em .045em 0 var(--orange), .09em .09em 0 var(--red); margin: .2rem 0 1rem; transform: rotate(-2deg); transform-origin: left; }
.gate-logo { width: 128px; height: 96px; margin-left: -12px; }
.dev { margin: 1.2rem 0; padding: 1rem; border: 1px dashed #f7ead040; border-radius: 4px; display: grid; gap: .5rem; font-size: .9rem; color: var(--muted); }
.dev .row { flex-wrap: nowrap; }
@media (max-width: 480px) { .dev .row { flex-wrap: wrap; } }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0; z-index: 50; background: var(--red); color: var(--ink); padding: .8rem max(16px, env(safe-area-inset-left, 0px)) calc(.8rem + env(safe-area-inset-bottom, 0px)); }
#blazor-error-ui a { color: var(--ink); font-weight: 700; }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; color: var(--ink); cursor: pointer; font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
