/* Calendar grid — weekly availability view */

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

.calendar-grid caption {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.calendar-grid th {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--pico-muted-color);
}

.calendar-grid th[scope="row"] {
  text-align: right;
  white-space: nowrap;
  padding-right: 0.75rem;
}

.calendar-grid td {
  padding: 0;
  border: 1px solid var(--pico-muted-border-color);
}

/* Remove default form margins inside cells */
.calendar-grid td form {
  margin: 0;
}

/* Cell buttons — rely on Pico's native filled/outline button styling.
   Only override sizing and layout to fit the grid. */
.calendar-grid__cell {
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  border-radius: 0;
  font-size: 0.75rem;
}

.calendar-grid__cell:focus-visible {
  outline: 2px solid var(--pico-primary);
  outline-offset: -2px;
  z-index: 1;
}

.calendar-grid__cell--past {
  background-color: var(--pico-muted-border-color);
  cursor: default;
  opacity: 0.4;
}

/* Suppress Pico's aria-busy spinner throughout the calendar grid.
   Turbo sets aria-busy on turbo-frame (during navigation) and on
   form/button elements (during submission). Pico styles all of
   these with a loading spinner — inappropriate for instant toggles. */
#calendar_week[aria-busy=true]::before,
.calendar-grid td form[aria-busy=true]::before,
.calendar-grid__cell[aria-busy=true]::before {
  display: none;
}

#calendar_week[aria-busy=true],
.calendar-grid__cell[aria-busy=true] {
  pointer-events: auto;
}
