/* The type styles, colour roles and component roles are in docs/design-spec.md.
   Change that file when you change this file. */

:root {
  /* Colour roles */
  --colour-page: #f6f2ec;
  --colour-surface: #fffdfa;
  --colour-ink: #1f1a24;
  --colour-muted: #5c5466;
  --colour-rule: #ded5c9;
  --colour-brand: #1c1626;
  --colour-on-brand: #f6f2ec;
  --colour-link: #a3134f;
  --colour-focus: #a3134f;
  --colour-focus-on-brand: #ff9cc4;
  --colour-action-hover: #85103f;
  --colour-problem: #b42318;
  --colour-success: #1e7b4a;
  --colour-warning: #94510a;
  --colour-selected: #f9eef2;
  --colour-badge: #efe8df;

  /* Type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Component roles */
  --radius-panel: 12px;
  --radius-control: 8px;
  --radius-badge: 4px;
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--colour-page);
  color: var(--colour-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--colour-link);
  text-underline-offset: 0.15em;
}

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

/* Site header: the brand band with the wordmark. */
.site-header {
  background: var(--colour-brand);
  border-bottom: 4px solid var(--colour-link);
  padding-block: 0.875rem;
}

/* One content column for the header and the page, so that they align. */
.column {
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.site-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.wordmark {
  color: var(--colour-on-brand);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
}

.wordmark:focus-visible {
  outline-color: var(--colour-focus-on-brand);
}

/* Account: the admin link, the logged-in user and the log out button, in the site header. */
.account,
.account-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
}

.account {
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.header-link {
  color: var(--colour-on-brand);
  font-size: 0.9375rem;
  font-weight: 600;
}

.header-link:focus-visible {
  outline-color: var(--colour-focus-on-brand);
}

.account-name {
  color: var(--colour-on-brand);
  font-size: 0.9375rem;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-button {
  appearance: none;
  margin: 0;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--colour-on-brand);
  border-radius: var(--radius-control);
  background: var(--colour-brand);
  color: var(--colour-on-brand);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.header-button:hover {
  background: var(--colour-on-brand);
  color: var(--colour-brand);
}

.header-button:focus-visible {
  outline-color: var(--colour-focus-on-brand);
}

.page {
  padding-block: 2.5rem 4rem;
}

/* Type styles */
h1 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 650;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.125rem;
}

/* Empty state panel */
.empty-state {
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-panel);
  padding: 2rem 1.5rem;
  max-width: 36rem;
}

.empty-state p {
  margin: 0;
  color: var(--colour-muted);
}

/* Principal action button */
.button {
  appearance: none;
  margin: 0;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--colour-link);
  color: var(--colour-on-brand);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

a.button {
  display: inline-block;
  text-decoration: none;
}

.button:hover {
  background: var(--colour-action-hover);
}

/* Secondary action button: an action that is not the principal action of the page. */
.button-secondary {
  appearance: none;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--colour-link);
  border-radius: var(--radius-control);
  background: var(--colour-surface);
  color: var(--colour-link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button-secondary:hover {
  background: var(--colour-selected);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Notice: a problem that stopped the last action of the user. */
.notice {
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-left: 4px solid var(--colour-problem);
  border-radius: var(--radius-panel);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 36rem;
}

.notice p:last-child,
.notice ul:last-child {
  margin-bottom: 0;
}

/* A confirmation after a successful action. */
.notice-success {
  border-left-color: var(--colour-success);
}

/* A completed action that the user must check, for example a match with a genre warning. */
.notice-warning {
  border-left-color: var(--colour-warning);
}

.notice h2:last-child {
  margin-bottom: 0;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-summary li + li {
  margin-top: 0.25rem;
}

/* Admin: festival list */
.admin-festival-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.admin-festival {
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-panel);
  padding: 1.25rem 1.5rem 1.5rem;
}

.admin-festival-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.admin-festival h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-festival .festival-dates {
  margin: 0.25rem 0 1rem;
}

/* Status label: the state of a festival. */
.status-label,
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-badge);
  background: var(--colour-badge);
  color: var(--colour-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Facts: label and value pairs. */
.facts {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.facts div {
  display: grid;
  gap: 0 1rem;
}

.facts dt {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* A second line in a fact: an action, or one list of a lineup change. */
.fact-action,
.change-names {
  display: block;
}

.change-names {
  margin-top: 0.25rem;
}

/* A problem inside a panel: the last lineup attempt failed. */
.inline-problem {
  border-left: 4px solid var(--colour-problem);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0 0 1.25rem;
}

.inline-problem p {
  margin: 0 0 0.5rem;
}

.inline-problem p:last-child {
  margin-bottom: 0;
}

.problem-cause {
  overflow-wrap: anywhere;
}

/* Forms */
.back-link {
  margin-bottom: 1rem;
}

.festival-form {
  max-width: 40rem;
}

.field {
  margin-bottom: 1.5rem;
}

.field-group {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-group legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 650;
}

.date-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.date-fields .field {
  margin-bottom: 0;
}

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.hint {
  margin: 0 0 0.5rem;
  color: var(--colour-muted);
  font-size: 0.9375rem;
}

.input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--colour-muted);
  border-radius: var(--radius-control);
  background: var(--colour-surface);
  color: var(--colour-ink);
  font: inherit;
}

.input[size] {
  width: auto;
}

.input-date {
  width: auto;
  min-width: 11rem;
}

/* A field with a problem: the problem text and a strip on the left. */
.field-with-problem {
  border-left: 4px solid var(--colour-problem);
  padding-left: 1rem;
}

.field-problem {
  margin: 0 0 0.5rem;
  color: var(--colour-problem);
  font-weight: 600;
}

.lineup-source {
  margin: 2rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--colour-rule);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
}

.search-row .input {
  flex: 1 1 16rem;
  width: auto;
}

.search-empty {
  margin-bottom: 1.5rem;
}

.search-empty h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.notice h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

/* Clashfinder page choices: one radio button for each page. */
.choice-group-heading {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 650;
}

.choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.choice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-panel);
}

/* The chosen page: a 2px border. The padding is 1px less, so that the text does not move. */
.choice:has(.choice-input:checked) {
  padding: calc(0.75rem - 1px) calc(1rem - 1px);
  border: 2px solid var(--colour-link);
  background: var(--colour-selected);
}

.choice-input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--colour-link);
}

.choice-body {
  min-width: 0;
}

.choice-label {
  display: block;
  font-weight: 650;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.choice-facts {
  margin: 0.125rem 0 0;
  color: var(--colour-muted);
  font-size: 0.9375rem;
}

.choice-facts .badge {
  margin-right: 0.25rem;
}

/* A line breaks between two facts, so that a short fact, for example a date, stays on one line.
   A fact from MusicBrainz can be longer than the line. Only such a fact breaks, so that the page
   does not become wider than the screen. */
.fact {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.page-choices > legend + .choice-group-heading,
.page-choices > legend + .field-problem + .choice-group-heading,
.page-choices > legend + .hint + .choice-group-heading {
  margin-top: 0;
}

.page-choices > legend {
  margin-bottom: 0.5rem;
}

.choice-link {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
}

/* Admin: artist matches */
.match-section {
  margin-top: 2.5rem;
}

.search-progress {
  color: var(--colour-muted);
}

.match-list,
.matched-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

/* One lineup name without an artist match. A rule separates the names, because
   the choices in each name already have panels. */
.match-list > li {
  padding-block: 1.5rem;
  border-top: 1px solid var(--colour-rule);
}

.match-item {
  max-width: 40rem;
}

.match-item-heading {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.match-choices {
  margin-bottom: 1rem;
}

/* The possible artists after the proposal. Closed by default, without animation. */
.more-choices {
  margin-top: 0.5rem;
}

.more-choices summary {
  width: fit-content;
  padding: 0.25rem 0;
  color: var(--colour-link);
  font-weight: 600;
  cursor: pointer;
}

.more-choices[open] summary {
  margin-bottom: 0.5rem;
}

.match-item-link {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

/* A genre warning: the text says "Warning", so the colour is not the only sign. */
.genre-warning {
  margin: 0.125rem 0 0;
  color: var(--colour-warning);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* The artist matches: one row for each lineup name. */
.matched-list {
  border-top: 1px solid var(--colour-rule);
}

.matched-list > li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--colour-rule);
}

.matched-name {
  min-width: 0;
  flex: 1 1 20rem;
}

.matched-name p {
  margin: 0;
}

.matched-lineup-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* The badge "New" after a lineup name. */
.match-item-heading .badge,
.matched-lineup-name .badge {
  vertical-align: 0.1em;
}

.matched-artist,
.matched-spotify {
  color: var(--colour-muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

/* "Change" and "Set the Spotify artist". */
.matched-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
}

.match-search {
  max-width: 40rem;
}

/* Predicted songs for one name */
.calculate-form {
  margin-bottom: 2rem;
}

/* The numbers show the order of prediction (LY-06). A counter puts each number
   in the vertical centre of its player, which a list marker cannot do. */
.predicted-song-list {
  max-width: 40rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: song;
}

.predicted-song-list > li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  align-items: center;
  margin-bottom: 0.5rem;
  counter-increment: song;
}

.predicted-song-list > li::before {
  content: counter(song) ".";
  color: var(--colour-muted);
  font-weight: 600;
}

/* The Spotify embed player. Spotify draws the player with its own radius. */
.spotify-player {
  display: block;
  width: 100%;
  height: 80px;
  border: 0;
  border-radius: var(--radius-panel);
}

/* Festival list: the published festivals on the Festivals page. Each panel is one link. */
.festival-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
}

.festival-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-panel);
  color: var(--colour-ink);
  text-decoration: none;
}

.festival-link:hover {
  background: var(--colour-selected);
  border-color: var(--colour-link);
}

/* The festival name has the link colour, so that the panel reads as a link (VS-04). */
.festival-link .festival-name {
  color: var(--colour-link);
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

/* The festival name, and the badge when the user has a playlist for the festival. */
.festival-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.festival-link:hover .festival-name {
  text-decoration: underline;
}

.complete-festivals {
  margin-top: 2.5rem;
}

/* Publication on Manage festivals */
.publication {
  margin: 0 0 1rem;
}

.publication-hint {
  margin: 0 0 1rem;
  color: var(--colour-muted);
}

/* Festival page */
.festival-page-dates {
  margin: -0.5rem 0 1rem;
}

/* Playlist panel: the number of songs, the link, the last update and the action. */
.playlist {
  background: var(--colour-surface);
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-panel);
  padding: 1.25rem 1.5rem 1.5rem;
  margin: 0 0 2rem;
  max-width: 40rem;
}

.playlist h2 {
  margin-top: 0;
}

.playlist-link {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.playlist-updated {
  margin: 0 0 1rem;
  color: var(--colour-muted);
}

.playlist .genre-warning {
  margin: 0 0 1rem;
}

.playlist-count {
  margin: 0 0 1rem;
}

/* "N artists are new on the lineup since your last update." */
.playlist-new {
  margin: 0 0 1rem;
}

/* The added or removed artists in the confirmation after an update. */
.notice .change-heading {
  margin-top: 1rem;
}

.change-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

/* Columns keep a long list short. A short list stays in one column. */
.change-list-long {
  columns: 2 12rem;
  column-gap: 1.5rem;
}

.change-list li {
  break-inside: avoid;
  overflow-wrap: anywhere;
}

.change-reason {
  color: var(--colour-muted);
}

.playlist-form {
  margin: 0;
}

/* The request waits for Spotify. */
.button:disabled {
  cursor: progress;
}

/* Search, filter and sort of the lineup. The script shows them. */
.lineup-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.lineup-tools[hidden],
.lineup-action[hidden],
.lineup-save[hidden],
.artist[hidden] {
  display: none;
}

/* The two selects share one row on a narrow screen. */
.lineup-tool {
  flex: 1 1 9rem;
  min-width: 0;
}

.lineup-tool-search {
  flex: 1 1 16rem;
}

/* "Only new artists": a checkbox with the height of an input, so that it aligns with the selects. */
.lineup-tool-check {
  flex: 0 1 auto;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--colour-link);
}

.lineup-count {
  margin: 0 0 0.75rem;
  color: var(--colour-muted);
}

.lineup-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  color: var(--colour-muted);
}

.lineup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--colour-rule);
}

/* One artist: the name and the genres, then the interest levels at the right,
   or below the name on a narrow screen. */
.artist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--colour-rule);
}

.artist-text {
  flex: 1 1 14rem;
  min-width: 0;
}

.artist-text p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The artist name, and the badge "New" when the artist is new since the last update. */
.artist-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
}

.artist-name {
  font-weight: 650;
  min-width: 0;
}

.artist-genres {
  color: var(--colour-muted);
  font-size: 0.9375rem;
}

.artist-problem {
  flex: 1 1 100%;
  margin: 0;
}

/* The player button, "Open in Spotify" and "Setlists on setlist.fm" under the genres (#18). */
.artist-text .listen-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-top: 0.375rem;
  font-size: 0.9375rem;
}

/* "Play the songs": a small secondary button, because the interest levels are the principal task of the row. */
.listen-button {
  appearance: none;
  margin: 0;
  min-height: 2rem;
  padding: 0.125rem 0.75rem;
  border: 1px solid var(--colour-link);
  border-radius: var(--radius-control);
  background: var(--colour-surface);
  color: var(--colour-link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.listen-button:hover,
.listen-button[aria-expanded="true"] {
  background: var(--colour-selected);
}

/* The Spotify embed player of one artist, under the links. Spotify draws the player. */
.listen-player {
  margin-top: 0.5rem;
  max-width: 32rem;
}

.listen-embed iframe {
  display: block;
  width: 100%;
  height: 80px;
  border: 0;
  border-radius: var(--radius-panel);
}

.artist-text .listen-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.listen-control {
  padding: 0.25rem 0.75rem;
  font-size: 0.9375rem;
}

.listen-control:disabled {
  border-color: var(--colour-rule);
  color: var(--colour-muted);
  background: var(--colour-surface);
  cursor: default;
}

.listen-position {
  color: var(--colour-muted);
  font-size: 0.9375rem;
}

.artist-text .listen-player .field-problem {
  margin-top: 0.5rem;
}

/* The interest levels of one artist: four radio buttons that look like
   segments. The radio button covers its segment, so that the full segment
   selects it. */
.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  flex: 1 1 100%;
}

.level {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--colour-rule);
  border-radius: var(--radius-control);
  background: var(--colour-surface);
  font-size: 0.9375rem;
  line-height: 1.25;
  text-align: center;
}

.level:hover {
  background: var(--colour-selected);
}

/* The chosen level: a 2px border. The padding is 1px less, so that the text does not move. */
.level:has(.level-input:checked) {
  padding: calc(0.25rem - 1px) calc(0.5rem - 1px);
  border: 2px solid var(--colour-link);
  background: var(--colour-selected);
  color: var(--colour-link);
  font-weight: 650;
}

.level:has(.level-input:focus-visible) {
  outline: 3px solid var(--colour-focus);
  outline-offset: 2px;
}

.level-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.lineup-save {
  margin: 1.5rem 0 0;
}

.festival-name {
  font-weight: 650;
}

.festival-dates {
  color: var(--colour-muted);
}

@media (min-width: 40rem) {
  .column {
    padding-inline: 2rem;
  }

  .facts div {
    grid-template-columns: 9rem 1fr;
  }
}

@media (min-width: 48rem) {
  .levels {
    flex: 0 0 auto;
    grid-template-columns: repeat(4, 8rem);
  }
}
