/*
 * Header band (includes/header3.asp, UIVersion 2): logo, agency name, and the
 * account tiles - notification bell, profile, log out - with the notifications
 * dropdown. One stylesheet for both page branches (bootstrapped and legacy),
 * linked from header3.asp with a version query string: bump it there whenever
 * this file changes, so browsers holding the old copy pick up the new one.
 *
 * Flat by design: the band is transparent over the page's grey top gradient,
 * tiles are 50px squares divided by hairlines, icons are dark grey and sit
 * centered. Sizes are explicit rather than inherited because the two page
 * branches have different base fonts.
 */

@media screen {
	#header {
		display: flex;
		align-items: stretch;
		width: 100%;
		height: 50px;
		margin: 0;
		box-sizing: border-box;
		text-align: left;
		white-space: nowrap;
	}

	/* Both side columns grow equally so the agency name stays centered on the
	   page; the name shrinks to an ellipsis before either side does. */
	#header-left {
		order: 1;
		flex: 1 1 0;
		float: none;
		width: auto;
		min-width: 160px;
		height: 50px;
	}

	#header img.eschedule-logo {
		display: block;
		padding: 5px 0 0 0;
		border: 0;
	}

	#agency-title {
		order: 2;
		flex: 0 1 auto;
		min-width: 0;
		margin: 0;
		padding: 0 16px;
		height: 50px;
		line-height: 50px;
		vertical-align: middle;
		text-align: center;
		font-size: 26px;
		font-weight: bold;
		color: #666;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* ---- Account tiles ------------------------------------------------- */
	#header-right {
		order: 3;
		flex: 1 1 0;
		position: relative;
		display: flex;
		justify-content: flex-end;
		align-items: stretch;
		float: none;
		height: 50px;
		margin: 0;
		padding: 0;
		font-size: 13px;
		vertical-align: top;
	}

	#header-right .header-icon-wrap {
		display: block;
		position: relative;
	}

	#header-right .header-icon,
	#header-right .header-account {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 50px;
		box-sizing: border-box;
		border-left: 1px solid rgba(0, 0, 0, .16);
		background: transparent;
		color: #4a4a4a;
		text-decoration: none;
		line-height: 1;
		transition: background-color .12s ease, color .12s ease;
	}

	#header-right > a:last-of-type {
		border-right: 1px solid rgba(0, 0, 0, .16);
	}

	#header-right .header-icon {
		position: relative;
		width: 50px;
		font-size: 18px;
	}

	#header-right .header-account {
		padding: 0 16px 0 14px;
		font-size: 13px;
		color: #3c3c3c;
	}

	#header-right .header-account .fas {
		font-size: 18px;
		margin-right: 8px;
		color: #4a4a4a;
	}

	#header-right #header-user {
		display: inline-block;
		max-width: 180px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: 13px;
	}

	#header-right .header-icon:hover,
	#header-right .header-account:hover,
	#header-right .header-icon:focus,
	#header-right .header-account:focus {
		background: rgba(0, 0, 0, .05);
		color: #111;
		outline: none;
	}

	#header-right .header-account:hover .fas,
	#header-right .header-account:focus .fas {
		color: #111;
	}

	#header-right .header-icon:focus-visible,
	#header-right .header-account:focus-visible {
		outline: 2px solid #4a4a4a;
		outline-offset: -3px;
	}

	/* The open bell reads as the pressed tile the dropdown hangs from. */
	#header-right .header-icon[aria-expanded="true"],
	#header-right .header-icon[aria-expanded="true"]:hover {
		background: rgba(0, 0, 0, .09);
		color: #111;
	}

	#header-right .header-badge {
		display: none;
		position: absolute;
		top: 9px;
		right: 7px;
		min-width: 16px;
		height: 16px;
		padding: 0 4px;
		border-radius: 8px;
		background: #e96f30;
		color: #fff;
		font: bold 10px/16px Arial, Helvetica, sans-serif;
		text-align: center;
		box-sizing: border-box;
		pointer-events: none;
	}

	#header-right .header-badge.is-visible {
		display: block;
	}

	/* ---- Notifications dropdown --------------------------------------- */
	#header-right .header-panel {
		display: none;
		position: absolute;
		top: 50px;
		right: 0;
		width: 380px;
		max-width: calc(100vw - 16px);
		background: #fff;
		border: 1px solid rgba(0, 0, 0, .16);
		border-top: 0;
		box-shadow: 0 8px 16px -6px rgba(0, 0, 0, .28);
		z-index: 9500;
		text-align: left;
		white-space: normal;
		font: 12px/1.5 Arial, Helvetica, sans-serif;
		color: #333;
	}

	#header-right .header-panel.is-open {
		display: block;
	}

	#header-right .header-panel-head {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 38px;
		padding: 0 14px;
		background: #f4f4f4;
		border-bottom: 1px solid #e2e2e2;
	}

	#header-right .header-panel-title {
		font-size: 13px;
		font-weight: bold;
		color: #333;
	}

	#header-right .header-panel-action {
		color: #666;
		font-size: 12px;
		text-decoration: none;
	}

	#header-right .header-panel-action:hover,
	#header-right .header-panel-action:focus {
		color: #111;
		text-decoration: underline;
	}

	#header-right .header-panel-body {
		max-height: 420px;
		overflow-y: auto;
	}

	/* Rows: the left rail carries the outcome, an orange dot marks unread. */
	#header-right .header-alert {
		position: relative;
		display: block;
		padding: 10px 14px 9px 24px;
		border-left: 3px solid transparent;
		border-bottom: 1px solid #ececec;
		background: #fff;
		cursor: pointer;
	}

	#header-right .header-alert:last-child {
		border-bottom: 0;
	}

	#header-right .header-alert:hover,
	#header-right .header-alert:focus {
		background: #f7f7f7;
		outline: none;
	}

	#header-right .header-alert.is-unread::before {
		content: "";
		position: absolute;
		left: 11px;
		top: 15px;
		width: 7px;
		height: 7px;
		border-radius: 50%;
		background: #e96f30;
	}

	#header-right .header-alert.is-accepted  { border-left-color: #6aa84f; }
	#header-right .header-alert.is-rejected  { border-left-color: #c0504d; }
	#header-right .header-alert.is-cancelled { border-left-color: #9aa5b1; }
	#header-right .header-alert.is-reminder  { border-left-color: #d29b3c; }

	#header-right .header-alert-top {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 10px;
	}

	#header-right .header-alert-subject {
		font-size: 13px;
		color: #444;
	}

	#header-right .header-alert.is-unread .header-alert-subject {
		font-weight: bold;
		color: #222;
	}

	#header-right .header-alert-time {
		flex-shrink: 0;
		font-size: 11px;
		color: #888;
	}

	#header-right .header-alert-body {
		margin-top: 3px;
		color: #555;
		white-space: pre-line;
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	#header-right .header-alert.is-expanded .header-alert-body {
		display: block;
		overflow: visible;
	}

	#header-right .header-alert-empty,
	#header-right .header-alert-error {
		padding: 22px 14px;
		text-align: center;
		color: #888;
	}
}
