/**
 * RE/MAX Agent Showcase
 *
 * Every rule is scoped to .rms-wrap so nothing leaks into the theme, and every
 * text element inherits the theme's own font stack rather than declaring one.
 * The one piece of brand identity the plugin insists on is the balloon's
 * red / cream / blue band, which appears on card hover and above the modal.
 */

.rms-wrap {
	/* Sampled from the RE/MAX balloon. */
	--rms-red: #ed1c24;
	--rms-red-deep: #680506;
	--rms-blue: #275cab;
	--rms-navy: #0b143b;
	--rms-cream: #f6f4ea;

	--rms-accent: var(--rms-red);
	--rms-columns: 4;

	--rms-surface: #fff;
	--rms-line: rgba(11, 20, 59, 0.1);
	--rms-ink: var(--rms-navy);
	--rms-ink-soft: rgba(11, 20, 59, 0.62);
	--rms-radius: 14px;
	--rms-ratio: 4 / 5;
	--rms-gap: clamp(16px, 2vw, 26px);

	font-family: inherit;
	color: var(--rms-ink);
	container-type: inline-size;
}

.rms-wrap *,
.rms-wrap *::before,
.rms-wrap *::after {
	box-sizing: border-box;
}

.rms-wrap p,
.rms-wrap h2,
.rms-wrap h3,
.rms-wrap ul,
.rms-wrap li,
.rms-wrap button,
.rms-wrap input {
	font-family: inherit;
}

.rms-sr,
.rms-wrap .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Toolbar                                                             */
/* ------------------------------------------------------------------ */

.rms-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	margin-bottom: 18px;
}

.rms-search {
	position: relative;
	flex: 1 1 260px;
	max-width: 380px;
}

.rms-search__icon {
	position: absolute;
	top: 50%;
	left: 14px;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	fill: var(--rms-ink-soft);
	pointer-events: none;
}

.rms-wrap .rms-search__input {
	width: 100%;
	margin: 0;
	padding: 12px 16px 12px 42px;
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--rms-ink);
	background: var(--rms-surface);
	border: 1px solid var(--rms-line);
	border-radius: 999px;
	box-shadow: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.rms-wrap .rms-search__input:focus {
	border-color: var(--rms-accent);
	box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.14);
	outline: none;
}

.rms-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.rms-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rms-wrap .rms-chip {
	margin: 0;
	padding: 8px 15px;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--rms-ink-soft);
	text-transform: none;
	letter-spacing: 0.01em;
	cursor: pointer;
	background: transparent !important;
	border: 1px solid var(--rms-line) !important;
	border-radius: 999px;
	box-shadow: none !important;
	transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.rms-wrap .rms-chip:hover {
	color: var(--rms-ink);
	border-color: rgba(11, 20, 59, 0.28) !important;
}

.rms-wrap .rms-chip.is-active {
	color: #fff;
	background: var(--rms-navy) !important;
	border-color: var(--rms-navy) !important;
}

.rms-count {
	margin: 0 0 16px;
	font-size: 0.82rem;
	color: var(--rms-ink-soft);
}

/* ------------------------------------------------------------------ */
/* Grid                                                                */
/* ------------------------------------------------------------------ */

.rms-grid {
	display: grid;
	grid-template-columns: repeat(var(--rms-columns), minmax(0, 1fr));
	gap: var(--rms-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.rms-card {
	margin: 0;
	padding: 0;
	border: 0;
}

.rms-card[hidden] {
	display: none;
}

/* Themes style bare buttons aggressively, so this reset is deliberately loud. */
.rms-wrap .rms-card__btn {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0 !important;
	font: inherit;
	color: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	background: var(--rms-surface) !important;
	border: 1px solid var(--rms-line) !important;
	border-radius: var(--rms-radius);
	box-shadow: 0 1px 2px rgba(11, 20, 59, 0.04) !important;
	overflow: hidden;
	transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.rms-wrap .rms-card__btn:hover,
.rms-wrap .rms-card__btn:focus-visible {
	transform: translateY(-4px);
	border-color: rgba(11, 20, 59, 0.16) !important;
	box-shadow: 0 14px 30px rgba(11, 20, 59, 0.12) !important;
}

.rms-wrap .rms-card__btn:focus-visible {
	outline: 2px solid var(--rms-accent);
	outline-offset: 3px;
}

/* Uniform photo container: every image is cropped to the same box. */
.rms-card__media {
	position: relative;
	display: block;
	width: 100%;
	padding-top: 125%; /* 4:5 fallback for browsers without aspect-ratio */
	overflow: hidden;
	background: linear-gradient(160deg, #f2f3f6, #e7e9ef);
}

@supports (aspect-ratio: 4 / 5) {
	.rms-card__media {
		padding-top: 0;
		aspect-ratio: var(--rms-ratio);
	}
}

.rms-wrap .rms-card__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center top;
	border-radius: 0;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.rms-wrap .rms-card__btn:hover .rms-card__img,
.rms-wrap .rms-card__btn:focus-visible .rms-card__img {
	transform: scale(1.045);
}

/* The signature: the balloon's three bands, wiping in from the left. */
.rms-card__band,
.rms-modal__band {
	display: flex;
	width: 100%;
	height: 5px;
	overflow: hidden;
}

.rms-card__band {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.rms-wrap .rms-card__btn:hover .rms-card__band,
.rms-wrap .rms-card__btn:focus-visible .rms-card__band {
	transform: scaleX(1);
}

.rms-card__band i,
.rms-modal__band i {
	flex: 1;
	display: block;
	height: 100%;
	font-style: normal;
}

.rms-card__band i:nth-child(1),
.rms-modal__band i:nth-child(1) {
	background: var(--rms-red);
}

.rms-card__band i:nth-child(2),
.rms-modal__band i:nth-child(2) {
	background: var(--rms-cream);
}

.rms-card__band i:nth-child(3),
.rms-modal__band i:nth-child(3) {
	background: var(--rms-blue);
}

.rms-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px 18px;
}

.rms-card__name {
	display: block;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--rms-ink);
}

.rms-card__title {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--rms-blue);
}

.rms-card__specialty {
	display: -webkit-box;
	margin-top: 2px;
	overflow: hidden;
	font-size: 0.83rem;
	line-height: 1.45;
	color: var(--rms-ink-soft);
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}

.rms-card__cta {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: auto;
	padding-top: 12px;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rms-accent);
}

.rms-card__cta svg {
	width: 13px;
	height: 13px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.24s ease;
}

.rms-wrap .rms-card__btn:hover .rms-card__cta svg,
.rms-wrap .rms-card__btn:focus-visible .rms-card__cta svg {
	transform: translateX(3px);
}

/* Shape variants */
.rms-shape-square .rms-card__btn {
	border-radius: 0;
}

.rms-shape-circle {
	--rms-ratio: 1 / 1;
}

.rms-shape-circle .rms-card__btn {
	background: transparent !important;
	border-color: transparent !important;
	box-shadow: none !important;
}

.rms-shape-circle .rms-card__media {
	padding-top: 100%;
	border-radius: 50%;
}

@supports (aspect-ratio: 1 / 1) {
	.rms-shape-circle .rms-card__media {
		padding-top: 0;
	}
}

.rms-shape-circle .rms-card__body {
	padding: 14px 6px 0;
	text-align: center;
}

.rms-shape-circle .rms-card__cta {
	justify-content: center;
}

.rms-shape-circle .rms-card__band {
	display: none;
}

.rms-noresults,
.rms-empty {
	padding: 40px 0;
	font-size: 0.95rem;
	color: var(--rms-ink-soft);
	text-align: center;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.rms-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(12px, 4vw, 40px);
}

.rms-modal[hidden] {
	display: none;
}

.rms-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 20, 59, 0.55);
	backdrop-filter: blur(3px);
	animation: rms-fade 0.2s ease both;
}

.rms-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(780px, 100%);
	max-height: min(86vh, 720px);
	overflow: hidden auto;
	background: var(--rms-surface);
	border-radius: 16px;
	box-shadow: 0 30px 70px rgba(11, 20, 59, 0.3);
	animation: rms-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
	-webkit-overflow-scrolling: touch;
}

.rms-modal__dialog:focus {
	outline: none;
}

.rms-modal__band {
	position: sticky;
	top: 0;
	z-index: 3;
	height: 5px;
}

.rms-wrap .rms-modal__close {
	position: absolute;
	top: 17px;
	right: 17px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0 !important;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.92) !important;
	border: 1px solid var(--rms-line) !important;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(11, 20, 59, 0.14) !important;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.rms-wrap .rms-modal__close:hover {
	background: #fff !important;
	transform: rotate(90deg);
}

.rms-wrap .rms-modal__close:focus-visible {
	outline: 2px solid var(--rms-accent);
	outline-offset: 2px;
}

.rms-modal__close svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: var(--rms-navy);
	stroke-width: 2;
	stroke-linecap: round;
}

.rms-modal__grid {
	display: grid;
	grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
	align-items: stretch;
}

.rms-modal__media {
	position: relative;
	min-height: 100%;
	background: linear-gradient(160deg, #f2f3f6, #e7e9ef);
}

.rms-wrap .rms-modal__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center top;
	border-radius: 0;
}

.rms-modal__content {
	padding: clamp(24px, 3vw, 36px);
	padding-right: clamp(24px, 3vw, 44px);
}

.rms-wrap .rms-modal__name {
	margin: 0 0 4px;
	padding: 0;
	font-size: clamp(1.4rem, 2.4vw, 1.75rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--rms-ink);
	text-transform: none;
}

.rms-wrap .rms-modal__title {
	margin: 0 0 20px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--rms-blue);
}

.rms-wrap .rms-modal__title[hidden] {
	display: none;
}

.rms-modal__section {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--rms-line);
}

.rms-modal__section[hidden] {
	display: none;
}

.rms-wrap .rms-modal__label {
	margin: 0 0 8px;
	padding: 0;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--rms-ink-soft);
}

.rms-wrap .rms-modal__specialty,
.rms-wrap .rms-modal__bio {
	margin: 0;
	font-size: 0.94rem;
	line-height: 1.6;
	color: var(--rms-ink);
}

.rms-wrap .rms-contact {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rms-wrap .rms-contact li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rms-wrap .rms-contact li + li {
	margin-top: 4px;
}

.rms-wrap .rms-contact a,
.rms-wrap .rms-contact span {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 10px;
	margin-left: -10px;
	font-size: 0.94rem;
	line-height: 1.4;
	color: var(--rms-ink);
	text-decoration: none;
	word-break: break-word;
	border-radius: 9px;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.rms-wrap .rms-contact a:hover {
	color: var(--rms-accent);
	background: rgba(11, 20, 59, 0.045);
	text-decoration: none;
}

.rms-wrap .rms-contact a:focus-visible {
	outline: 2px solid var(--rms-accent);
	outline-offset: 1px;
}

.rms-contact svg {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	fill: none;
	stroke: var(--rms-blue);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@keyframes rms-fade {
	from {
		opacity: 0;
	}
}

@keyframes rms-rise {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
	.rms-grid {
		grid-template-columns: repeat(min(3, var(--rms-columns)), minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.rms-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rms-modal__grid {
		grid-template-columns: 1fr;
	}

	.rms-modal__media {
		aspect-ratio: 16 / 10;
		min-height: 0;
	}

	.rms-wrap .rms-modal__media img {
		object-position: center 22%;
	}
}

@media (max-width: 560px) {
	.rms-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.rms-search {
		max-width: none;
	}

	.rms-filters {
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.rms-filters::-webkit-scrollbar {
		display: none;
	}

	.rms-wrap .rms-chip {
		white-space: nowrap;
	}

	.rms-card__body {
		padding: 13px 14px 15px;
	}

	.rms-card__name {
		font-size: 0.94rem;
	}
}

@media (max-width: 400px) {
	.rms-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rms-wrap *,
	.rms-modal * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.rms-wrap .rms-card__btn:hover {
		transform: none;
	}

	.rms-card__band {
		transform: scaleX(1);
	}
}

@media print {
	.rms-toolbar,
	.rms-modal,
	.rms-card__cta {
		display: none !important;
	}
}
