/*
 * Boston Jazz Calendar: shared structure.
 *
 * Everything here is drawn from custom properties. Each theme-*.css file
 * defines the colors and fonts (light and dark) and its own layouts, all
 * scoped to :root[data-theme="…"], which index.html sets before first paint.
 *
 * Color tokens every theme defines: --bg, --surface, --ink, --muted, --rule,
 * --accent, --accent-ink, --adjacent, --focus, --cancelled.
 */

:root {
  --font-text:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: var(--font-text);
  /* Times, dates and counts. */
  --font-time: var(--font-text);
  --rule-strong: var(--ink);
  --chip: var(--surface);
  --highlight: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --shadow-popover: 0 0.5rem 1.5rem rgb(0 0 0 / 0.14);

  --measure: 46rem;
  /* The month grid's width; the list keeps the narrower measure. */
  --measure-wide: 68rem;
  --gutter: 1rem;
  /* Popovers, inputs and month cells. */
  --radius: 4px;
  /* Buttons, presets and chips. */
  --radius-control: 4px;
  --time-col: 5rem;
  --row-pad: 0.75rem;
  /* The height of a bar the theme pins to the top; set by main.ts. */
  --sticky-top: 0px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem / 1.5 var(--font-text);
  font-feature-settings: "kern";
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

button,
input,
select {
  font: inherit;
}

/* Themes set display on many elements; hidden must still win. */
[hidden] {
  display: none !important;
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  top: 0.5rem;
}

/* Masthead: title block, last update and Subscribe. */

.masthead {
  margin-bottom: 1.25rem;
}

.masthead-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "text text"
    "updated subscribe";
  align-items: end;
  gap: 0.25rem 1.5rem;
}

.masthead-text {
  grid-area: text;
}

.masthead-text > * {
  margin: 0;
}

.updated {
  grid-area: updated;
  margin: 0;
  min-height: 1.3em;
  font-size: 0.875rem;
  color: var(--muted);
}

.updated.stale {
  color: var(--cancelled);
}

.subscribe {
  grid-area: subscribe;
}

.wordmark {
  font-family: var(--font-display);
  line-height: 1.05;
}

.tagline {
  max-width: 36rem;
  color: var(--muted);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font: 600 0.875rem / 1.2 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--ink);
  color: var(--bg);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  border-color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  background: color-mix(in srgb, var(--accent) 82%, var(--ink));
  color: var(--accent-ink);
}

.button-small {
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
}

.link-button {
  padding: 0.25rem 0.1rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.link-button:hover {
  color: var(--ink);
}

/* Filters */

.filters {
  position: relative;
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem 1rem;
}

.field {
  display: grid;
  gap: 0.25rem;
}

.field-search {
  flex: 1 1 100%;
}

.picker {
  flex: 1 1 9rem;
}

.field-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input[type="search"]:hover,
input[type="search"]:focus {
  border-color: var(--ink);
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Date presets and List | Month: radio buttons drawn as segments. */

.presets,
.segmented {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 0;
}

.presets {
  flex: 1 1 auto;
  gap: 0.4rem;
}

.presets label,
.segmented label {
  position: relative;
}

.presets input,
.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.presets span,
.segmented span {
  display: block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-size: 0.875rem;
  font-weight: 550;
  text-align: center;
  white-space: nowrap;
}

.presets input:hover + span,
.segmented input:hover + span {
  border-color: var(--ink);
}

.presets input:checked + span,
.segmented input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.presets input:focus-visible + span,
.segmented input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.segmented label + label {
  margin-left: -1px;
}

.segmented label:not(:last-of-type) span {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.segmented label:not(:first-of-type) span {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

/* The jazz-adjacent switch */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.toggle input {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.2rem;
  height: 1.3rem;
  margin: 0;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 0.15s;
}

.toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.3rem - 6px);
  height: calc(1.3rem - 6px);
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s;
}

.toggle input:checked {
  border-color: var(--ink);
  background: var(--ink);
}

.toggle input:checked::before {
  background: var(--bg);
  transform: translateX(0.9rem);
}

/* Popovers: picker panels, the subscribe panel, add-to-calendar menus. */

.popover {
  position: absolute;
  z-index: 5;
  /* top: auto leaves the panel just below its button, wherever it's anchored. */
  top: auto;
  left: 0;
  right: 0;
  margin-top: 0.3rem;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-popover);
  text-align: left;
}

.popover-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

/* Multi-select pickers */

.picker-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.picker-toggle::after {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: -0.2rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.is-open > .picker-toggle::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.picker-toggle:hover,
.is-open > .picker-toggle {
  border-color: var(--ink);
}

.picker-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker.has-selection .picker-summary {
  font-weight: 600;
}

.picker-filter {
  margin-bottom: 0.5rem;
}

.picker-options {
  max-height: min(20rem, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.picker-group {
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
}

.picker-group legend {
  padding: 0.35rem 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.1rem;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius);
  font-size: 0.94rem;
  cursor: pointer;
}

.picker-option:hover {
  background: var(--highlight);
}

.picker-option input {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.picker-empty {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

/* Selected venues and towns, as removable chips */

.selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.3rem 0.4rem 0.3rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--chip);
  color: var(--ink);
  font: 500 0.8125rem / 1.2 var(--font-text);
  cursor: pointer;
}

.selection-chip:hover {
  border-color: var(--ink);
}

.selection-chip-kind {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.selection-chip-x {
  padding-inline: 0.2rem;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
}

/* Toolbar: count and List | Month */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--rule);
}

.count {
  flex: 1 1 auto;
  margin: 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* Subscribe */

.subscribe-toggle {
  white-space: nowrap;
}

.subscribe-panel > * {
  margin: 0 0 0.75rem;
}

.subscribe-panel > :last-child {
  margin-bottom: 0;
}

.subscribe-scope {
  font-weight: 600;
}

.subscribe-help,
.subscribe-everything,
.subscribe-status {
  font-size: 0.875rem;
  color: var(--muted);
}

.subscribe-status:empty {
  display: none;
}

.subscribe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subscribe-copy {
  display: flex;
  gap: 0.5rem;
}

.subscribe-url {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font:
    0.8rem / 1.3 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
}

/* Submit a gig: the header link and the dialog's form. */

.submit-link {
  margin-right: 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

:root:has(.submit-dialog[open]) {
  overflow: hidden;
}

.submit-dialog {
  width: min(36rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-popover);
  overscroll-behavior: contain;
  /* Fields scrolled into view clear the sticky header. */
  scroll-padding-top: 4.5rem;
}

.submit-dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.submit-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.submit-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.submit-close {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.submit-close:hover {
  border-color: var(--rule);
  color: var(--ink);
}

.submit-form,
.submit-done {
  display: grid;
  gap: 0.9rem;
  padding: 1rem var(--gutter) 1.25rem;
}

.submit-form p,
.submit-done p {
  margin: 0;
}

.submit-intro {
  font-size: 0.9rem;
  color: var(--muted);
}

.form-field {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 0.75rem;
}

.form-row > .form-field {
  flex: 1 1 7rem;
}

.form-group {
  display: grid;
  gap: 0.9rem;
}

:is(.form-repeats, .form-choices) {
  margin: 0;
  padding: 0;
  border: 0;
}

.form-repeats .segmented {
  gap: 0.4rem;
}

.form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.form-row > .form-field-date,
.form-row > .form-field-wide {
  flex: 2 1 11rem;
}

.form-label {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-optional {
  margin-left: 0.3em;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.field-error {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cancelled);
}

:is(.submit-form, .review-card)
  :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

:is(.submit-form, .review-card) textarea {
  min-height: 4.5rem;
  resize: vertical;
}

:is(.submit-form, .review-card)
  :is(input, select, textarea):hover:not(:disabled),
:is(.submit-form, .review-card) :is(input, select, textarea):focus {
  border-color: var(--ink);
}

:is(.submit-form, .review-card) [aria-invalid="true"] {
  border-color: var(--cancelled);
}

:is(.submit-form, .review-card) :disabled {
  opacity: 0.5;
}

.form-check {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.form-check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.form-private {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-private legend {
  padding-inline: 0.3rem;
}

.submit-form .form-private input {
  background: var(--bg);
}

/* Room for the Turnstile widget, so the form doesn't jump when it loads. */
.submit-turnstile {
  min-height: 65px;
}

.submit-turnstile[data-state="failed"] {
  min-height: 0;
}

.submit-status {
  font-size: 0.875rem;
}

.submit-status:empty {
  display: none;
}

.submit-status[data-kind="error"] {
  font-weight: 600;
  color: var(--cancelled);
}

.submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submit-done-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

/* A single day picked from the month grid */

.day-filter {
  margin: 0.25rem 0 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.92rem;
}

/* Day strip: jump links to each day of the list. Themes opt in. */

.day-strip {
  display: none;
}

.day-strip-list {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.75rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  font-family: var(--font-time);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-decoration: none;
}

a.strip-day:hover {
  border-color: var(--ink);
}

.strip-day.is-empty {
  color: var(--muted);
  border-style: dashed;
}

.strip-day.is-today {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.strip-weekday {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strip-date {
  font-weight: 600;
}

/* Month view */

/* The month grid needs more width; the header and footer follow it. */
:root:has(#listings.is-month) .wrap {
  max-width: var(--measure-wide);
}

.month {
  margin-bottom: 1.5rem;
}

.month-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0.75rem;
}

.month-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.month-steps {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}

.month-step {
  min-width: 2.25rem;
  padding-inline: 0.5rem;
  font-size: 1.1rem;
}

.month-steps [aria-disabled="true"] {
  border-color: var(--rule);
  color: var(--muted);
}

.month-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.month-grid th {
  padding: 0 0.4rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
}

.month-grid abbr {
  text-decoration: none;
}

.month-cell {
  height: 1px; /* lets the day link fill the cell */
  padding: 0;
  border: 1px solid var(--rule);
  vertical-align: top;
}

.month-day {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  height: 100%;
  min-height: 6.5rem;
  padding: 0.3rem 0.4rem 0.4rem;
  color: inherit;
  text-decoration: none;
}

a.month-day:hover {
  background: var(--highlight);
}

a.month-day:focus-visible {
  outline-offset: -2px;
}

.month-date {
  align-self: flex-start;
  min-width: 1.6rem;
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-control);
  font-family: var(--font-time);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.month-cell.is-today {
  background: var(--highlight);
}

.is-today .month-date {
  background: var(--accent);
  color: var(--accent-ink);
}

.is-outside {
  background: color-mix(in srgb, var(--ink) 5%, var(--bg));
}

.is-outside .month-day,
.is-past .month-date {
  color: var(--muted);
}

.is-selected {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.month-entries {
  display: grid;
  min-width: 0;
}

.month-entry,
.month-more {
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-entry-time {
  margin-right: 0.3em;
  font-family: var(--font-time);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.month-entry.adjacent .month-entry-time {
  color: var(--adjacent);
}

.month-entry.cancelled {
  color: var(--muted);
  text-decoration: line-through;
}

.month-more {
  color: var(--muted);
}

.month-count {
  display: none;
}

@media (max-width: 39.99rem) {
  .month-grid th {
    padding-inline: 0;
    text-align: center;
  }

  .month-day {
    align-items: center;
    min-height: 3.25rem;
    padding: 0.25rem 0.1rem;
  }

  .month-date {
    align-self: center;
  }

  .month-entries {
    display: none;
  }

  .month-count {
    display: block;
    min-width: 1.4rem;
    padding: 0 0.3rem;
    border-radius: var(--radius-control);
    background: var(--surface);
    font-family: var(--font-time);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    color: var(--ink);
  }

  .is-outside .month-count,
  .is-today .month-count {
    background: var(--bg);
  }
}

/* Add to calendar: a compact icon button and its menu. */

.add-to-calendar {
  position: relative;
}

.add-to-calendar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}

.add-to-calendar-toggle::-webkit-details-marker {
  display: none;
}

.add-to-calendar-toggle:hover,
.add-to-calendar[open] > .add-to-calendar-toggle {
  border-color: var(--rule);
  color: var(--ink);
}

/* Visually hidden by default; the icon carries the button. */
.add-to-calendar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}

.icon-calendar {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='1.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M12 13v5M9.5 15.5h5'/%3E%3C/svg%3E");
}

.menu {
  right: 0;
  left: auto;
  width: max-content;
  min-width: 13rem;
  margin: 0.25rem 0 0;
  padding: 0.3rem;
  list-style: none;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: 500 0.9rem / 1.3 var(--font-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--highlight);
}

/* Days */

.day {
  margin-bottom: 1.25rem;
  scroll-margin-top: var(--sticky-top);
}

.day-heading {
  position: sticky;
  top: var(--sticky-top);
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0 0.4rem;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--bg);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

/* The heading comes in two forms; each theme shows one. */
.day-short {
  display: none;
}

.day-relative {
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
}

/*
 * A day's shows skip layout and paint while off screen, standing in as a
 * box sized from their count (--day-events, set by render.ts) until first
 * shown. That containment clips to the padding box, so the padding,
 * cancelled by the negative margin, leaves room for focus rings; an open
 * add-to-calendar menu lifts it so the menu can hang below the list.
 */
.day > .events {
  --clip-room: 0.375rem;
  margin: calc(-1 * var(--clip-room));
  padding: var(--clip-room);
  content-visibility: auto;
  contain-intrinsic-block-size: auto calc(var(--day-events, 4) * 4.5rem);
}

.day > .events:has(.add-to-calendar[open]) {
  content-visibility: visible;
}

/* Events. Each theme lays out .event-row; this is the plain default. */

.event,
.regular {
  border-bottom: 1px solid var(--rule);
}

.event-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--time-col) minmax(0, 1fr) auto;
  grid-template-areas:
    "time title cal"
    "time venue cal"
    "time extra cal"
    "time marks cal";
  align-items: start;
  column-gap: 1rem;
  padding-block: var(--row-pad);
}

.event-row > * {
  margin: 0;
  min-width: 0;
}

.event-time {
  grid-area: time;
  font-family: var(--font-time);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.35;
}

.event-time time {
  display: block;
  white-space: nowrap;
}

/* Clock times come in two forms; each theme shows one. */
.clock-short {
  display: none;
}

.event-end {
  display: block;
  font-size: 0.8em;
  color: var(--muted);
  white-space: nowrap;
}

/* A set after midnight, listed with the night before. */
.event-late {
  display: block;
  font-size: 0.8em;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
}

.event-marks {
  grid-area: marks;
}

.event-title {
  grid-area: title;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.event-link {
  color: inherit;
  text-decoration: none;
}

a.event-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.event-artists {
  display: block;
  font-family: var(--font-text);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.event-venue {
  grid-area: venue;
  font-size: 0.875rem;
}

.event-venue a {
  text-decoration: none;
}

.event-venue a:hover {
  text-decoration: underline;
}

.event-place {
  color: var(--muted);
}

.event-place::before {
  content: " · ";
}

.event-extra {
  grid-area: extra;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Inline-block keeps a link's underline off its separator. */
.event-extra > * + *::before {
  content: "·" / "";
  display: inline-block;
  margin-inline: 0.3em;
  color: var(--muted);
}

.event-price {
  font-variant-numeric: tabular-nums;
}

/* Tags are pills, so no separator dot before them. */
.event-extra > .event-tag::before {
  content: none;
}

.event-tag {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0 0.5em;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}

.event-extra > .event-tag:first-child {
  margin-left: 0;
}

.event-tag.tag-adjacent {
  border-color: var(--adjacent);
  color: var(--adjacent);
}

.event-tickets {
  color: var(--ink);
  font-weight: 600;
}

/* "via Ticketmaster": the third party a listing came through. */
.event-via {
  font-size: 0.92em;
}

/* A full-size target that doesn't make the row taller. */
.event-row > .add-to-calendar {
  grid-area: cal;
  align-self: start;
  margin-block: -0.3rem;
}

/* Markers: a glyph each, with text for screen readers. */

.mark::before {
  font-size: 0.85em;
}

.mark-now::before {
  content: "●" / "";
  color: var(--accent);
}

.mark + .mark {
  margin-left: 0.3em;
}

.badge-cancelled {
  margin-left: 0.5rem;
  padding: 0 0.3rem;
  border: 1px solid var(--cancelled);
  border-radius: 2px;
  font-family: var(--font-text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.15em;
  color: var(--cancelled);
}

.event.cancelled .event-link,
.event.cancelled .event-time time {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.event.cancelled .event-row {
  color: var(--muted);
}

/* Weekly regulars: standing series, kept apart from the dated listings. */

.regulars {
  margin-top: 2.5rem;
}

.regulars-intro {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.regular-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "when" "marks" "title" "venue" "checked";
  padding-block: var(--row-pad);
}

.regular-row > * {
  margin: 0;
}

.regular-when {
  grid-area: when;
  font-family: var(--font-time);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.regular-checked {
  grid-area: checked;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Loading, empty and error notices */

.notice {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

.notice > * {
  margin: 0 0 0.75rem;
}

.notice-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

/* Footer */

.colophon {
  margin-top: 3rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  background: var(--surface);
  font-size: 0.9rem;
}

.colophon-grid {
  display: grid;
  gap: 1.5rem 2.5rem;
}

.colophon h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.colophon p {
  margin: 0 0 0.75rem;
}

.colophon a {
  overflow-wrap: anywhere;
}

/* Where listings come from: a disclosure in the About section. */

.sources {
  margin: 0 0 0.75rem;
}

.sources summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
}

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

.sources-heading {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.sources-list {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.sources-list li {
  display: inline;
}

.sources-list li + li::before {
  content: " · " / "";
  color: var(--muted);
}

.colophon .fine-print {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.colophon .fine-print + .fine-print {
  margin-top: 0;
}

/* Review-period theme switcher; remove with the themes not chosen. */

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.theme-switcher legend {
  float: left;
  margin-right: 0.3rem;
  padding: 0;
}

.theme-switcher button {
  padding: 0.2rem 0.15rem;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.theme-switcher button + button::before {
  content: "·" / "";
  display: inline-block;
  margin-right: 0.3rem;
  text-decoration: none;
}

.theme-switcher button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

/* Wider screens */

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }

  .field-search {
    flex-basis: 16rem;
  }

  .picker {
    flex: 0 1 12rem;
  }

  .picker-anchor,
  .subscribe {
    position: relative;
  }

  /* Right-aligned so a panel never runs past the filters' right edge. */
  .picker-panel {
    left: auto;
    width: 22rem;
  }

  .subscribe-panel {
    left: auto;
    width: 26rem;
  }

  .colophon-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 39.99rem) {
  .subscribe-panel {
    left: var(--gutter);
    right: var(--gutter);
  }

  .submit-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

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

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

/* Headings focused by script (tabindex="-1") need no focus ring. */
[tabindex="-1"]:focus {
  outline: none;
}
