/*
 * Imardix Site: styles for the plugin's own markup (mini calculator,
 * testimonial thumbnails + lightbox, reviews wrapper). Colours come from the
 * block theme's palette presets when present; the fallbacks are the same
 * DESIGN.md hexes so the markup also looks right under any other theme.
 */

/* ---------- Mini calculator ---------- */
.imx-calc-card {
	--imx-c-primary: var(--wp--preset--color--primary, #1476AD);
	--imx-c-navy: var(--wp--preset--color--navy, #1F3A52);
	--imx-c-slate: var(--wp--preset--color--slate, #5B6B76);
	--imx-c-surface: var(--wp--preset--color--surface, #F5F7F9);
	--imx-c-line: var(--wp--preset--color--line, #E2E8ED);
	box-sizing: border-box;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 2px 4px rgba(31, 58, 82, 0.06), 0 12px 32px rgba(31, 58, 82, 0.14);
	padding: 28px;
	text-align: right;
	color: var(--imx-c-navy);
}
.imx-calc-card__title {
	margin: 0 0 4px;
	font-size: 22px;
	line-height: 1.25;
	color: var(--imx-c-navy);
}
.imx-calc-card__note {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--imx-c-slate);
}
.imx-calc-card .imx-field {
	margin: 0 0 14px;
}
.imx-calc-card .imx-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--imx-c-navy);
}
.imx-calc-card .imx-field input {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #5B6B76;
	border-radius: 8px;
	background: #fff;
	color: #20303B;
	font: inherit;
	font-size: 16px;
	text-align: left;
}
.imx-calc-card .imx-field input:focus-visible {
	outline: 2px solid var(--imx-c-primary);
	outline-offset: 2px;
	border-color: var(--imx-c-primary);
}
.imx-calc-card__btn {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin-top: 4px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--imx-c-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.imx-calc-card__btn:hover {
	background: var(--wp--preset--color--primary-dark, #0F5A87);
}
.imx-calc-card__btn:focus-visible {
	outline: 2px solid var(--imx-c-primary);
	outline-offset: 3px;
}
.imx-calc-card__result {
	margin-top: 16px;
	padding: 14px;
	border-radius: 8px;
	background: var(--imx-c-surface);
	text-align: center;
}
.imx-calc-card__result[hidden] {
	display: none;
}
.imx-calc-card__result-value {
	font-family: var(--wp--preset--font-family--heading, 'Rubik', sans-serif);
	font-size: 28px;
	font-weight: 700;
	color: var(--imx-c-primary);
}
.imx-calc-card__link {
	display: block;
	margin-top: 16px;
	text-align: center;
	font-weight: 600;
	color: var(--imx-c-primary);
}
.imx-calc-card__link::after {
	content: '';
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-inline-start: 6px;
	vertical-align: -3px;
	background: currentColor;
	/* Lucide chevron-left (ISC) as a mask: always points left, never mirrored by RTL. */
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Google reviews wrapper ---------- */
.imx-google-reviews-widget {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	overflow-x: auto;
}
.imx-reviews-fallback {
	margin: 0;
	padding: 24px;
	border-radius: 16px;
	background: var(--wp--preset--color--surface, #F5F7F9);
	color: var(--wp--preset--color--slate, #5B6B76);
	text-align: center;
}

/* ---------- Testimonial thumbnails ---------- */
.imx-testimonial-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
	gap: 20px;
}
.imx-letters {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
	.imx-letters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.imx-testimonial-shot {
	margin: 0;
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(31, 58, 82, 0.06), 0 6px 20px rgba(31, 58, 82, 0.1);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.imx-testimonial-shot:hover,
.imx-testimonial-shot:focus-within {
	box-shadow: 0 2px 4px rgba(31, 58, 82, 0.08), 0 12px 28px rgba(31, 58, 82, 0.16);
	transform: translateY(-2px);
}
.imx-testimonial-shot-trigger {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--surface, #F5F7F9);
	cursor: pointer;
	font: inherit;
}
.imx-testimonial-shot-trigger:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #1476AD);
	outline-offset: -4px;
}
.imx-testimonial-shot-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}
.imx-testimonial-video-placeholder {
	display: block;
	background: var(--wp--preset--color--navy, #1F3A52);
}
.imx-testimonial-shot figcaption {
	padding: 10px 12px;
	overflow: hidden;
	font-size: 14px;
	color: var(--wp--preset--color--slate, #5B6B76);
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.imx-testimonial-play-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.imx-testimonial-play-icon svg {
	box-sizing: content-box;
	width: 22px;
	height: 22px;
	padding: 14px;
	border-radius: 50%;
	background: rgba(31, 58, 82, 0.7);
	color: #fff;
}

/* ---------- Lightbox + video modal ---------- */
.imx-lightbox-overlay,
.imx-video-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(31, 58, 82, 0.88);
}
.imx-lightbox-overlay[hidden],
.imx-video-modal-overlay[hidden] {
	display: none;
}
.imx-lightbox-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	max-width: min(90vw, 900px);
	max-height: 90vh;
	padding: 16px;
	border-radius: 12px;
	background: #fff;
}
.imx-lightbox-image {
	max-width: 100%;
	max-height: 75vh;
	object-fit: contain;
	border-radius: 8px;
}
.imx-lightbox-caption {
	margin: 0;
	font-size: 15px;
	color: var(--wp--preset--color--slate, #5B6B76);
	text-align: center;
}
.imx-video-modal-dialog {
	position: relative;
	width: min(90vw, 1120px);
	padding: 16px;
	border-radius: 12px;
	background: var(--wp--preset--color--navy, #1F3A52);
}
.imx-video-modal-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}
.imx-video-modal-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 8px;
}
.imx-lightbox-close {
	position: absolute;
	top: -24px;
	inset-inline-end: -8px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--navy, #1F3A52);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(31, 58, 82, 0.3);
}
.imx-lightbox-close:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #1476AD);
	outline-offset: 2px;
}
body.imx-modal-open {
	overflow: hidden;
}
@media (max-width: 640px) {
	.imx-lightbox-close {
		top: -16px;
		inset-inline-end: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.imx-testimonial-shot {
		transition: none;
	}
	.imx-testimonial-shot:hover,
	.imx-testimonial-shot:focus-within {
		transform: none;
	}
}

/*
 * The Trustindex widget draws its stars as remote yellow SVG images. The brand
 * palette has no yellow, so recolour them to #1476AD with a filter (black base,
 * then a fitted chain; measured result rgb(20,118,173)). Plugin files are untouched.
 */
.imx-google-reviews-widget .ti-star {
	filter: brightness(0) invert(46%) sepia(100%) saturate(852%) hue-rotate(172deg) brightness(68%) contrast(96%);
}

/* Trustindex "read more" links ship #7a7a7a on #f4f4f4 (3.9:1); use the palette slate (5.2:1). */
.imx-google-reviews-widget .ti-read-more,
.imx-google-reviews-widget .ti-read-more *,
.imx-google-reviews-widget .ti-read-more::before,
.imx-google-reviews-widget .ti-read-more::after {
	color: var(--wp--preset--color--slate, #5B6B76) !important;
	opacity: 1 !important;
}
