/* 
 * Card, modal, and form layouts.
 * 
 */

.card {
	position:relative;
	display:block;
	flex-basis:auto;
	flex-grow:1;
	margin:15px 15px 40px 15px;
	max-width:calc(100% - 30px);
	white-space:normal;
	font-size:15px;
}

.card.full {
	width:100%;
	display:block;
	align-self:start;
}

.card.split {
	max-width:calc(50% - 30px);
}

.card.split.less {
	max-width:calc(40% - 30px);
}

.card.split.more {
	max-width:calc(60% - 30px);
}

div.p .card {
	margin:0;
	max-width:100%;
}

div.card.p {
	margin:15px;
	padding:0;
}

.card > h2, .card > h3, .card nav {
	display:block;
	overflow:hidden;
	margin:0;
	font-weight:normal;
	font-size:16px;
	user-select:none;
	-moz-user-select:none;
	-ms-user-select:none;
	-webkit-user-select:none;
}

.card > h2:first-of-type {
	padding:15px 20px;
	font-size:18px;
	border-bottom:1px solid;
}

.card aside {
	float:right;
	font-size:15px;
	font-weight:normal;
}

.card > h3 {
	padding:0;
	font-size:13px;
	border-bottom:1px dotted;
}

.card > h3 label {
	font-weight:bold;
	padding:0 2em;
	margin-right:1em;
	border-right:1px solid;
}

.card > h3 a {
	text-decoration:none;
}

.card nav aside {
	padding:5px 15px;
}

.card > nav:not(.sort):first-child {
	font-family:'Montserrat',Verdana,Arial,sans-serif;
	font-size:16px;
	text-align:center;
}

.card nav:not(.sort) {
	padding:0;
	line-height:2em;
}

.card aside a {
	text-decoration:none;
}

.card nav a, .card > h3 > a, .card > h3 div.dropdown a {
	display:inline-block;
	padding:5px 2em;
	border-bottom:none !important;
}

.card > h3 div.dropdown > div {
	padding:0;
}

.card > h3 div.dropdown > div a {
	display:block;
	padding:8px 4em 8px 2em;
}

.card:not(.carousel) > nav:not(.sort):first-child a {
	padding:7px 3em;
}

.card nav.sort, .card > h3 div.dropdown a {
	font-size:13px;
}

.card nav.sort a {
	border:none;
}

.card nav.sort:not(.selector)::before {
	font-family:'Font Awesome 5 Free';
	font-weight:900;
	content:"\f0dc"; /* FontAwesome sort icon */
	display:inline-block;
	padding:0 1em;
	opacity:0.5;
}

.card nav.sort a.selected[data-key]::after {
	font-family:'Font Awesome 5 Free';
	font-weight:900;
	content:"\f15d"; /* FontAwesome sort-down icon */
	display:inline-block;
	margin-left:0.5em;
}

.card nav.sort a.selected[data-key][data-direction=descending]::after {
	content:"\f882"; /* FontAwesome sort-up icon */
}

.card.carousel {
	display:flex;
}

.card.carousel nav {
	min-width:260px;
}

.card.carousel nav a {
	display:block;
	padding:15px 1.5em;
	text-align:left;
	white-space:nowrap;
	min-width:300px;
}

.card.carousel h3 {
	display:none !important;
}

.card.carousel p {
	padding:20px;
}

.card.carousel button {
	white-space:nowrap;
}

.card:not(.p) section {
	overflow:hidden;
	display:flex;
	flex-direction:column;
}

.card section:not(:first-of-type) {
	display:none;
}

.card .center {
	display:block;
	text-align:center;
	margin:auto;
}

.card .terms {
	display:block;
	margin:auto;
	max-width:400px;
}

.card .overlay {
	display:block;
	position:absolute;
	left:0;
	top:0;
	bottom:0;
	right:0;
	height:100%;
	width:100%;
	background-color:black;
	opacity:0.7;
}

.card .overlay::before {
	font-family:'Font Awesome 5 Free';
	font-weight:900;
	content:"\f574";
	font-size:90px;
	text-align:center;
	width:100%;
	display:block;
	position:absolute;
	top:35%;
}

.card .overlay::after {
	font-family:'Montserrat',Verdana,Arial,sans-serif;
	content:"Drop files here";
	font-size:30px;
	text-align:center;
	width:100%;
	display:block;
	position:absolute;
	top:50%;
}

/*
 * Modal
 * 
 */

.card.modal {
	display:none;
	position:fixed;
	z-index:2000;
	width:650px;
	left:calc(50% - 325px);
	top:10%;
	box-shadow:2px 2px 10px rgba(0, 0, 0, 0.1);
	animation:fadein 0.2s;
	border-radius:10px;
	overflow:hidden;
}

.card.modal section {
	max-height:60vh;
	position:relative;
	overflow-y:auto;
}

.card.modal div.p {
	width:auto;
}

#overlay {
	display:none;
	position:fixed;
	left:0;
	top:0;
	bottom:0;
	right:0;
	height:100%;
	width:100%;
	background-color:black;
	opacity:0.85;
	z-index:200;
}

/* 
 * Responsive form inputs
 * 
 */

.card > section > form {
	display:inline-block;
	margin:auto;
}

.card > section > form samp {
	display:inline-block;
	max-width:20em;
}

.card > section:first-child > form:first-child, .card > h2 + section > form:first-child {
	margin-top:2em;
}

.card .container, .card input[type=text], .card .text-wrapper, .card .stripe, .card input[type=password], select, textarea, .card label + div.taglist, .card input[type=file] + label[for], .card label + .copy {
	margin-bottom:1em;
}

.card .text-wrapper input[type=text] {
	margin-bottom:0;
}

.card .container, .card input[type=text], .card .stripe, .card input[type=password], select, textarea {
	width:300px;
}

.card input[type=checkbox] + label {
	width:calc(100% - 3em);
	max-width:30em;
}

.card label + div.taglist, .card label + .copy {
	max-width:400px;
}

.card.modal label + div.taglist, .card.modal label + .copy {
	max-width:300px;
}

.card.modal label + label {
	display:inline-block;
	max-width:20em;
}

.card form p {
	max-width:500px;
}

.card .container {
	vertical-align:top;
	padding:0;
}

.card textarea {
	width:400px;
	min-width:400px;
}

.card label + textarea {
	width:300px;
	min-width:300px;
}

.card:not(.modal) textarea {
	width:calc(100% - 300px);
}

.card .container.cloner {
	width:100%;
}

/* 
 * Notice
 * 
 */

.card.notice {
	position:relative;
	margin:5px 0;
	animation:flash 0.3s linear 2;
}

.card.notice + h1 {
	margin-top:20px;
}

.card.notice div {
	font-size:13px;
	padding:5px 3em 5px 15px;
}

.card.notice div p {
	padding-left:5px;
}

.card.notice i.close {
	position:absolute;
	right:0.5em;
	top:1em;
	cursor:pointer;
}

/*
 * Adjust on bigger/smaller screens
 *
 */

@media only screen and (max-width: 80em) {
	
	.card.carousel {
		display:block;
		background-color:none !important;
	}
	
	.card.carousel nav {
		display:none;
	}
	
	.card.carousel h3 {
		display:block !important;
		padding:1em 1em 0 1em;
	}
	
	#carousel section {
		display:block !important;
		background-color:none;
		margin:0;
	}
	
	#carousel section:not(:first-of-type) {
		border-top:1px solid grey;
	}
	
	#carousel section:not(:last-of-type) {
		margin-bottom:70px;
	}
	
	#carousel p:not(:last-of-type) {
		padding-bottom:0;
	}
	
	#carousel img.diagram {
		margin-top:2em;
		margin-bottom:4em;
	}
	
	.card.modal .container, .card label + .container {
		width:100%;
	}
	
	.card label + input[type=text], select, .card .stripe, .card label + input[type=password], .card textarea, .card label + .copy {
		width:calc(100% - 15px) !important;
	}
	
	.card label + div.taglist {
		width:100% !important;
		max-width:100% !important;
	}
	
}

@media only screen and (max-width: 900px) {
	
	.card.split {
		max-width:100%;
	}
	
	.card.split.less {
		max-width:100%;
	}
	
	.card.split.more {
		max-width:100%;
	}
	
	.card > h3 label {
		display:none;
	}
	
	.card, div.card.p {
		margin:8px 0;
		width:100%;
		max-width:100%;
	}
	
	.card textarea {
		min-width:300px;
	}
	
	.card.modal {
		position:fixed;
		left:0;
		top:0;
		bottom:0;
		right:0;
		transform:none;
		margin:0;
		width:auto;
	}
	
	.card.modal section {
		max-height:calc(100% - 100px);
	}
	
	/* this will contain buttons after long text */
	.card.modal div.p + p.center {
		position:fixed;
		bottom:0;
		left:0;
		right:0;
	}
	
	.card.notice {
		width:calc(100% - 30px);
	}
	
	.card.notice button {
		display:block;
		margin:15px 0;
	}
	
}

/*@media only screen and (min-width: 2000px) {
	
	main > section {
		width:100%;
		max-width:2100px;
		display:flex;
	}
	
	.card {
		max-width:1000px;
		width:1000px;
	}
	
}*/