/* The app's own styles (dark-factory #812, #1078). Three stylesheets, in this order: the platform's theme.css with
   the --theme-* custom properties (light and dark), the utilities .container .prose .stack .cluster .card and the app
   shell's classes (.app-*, .skip-link); brand.css, the project's brand; then this file.
   Style here, never there: a rule here wins over the theme's.

   Musikgesellschaft Oberwyssen: a concert poster for the next concert, the weeks ahead as a stave, one list pattern
   (.rows) for dates and sign-ups, one mark (.seats) for how full a date is. Every value is a --theme-* token. */

[hidden] {
  display: none !important;
}

body {
  font-variant-numeric: lining-nums tabular-nums;
}

/* The demo notice above the header: the platform's, so it stands on the neutral surfaces, never on the brand. */
.demo-banner {
  padding: var(--theme-space-3xs) var(--theme-space-s);
  color: var(--theme-text-secondary);
  font-size: var(--theme-size-step--1);
  text-align: center;
  background: var(--theme-surface-sunken);
  border-block-end: 1px solid var(--theme-border-subtle);
}

.demo-banner a,
.demo-banner a:hover {
  color: inherit;
}

/* The brand mark in the logo slot: two beamed notes. */
.brand-mark {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.brand-mark-ground {
  fill: var(--theme-accent-base);
}

.brand-mark-head,
.brand-mark-beam {
  fill: var(--theme-accent-contrast);
}

.brand-mark-stem {
  fill: none;
  stroke: var(--theme-accent-contrast);
  stroke-width: 1.8;
}

footer small + small {
  margin-inline-start: auto;
}

.muted {
  color: var(--theme-text-muted);
}

/* Page rhythm: the head of a page, then sections a clear step apart. */
.hero {
  padding-block: var(--theme-space-l) var(--theme-space-2xs);
}

.hero h1 {
  max-inline-size: 20ch;
  margin-block-end: var(--theme-space-xs);
  font-size: var(--theme-size-step-5);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-kind {
  margin-block-end: var(--theme-space-xs);
}

.lede {
  max-inline-size: var(--theme-measure-prose);
  color: var(--theme-text-secondary);
  font-size: var(--theme-size-step-1);
}

main > .section {
  margin-block-start: var(--theme-space-xl);
}

main h2 {
  font-size: var(--theme-size-step-2);
}

.section-head {
  margin-block-end: var(--theme-space-s);
}

.section-head h2,
.section-head p {
  margin: 0;
}

.back {
  margin: 0;
}

/* A link that is the main action of its block looks like the theme's button. */
.button,
.button:hover,
.button:focus-visible {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--theme-control-min);
  padding: var(--theme-space-2xs) var(--theme-space-s);
  color: var(--theme-accent-contrast);
  font-weight: 700;
  text-decoration: none;
  background: var(--theme-accent-base);
  border-radius: var(--theme-radius-m);
}

.button:hover,
.button:focus-visible {
  background: var(--theme-accent-strong);
}

button {
  font-weight: 700;
}

/* The poster of the next concert: the date set large on the brand colour, the invitation beside it. */
.poster {
  display: grid;
  overflow: hidden;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--theme-radius-l);
}

.poster-date {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--theme-space-xs);
  align-items: baseline;
  margin: 0;
  padding: var(--theme-space-m);
  color: var(--theme-accent-contrast);
  background: var(--theme-accent-base);
}

.poster-day {
  font-size: var(--theme-size-step-6);
  font-weight: 700;
  line-height: 1;
}

.poster-month {
  font-size: var(--theme-size-step-2);
  font-weight: 700;
}

.poster-weekday {
  flex-basis: 100%;
}

.poster-body {
  padding: var(--theme-space-m);
}

.poster-body h2 {
  margin-block-end: var(--theme-space-xs);
  font-size: var(--theme-size-step-3);
}

.poster-label {
  margin-block-end: var(--theme-space-3xs);
  color: var(--theme-text-muted);
}

.poster-body p {
  max-inline-size: var(--theme-measure-prose);
}

.poster-facts {
  color: var(--theme-text-secondary);
}

.poster-action,
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theme-space-xs) var(--theme-space-m);
  align-items: center;
  margin: var(--theme-space-m) 0 0;
}

/* The weeks ahead as a stave: one bar a week, a filled note for a concert, an open one for a rehearsal. */
.stave {
  margin-inline: 0;
}

.stave svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.stave figcaption {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.stave-line,
.stave-bar,
.stave-stem {
  vector-effect: non-scaling-stroke;
}

.stave-line {
  fill: none;
  stroke: var(--theme-border-strong);
  stroke-width: 1.5;
}

.stave-bar {
  fill: none;
  stroke: var(--theme-text-secondary);
  stroke-width: 2;
}

.stave-week,
.stave-label {
  display: none;
  fill: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.stave-label {
  fill: var(--theme-text-secondary);
}

.stave-stem {
  fill: none;
  stroke: var(--theme-text-primary);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.stave-note-rehearsal ellipse {
  fill: var(--theme-surface-base);
  stroke: var(--theme-text-primary);
  stroke-width: 2.5;
}

.stave-note-concert ellipse {
  fill: var(--theme-accent-base);
}

.stave-note-concert .stave-stem {
  stroke: var(--theme-accent-base);
}

/* The kind filter: links with their count; the one applied is filled. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theme-space-2xs);
  margin: 0 0 var(--theme-space-s);
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  gap: var(--theme-space-2xs);
  align-items: center;
  min-block-size: var(--theme-control-min);
  padding: var(--theme-space-2xs) var(--theme-space-s);
  color: var(--theme-text-primary);
  text-decoration: none;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-border-strong);
  border-radius: var(--theme-radius-full);
}

.chip:hover {
  color: var(--theme-text-primary);
  border-color: var(--theme-accent-base);
}

.chip-count {
  color: var(--theme-text-muted);
  font-weight: 700;
}

.chip[aria-current='true'],
.chip[aria-current='true'] .chip-count {
  color: var(--theme-accent-contrast);
}

.chip[aria-current='true'] {
  font-weight: 700;
  background: var(--theme-accent-base);
  border-color: var(--theme-accent-base);
}

/* The one list pattern: a raised sheet of rows, each a grid that folds on a narrow screen. */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--theme-surface-raised);
  border: 1px solid var(--theme-border-subtle);
  border-radius: var(--theme-radius-l);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--theme-space-2xs) var(--theme-space-m);
  align-items: center;
  padding: var(--theme-space-s) var(--theme-space-m);
}

.row + .row {
  border-block-start: 1px solid var(--theme-border-subtle);
}

.row-main {
  display: flex;
  flex-direction: column;
  gap: var(--theme-space-3xs);
  min-inline-size: 0;
}

.row-title {
  color: var(--theme-text-primary);
  font-size: var(--theme-size-step-1);
  font-weight: 700;
  line-height: 1.2;
}

a.row-title {
  text-decoration-color: var(--theme-border-strong);
  text-underline-offset: var(--theme-space-3xs);
}

a.row-title:hover {
  color: var(--theme-accent-base);
  text-decoration-color: currentColor;
}

.row-sub {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.rows + p {
  margin-block-start: var(--theme-space-m);
}

.date-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.date-row > .tag,
.date-row > .seats {
  grid-column: 2;
  justify-self: start;
}

.date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-inline-size: var(--theme-space-xl);
  line-height: 1.2;
}

.date-weekday,
.date-month {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.date-day {
  font-size: var(--theme-size-step-3);
  font-weight: 700;
}

.signup-what {
  color: var(--theme-text-secondary);
  font-weight: 700;
  text-align: end;
}

/* The kind of a date, and how full it is: always words, the tone only follows them. */
.tag {
  display: inline-block;
  padding: 0 var(--theme-space-2xs);
  color: var(--theme-text-secondary);
  font-size: var(--theme-size-step--1);
  font-weight: 700;
  border: 1px solid var(--theme-border-strong);
  border-radius: var(--theme-radius-s);
}

.tag-concert {
  color: var(--theme-accent-base);
  border-color: var(--theme-accent-base);
}

.seats {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.seats-few {
  color: var(--theme-state-warning);
  font-weight: 700;
}

.seats-full {
  color: var(--theme-state-danger);
  font-weight: 700;
}

/* A date's page: the facts and the programme beside the sign-up form. */
.detail {
  display: grid;
  gap: var(--theme-space-l);
  align-items: start;
  margin-block-start: var(--theme-space-m);
}

.detail-main {
  display: grid;
  gap: var(--theme-space-l);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(var(--theme-space-3xl) * 1.6), 1fr));
  gap: 0 var(--theme-space-l);
  margin: 0;
}

.facts-single {
  grid-template-columns: minmax(0, 1fr);
}

.facts div {
  padding-block: var(--theme-space-xs);
  border-block-start: 1px solid var(--theme-border-subtle);
}

.facts dt {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.facts .seats {
  font-size: var(--theme-size-step-0);
}

.programme {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: piece;
}

.programme li {
  display: grid;
  grid-template-columns: var(--theme-space-l) minmax(0, 1fr);
  padding-block: var(--theme-space-xs);
  border-block-start: 1px solid var(--theme-border-subtle);
  counter-increment: piece;
}

.programme li::before {
  grid-row: span 2;
  color: var(--theme-text-muted);
  content: counter(piece);
}

.piece {
  font-size: var(--theme-size-step-1);
  font-style: italic;
}

.composer {
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.committee-heading {
  margin-block-start: var(--theme-space-l);
}

/* The form: a label above each field, its hint, and its error in words right under it. */
.signup h2 {
  margin-block-end: var(--theme-space-s);
}

.field {
  margin-block-end: var(--theme-space-s);
}

.field label {
  color: var(--theme-text-primary);
  font-weight: 700;
}

.field-hint {
  margin: 0 0 var(--theme-space-3xs);
  color: var(--theme-text-muted);
  font-size: var(--theme-size-step--1);
}

.field-error {
  margin: var(--theme-space-3xs) 0 0;
  color: var(--theme-state-danger);
  font-size: var(--theme-size-step--1);
  font-weight: 700;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border: 2px solid var(--theme-state-danger);
}

.form-errors {
  margin-block-end: var(--theme-space-s);
  padding: var(--theme-space-s);
  border: 2px solid var(--theme-state-danger);
  border-radius: var(--theme-radius-m);
}

.form-errors-title {
  margin-block-end: var(--theme-space-2xs);
  color: var(--theme-state-danger);
  font-weight: 700;
}

.form-errors ul {
  margin: 0;
  padding-inline-start: var(--theme-space-m);
}

.form-errors a {
  color: var(--theme-text-primary);
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theme-space-s);
  align-items: end;
}

.filter .field {
  flex: 1 1 calc(var(--theme-space-3xl) * 2);
  max-inline-size: calc(var(--theme-space-3xl) * 4);
  margin: 0;
}

/* The confirmation and the fill of a date. */
.ticket {
  max-inline-size: var(--theme-measure-prose);
  border-block-start: var(--theme-space-3xs) solid var(--theme-accent-base);
}

.ticket .facts {
  margin-block-end: var(--theme-space-s);
}

.ref {
  font-size: var(--theme-size-step-1);
  letter-spacing: 0.08em;
}

.fill {
  margin-block-end: var(--theme-space-s);
}

.fill p {
  display: flex;
  flex-wrap: wrap;
  gap: var(--theme-space-2xs) var(--theme-space-m);
  align-items: baseline;
  margin: var(--theme-space-2xs) 0 0;
}

.gauge {
  display: block;
  inline-size: 100%;
  block-size: var(--theme-space-2xs);
  border-radius: var(--theme-radius-full);
}

.gauge-track {
  fill: var(--theme-surface-sunken);
}

.gauge-value {
  fill: var(--theme-accent-base);
}

@media (min-width: 52em) {
  .hero {
    padding-block-start: var(--theme-space-xl);
  }

  .hero h1 {
    font-size: var(--theme-size-step-6);
  }

  .poster {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  }

  .poster-date {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: var(--theme-space-2xs);
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--theme-space-l);
  }

  .poster-body {
    padding: var(--theme-space-l);
  }

  .stave-week,
  .stave-label {
    display: inline;
  }

  .date-row {
    grid-template-columns: auto minmax(0, 6fr) minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
  }

  .date-row > .tag,
  .date-row > .seats {
    grid-column: auto;
  }

  .date-row > .seats {
    justify-self: end;
    text-align: end;
  }

  .detail {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
