/*
----------------------------------------------------------

					Template Library Styles

----------------------------------------------------------
*/

#template_library {
	--padding: 32px;
}
#greyd_pattern_library.template_library_main_button {
	background-color: #1e1e1e;
	color: #fff !important;
}
#greyd_pattern_library.template_library_main_button:hover,
#greyd_pattern_library.template_library_main_button:focus {
	background-color: #000;
	box-shadow: none;
}


/*    Tabs
__________________________________
*/
#template_library .block_tabs {
	flex: 1;
	align-self: flex-end;
	height: 100%;
	font-size: 1.2em;
}
#template_library .block_tab.active {
	box-shadow: inset 0 -5px 0 0 var(--wp-admin-theme-color);
}


/*    Sidebar
__________________________________
*/
.template_category {
	display: block;
	pointer-events: auto;
	cursor: pointer;
	padding: 9px;
	margin: 0 -6px;
	border-radius: 2px;
	transition: background .2s ease;
	color: #6c6c6c;
}
.template_category:hover {
	color: var(--wp-admin-theme-color);
	background: rgba(0,0,0,.03);
}
.template_category.selected {
	color: #1e1e1e;
	text-decoration: underline;
}
.template_library_links_wrapper a {
	display: block;
	margin-bottom: 10px;
	text-decoration: none;
}
.template_library_links_wrapper a:hover {
	text-decoration: underline;
}
.template_library_user_templates_info {
	display:none;
}
#template_library .sidebar_top > :not(.active) {
	display: none;
}


/*    Content
__________________________________
*/
#template_library .overlay_inner_content {
	padding: 0;
}
.template_library_content {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}
.template_library_content > div {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-height: 100%;
	overflow: auto;
	display: flex;
	flex-direction: row;

	opacity: 0;
	-webkit-transform: translateX(-100%);
	transform: translateX(-100%);

	-webkit-transition: opacity .15s ease, -webkit-transform .4s ease;
	transition: opacity .15s ease, -webkit-transform .4s ease;
	transition: transform .4s ease, opacity .15s ease;
	transition: transform .4s ease, opacity .15s ease, -webkit-transform .4s ease;
}
.template_library_content > div.active {
	-webkit-transform: none;
	transform: none;
	opacity: 1;
	-webkit-transition: opacity .6s ease, -webkit-transform .4s ease;
	transition: opacity .6s ease, -webkit-transform .4s ease;
	transition: transform .4s ease, opacity .6s ease;
	transition: transform .4s ease, opacity .6s ease, -webkit-transform .4s ease;
}
.template_library_content > div.active ~ div {
	-webkit-transform: translateX(100%);
	transform: translateX(100%);
}
.template_library_content h2 {
	text-align: left;
	font-size: 2em;
	margin: 35px 0px;
	font-weight: 700;
}
.template_library_body .greyd_info_box {
	margin: 0;
}


/*    Body & Items
__________________________________
*/
.template_library_body {
	display: none;
	height: 100%;
	flex-grow: 1;
	overflow-x: hidden;
}
.template_library_body > * {
	padding: var(--padding);
}
.template_library_body.active {
	display: block;
}
.template_library_items {
	display: grid;
	max-width: 100%;
	grid-template-columns: 1fr 1fr 1fr;
	grid-auto-rows: minmax(150px, auto);
	grid-gap: 2.5vw;
}
/* responsive */
@media ( min-width: 2000px ) {
	.template_library_items {
		grid-template-columns: 1fr 1fr 1fr 1fr;
	}
}
@media ( max-width: 1000px ) {
	.template_library_items {
		grid-template-columns: 1fr 1fr;
	}
}
@media ( max-width: 767px ) {
	.template_library_items {
		grid-template-columns: 1fr;
	}
}


/*    Welcome
__________________________________
*/
.template_library_content .template_library_welcome {
	max-width: 47em;
}
.template_library_welcome .button {
	margin: 1em 0;
}
.template_library_body[data-type=welcome] {
	background-image: url('../img/library-bg.jpg');
	background-position: bottom right;
	background-size: auto 65%;
	background-repeat: no-repeat;
}


/*    Item (normal)
__________________________________
*/
.template_library_item {
	box-sizing: border-box;
	position: relative;
	font-size: 11px;
}

/* image */
.template_library_item_image {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--wp-admin-color-offwhite);
	min-height: 70px;
}
.template_library_item_image > img,
.template_library_item_image .template_library_item_iframe_preview_container {
	display: block;
	width: 100%;
	height: fit-content;
	-webkit-transition: opacity .3s ease;
	transition: opacity .3s ease;
}

/* title */
.template_library_item_title {
	margin: 1.3em 0 0.5em;
	-webkit-transition: opacity .6s ease;
	transition: opacity .6s ease;
}
.template_library_item_title h3 {
	color: inherit;
	margin: 0;
}

/* description */
.template_library_item_description p {
	font-size: 1em;
	margin: 0;
	-webkit-transition: opacity .6s ease;
	transition: opacity .6s ease;
}

/* buttons */
.template_library_item_buttons {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	-webkit-transition: opacity .4s ease;
	transition: opacity .4s ease;
	opacity: 0;
}
.template_library_item_buttons .button {
	margin: 0.5em;
}
.template_library_item_buttons .button:not(.large) {
	margin-bottom: -20px;
}
.template_library_item_buttons .link:hover {
	color: var(--wp-admin-theme-color-darker-10);
}
#template_library .button .dashicons {
	font-size: 1em;
	height: 1em;
	width: 1em;
	margin-left: 0.5em;
}

/* hide & show */
.template_library_content.partial .import_template {
	display: inline-block;
}
.template_library_content.fullsite .import_template,
.template_library_content.fullsite .import_pattern,
.template_library_content.partial .import_pattern, 
.template_library_content.partial .install_fullsite_template, 
.template_library_content.pattern .import_template,
.template_library_content.pattern .install_fullsite_template, 
.template_library_content.pattern .template_details,
.template_library_content.partial .live-preview {
	display: none;
}

.template_library_item_version_chip {
	top: 10px;
	right: 10px;
	position: absolute;
	font-size: 11px;
	line-height: 2;
	padding: 0 0.6rem;
	border-radius: 50px;
	color: #ffffff;
	background-color: #7351FB;
}

.template_library_item_version_chip.green {
	background-color: #108D59;
}


/*    Item (hover)
__________________________________
*/
.template_library_item:hover .template_library_item_image > img,
.template_library_item:hover .template_library_item_image > .template_library_item_iframe_preview_container {
	opacity: 0.2;
}
.template_library_item:hover .template_library_item_buttons {
	opacity: 1;
}


/*    Details view
__________________________________
*/
.template_library_detail_wrapper .template_library_body {
	display: flex;
	flex-direction: row;
}
.template_library_details {
	flex: 1 1 400px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: start;
}
.template_library_details_buttons .button {
	margin: 15px 10px 0 0;
}
.back_to_main_library {
	width: fit-content;
	padding: 5px;
	cursor: pointer;
}
.template_library_details_screenshots {
	flex: 2 2 60%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	padding: 30px;
	padding-left: 0;
}
.template_library_details_screenshot img {
	width: 100%;
	width: 100%;
	margin-bottom: 30px;
}
.template_library_details h2 {
	line-height: 1.1em;
}


/*    Block Editor
__________________________________
*/
.components-accessible-toolbar.edit-post-header-toolbar {
	flex-grow: 0;
}


/*    Loading
__________________________________
*/
#template_library .loading:not(.template_library_details_screenshots, .template_library_item_buttons ) {
	position: relative;
	background: var(--wp-admin-color-offwhite);
}
#template_library .loading:after,
.template_library_item_image .template_library_item_iframe_preview_container:empty::after {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	width: 100%;
	height: 100%;
	transform: translateX(-100px);
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
	animation: loading 0.8s infinite;
}
@keyframes loading {
	100% {
		transform: translateX(100%);
	}
}
/* category */
.template_category.loading {
	height: 1.4em;
	margin: 9px 0 18px;
	padding: 0;
	width: 100%;
}
/* items */
.template_library_item_image.loading img {
	display: none;
}
.template_library_item_image.loading {
	aspect-ratio: 16/9;
	background-color: var(--wp-admin-color-offwhite);
}
.template_library_item.pattern .template_library_item_image.loading,
.template_library_item_image .template_library_item_iframe_preview_container:empty {
	aspect-ratio: 16/9;
	background-color: var(--wp-admin-color-offwhite);
	background-repeat: no-repeat;
	background-image:
		linear-gradient( #fff 32px, transparent 0 ),
		linear-gradient( #fff 20px, transparent 0 );
	background-size:
		40% 100%,
		65% 100%;
	background-position:
		20px 30px,
		20px 80px;
}
.template_library_item_title.loading {
	width: 60%;
	height: 1em;
}
.template_library_item_description.loading {
	width: 40%;
	height: 1em;
}
.template_library_item_buttons.loading {
	display: none;
	opacity: 0;
}
/* details */
#template_library .template_library_details_title.loading {
	height: 5%;
	margin-bottom: 20px;
}
#template_library .template_library_details_description.loading {
	height: 75%;
	margin-bottom: 20px;
}
#template_library .template_library_details_bulletpoints.loading {
	height: 20%;
}
#template_library .template_library_details_buttons.loading {
	display: none;
}
#template_library .template_library_details_screenshots.loading {
	height: 100%;
	padding-left:0;
}
#template_library .template_library_details_screenshot.loading {
	height: 100%;
	margin-bottom:0;
}


/*    Installation process
__________________________________
*/
#template_library .template_library_progress {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0%;
	margin: 0;
}
#template_library .template_library_progress.is-loading {
	height: 10px;
	transition: all .3s ease;
}

.greyd_overlay > .decision {
	max-width: 520px;
}


/*    User fullsite templates
__________________________________
*/
.template_library_add_new_user_template {
	display: flex;
	align-items: center;
	flex-direction: column;
	justify-content: center;
	border: 1px dashed #ddd;
	margin-bottom: 4.3em;
	min-height: 10em;
}
#create_user_template_form {
	display: flex;
	flex-direction: column;
}
#create_user_template_form input,
#create_user_template_form textarea,
#create_user_template_form select,
#create_user_template_form label.button {
	width: 100%;
	margin-bottom: 15px;
	margin-top: 3px;
}
#create_user_template_form label[for='fullsite_template_thumbnail'] .dashicons-arrow-up-alt {
	margin-right: 5px;
}
#create_user_template_form .create_user_fulsite_template_filename {
	margin-bottom: 5px;
}
#create_user_template_form label {
	font-weight:600;
}
