/*
 * InkBridge local presentation tweaks for the Request Tracker (RT) portal.
 *
 * Loaded into every page's <head> by the Mason callback
 * local/html/Callbacks/InkBridge/Elements/Header/Head.
 *
 * IMPORTANT: this is an ADDITIONAL stylesheet, loaded after RT's own CSS, so it
 * overrides individual rules via the cascade. It is deliberately NOT named
 * calendar.css; a file at local/static/css/calendar.css would shadow (replace)
 * the RTx::Calendar plugin's own calendar.css and wipe its whole calendar
 * layout (td vertical-align, day rounding, the hover popup). Keeping these as
 * overrides leaves the plugin's layout (aligned days, rounded bars, absolute
 * hover popup) intact.
 *
 * The per-status calendar event colours are set server-side by
 * %CalendarStatusColorMap in RT_SiteConfig.pm.
 */

/* Nudge the InkBridge logo off the right edge of the header. */
#logo {
    padding-right: 18px !important;
    box-sizing: border-box !important;
}

/* Let event titles wrap to as many lines as they need, instead of RTx clipping
   them to one line. The plugin's td is vertical-align:top, so taller cells do
   not knock the day numbers out of line, and its hover popup stays an absolute
   overlay, so wrapping does not push the calendar around. */
table.rtxcalendar .day {
    height: auto !important;
}

table.rtxcalendar .event-info {
    height: auto !important;
}

table.rtxcalendar .event-info a.event-title {
    position: static !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Event bars get a subtle border for definition (the per-status fill colour
   comes from %CalendarStatusColorMap in RT_SiteConfig.pm). */
table.rtxcalendar .day[class*="event-status"] {
    border: 1px solid rgba(0, 0, 0, .2) !important;
}

/* Default text is dark, for the white-filled default status. */
table.rtxcalendar .event-info a.event-title,
table.rtxcalendar .event-info a.event-title:visited,
table.rtxcalendar .event-info a.event-title:hover,
table.rtxcalendar .event-info a.event-title:focus {
    color: #212529 !important;
}

/* The coloured (dark-filled) statuses get white text instead. */
table.rtxcalendar .day.event-status-new .event-info a.event-title,
table.rtxcalendar .day.event-status-open .event-info a.event-title,
table.rtxcalendar .day.event-status-stalled .event-info a.event-title,
table.rtxcalendar .day.event-status-rejected .event-info a.event-title,
table.rtxcalendar .day.event-status-resolved .event-info a.event-title,
table.rtxcalendar .day.event-status-new .event-info a.event-title:visited,
table.rtxcalendar .day.event-status-open .event-info a.event-title:visited,
table.rtxcalendar .day.event-status-stalled .event-info a.event-title:visited,
table.rtxcalendar .day.event-status-rejected .event-info a.event-title:visited,
table.rtxcalendar .day.event-status-resolved .event-info a.event-title:visited {
    color: #fff !important;
}

/* Day-of-week header row: #547ccc with white text, instead of RTx's lavender. */
table.rtxcalendar th {
    background-color: #547ccc !important;
    color: #fff !important;
}

/* Today's cell: a light tint with a #547ccc date number, instead of RTx's amber. */
table.rtxcalendar td.today {
    background: #eef2f7 !important;
    border-color: #547ccc !important;
}

table.rtxcalendar td.today .calendardate {
    background-color: #547ccc !important;
    color: #fff !important;
}
