/*
 * Checkatrade Reviews Importer: front end.
 * Fonts come from the theme. Colours come from Settings → Checkatrade Reviews
 * (or override --ctr-accent / --ctr-edge in your theme CSS).
 * Selectors are prefixed with .ctr-reviews so page builders don't add their own
 * padding to headings and paragraphs. A few properties use !important because
 * Divi's Theme Builder styles headings and links with ID selectors (#et-boc),
 * which no ordinary class rule can beat.
 */
.ctr-reviews,
.ctr-score {
	--ctr-accent: #1d5fa8;
	--ctr-edge: var(--ctr-accent);
	--ctr-text: rgba(0, 0, 0, .8);
	--ctr-heading: #111;
	--ctr-muted: rgba(0, 0, 0, .55);
	--ctr-line: rgba(0, 0, 0, .09);
	--ctr-card: #fff;
	--ctr-ok: #1a7f37;
}

/* ---- Grid ---- */
.ctr-reviews {
	display: grid;
	gap: 24px;
	margin: 0 0 24px;
	padding: 0;
}
.ctr-reviews--grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.ctr-reviews--list { grid-template-columns: 1fr; max-width: 760px; }

/* ---- Card ---- */
.ctr-reviews .ctr-review {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 24px 24px 20px;
	background: var(--ctr-card);
	border: 1px solid var(--ctr-line);
	border-left: 3px solid var(--ctr-edge);
	color: var(--ctr-text);
	min-width: 0;
}
.ctr-reviews .ctr-review[hidden] { display: none; }
.ctr-reviews .ctr-review:focus { outline: 2px solid var(--ctr-accent); outline-offset: 2px; }

.ctr-reviews .ctr-review__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	line-height: 1;
}
.ctr-reviews .ctr-review__score { color: var(--ctr-accent); font-weight: 700; white-space: nowrap; }
.ctr-reviews .ctr-review__score-num { font-size: 28px; letter-spacing: -.02em; }
.ctr-reviews .ctr-review__score-of { font-size: 14px; color: var(--ctr-muted); margin-left: 2px; font-weight: 600; }

.ctr-reviews .ctr-review__verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ctr-ok);
}

.ctr-reviews .ctr-review__title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 19px !important;
	line-height: 1.3 !important;
	font-weight: 700;
	color: var(--ctr-heading) !important;
	text-transform: none !important;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
}

.ctr-reviews .ctr-review__text { flex: 1; font-size: 15px; line-height: 1.65; }
.ctr-reviews .ctr-review__text p { margin: 0 0 .7em; padding: 0 !important; font-size: inherit; line-height: inherit; }
.ctr-reviews .ctr-review__text p:last-child { margin-bottom: 0; }

.ctr-reviews .ctr-review__photos { display: flex; gap: 6px; flex-wrap: wrap; }
.ctr-reviews .ctr-review__photos a { display: block; line-height: 0; }
.ctr-reviews .ctr-review__photos img { width: 64px; height: 64px; object-fit: cover; display: block; margin: 0; }

.ctr-reviews .ctr-review__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 4px;
	padding-top: 12px;
	border-top: 1px solid var(--ctr-line);
	font-size: 14px;
	line-height: 1.4;
}
.ctr-reviews .ctr-review__who { font-weight: 600; color: var(--ctr-heading); }
.ctr-reviews .ctr-review__detail { font-size: 13px; color: var(--ctr-muted); }

/* ---- Show more ---- */
.ctr-more-wrap { text-align: center; margin: 8px 0 24px; }
.ctr-more-wrap .ctr-more {
	display: inline-block;
	padding: 12px 28px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--ctr-accent, #1d5fa8) !important;
	background: transparent;
	border: 2px solid var(--ctr-accent, #1d5fa8);
	border-radius: 50px;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.ctr-more-wrap .ctr-more:hover,
.ctr-more-wrap .ctr-more:focus-visible { background: var(--ctr-accent, #1d5fa8); color: #fff !important; }

.ctr-reviews__source { font-size: 14px; margin: 0 0 1em; text-align: center; }

/* ---- [checkatrade_score] ---- */
.ctr-score {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 12px;
	color: var(--ctr-text) !important;
	text-decoration: none !important;
}
a.ctr-score:hover .ctr-score__text { text-decoration: underline; }
.ctr-score__num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--ctr-accent) !important; letter-spacing: -.02em; }
.ctr-score__of { font-size: 18px; font-weight: 600; color: var(--ctr-muted); margin-left: 2px; letter-spacing: 0; }
.ctr-score__text { font-size: 16px; font-weight: 500; }

@media (max-width: 480px) {
	.ctr-reviews .ctr-review { padding: 20px 18px 16px; }
}
