/* H&T Product Boxes. Matches the look of the old Lasso "Our Favorite" boxes. */

.htpb-box,
.htpb-table {
	--htpb-accent: #8a499d;
	--htpb-ink: #000;
	--htpb-star: #fc0;
	--htpb-star-off: #e2e2e2;
	--htpb-muted: rgba(95, 99, 104, 0.92);
	--htpb-font: Lato, sans-serif;
	font-family: var(--htpb-font);
	color: var(--htpb-ink);
	box-sizing: border-box;
}

.htpb-box *,
.htpb-table * {
	box-sizing: border-box;
}

/* ---------- Box ---------- */

.htpb-box {
	position: relative;
	margin: 2.75em 10px 2em;
	padding: 20px;
	background: #fff;
	border: 6px solid var(--htpb-ink);
	box-shadow: 0 0 5px 0 var(--htpb-ink);
	line-height: 1.5;
	container-type: inline-size;
}

.htpb-badge {
	position: absolute;
	top: -18px;
	left: -10px;
	z-index: 1;
	padding: 10px 15px;
	background: var(--htpb-ink);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.htpb-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	padding-top: 16px;
}

.htpb-box a.htpb-image {
	display: block;
	text-align: center;
	border: 0;
	box-shadow: none;
}

.htpb-box .htpb-image img {
	display: inline-block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 350px;
	object-fit: contain;
	margin: 0;
}

.htpb-content {
	min-width: 0;
}

.htpb-box a.htpb-title {
	display: block;
	margin: 0 0 10px;
	color: var(--htpb-ink);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: underline;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}

.htpb-box a.htpb-title:hover {
	color: var(--htpb-ink);
	text-decoration-thickness: 2px;
}

.htpb-stars {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 12px;
	line-height: 1;
}

.htpb-stars-icons {
	font-size: 18px;
	letter-spacing: 1px;
	background: linear-gradient(90deg, var(--htpb-star) calc(var(--htpb-rating) / 5 * 100%), var(--htpb-star-off) calc(var(--htpb-rating) / 5 * 100%));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.htpb-stars-value {
	font-size: 14px;
	color: var(--htpb-ink);
}

.htpb-stars-label {
	font-size: 12px;
	color: var(--htpb-muted);
}

.htpb-desc {
	font-size: 16px;
	line-height: 1.8;
	margin: 0 0 16px;
}

.htpb-desc p {
	margin: 0 0 0.75em;
}

.htpb-desc p:last-child {
	margin-bottom: 0;
}

.htpb-box a.htpb-button,
.htpb-table a.htpb-button {
	display: block;
	padding: 10px 15px;
	background: var(--htpb-accent);
	color: #fff;
	border: 0;
	border-radius: 7px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	box-shadow: none;
	transition: filter 0.15s ease;
}

.htpb-box a.htpb-button:hover,
.htpb-box a.htpb-button:focus,
.htpb-table a.htpb-button:hover,
.htpb-table a.htpb-button:focus {
	color: #fff;
	filter: brightness(0.9);
	text-decoration: none;
}

.htpb-disclosure {
	margin-top: 12px;
	font-size: 12px;
	font-style: italic;
	line-height: 1.5;
	color: var(--htpb-muted);
}

/* Image beside the text when the box has room. */
@container (min-width: 560px) {
	.htpb-inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
		gap: 24px;
	}

	.htpb-box--no-image .htpb-inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.htpb-box a.htpb-title {
		font-size: 30px;
	}
}

/* ---------- Table ---------- */

.htpb-table {
	margin: 2em 0;
	border: 1px solid #e2e2e2;
	background: #fff;
	container-type: inline-size;
}

.htpb-row {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	grid-template-areas: "image info" "action action";
	gap: 12px 16px;
	align-items: center;
	padding: 16px;
	border-bottom: 1px solid #e2e2e2;
}

.htpb-row:last-of-type {
	border-bottom: 0;
}

.htpb-row-image {
	grid-area: image;
	text-align: center;
}

.htpb-row-image a {
	display: block;
	border: 0;
	box-shadow: none;
}

.htpb-row-image img {
	display: inline-block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 96px;
	object-fit: contain;
}

.htpb-row-badge {
	display: inline-block;
	margin: 0 0 8px;
	padding: 4px 8px;
	background: var(--htpb-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.htpb-row-info {
	grid-area: info;
	min-width: 0;
}

.htpb-table a.htpb-row-title {
	display: block;
	margin: 0 0 6px;
	color: var(--htpb-ink);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.htpb-row .htpb-stars {
	margin: 0;
}

.htpb-row-action {
	grid-area: action;
}

.htpb-table > .htpb-disclosure {
	margin: 0;
	padding: 10px 16px 14px;
}

@container (min-width: 560px) {
	.htpb-row {
		grid-template-columns: 120px minmax(0, 1fr) 160px;
		grid-template-areas: "image info action";
	}

	.htpb-row-image img {
		max-height: 120px;
	}
}

.htpb-missing {
	padding: 10px 14px;
	border: 1px dashed #c00;
	color: #c00;
}
