/**
 * VRCC Local Fixes - arrival and departure days of other stays as half days.
 *
 * The taken half uses the same grey stripes as a closed day, and the diagonal
 * carries the same red as a closed day's border and stroke, so a half day
 * reads as "half of a booked day". The triangle is a pseudo-element clipped
 * corner to corner and laid under the cell's text (z-index -1 inside an
 * isolated cell), which keeps the day number, the price and the hover colour
 * of the free half untouched.
 *
 *   .vrcc-lf-depart-only  a stay begins that afternoon: lower right half
 *   .vrcc-lf-arrive-only  a stay ends that morning:     upper left half
 */

.flatpickr-calendar .flatpickr-day.vrcc-lf-half {
  position: relative;
  isolation: isolate;
}

.flatpickr-calendar .flatpickr-day.vrcc-lf-half::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom right,
      transparent calc(50% - 1px),
      #d32f2f calc(50% - 1px),
      #d32f2f calc(50% + 1px),
      transparent calc(50% + 1px)),
    repeating-linear-gradient(45deg,
      #f8f8f8 0, #f8f8f8 4px,
      #e8e8e8 4px, #e8e8e8 8px);
}

.flatpickr-calendar .flatpickr-day.vrcc-lf-depart-only::before {
  -webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.flatpickr-calendar .flatpickr-day.vrcc-lf-arrive-only::before {
  -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Once a half day is part of the guest's own selection, the selection colour
   says everything. */
.flatpickr-calendar .flatpickr-day.vrcc-lf-half.selected::before,
.flatpickr-calendar .flatpickr-day.vrcc-lf-half.startRange::before,
.flatpickr-calendar .flatpickr-day.vrcc-lf-half.endRange::before,
.flatpickr-calendar .flatpickr-day.vrcc-lf-half.inRange::before {
  display: none;
}
