/* Reservation slots: a calendar of the days, then the times of the picked one. */
.slot-days {
  margin-top: 8px;
  max-width: 460px;
}
.slot-times-box {
  margin-top: 16px;
}
.slot-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.cal {
  padding: 10px;
  border: 1.5px solid var(--field-line);
  border-radius: 6px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cal-month {
  font-size: var(--fs-body);
}
.cal-nav {
  width: 40px;
  height: 40px;
}
.cal-prev .icon {
  transform: scaleX(-1);
}
[dir="rtl"] .cal-prev .icon-arrow {
  transform: none;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-wd {
  padding-bottom: 4px;
  color: var(--mute);
  font-size: var(--fs-help);
  text-align: center;
}
.cal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 2px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--mute);
  font-size: var(--fs-body);
  line-height: 1.1;
}
/* A date or a time that can still be booked is a ticket: its top and bottom
   edges are a zigzag, as the ticket a booking ends with. */
.cal-date.is-day,
.slot-chip.time:not(.is-full):not(.is-past) {
  border-color: transparent;
  background: var(--tint-a);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  -webkit-mask:
    conic-gradient(
        from 135deg at top,
        var(--mask-clear),
        var(--mask-solid) 1deg 89deg,
        var(--mask-clear) 90deg
      )
      top / 8px 51% repeat-x,
    conic-gradient(
        from -45deg at bottom,
        var(--mask-clear),
        var(--mask-solid) 1deg 89deg,
        var(--mask-clear) 90deg
      )
      bottom / 8px 51% repeat-x;
  mask:
    conic-gradient(
        from 135deg at top,
        var(--mask-clear),
        var(--mask-solid) 1deg 89deg,
        var(--mask-clear) 90deg
      )
      top / 8px 51% repeat-x,
    conic-gradient(
        from -45deg at bottom,
        var(--mask-clear),
        var(--mask-solid) 1deg 89deg,
        var(--mask-clear) 90deg
      )
      bottom / 8px 51% repeat-x;
}
.cal-left {
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
}
.cal-date[aria-pressed="true"] {
  border-color: var(--sea);
  background: var(--sea);
  color: var(--on-sea);
}
/* A date with no time left is crossed out with a red X; the cell is too
   small for the word, so the X says it and the label reads it out. */
.cal-date.is-day.is-full {
  -webkit-mask: none;
  mask: none;
  position: relative;
  border-color: transparent;
  background: var(--sheet-2);
  color: var(--mute);
  font-weight: 400;
  cursor: not-allowed;
}
.cal-date.is-day.is-full .cal-left {
  display: none;
}
.cal-date.is-day.is-full::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background:
    linear-gradient(
      to top right,
      transparent calc(50% - 1.5px),
      var(--err) calc(50% - 1.5px),
      var(--err) calc(50% + 1.5px),
      transparent calc(50% + 1.5px)
    ),
    linear-gradient(
      to top left,
      transparent calc(50% - 1.5px),
      var(--err) calc(50% - 1.5px),
      var(--err) calc(50% + 1.5px),
      transparent calc(50% + 1.5px)
    );
  opacity: 0.7;
}
.slot-chip {
  min-height: 44px;
  padding: 4px 16px;
  border: 1.5px solid var(--field-line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: var(--fs-body);
}
.slot-chip small {
  display: block;
  color: var(--mute);
  font-size: var(--fs-help);
  line-height: 1.1;
}
.slot-chip[aria-pressed="true"],
.slot-chip.time[aria-pressed="true"]:not(.is-full) {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--on-sea);
  font-weight: 700;
}
.slot-chip[aria-pressed="true"] small {
  color: inherit;
}
/* A time that is full is a ticket torn in two across the middle: the time
   on the top half, Full on the bottom one. */
.slot-chip.is-full {
  cursor: not-allowed;
  color: var(--mute);
  border-color: transparent;
  background: var(--sheet-2);
  padding-block: 8px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(50% - 2px),
    87.5% calc(50% - 5px),
    75% calc(50% - 2px),
    62.5% calc(50% - 5px),
    50% calc(50% - 2px),
    37.5% calc(50% - 5px),
    25% calc(50% - 2px),
    12.5% calc(50% - 5px),
    0% calc(50% - 2px),
    0% calc(50% + 5px),
    12.5% calc(50% + 2px),
    25% calc(50% + 5px),
    37.5% calc(50% + 2px),
    50% calc(50% + 5px),
    62.5% calc(50% + 2px),
    75% calc(50% + 5px),
    87.5% calc(50% + 2px),
    100% calc(50% + 5px),
    100% 100%,
    0 100%
  );
}
.slot-chip .slot-left {
  font-family: var(--font-body);
  letter-spacing: 0;
}
.slot-chip.is-full .slot-left {
  margin-top: 10px;
  color: var(--err);
  font-weight: 700;
}
.slot-move {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1.5px solid var(--gold);
  border-inline-start-width: 5px;
  border-radius: 4px;
  background: var(--tint-b);
  color: var(--ink);
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.5;
}
.slot-move .icon {
  color: var(--gold);
  flex: none;
  margin-top: 2px;
}
.slot-chip.time {
  font-family: var(--font-code);
  letter-spacing: 0.04em;
  font-size: 1rem;
}
/* A date or a time that has passed is greyed out, not crossed: it was never
   taken, it is only over. The date still reads Passed under its number. */
.cal-date.is-day.is-past,
.slot-chip.is-past {
  -webkit-mask: none;
  mask: none;
  border-color: transparent;
  background: transparent;
  color: var(--mute);
  font-weight: 400;
  opacity: 0.6;
  cursor: not-allowed;
}
