/*
 * Shop recommendations (/shops/<slug>/recommendations/).
 *
 * The page answers one question - can this seller be trusted - so it is
 * built around the two facts that answer it: how many people have said so,
 * and how long they have been saying it - hence the count set in the
 * masthead sentence rather than a bare heading. Each recommendation then
 * shows what the buyer bought, which is the only handmade thing on an
 * otherwise wordy page, and a way back into the shop.
 *
 * Namespaced .recs-* because Bootstrap 2 and flat-ui are loaded globally.
 * Palette and type are the site's own: Bitter over Lato, slate and teal.
 */

.recs {
	--rc-ink: #34495e;
	--rc-accent: #16a085;
	--rc-muted: #8d959c;
	--rc-hairline: #e9e4dc;
	--rc-surface: #f7f4ef;

	color: var(--rc-ink);
}

/* ------------------------------------------------------------- masthead */

.recs-head {
	margin: 0 0 6px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--rc-hairline);
}

.recs-title {
	margin: 0;
	font-family: Bitter, Georgia, serif;
	font-weight: 400;
	font-size: 24px;
	line-height: 1.3;
	color: var(--rc-ink);
	text-wrap: balance;
}

/* The count is the claim; the rest of the sentence is context for it. */
.recs-title strong {
	font-weight: 700;
	color: var(--rc-accent);
}

.recs-rule {
	margin: 8px 0 0;
	font-family: Lato, Arial, sans-serif;
	font-size: 13px;
	color: var(--rc-muted);
}

/* ---------------------------------------------------------------- list
 *
 * No boxes. A recommendation is somebody talking, not a component, so the
 * only thing between them is a light rule - the same one the rest of the
 * site uses to separate rows.
 */

.recs-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.recs-item {
	display: flex;
	gap: 14px;
	padding: 22px 0;
}

.recs-item + .recs-item {
	border-top: 1px solid var(--rc-hairline);
}

.recs-body {
	flex: 1 1 auto;
	min-width: 0;
}

.recs-card-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 6px;
}

.recs-avatar {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--rc-surface);
}

/* Two thirds of buyers never set a picture, and the same grey silhouette
   forty times down a page says nothing. An initial at least differs. */
.recs-avatar--initial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(22, 160, 133, 0.1);
	color: var(--rc-accent);
	font-family: Bitter, Georgia, serif;
	font-size: 17px;
	line-height: 1;
}

.recs-who {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 10px;
	min-width: 0;
}

.recs-name {
	font-family: Bitter, Georgia, serif;
	font-size: 15px;
	color: var(--rc-ink);
}

.recs-date {
	font-family: Lato, Arial, sans-serif;
	font-size: 12px;
	color: var(--rc-muted);
}

.recs-admin {
	margin-left: auto;
	flex: 0 0 auto;
	font-family: Lato, Arial, sans-serif;
	font-size: 12px;
	color: var(--rc-accent);
}

.recs-text {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: Lato, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.7;
	color: var(--rc-ink);
	/* Comfortable measure. Some of these run to a full paragraph. */
	max-width: 68ch;
}

.recs-text p {
	margin: 0 0 10px;
}

.recs-text p:last-child {
	margin-bottom: 0;
}

.recs-blank {
	margin: 22px 0;
	font-family: Lato, Arial, sans-serif;
	font-size: 15px;
	color: var(--rc-muted);
}

/* ------------------------------------------------------- what they bought
 *
 * A line of names between the buyer and their words: what the
 * recommendation is actually about, and a way into the shop from it.
 *
 * No thumbnails. The only pictures on this page are the ones buyers took
 * themselves - product shots here would compete with those, and half of
 * these orders hold several products, one holds twenty-seven.
 */

.recs-bought {
	margin: 0 0 8px;
	font-family: Lato, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	color: var(--rc-muted);
	max-width: 68ch;
}

.recs-bought-label {
	margin-right: 4px;
}

.recs-bought-link {
	color: var(--rc-accent);
}

.recs-bought-link:hover,
.recs-bought-link:focus-visible {
	color: var(--rc-accent);
	text-decoration: underline;
}

/* -------------------------------------------------------- buyer photos */

.rec-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.rec-photos img {
	display: block;
	width: 84px;
	height: 84px;
	margin: 0;
	border-radius: 3px;
	object-fit: cover;
	background: var(--rc-surface);
	box-shadow: 0 0 0 1px var(--rc-hairline);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.rec-photos a:hover img {
	box-shadow: 0 0 0 1px var(--rc-accent);
	transform: translateY(-1px);
}

.rec-photos a:focus-visible img {
	outline: 2px solid var(--rc-accent);
	outline-offset: 2px;
}

/* Says what the photo fields on the recommendation form are for. */
.rec-photo-hint {
	color: var(--rc-muted);
	font-size: 14px;
}

/* -------------------------------------------------------------- mobile */

@media (max-width: 767px) {
	.recs-title {
		font-size: 20px;
	}

	.recs-item {
		gap: 10px;
		padding: 18px 0;
	}

	.recs-text {
		font-size: 14px;
	}
}
