/*
 * myWebLog information screens and web widgets (display.php), v1.3.
 * Plan: Dokument/05 Development/info-displays.
 *
 * The class names (.mwl-*) and the variables (--mwl-*) are a contract with the organizations'
 * own CSS: only add new ones, never rename or remove. Colours are written twice where it matters:
 * a fixed colour first for old browsers without CSS variables, then the variable.
 */

html, body { margin: 0; padding: 0; height: 100%; }

.mwl-display {
	--mwl-bg: #0d1520;
	--mwl-text: #f2f5f8;
	--mwl-muted: #93a4b8;
	--mwl-head-bg: #16243a;
	--mwl-head-text: #ffffff;
	--mwl-line: #26364d;
	--mwl-row-alt: #111c2b;
	--mwl-active: #2e9d58;
	--mwl-active-text: #ffffff;
	--mwl-soon: #e0b020;
	--mwl-soon-text: #1a1a1a;
	--mwl-maint: #c8473b;
	--mwl-maint-text: #ffffff;
	--mwl-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	background: #0d1520;
	background: var(--mwl-bg);
	color: #f2f5f8;
	color: var(--mwl-text);
	font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-family: var(--mwl-font);
	line-height: 1.3;
	box-sizing: border-box;
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}
.mwl-display *, .mwl-display *:before, .mwl-display *:after { box-sizing: inherit; }


/* Themes */
.mwl-theme-light {
	--mwl-bg: #ffffff;
	--mwl-text: #1c2430;
	--mwl-muted: #5b6675;
	--mwl-head-bg: #f0f3f7;
	--mwl-head-text: #1c2430;
	--mwl-line: #dde3ea;
	--mwl-row-alt: #f7f9fb;
	--mwl-active: #1f8a4c;
	--mwl-active-text: #ffffff;
	--mwl-soon: #e8b100;
	--mwl-soon-text: #1a1a1a;
	--mwl-maint: #c0392b;
	--mwl-maint-text: #ffffff;
}
.mwl-theme-contrast {
	--mwl-bg: #000000;
	--mwl-text: #ffffff;
	--mwl-muted: #e6e6e6;
	--mwl-head-bg: #000000;
	--mwl-head-text: #ffffff;
	--mwl-line: #ffffff;
	--mwl-row-alt: #000000;
	--mwl-active: #00d25b;
	--mwl-active-text: #000000;
	--mwl-soon: #ffd600;
	--mwl-soon-text: #000000;
	--mwl-maint: #ff5a50;
	--mwl-maint-text: #000000;
	font-weight: 600;
}
/* Classic: the airport-board look of the old info screen kit (infoscreen_v2.css). The default for
   screens; the rules that change the layout are in the Classic section at the end. */
.mwl-theme-classic {
	--mwl-bg: #000033;
	--mwl-text: #ffffff;
	--mwl-muted: #8f8fb8;
	--mwl-head-bg: #bbbbbb;
	--mwl-head-text: #666666;
	--mwl-line: #888888;
	--mwl-row-alt: #000033;
	--mwl-active: #333388;
	--mwl-active-text: #ffffff;
	--mwl-soon: #319031;
	--mwl-soon-text: #ffffff;
	--mwl-maint: #cc0000;
	--mwl-maint-text: #ffffff;
	--mwl-second: #ffc500;
	--mwl-font: "Arial Narrow", Arial, sans-serif;
	font-weight: bold;
}


/* Text size: a screen grows with the width of the window or iframe, but at 100 % never gets smaller than
   the old info screen's fixed 28 px rows (a TV at 1366 px, or a 1920 screen with 125-150 % scaling, shows
   the browser a narrower window). The fixed size first is for old browsers without max().
   A widget uses fixed sizes. */
.mwl-screen { font-size: 28px; font-size: max(28px, 1.5vw); }
.mwl-screen.mwl-size-80  { font-size: 22.4px; font-size: max(22.4px, 1.2vw); }
.mwl-screen.mwl-size-90  { font-size: 25.2px; font-size: max(25.2px, 1.35vw); }
.mwl-screen.mwl-size-100 { font-size: 28px;   font-size: max(28px, 1.5vw); }
.mwl-screen.mwl-size-115 { font-size: 32.2px; font-size: max(32.2px, 1.73vw); }
.mwl-screen.mwl-size-130 { font-size: 36.4px; font-size: max(36.4px, 1.95vw); }
.mwl-screen.mwl-size-150 { font-size: 42px;   font-size: max(42px, 2.25vw); }
.mwl-screen.mwl-size-175 { font-size: 49px;   font-size: max(49px, 2.63vw); }
.mwl-screen.mwl-size-200 { font-size: 56px;   font-size: max(56px, 3vw); }

.mwl-widget { font-size: 15px; }
.mwl-widget.mwl-size-80  { font-size: 12px; }
.mwl-widget.mwl-size-90  { font-size: 13.5px; }
.mwl-widget.mwl-size-100 { font-size: 15px; }
.mwl-widget.mwl-size-115 { font-size: 17px; }
.mwl-widget.mwl-size-130 { font-size: 19.5px; }
.mwl-widget.mwl-size-150 { font-size: 22.5px; }
.mwl-widget.mwl-size-175 { font-size: 26px; }
.mwl-widget.mwl-size-200 { font-size: 30px; }

/* A screen opened on a phone or in a narrow column: fixed text size, the clocks under the title
   and a table that wraps instead of running off the edge (more rules under Rows) */
@media (max-width: 700px) {
	.mwl-display.mwl-screen { font-size: 14px; }
	.mwl-screen .mwl-head { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
	/* At least half the width, so the clocks (full width) wrap below while the logo stays beside the title */
	.mwl-screen .mwl-heading { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 50%; }
	.mwl-screen .mwl-clocks { margin: 0.4em 0 0 0; width: 100%; }
	.mwl-screen .mwl-clockbox { margin: 0 1.4em 0 0; text-align: left; }
}


/* Head */
.mwl-head {
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	padding: 0.6em 1em;
	background: #16243a;
	background: var(--mwl-head-bg);
	color: #ffffff;
	color: var(--mwl-head-text);
	border-bottom: 1px solid #26364d;
	border-bottom: 1px solid var(--mwl-line);
}
.mwl-logo { height: 2.6em; width: auto; margin-right: 0.9em; }
.mwl-heading { -webkit-flex: 1; flex: 1; min-width: 0; }
.mwl-title { margin: 0; font-size: 1.6em; font-weight: 600; line-height: 1.15; }
.mwl-date { color: #93a4b8; color: var(--mwl-muted); font-size: 0.9em; margin-top: 0.15em; }
.mwl-clocks { display: -webkit-box; display: -webkit-flex; display: flex; margin-left: 1em; }
.mwl-clockbox { text-align: right; margin-left: 1.4em; }
.mwl-clock, .mwl-clock-utc {
	display: block;
	font-size: 1.9em;
	font-weight: 600;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
}
.mwl-clock-utc { color: #93a4b8; color: var(--mwl-muted); }
.mwl-clock-label { display: block; font-size: 0.7em; color: #93a4b8; color: var(--mwl-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.mwl-widget .mwl-head { padding: 0.5em 0.7em; }
.mwl-widget .mwl-title { font-size: 1.15em; }
.mwl-widget .mwl-logo { height: 1.8em; }


/* Rows */
.mwl-main {
	-webkit-flex: 1;
	flex: 1;
	min-height: 0;
	overflow: auto;
}
/* With the script running, rows that do not fit are paged instead of scrolled */
.mwl-js .mwl-main { overflow: hidden; }

.mwl-table { width: 100%; border-collapse: collapse; }
.mwl-table th {
	text-align: left;
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #93a4b8;
	color: var(--mwl-muted);
	padding: 0.6em 1em 0.45em;
	border-bottom: 2px solid #26364d;
	border-bottom: 2px solid var(--mwl-line);
	white-space: nowrap;
}
.mwl-second { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.8; color: var(--mwl-second, inherit); }
.mwl-table td {
	padding: 0.5em 1em;
	border-bottom: 1px solid #26364d;
	border-bottom: 1px solid var(--mwl-line);
	vertical-align: middle;
}
.mwl-table tr.mwl-row:nth-child(even) td { background: #111c2b; background: var(--mwl-row-alt); }

.mwl-col-time, .mwl-col-span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mwl-col-time { font-weight: 600; }
.mwl-col-object { white-space: nowrap; font-weight: 600; }
.mwl-col-status { white-space: nowrap; color: #93a4b8; color: var(--mwl-muted); }
/* max-width: 0 lets a long name end in "..." instead of widening the table */
.mwl-col-name { width: 40%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A long status may break inside a narrow column; the page allows a break after "/" (Service/underhåll) */
.mwl-status { display: inline-block; max-width: 100%; padding: 0.12em 0.6em; border-radius: 0.3em; word-wrap: break-word; }
.mwl-row-active .mwl-status { background: #2e9d58; background: var(--mwl-active); color: #ffffff; color: var(--mwl-active-text); }
.mwl-row-soon .mwl-status { background: #e0b020; background: var(--mwl-soon); color: #1a1a1a; color: var(--mwl-soon-text); }
.mwl-row-maint .mwl-status { background: #c8473b; background: var(--mwl-maint); color: #ffffff; color: var(--mwl-maint-text); }
.mwl-row-active td:first-child { box-shadow: inset 0.3em 0 0 #2e9d58; box-shadow: inset 0.3em 0 0 var(--mwl-active); }
.mwl-row-soon td:first-child { box-shadow: inset 0.3em 0 0 #e0b020; box-shadow: inset 0.3em 0 0 var(--mwl-soon); }
.mwl-row-maint td:first-child { box-shadow: inset 0.3em 0 0 #c8473b; box-shadow: inset 0.3em 0 0 var(--mwl-maint); }
.mwl-row-done td { opacity: 0.5; }

.mwl-day th {
	color: #f2f5f8;
	color: var(--mwl-text);
	font-size: 0.85em;
	padding-top: 1em;
}

/* A widget often sits in a narrow column: fixed column widths, tighter cells, and the time span
   and status may wrap instead of making the table wider than the iframe */
.mwl-widget .mwl-table { table-layout: fixed; }
.mwl-widget .mwl-table th { padding: 0.5em 0.5em 0.35em; font-size: 0.75em; }
.mwl-widget .mwl-table td { padding: 0.35em 0.5em; }
.mwl-widget .mwl-table th:first-child, .mwl-widget .mwl-table td:first-child { padding-left: 0.7em; }
.mwl-widget .mwl-col-object { width: 26%; }
.mwl-widget .mwl-col-span { width: 30%; }
.mwl-widget .mwl-col-name { width: auto; max-width: none; }
.mwl-widget .mwl-table th { overflow: hidden; text-overflow: ellipsis; }
.mwl-widget td.mwl-col-span, .mwl-widget td.mwl-col-status { white-space: normal; word-wrap: break-word; }
.mwl-widget .mwl-status { padding: 0.05em 0.45em; }

@media (max-width: 700px) {
	.mwl-screen .mwl-table { table-layout: fixed; }
	.mwl-screen .mwl-table th, .mwl-screen .mwl-table td { padding-left: 0.5em; padding-right: 0.5em; }
	/* The start time is also first in the Booked column */
	.mwl-screen .mwl-col-time { display: none; }
	.mwl-screen .mwl-col-object { width: 26%; }
	.mwl-screen .mwl-col-span { width: 30%; }
	.mwl-screen .mwl-col-name { width: auto; max-width: none; }
	.mwl-screen .mwl-table th { overflow: hidden; text-overflow: ellipsis; }
	.mwl-screen td.mwl-col-span, .mwl-screen td.mwl-col-status { white-space: normal; }
	.mwl-screen .mwl-status { padding: 0.08em 0.4em; font-size: 0.85em; }
}

.mwl-empty {
	margin: 0;
	padding: 2em 1em;
	text-align: center;
	color: #93a4b8;
	color: var(--mwl-muted);
	font-size: 1.15em;
}

/* "No more bookings today" as a row, when tomorrow's bookings follow under it */
.mwl-display .mwl-table td.mwl-empty { padding: 1em; border-bottom: 0; }

/* Tomorrow under today (option tomorrow_overflow): a clear divider with room above it. Only with the
   script, which shows the rows that fit; without it, or with automatic height, it is left out. */
.mwl-overflow { display: none; }
.mwl-js .mwl-overflow { display: table-row-group; }
.mwl-auto .mwl-overflow, .mwl-js.mwl-auto .mwl-overflow { display: none; }
.mwl-display .mwl-table .mwl-overflow-head th {
	padding-top: 1.6em;
	border-top: 3px solid #26364d;
	border-top: 3px solid var(--mwl-line);
}

/* Paging: rows of other pages */
.mwl-off { display: none; }


/* Foot */
.mwl-foot {
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	padding: 0.4em 1em;
	font-size: 0.75em;
	color: #93a4b8;
	color: var(--mwl-muted);
	border-top: 1px solid #26364d;
	border-top: 1px solid var(--mwl-line);
}
.mwl-foot > * { margin-right: 1.5em; }
.mwl-foot > *:last-child { margin-right: 0; }
.mwl-updated { font-variant-numeric: tabular-nums; }
.mwl-stale {
	background: #e0b020;
	background: var(--mwl-soon);
	color: #1a1a1a;
	color: var(--mwl-soon-text);
	padding: 0.1em 0.6em;
	border-radius: 0.3em;
}
.mwl-page-dots { margin-left: auto; font-variant-numeric: tabular-nums; }
.mwl-book { color: inherit; }
.mwl-hidden { display: none; }


/*
 * Classic: as the old info screen. Grey bevelled bar with logo, title and two light clock boxes;
 * column headings in white with the second language in yellow under them; bold rows on navy without
 * stripes; the status fills its whole cell (Active blue, Maintenance red, Go to plane blinking green
 * as the old gotoplane.gif: green and navy, 1.5 s each). Sizes in em of the screen's text size, which
 * gives the old pixel sizes (rows 28 px, headings 21 px, title 26 px) on a 1920 px wide screen.
 */
.mwl-theme-classic { padding: 3px; }
.mwl-theme-classic .mwl-head {
	background: #bbbbbb;
	background: var(--mwl-head-bg);
	color: #666666;
	color: var(--mwl-head-text);
	border: 3px outset #999999;
	padding: 0.18em 0.18em 0.18em 0.3em;
	font-family: Arial, sans-serif;
}
.mwl-theme-classic .mwl-logo { height: 1.45em; margin-right: 0.6em; }
.mwl-theme-classic .mwl-heading {
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: baseline;
	align-items: baseline;
	-webkit-flex-wrap: wrap;
	flex-wrap: wrap;
}
.mwl-theme-classic .mwl-title { font-size: 0.93em; color: #666666; color: var(--mwl-head-text); font-weight: bold; margin-right: 1em; }
.mwl-theme-classic .mwl-date { font-size: 0.7em; color: #666666; color: var(--mwl-head-text); font-weight: normal; margin: 0; }
.mwl-theme-classic .mwl-clocks { margin-left: 1em; }
.mwl-theme-classic .mwl-clockbox {
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: baseline;
	align-items: baseline;
	-webkit-justify-content: flex-end;
	justify-content: flex-end;
	min-width: 6.1em;
	margin-left: 0.25em;
	padding: 0.15em 0.35em;
	background: #dddddd;
}
.mwl-theme-classic .mwl-clock, .mwl-theme-classic .mwl-clock-utc {
	display: inline;
	font-size: 0.93em;
	font-weight: bold;
	color: #555555;
}
.mwl-theme-classic .mwl-clock-label {
	display: inline;
	margin-left: 0.4em;
	font-size: 0.5em;
	color: #777777;
	letter-spacing: 0;
}

.mwl-theme-classic .mwl-table th {
	font-size: 0.75em;
	font-weight: normal;
	color: #ffffff;
	color: var(--mwl-text);
	text-transform: none;
	letter-spacing: 0;
	padding: 0.25em 0 0.25em 10px;
	border-bottom: 2px solid #888888;
	border-bottom: 2px solid var(--mwl-line);
}
.mwl-theme-classic .mwl-second { color: #ffc500; color: var(--mwl-second); opacity: 1; }
/* Tight rows as the old screen (no padding, Arial Narrow's own line height), so the larger text still
   fits about as many bookings per page */
.mwl-theme-classic .mwl-table { line-height: 1.15; }
.mwl-theme-classic .mwl-table td {
	padding: 0 0.3em 0 10px;
	border: 2px solid #000033;
	border-color: var(--mwl-bg);
	color: #ffffff;
	color: var(--mwl-text);
}
.mwl-theme-classic .mwl-table tr.mwl-row:nth-child(even) td { background: transparent; }
.mwl-theme-classic .mwl-row td:first-child { box-shadow: none; }
.mwl-theme-classic .mwl-col-time { width: 9%; }
.mwl-theme-classic .mwl-col-object { width: 15%; }
.mwl-theme-classic .mwl-col-name { width: 28%; }
.mwl-theme-classic .mwl-col-span { width: 16%; }

/* The status fills the cell instead of a pill */
.mwl-theme-classic .mwl-row .mwl-status { display: inline; padding: 0; border-radius: 0; background: transparent; color: #ffffff; color: var(--mwl-text); }
.mwl-theme-classic .mwl-row-active td.mwl-col-status { background: #333388; background: var(--mwl-active); }
.mwl-theme-classic .mwl-row-maint td.mwl-col-status { background: #cc0000; background: var(--mwl-maint); }
.mwl-theme-classic .mwl-row-soon td.mwl-col-status {
	background: #319031;
	background: var(--mwl-soon);
	-webkit-animation: mwl-blink 3s step-end infinite;
	animation: mwl-blink 3s step-end infinite;
}
@-webkit-keyframes mwl-blink { 0% { background-color: #319031; background-color: var(--mwl-soon); } 50% { background-color: transparent; } }
@keyframes mwl-blink { 0% { background-color: #319031; background-color: var(--mwl-soon); } 50% { background-color: transparent; } }

/* Finished bookings in the old "N/A" grey */
.mwl-theme-classic .mwl-row-done td { opacity: 1; color: #505060; }
.mwl-theme-classic .mwl-row-done .mwl-status { color: #505060; }

.mwl-theme-classic .mwl-day th { color: #ffc500; color: var(--mwl-second); }
.mwl-theme-classic .mwl-empty { font-weight: normal; }
.mwl-theme-classic .mwl-foot {
	border-top: 0;
	color: #6c6c9c;
	font-family: Arial, sans-serif;
	font-weight: normal;
}

@media (max-width: 700px) {
	.mwl-theme-classic .mwl-clocks { margin-left: 0; }
	.mwl-theme-classic .mwl-clockbox { margin: 0.3em 0.3em 0 0; }
	.mwl-theme-classic .mwl-col-object, .mwl-theme-classic .mwl-col-span { width: auto; }
}


/* Automatic height (display.php?auto=1 with js/display-embed-vX.js on the club's page): the page grows
   with its rows instead of paging them, and the script tells the web page around it the height */
html.mwl-auto-root, .mwl-display.mwl-auto { height: auto; }
.mwl-display.mwl-auto { overflow: visible; }
.mwl-auto .mwl-main, .mwl-js.mwl-auto .mwl-main { -webkit-flex: none; flex: none; overflow: visible; }


/* Page for an unknown or switched-off display */
.mwl-notactive {
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	padding: 16px;
	font-size: 18px;
	text-align: center;
}
