* {
	box-sizing: border-box;
	margin: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
	color: #00c;
}

header {
	margin-bottom: 20px;
	text-align: center;
}

h1 {
	color: #f5f5f5;
	font-size: 72px;
	font-style: oblique;
	font-weight: 900;
	letter-spacing: -.05em;
	margin-top: -20px;
	text-shadow: 1px 1px 2px #000;
}

h2 {
	border-bottom: 1px solid #ccc;
	font-size: 20px;
	margin: 40px 0 20px;
	padding-bottom: 10px;
}

h3 {
	font-size: 17px;
	margin-bottom: 10px;
}

label {
	display: inline-block;
}

button, input, select {
	font: inherit;
	padding: 6px;
}
input[type="number"] {
	width: 90px;
}
input[type="color"] {
	padding: 0;
}

button, .button {
	background-color: #f0f0f0;
	border: 1px solid #ccc;
	border-radius: 5px;
	color: #555;
	cursor: pointer;
	display: inline-block;
	padding: 6px 20px;
	text-align: center;
	text-decoration: none;
	min-width: 100px;
}

optgroup option {
	font-size: 90%;
}

.action-button::before,
.icon-button::before {
	background-size: 24px;
	content: '';
	display: inline-block;
	height: 24px;
	vertical-align: text-top;
	width: 24px;
}

.icon-button::before {
	margin-right: 10px;
}

button[data-action="rotR"]::before {
	background-image: url(img/icons8-rotate-right-100.png);
}
button[data-action="rotL"]::before {
	background-image: url(img/icons8-rotate-left-100.png);
}
button[data-action="flipX"]::before {
	background-image: url(img/icons8-flip-vertical-100.png);
}
button[data-action="flipY"]::before {
	background-image: url(img/icons8-flip-horizontal-100.png);
}
button[data-action="reset"]::before {
	background-image: url(img/icons8-exchange-100.png);
}

p {
	margin-bottom: 1em;
}

.bottom {
	margin-bottom: 20px;
}

.fullwidth {
	width: 100%;
}

.lang-selection {
	display: flex;
	justify-content: space-evenly;
	list-style: none;
	padding: 0;
}
.lang-selection li img {
	width: 32px;
}

#config,
#loading,
#preview {
	display: inline-block;
	margin: 0 calc( ( 100vw - 1230px ) / 4 );
}

#config {
	color: #555;
	padding: 20px;
	width: 700px;
}

#color-presets-table {
	font-size: 13px;
}
#color-presets-table button {
	margin-right: 5px;
}

.color-block {
	border: 1px solid #888;
	display: inline-block;
	height: 20px;
	margin-right: 10px;
	width: 20px;
}

.config-row {
	margin-bottom: 20px;
}

.config-blocks {
	display: flex;
	justify-content: space-between;
	margin-bottom: 20px;
}

.flex-blocks {
	display: flex;
	justify-content: space-evenly;
	margin-bottom: 40px;
}

.flex-wrap {
	column-gap: 1em;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
}

.config-block {
	display: inline-block;
}
.config-blocks input[type="text"] {
	width: 150px;
}

.right {
	float: right;
}

#layout-selector input[type="radio"] {
	display: none;
}
#layout-selector input[type="radio"]:checked + .label-layout {
	background: #fff4d3;
	border-color: #ea0;
	color: #543;
}
.label-layout {
	border: 4px solid transparent;
	border-radius: 5px;
	cursor: pointer;
	padding: 10px;
}
.label-layout:hover {
	background-color: #f0f0f0;
}
.label-layout img {
	display: block;
	height: 150px;
	margin: 0 auto;
}

.tag {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
}

.image-selector {
	height: 500px;
	margin-bottom: 20px;
}
.image-selector img {
	max-width: 100%;
}

.custom-file-button input,
#config.digital #print-config,
#config.digital .calendar-config,
#config.digital #show-holidays-label,
#config:not(.digital) .canvas-config,
#config:not(.digital) #download-config {
	display: none;
}

.custom-file-button::before {
	background-image: url(img/icons8-image-file.png);
}

.print-button::before {
	background-image: url(img/icons8-print.png);
}

.download-button::before {
	background-image: url(img/icons8-download.png);
}

.rotate-button::before {
	background-image: url(img/icons8-rotate-screen-100.png);
}

#custom-holidays {
	font-size: 13px;
}
#custom-holidays-table tr td:nth-child(2) {
	text-align: center;
}
#custom-holidays-table td {
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
#custom-holidays-table button {
	width: 100px;
}

#custom-holiday-day {
	width: 50px;
}
#custom-holiday-name {
	width: 150px;
}

#print-config ul {
	background-image: url(img/icons8-training.png);
	background-repeat: no-repeat;
	background-size: 80px;
	line-height: 1.6;
	margin-bottom: 30px;
	padding: 0 0 10px 110px;
}

.note,
.credits {
	font-size: 12px;
	padding: 10px 0;
}

h2 ~ .note {
	margin-top: -20px;
}

label .note {
	padding: 0 0 0 18px;
}

.credits {
	border-top: 1px dotted #ccc;
	line-height: 1.6;
	margin-top: 50px;
	text-align: center;
}

/* Tabs */

.tab-container {
	background: #f0f0f0;
}
.tab-container input[type="radio"] {
	display: none;
}
.tab-container .tab {
	cursor: pointer;
	margin-right: 10px;
	padding: 10px;
	text-align: center;
	width: 20%;
}
.tab-container input[type="radio"]:checked + label {
	background: #fff;
	box-shadow: inset 0 4px #ea0;
}

#front-config,
#back-config {
	background: #fff;
	display: none;
	padding-top: 20px;
}
#pos0:checked ~ #front-config,
#pos1:checked ~ #back-config {
	display: block;
}

/**
 * Preview area
 */

#loading,
#preview {
	position: sticky;
	vertical-align: top;
	width: 500px;
}

#loading {
	text-align: center;
	top: 40%;
}

#preview {
	top: 10px;
}

.preview-header {
	font-size: 26px;
	font-style: oblique;
	font-weight: bold;
	margin-bottom: 20px;
}

#preview-content {
	box-shadow: 1px 1px 6px rgba(0,0,0,.3);
	font-size: 12px;
}
#preview-content.iso {
	height: 707px; /* aspect-ratio: 1 / 1.414 */
}
#preview-content.letter {
	height: 646px; /* aspect-ratio: 1 / 1.292 */
}
#preview-content.tabloid {
	height: 774px; /* aspect-ratio: 1 / 1.548 */
}
#preview-content.legal {
	height: 824px; /* aspect-ratio: 1 / 1.648 */
}

#canvas {
	display: none;
	max-height: 705px;
	max-width: 100%;
}

#preview-content .note {
	color: #999;
	font-size: 10px;
	margin-top: -2em;
	padding: 0;
}

.top-half {
	height: 50%;
	position: relative;
	transform: rotate(180deg);
}

.bottom-half {
	border-top: 1px dashed #000;
	height: 50%;
	position: relative;
}

.fold-line {
	border-top: 1px dashed #000;
	bottom: 0;
	height: 20%;
	padding-top: 15px;
	position: absolute;
	text-align: center;
	width: 100%;
}
.fold-line img {
	height: 2.5em;
	vertical-align: middle;
	width: 2.5em;
}

.elements {
	display: flex;
	height: 100%;
}

.align-center {
	text-align: center;
}

.align-middle {
	align-self: center;
}

.align-right {
	text-align: right;
}

/**
 * Calendar styles
 */

.calendar {
	height: calc( 80% - 6em );
}
.calendar table {
	border-collapse: collapse;
	height: 100%;
	margin: 0 auto;
	width: 90%;
}
.calendar table th,
.calendar table td {
	border: 1px solid #ddd;
	padding: .3em .5em;
	width: 14.3%;
}
.calendar table th {
	font-size: 80%;
	font-weight: normal;
	height: 10%;
	text-align: center;
	text-transform: uppercase;
}
.calendar table td {
	position: relative;
	text-align: right;
	vertical-align: top;
}
.calendar table td.prev-month,
.calendar table td.next-month {
	color: #ccc;
}
.calendar table th.holiday,
.calendar table td.holiday {
	color: #c00;
}
.calendar table td.holiday.prev-month,
.calendar table td.holiday.next-month {
	color: #fcc;
}

.cal-image {
	background-position: center;
	background-repeat: no-repeat;
	background-size: auto 100%;
	height: 80%;
	overflow: hidden;
	width: 40%;
}
#preview0, #preview1 {
	height: 100%;
	width: 100%;
}

.cal-content {
	width: 60%;
}

.cal-title {
	font-size: 130%;
	font-weight: bold;
	margin: 1em 0;
	text-align: center;
}

.modern .calendar table th,
.modern .calendar table td {
	border-width: 1px 0;
	text-align: center;
	vertical-align: middle;
}

.holiday-name {
	bottom: 1em;
	color: #999;
	display: none;
	font-size: 40%;
	font-style: italic;
	left: 0;
	line-height: 1;
	position: absolute;
	right: 0;
	text-align: center;
}

.holiday-list {
	display: none;
	font-size: 85%;
}
.holiday-list td {
	border: none !important;
	text-align: center !important;
	vertical-align: middle !important;
}

.desktop.show-holidays .holiday-list {
	display: table-row;
}

.desktop.show-holidays .calendar {
	height: calc( 80% - 4.5em );
}


/* Single month wall calendar */

.wall-single #preview-content {
	font-size: 13px;
}
.wall-single .top-half,
.wall-single .fold-line {
	display: none;
}
.wall-single .elements {
	display: block;
}
.wall-single .bottom-half {
	border-top: none;
	height: 100%;
}
.wall-single .bottom-half .cal-image,
.wall-single .bottom-half .cal-content {
	background-size: 100%;
	height: 50%;
	width: 100%;
}
.wall-single .calendar {
	height: calc( 100% - 8em );
}

.wall-single.show-holidays .holiday-name {
	display: block;
}

/* Digital wallpaper calendar */

.digital #canvas {
	display: block;
}
.digital #preview-content {
	display: none;
}

/* Breakpoint for smaller screens */

@media screen and ( max-width: 1279px ) {

	#config, #preview {
		display: block;
		margin: 0 auto;
		padding: 20px;
	}
}

/**
 * Styles for printing
 */

@media print {

	html,
	body,
	.container,
	#preview,
	#preview-content {
		height: 100% !important;
		margin: 0;
		width: 100%;
	}

	#config,
	.preview-header,
	.credits {
		display: none;
	}

	#preview-content {
		box-shadow: none;
		font-size: 2.2vw;
		left: 0;
		position: absolute;
		top: 0;
	}
	#preview-content .note {
		font-size: 1.5vw;
		margin-top: -4em;
	}

	.wall-single #preview-content {
		font-size: 2.5vw;
	}
	.wall-single .top-half .note {
		display: none;
	}
}