.widget_box {
	background-color: var(--widget_and_content_bg);
	border: var(--widget_and_content_border);
	border-radius: 5px;
	text-align: center;
	font-size: 1em;
	padding: 0.5em;
	color: rgb(242, 246, 248);
	display: flex;
	flex-direction: column;
	container-type: inline-size;
	height: 100%;
	box-sizing: border-box;
}

.widget_box>*:nth-child(2) {
	flex-grow: 2;
}

.widget_box h1,
.widget_box h2,
.widget_box h3,
.widget_box h4 {
	text-align: center;
	font-weight: bold;
	display: inline-block;
	text-decoration: none;
}

.widget_box h1 {
	font-size: 1.15em;
	margin-top: 0.1em;
	margin-bottom: 0.6em;
	color: var(--h2_color);
}

.widget_box h2 {
	font-size: 1.1em;
	margin-top: 0.1em;
	margin-bottom: 0.6em;
	color: var(--h2_color);
}

.widget_box h3 {
	font-size: 0.8em;
	margin-top: 1em;
	margin-bottom: 0.1em;
	color: #000;
}

.widget_box h4 {
	font-size: 0.7em;
	color: #000;
}

.widget_box .widget_current_value {
	text-align: center;
	height: 30%;
	font-size: 1.5em;
	font-weight: bold;
	display: flex;
	justify-content: center;
	align-items: center;
}

.sub_content_box .value {
	font-size: 3em;
	font-weight: bold;
	white-space: nowrap;
}

.sub_content_box .value_2 {
	font-size: 1.5em;
	font-weight: bold;
	white-space: nowrap;
}

.value_min:before {
	background-image: url('../images/thermometer-temperature-svgrepo-com.svg');
}

.value_max:before {
	background-image: url('../images/thermometer-summer-svgrepo-com.svg');
}

.icon_before_small:before {
	background-repeat: no-repeat;
	background-size: 1em 1em;
	width: 1em;
	height: 1em;
	content: "";
	display: inline-block;
	margin-right: 0.5em;
	margin-left: 0.5em;
	vertical-align: middle;
}

.icon_before_big:before {
	background-repeat: no-repeat;
	background-size: 2em 2em;
	width: 2em;
	height: 2em;
	content: "";
	display: inline-block;
	margin-right: 0.5em;
	margin-left: 0.5em;
	vertical-align: middle;
}

.widget_statistics_icon {
	background-repeat: no-repeat;
	background-position-x: center;
	background-size: auto 2em;
	opacity: 0.8;
	width: 100%;
	height: 2em;
}

.min_max_svg_image {
	background-image: url("../images/min-max.svg");
}

.average_svg_image {
	background-image: url("../images/average.svg");
}

.time_svg_image {
	background-image: url("../images/time.svg");
}

.widget_statistics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(2, 3em);
	grid-gap: 0em;
}

.widget_statistics>div {
	box-sizing: border-box;
	justify-self: center;
	align-self: center;
	font-size: 0.7em;
}

.widget_statistics>div:nth-child(1) {
	grid-column: 1;
	grid-row: 1;
}

.widget_statistics>div:nth-child(2) {
	grid-column: 1;
	grid-row: 2;
}

.widget_statistics>div:nth-child(3) {
	grid-column: 2;
	grid-row: 1;
}

.widget_statistics>div:nth-child(4) {
	grid-column: 2;
	grid-row: 2;
}

.widget_statistics>div:nth-child(5) {
	grid-column: 3;
	grid-row: 1;
}

.widget_statistics>div:nth-child(6) {
	grid-column: 3;
	grid-row: 2;
}

@container (width > 400px) {
	.widget_box .widget_current_value {
		font-size: 2em;
	}

	.widget_statistics>div {
		font-size: 0.8em;
	}
}

@container (width > 700px) {
	.widget_box .widget_current_value {
		font-size: 2.5em;
	}

	.widget_statistics>div {
		font-size: 1.0em;
	}
}

.box_back_button {
	float: left;
	background-image: url("../images/back.svg");
	background-position: top left;
	background-repeat: no-repeat;
	background-size: cover;
	width: 3em;
	height: 3em;
	position: absolute;
	top: 1.3vh;
	left: 1.3vw;
	z-index: 1000;
	cursor: pointer;
}

.tendency {
	background-image: url("../images/tendency.svg");
	background-position: top right;
	background-repeat: no-repeat;
	background-size: cover;
	opacity: 0.4;
	width: 2.5em;
	height: 2.5em;
	position: absolute;
	top: 1em;
	right: 1em;
	z-index: 1000;
}

.tendency-1 {
	transform: rotate(198deg);
}

.tendency-2 {
	transform: rotate(216deg);
}

.tendency-3 {
	transform: rotate(234deg);
}

.tendency-4 {
	transform: rotate(252deg);
}

.tendency-5 {
	transform: rotate(270deg);
}

.tendency0 {
	transform: rotate(180deg);
}

.tendency1 {
	transform: rotate(162deg);
}

.tendency2 {
	transform: rotate(144deg);
}

.tendency3 {
	transform: rotate(126deg);
}

.tendency4 {
	transform: rotate(108deg);
}

.tendency5 {
	transform: rotate(90deg);
}

.unit {
	display: inline-block;
	padding-left: 0.2em;
	font-size: 0.6em;
}

.unit svg {
	height: 0.7em;
	width: auto;
	fill: rgb(242, 246, 248);
}

.box_onclick_defined>* {
	cursor: pointer;
}

/* based on https://jonathanspeek.github.io/spacegrid/ */
#widget_grid {
	margin: 0 auto;
	width: 100%;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: stretch;
	align-content: stretch;
	height: 100%;
}

.widget_control_overlay {
	width: 12em;
	height: 1em;
	position: absolute;
	top: 1.5vh;
	left: 1.5vw;
	z-index: 1000;
}

[class*='widget_control_button_'] {
	background-repeat: no-repeat;
	background-size: cover;
	background-position-x: center;
	background-size: auto 1em;
	opacity: 0.8;
	display: inline-block;
	cursor: pointer;
	height: 1em;
}

.widget_control_button_move_up {
	background-image: url("../images/left.svg");
	width: 1em;
}

.widget_control_button_move_down {
	background-image: url("../images/right.svg");
	width: 1em;
}

.widget_control_button_increase_width {
	background-image: url("../images/increase_width.svg");
	width: 2em;
}

.widget_control_button_decrease_width {
	background-image: url("../images/decrease_width.svg");
	width: 2em;
}

.widget_control_button_increase_height {
	background-image: url("../images/increase_height.svg");
	width: 2em;
}

.widget_control_button_decrease_height {
	background-image: url("../images/decrease_height.svg");
	width: 2em;
}

.widget_control_button_reset_height {
	background-image: url("../images/reset_height.svg");
	width: 2em;
}

[class*='widget_width_'],
#widget_grid {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

[class*='widget_width_'] {
	float: left;
	padding: 0.3em;
	display: inline;
	position: relative;
}

.widget_width_100 {
	width: 100%;
}

.widget_width_75 {
	width: 75%;
}

.widget_width_66 {
	width: calc(2 * (100% / 3));
}

.widget_width_50 {
	width: 50%;
}

.widget_width_33 {
	width: calc(100% / 3);
}

.widget_width_25 {
	width: 25%;
}

.widget_width_12 {
	width: 12%;
}

@media (max-width: 600px) {

	.widget_width_100,
	.widget_width_75,
	.widget_width_66,
	.widget_width_50,
	.widget_width_33,
	.widget_width_25 {
		width: 100%;
	}

	.widget_width_12 {
		width: 50%;
	}
}

@media (min-width: 600px) and (max-width: 1000px) {

	.widget_width_33,
	.widget_width_25 {
		width: 50%;
	}

	.widget_width_100,
	.widget_width_75,
	.widget_width_66,
	.widget_width_50 {
		width: 100%;
	}

	.widget_width_12 {
		width: 25%;
	}
}

.widget_height_20 {
	height: 20%;
}

.widget_height_30 {
	height: 30%;
}

.widget_height_40 {
	height: 40%;
}

.widget_height_50 {
	height: 50%;
}
