/* Free tools on the guides. Loaded only on a page with a tool block. */

.ts-tool {
	margin-block: 1.75rem 2.25rem;
	padding: 1.25rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
}

.ts-tool__form + .ts-tool__form {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--line-soft);
}

.ts-tool__set {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.ts-tool__set + .ts-tool__set {
	margin-top: 1.25rem;
}

.ts-tool__legend {
	padding: 0;
	margin-bottom: 0.75rem;
	font-weight: 650;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--ink);
}

.ts-tool__grid {
	display: grid;
	gap: 0.85rem 1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	margin-bottom: 0.85rem;
}

.ts-tool__grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.ts-tool__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
	margin-bottom: 0.85rem;
}

.ts-tool__grid > .ts-tool__field {
	margin-bottom: 0;
}

.ts-tool__label {
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--ink);
}

.ts-tool__hint {
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.ts-tool input[type="text"],
.ts-tool input[type="url"],
.ts-tool input[type="tel"],
.ts-tool input[type="email"],
.ts-tool input[type="number"],
.ts-tool input[type="time"],
.ts-tool select,
.ts-tool textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.6rem 0.7rem;
	border: 1px solid #d4d4d8;
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1rem;
	line-height: 1.45;
}

.ts-tool textarea {
	resize: vertical;
	min-height: 7rem;
}

.ts-tool input:focus,
.ts-tool select:focus,
.ts-tool textarea:focus {
	border-color: var(--wp--preset--color--green);
	outline: 2px solid var(--wp--preset--color--green-tint);
	outline-offset: 0;
}

.ts-tool__check {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
	margin-bottom: 0.5rem;
	font-size: 0.9375rem;
}

.ts-tool__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 0.25rem;
}

.ts-tool__actions--end {
	align-items: flex-end;
}

.ts-tool__button {
	display: inline-flex;
	align-items: center;
	padding: 0.65rem 1rem;
	border: 1px solid var(--wp--preset--color--green);
	border-radius: 8px;
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--surface);
	font: inherit;
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.ts-tool__button:hover {
	background: #184d38;
	border-color: #184d38;
}

.ts-tool__button:active {
	transform: translateY(1px);
}

.ts-tool__button[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.ts-tool__button--quiet {
	background: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--line);
	color: var(--wp--preset--color--ink);
}

.ts-tool__button--quiet:hover {
	background: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--faint);
}

.ts-tool__result {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--line-soft);
}

.ts-tool__result > :first-child {
	margin-top: 0;
}

.ts-tool__error {
	color: #9f1d1d;
}

.ts-tool__score {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	font-weight: 600;
}

.ts-tool__big {
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.ts-tool__score--good .ts-tool__big,
.ts-tool__score--ok .ts-tool__big {
	color: var(--wp--preset--color--green);
}

.ts-tool__score--warn .ts-tool__big {
	color: #92400e;
}

.ts-tool__score--bad .ts-tool__big {
	color: #9f1d1d;
}

.ts-tool__tag {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 4px;
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
}

.ts-tool__tag--good,
.ts-tool__tag--ok {
	background: var(--wp--preset--color--green-tint);
	color: var(--wp--preset--color--green);
}

.ts-tool__tag--warn {
	background: #fef3c7;
	color: #92400e;
}

.ts-tool__tag--bad {
	background: #fee2e2;
	color: #9f1d1d;
}

.ts-tool__h {
	margin: 1.25rem 0 0.5rem;
	font-size: 1rem;
}

.ts-tool__shared li {
	margin-bottom: 0.4rem;
	padding: 0.35rem 0.5rem;
	background: #fef9e7;
	border-radius: 4px;
	font-size: 0.9375rem;
}

.ts-tool__table {
	overflow-x: auto;
	margin-block: 0.75rem;
}

.ts-tool__table--scroll {
	max-height: 26rem;
	overflow-y: auto;
	border: 1px solid var(--wp--preset--color--line-soft);
	border-radius: 6px;
}

.ts-tool__table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.ts-tool__table th,
.ts-tool__table td {
	padding: 0.45rem 0.6rem;
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
	text-align: left;
	vertical-align: top;
}

.ts-tool__table th {
	position: sticky;
	top: 0;
	background: var(--wp--preset--color--page);
	font-weight: 600;
}

.ts-tool__table .ts-tool__check {
	margin: 0;
}

.ts-tool__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8125rem !important;
	white-space: pre;
}

.ts-tool__notes {
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}

.ts-tool__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 0.5rem;
	padding: 0;
	list-style: none;
}

.ts-tool__chips li {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.3rem 0.2rem 0.6rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	font-size: 0.875rem;
}

.ts-tool__chips button {
	border: 0;
	background: none;
	padding: 0 0.3rem;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	color: var(--wp--preset--color--muted);
}

.ts-tool__map {
	height: 26rem;
	margin-top: 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	z-index: 0;
}

.ts-tool__map--short {
	height: 20rem;
}

.ts-tool__map[hidden] {
	display: none;
}

.ts-map-label {
	padding: 0 4px;
	border: 0;
	box-shadow: none;
	background: rgba(255, 255, 255, 0.85);
	font-weight: 600;
	font-size: 12px;
}

.ts-map-label::before {
	display: none;
}

.ts-tool__qr {
	display: block;
	width: 200px;
	height: 200px;
	margin-top: 0.75rem;
	image-rendering: pixelated;
}

/* Copy buttons on template code blocks. */
.ts-copy {
	position: relative;
}

.ts-copy__button {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.35rem 0.7rem;
	font-size: 0.8125rem;
}

@media (max-width: 600px) {
	.ts-tool {
		padding: 1rem;
		margin-inline: -0.25rem;
	}

	.ts-tool__map {
		height: 20rem;
	}
}

.ts-print {
	margin-block: 1rem;
}

@media print {
	header, footer, nav, aside, .ts-print, .ts-breadcrumbs, .ts-related, .ts-toc, .wp-block-townsmith-site-nav, #wpadminbar {
		display: none !important;
	}

	body {
		background: #fff !important;
		color: #000 !important;
	}

	a {
		color: inherit;
		text-decoration: underline;
	}

	main {
		max-width: none !important;
	}
}
