/**
 * Admin "When is your listing available" calendar (edit-listing -> Calendar
 * tab): fixes the check-in/check-out diagonal split and adds a same-day
 * turnover indicator.
 *
 * 1) True corner-to-corner diagonal.
 *    The parent theme's own rules (style.css AND the dynamic color version
 *    generated by libs/customcss.php from the "Calendar reserved color"
 *    Theme Option) draw the split with a FIXED angle - 135deg / -45deg.
 *    A fixed angle only lands on the two opposite corners when the box is
 *    perfectly square. These day cells are wider than tall, so the fixed
 *    angle instead cuts across the top and right edges, leaving a lopsided
 *    triangle in one corner rather than an even 50/50 split.
 *    "to bottom right" is corner-relative: the browser recalculates the
 *    actual angle needed to pass through the real opposite corners for
 *    THIS box's aspect ratio, so the split is always a clean diagonal
 *    regardless of cell shape. Both check-in and check-out use the SAME
 *    top-left/bottom-right axis (just with the two colors swapped) - that's
 *    what the parent's own rules do too: the modern, unprefixed
 *    "background: linear-gradient(135deg, ...)" declaration is the one
 *    that actually wins (it's listed last, after several vendor-prefixed
 *    fallbacks that browsers ignore once a standard one is present), and
 *    135deg runs top-left to bottom-right for check-in AND check-out alike.
 *    !important is needed to win over both parent rules regardless of
 *    stylesheet print order (the dynamic color block in customcss.php is
 *    printed inline in wp_head, not through the normal enqueued-styles
 *    pass, so relying on source order alone isn't reliable here).
 *
 * 2) Same-day turnover (a booking's checkout and the next booking's
 *    check-in fall on the same calendar day). The parent's calendar
 *    renderer only tracks reserved-vs-free transitions, not which booking
 *    a reserved day belongs to, so a turnover day currently renders as an
 *    indistinguishable solid, fully-booked day. The child override of
 *    templates/submit_templates/property_calendar.php
 *    (wpestate_draw_month()) detects this - the day is reserved and
 *    yesterday was too, but by a different booking - and adds the
 *    "same_day_turnover" class. This draws a thin white diagonal line
 *    across the (still solid, still booked-colored) cell instead of a
 *    50/50 fill split, since the day itself isn't half-free - it's fully
 *    occupied, just handed off between two guests.
 *
 *    The line's color stops below are in calc(50% ± Npx), not plain
 *    percentages. A "to <corner>" gradient's 0%-100% axis runs the full
 *    corner-to-corner line, which for a wide, short cell is noticeably
 *    LONGER than the visible diagonal itself - a percentage-wide band (e.g.
 *    47%-53%) reads as a much wider stripe than that number suggests, close
 *    to half the cell rather than a thin line. Offsetting by a fixed pixel
 *    amount from the 50% midpoint keeps the line's rendered width constant
 *    (a few px) regardless of that axis length or the cell's aspect ratio.
 *
 * 3) The "Booking id: N" label (wpestate_draw_reservation(), the
 *    ".rentals_reservation" div wpestate_draw_month() nests INSIDE each
 *    reserved <td>) has its own opaque background-color, same red,
 *    !important, from libs/customcss.php - the SAME rule that colors
 *    ".calendar-reserved" itself. It's a full-width block, so wherever it
 *    sits it paints solid red directly over the <td>'s background,
 *    covering whatever gradient is underneath - the checkin/checkout
 *    triangle split, or the turnover line if the label happens to cross
 *    it. Its own background is redundant anyway (the <td> is already that
 *    same red beneath it) except where it blocks the gradient, so drop it
 *    entirely and let the <td>'s background - solid, split, or lined -
 *    show through under the text too.
 *
 * --wprc-calendar-color is set inline (see functions.php) from the same
 * wp_estate_calendar_back_color Theme Option the parent rules use, so this
 * stays in sync if that color is ever changed; #b881fc is the theme's own
 * default reserved color, used as a fallback if the option is empty.
 */

.booking-calendar-wrapper-in .calendar-reserved.start_reservation {
  background-image: linear-gradient(
    to bottom right,
    #ffffff 0%,
    #ffffff 49%,
    var(--wprc-calendar-color, #b881fc) 51%,
    var(--wprc-calendar-color, #b881fc) 100%
  ) !important;
}

.booking-calendar-wrapper-in .end_reservation {
  background-image: linear-gradient(
    to bottom right,
    var(--wprc-calendar-color, #b881fc) 0%,
    var(--wprc-calendar-color, #b881fc) 49%,
    #ffffff 51%,
    #ffffff 100%
  ) !important;
}

.booking-calendar-wrapper-in .calendar-reserved.same_day_turnover {
  background-image: linear-gradient(
    to bottom right,
    transparent calc(50% - 3px),
    #ffffff calc(50% - 1px),
    #ffffff calc(50% + 1px),
    transparent calc(50% + 3px)
  ) !important;
}

.booking-calendar-wrapper-in .rentals_reservation {
  background: none !important;
  background-color: transparent !important;
}
