/*
 * refresh/css/templates-look.css (ReInk)
 *
 * The template selection in the refreshed look: the startup window, the template preview and the
 * Templates tab's grid, named by refresh/js/templates-look.js once their inline look is taken off.
 * The redesign's tokens (premium.css, facelift.css), with the same colours written out in case either
 * is missing; the amber notice is the Review window's (review-modal.css).
 */

/* ===== The windows ===== */
.reinkTplWindow {
	max-width: 640px;
	margin: 0 auto;
	color: var(--sp-ink-2, rgb(24 26 31));
	font: 14px/1.45 Arial, Helvetica, sans-serif;
	text-align: center;
}
.reinkTplWindow .reinkTplTitle {
	margin: 4px 0 18px;
	color: var(--sp-ink, rgb(4 0 0));
	font: 700 22px/1.25 Arial, Helvetica, sans-serif;
	text-transform: none;
	letter-spacing: 0;
}

/* Blank Canvas, Upload Your Own: outlined cards */
.reinkTplOptions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 0 0 22px;
}
.reinkTplWindow .reinkTplOption {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	width: 168px;
	min-height: 104px;
	margin: 0;
	padding: 16px 14px;
	border: 1px solid var(--sp-line, rgb(218 220 224));
	border-radius: 12px;
	background: var(--sp-surface, rgb(255 255 255));
	color: var(--sp-ink-2, rgb(24 26 31));
	font: 600 14px/1.3 Arial, Helvetica, sans-serif;
	text-transform: none;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}
.reinkTplWindow .reinkTplOption:hover {
	border-color: var(--sp-line-hover, rgb(176 181 190));
	background: var(--sp-fill-hover, rgb(241 242 245));
}
.reinkTplWindow .reinkTplOption:active {
	background: var(--sp-fill-press, rgb(229 231 235));
}
.reinkTplWindow .reinkTplOption:focus-visible {
	outline: 2px solid var(--sm-focus, rgb(4 0 0));
	outline-offset: 2px;
}
.reinkTplIcon {
	display: inline-flex;
	color: var(--sp-ink-3, rgb(76 82 94));
}
.reinkTplOption:hover .reinkTplIcon {
	color: var(--sp-ink, rgb(4 0 0));
}

/* "Or choose from one of our templates" */
.reinkTplSection {
	padding-top: 18px;
	border-top: 1px solid var(--sp-hairline, rgb(231 233 237));
}
.reinkTplWindow .reinkTplSubtitle {
	margin: 0 0 12px;
	color: var(--sp-ink-2, rgb(24 26 31));
	font: 600 15px/1.3 Arial, Helvetica, sans-serif;
	text-transform: none;
}

/* ===== Template tiles: the startup window and the Templates tab ===== */
.reinkTplGrid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	max-height: 360px;
	overflow-y: auto;
	padding: 4px;
}
.reinkTplTile {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 120px;
	min-height: 120px;
	padding: 8px;
	border: 1px solid var(--sp-line, rgb(218 220 224));
	border-radius: 10px;
	background: var(--sp-surface, rgb(255 255 255));
	cursor: pointer;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}
.reinkTplTile:hover {
	border-color: var(--sp-red, rgb(234 0 41));
	box-shadow: 0 0 0 1px var(--sp-red, rgb(234 0 41)), 0 4px 14px rgb(16 24 40 / 0.10);
}
.reinkTplTile:focus-visible {
	outline: 2px solid var(--sm-focus, rgb(4 0 0));
	outline-offset: 2px;
}
.reinkTplTile img {
	display: block;
}

/* The Templates tab: two to a row, as tall as the panel allows */
#templatesMenu .reinkTplPaneGrid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	max-height: calc(100vh - 200px);
	padding: 12px 2px;
}
#templatesMenu .reinkTplPaneGrid .reinkTplTile {
	min-width: 0;
	aspect-ratio: 1 / 1;
}
#templatesMenu .reinkTplPaneGrid .reinkTplTile img {
	max-width: 100% !important;   /* over Designer.cfm's inline 150px, so a tile fits half the pane */
	max-height: 100% !important;
	height: auto;
}

/* ===== The preview ===== */
.reinkTplWindow .reinkTplWarn {
	margin: -6px 0 16px;
	padding: 10px 12px;
	border: 1px solid rgb(240 200 90);
	border-radius: 8px;
	background: rgb(255 246 220);
	color: var(--sp-ink-2, rgb(24 26 31));
	font-size: 13px;
	text-align: left;
}
.reinkTplPages {
	display: block;
}
.reinkTplCarousel {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}
.reinkTplStage {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 0;
	min-height: 220px;
	padding: 20px;
	border-radius: 12px;
	background: var(--sp-workspace, rgb(237 238 241));
}
.reinkTplStage img {
	box-shadow: 0 1px 2px rgb(4 0 0 / 0.08), 0 4px 16px rgb(4 0 0 / 0.10);
	background: rgb(255 255 255);
}
.reinkTplWindow .reinkTplArrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--sp-line, rgb(218 220 224));
	border-radius: 50%;
	background: var(--sp-surface, rgb(255 255 255));
	color: var(--sp-ink-2, rgb(24 26 31));
	cursor: pointer;
}
.reinkTplWindow .reinkTplArrow:hover {
	border-color: var(--sp-line-hover, rgb(176 181 190));
	background: var(--sp-fill-hover, rgb(241 242 245));
}
.reinkTplWindow .reinkTplArrow:focus-visible {
	outline: 2px solid var(--sm-focus, rgb(4 0 0));
	outline-offset: 2px;
}
.reinkTplPageNum {
	margin-top: 10px;
	color: var(--sp-ink-4, rgb(100 107 120));
	font-size: 12px;
}
.reinkTplActions {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}
.reinkTplWindow .reinkTplActions .mui-btn {
	min-width: 150px;
	height: 40px;
	margin: 0;
	padding: 0 22px;
	font: 700 14px/40px Arial, Helvetica, sans-serif;
	text-transform: none;
}
/* Cancel: the redesign's outlined secondary */
.reinkTplWindow .mui-btn.reinkTplCancel,
.reinkTplWindow .mui-btn.reinkTplCancel:focus {
	border: 1px solid var(--sp-line, rgb(218 220 224));
	border-radius: 8px;
	background-color: var(--sp-surface, rgb(255 255 255));
	color: var(--sp-ink-2, rgb(24 26 31));
	box-shadow: none;
}
.reinkTplWindow .mui-btn.reinkTplCancel:hover {
	border-color: var(--sp-line-hover, rgb(176 181 190));
	background-color: var(--sp-fill-hover, rgb(241 242 245));
	color: var(--sp-ink, rgb(4 0 0));
}
.reinkTplWindow .mui-btn.reinkTplCancel:focus-visible {
	outline: 2px solid var(--sm-focus, rgb(4 0 0));
	outline-offset: 2px;
}

@media (max-width: 560px) {
	.reinkTplWindow .reinkTplOption {
		width: calc(50% - 6px);
	}
	.reinkTplCarousel {
		gap: 6px;
	}
	.reinkTplStage {
		padding: 10px;
		min-height: 160px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.reinkTplWindow .reinkTplOption,
	.reinkTplTile {
		transition: none;
	}
}
@media (forced-colors: active) {
	.reinkTplWindow .reinkTplOption,
	.reinkTplTile,
	.reinkTplWindow .reinkTplArrow {
		border-color: ButtonBorder;
	}
	.reinkTplWindow .reinkTplWarn {
		border-color: CanvasText;
	}
}
