/* Month grid. Deliberately plain CSS: the project vendors its assets and has
   no build step, so anything here has to be readable as-is. */

.calendar-grid {
  table-layout: fixed;
}

.calendar-grid td {
  height: 7.5rem;
  vertical-align: top;
  padding: 0.35rem;
}

.calendar-grid td.out-of-month {
  background-color: var(--bs-tertiary-bg);
}

.calendar-grid td.is-today {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}

.calendar-day-number {
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar-entry {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.15rem 0.3rem;
  margin-bottom: 0.15rem;
  border-radius: 0.2rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A cancelled slot still shows, struck through: "why is Tuesday empty" is a
   question worth being able to answer from the calendar. */
.calendar-entry.is-canceled {
  text-decoration: line-through;
  opacity: 0.6;
}

/* An appointment nobody has confirmed yet. Outlined rather than filled, so a
   month with a lot of silence reads as sparse at a glance. Colour is not the
   only signal -- the entry also carries a title attribute -- because roughly
   one man in twelve cannot tell these two apart. */
.calendar-entry.is-unconfirmed {
  background-color: transparent;
  border: 1px dashed var(--bs-primary);
  color: var(--bs-primary);
}

/* A day the viewer does not normally work. Hatched rather than merely tinted:
   out-of-month cells are already a flat grey, and two flat greys a shade apart
   is exactly the distinction that disappears on a laptop screen in a bright
   room. The cell also carries a title, so the signal is never colour alone. */
.calendar-grid td.is-nonworking {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    var(--bs-tertiary-bg) 6px,
    var(--bs-tertiary-bg) 12px
  );
}

/* Explicit time off. Muted and not a link -- it explains an empty day rather
   than offering anywhere to go. */
.calendar-entry.is-time-off {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-style: italic;
}

/* Checkbox and radio groups (core/_field.html renders these as a fieldset).
   Django nests the input inside its own label, so Bootstrap's .form-check
   wrapper markup does not apply -- this is that layout by hand, which is
   cheaper than overriding Django's widget templates. Bootstrap also scales a
   bare <legend> up to a heading size, which a field label is not. */
fieldset > legend.form-label {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

fieldset .form-check-input {
  margin-right: 0.4rem;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.15rem;
}

/* Alpine: keep toggled blocks from flashing open before the script boots. */
[x-cloak] { display: none !important; }
