/* Calendar month grid and the calendar-and-list block [2.3]. Tokens only. */
.calendar-block { display: block; }
.calendar {
  /* Inline padding stops at 16px so 200% text at 320px still leaves room for seven days. */
  padding: var(--space-4) min(var(--space-4), 16px);
  container-type: inline-size;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.calendar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); margin-bottom: var(--space-2); }
.calendar__head > * { flex: none; }
.landing .calendar__title { flex: 1 1 0; min-width: 0; margin: 0; font-size: var(--text-lg); overflow-wrap: break-word; text-align: center; }
/* Very large text: the month name takes the whole first row, the arrows sit under it. */
@container (max-width: 12em) {
  .calendar__head { flex-wrap: wrap; }
  .landing .calendar__title { flex-basis: 100%; order: -1; }
}
.calendar__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  color: var(--link);
}
.calendar__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar__grid th { padding-block: var(--space-1); color: var(--muted); font-size: var(--text-sm); font-weight: 500; }
.calendar__grid abbr { text-decoration: none; }
.calendar__cell { padding: 1px; text-align: center; }
.calendar__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  /* Near-square buttons (boards 1 and 9), centred in their cell and not stretched wide. */
  width: 100%;
  max-width: 3.5rem;
  min-height: var(--tap-min);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
}
/* The day number grows with the text but never past what fits a seventh of the card (two
   digits in a 1/7 column); at normal text sizes the cap is far above --text-base. */
.calendar__num { font-size: min(var(--text-base), 9.5cqi); line-height: 1; }
.calendar__dots { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 8px; color: var(--link); }
.calendar__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--link); }
.calendar__plus { width: 8px; height: 8px; }
.calendar__day--has-events { background: var(--band-testimonial); } /* L43: pale tint behind days with events */
.calendar__day--today { border-color: var(--outline); }
.calendar__day--selected { background: var(--gold); color: var(--ink); border-color: var(--text); }
.calendar__day--selected .calendar__dots { color: var(--ink); }
.calendar__day--selected .calendar__dot { background: var(--ink); }

.calendar-block__list { margin-top: var(--space-6); }

@media (min-width: 1024px) {
  .calendar-block { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: var(--space-8); align-items: start; }
  .calendar-block__list { margin-top: 0; }
}
/* Fix 4.5: a past day is plain muted text, not a control and without dots (events leave the page
   at their start). The box keeps the cell's shape so the rows line up. */
.calendar__day--past { color: var(--muted); cursor: default; }
