/* UNITE HPC Access: the shift calendar. Built on access.css and hub.css.
   A day's colours come from the calendar itself; the two or three letters in each day say the same thing
   without colour. Some rules carry !important because themes often restyle every table on a page. */

.uh-shift-pick { align-items: center; }
.uh-shift-pick label { font-weight: 600; }
.uh-shift-pick select { max-width: 100%; }
.uh-shift-years { align-items: center; font-size: 1.05rem; }
.uh-shift-today { font-weight: 600; }

/* twelve months: three across on a desktop, one on a phone */
.uh-shift-year { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; margin: 0 0 20px; }
.uh-shift-month { min-width: 0; padding: 10px; border: 1px solid var(--uh-a-line); border-radius: 12px; background: #fff; break-inside: avoid; }
.uh-shift-month h3 { margin: 0 0 8px; font-size: 1.05rem; }
.uh-shift .uh-shift-month table { display: table !important; width: 100%; margin: 0; table-layout: fixed; border-collapse: separate; border-spacing: 3px; border: 0; overflow: visible; }
.uh-shift .uh-shift-month thead { position: static !important; }
.uh-shift .uh-shift-month tr { display: table-row !important; margin: 0; padding: 0; border: 0; background: none; }
.uh-shift .uh-shift-month th,
.uh-shift .uh-shift-month td { display: table-cell !important; padding: 0 !important; border: 0; box-shadow: none; text-align: center; }
.uh-shift .uh-shift-month th { position: static !important; padding: 2px 0 !important; background: none; color: var(--uh-a-muted); font-size: .72rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.uh-shift .uh-shift-month th.is-weekend { color: var(--uh-a-red); }
.uh-shift .uh-shift-month td { position: relative !important; left: auto !important; height: 40px; border-radius: 6px; font-weight: 600; }
.uh-shift .uh-shift-month td::before { content: none; }
.uh-shift .uh-shift-month td.is-blank { background: none; }
.uh-shift .uh-shift-month td.is-out { background: #f4f2f1; color: #6d6362; }
.uh-shift-month td a { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; border-radius: 6px; color: inherit; line-height: 1.05; text-decoration: none; }
.uh-shift-month td a:focus-visible { outline: 3px solid #1d5fbf; outline-offset: 1px; }
.uh-shift-num { font-size: 1rem; }
.uh-shift-code { font-size: .58rem; font-weight: 700; letter-spacing: .03em; }
/* on a hatched or chequered day the figures sit on a pale plate, or the pattern would swallow them */
.uh-shift-month td.is-patterned a > span { padding: 0 3px; border-radius: 3px; background: rgba(255, 255, 255, .82); color: #111; }
.uh-shift-swatch { text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.uh-shift .uh-shift-month td.is-today { outline: 3px solid #111; outline-offset: 1px; z-index: 1; }
.uh-shift .uh-shift-month td.is-picked { outline: 3px solid #1d5fbf; outline-offset: 1px; z-index: 2; }
.uh-shift .uh-shift-month td[data-diff] { outline: 3px solid #111; outline-offset: -3px; }
/* a dot in the top corner: the calendar has a note for this day; in the bottom corner: you have something on */
.uh-shift .uh-shift-month td.has-note::after,
.uh-shift .uh-shift-month td.has-event::before { content: ""; position: absolute; right: 3px; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; pointer-events: none; }
.uh-shift .uh-shift-month td.has-note::after { top: 3px; background: #111; }
.uh-shift .uh-shift-month td.has-event::before { bottom: 3px; background: #1d5fbf; }

/* the key */
.uh-shift-key ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px 16px; list-style: none; margin: 0; padding: 0; }
.uh-shift-key li { display: flex; align-items: center; gap: 10px; }
.uh-shift-swatch { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 36px; height: 24px; padding: 0 4px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); font-size: .68rem; font-weight: 700; vertical-align: middle; }
.uh-shift-notes { margin: 0; padding-left: 20px; }
.uh-shift-note { padding: 8px 12px; border-left: 4px solid #111; background: #f6f5f3; }
.uh-shift-day { scroll-margin-top: 90px; }
.uh-shift-feed { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }

/* two calendars side by side, month by month */
.uh-shift-pairs { display: grid; gap: 14px; margin: 0 0 16px; }
.uh-shift-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uh-shift-diff { margin: 0 0 16px; }
.uh-shift-diff summary { cursor: pointer; font-weight: 600; }
@media (max-width: 640px) {
	.uh-shift-pair { grid-template-columns: 1fr; }
}

/* Setup: the kinds of day and the rotation */
.uh-shift-rotation { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

/* printing: only the calendar, three months across, colours kept */
@media print {
	body * { visibility: hidden; }
	.uh-shift, .uh-shift * { visibility: visible; }
	.uh-shift { position: absolute; left: 0; top: 0; width: 100%; }
	.uh-shift-pick, .uh-shift-tabs, .uh-shift-get, .uh-shift-day, .uh-shift-years a, .uh-shift form { display: none !important; }
	.uh-shift-year { grid-template-columns: repeat(3, 1fr); gap: 8px; }
	.uh-shift .uh-shift-month td { height: 26px; }
	.uh-shift-month, .uh-shift-month td, .uh-shift-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
