/* Mobile Home Mama - home catalog (archive, home type and single home). Builds on home.css. */

/* Let sections run full width inside GeneratePress's page container, as on the front page. */
.post-type-archive-home .site.grid-container,
.tax-home_type .site.grid-container,
.single-home .site.grid-container {
	max-width: none;
	padding: 0;
}

.post-type-archive-home .site-content,
.tax-home_type .site-content,
.single-home .site-content {
	display: block;
}

.mhm-catalog__header {
	margin-bottom: 24px;
}

.mhm-catalog h1 {
	font-size: clamp(2rem, 5vw, 2.75rem);
}

.mhm-catalog__intro {
	max-width: 680px;
	margin-top: 12px;
	color: #3d5568;
}

.mhm-catalog__intro p + p {
	margin-top: 12px;
}

/* ---------- Filters ---------- */
.mhm-filters {
	padding: 20px;
	border: 1px solid rgba(18, 40, 56, 0.12);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(18, 40, 56, 0.06);
}

.mhm-filters__row {
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1fr);
	align-items: end;
}

.mhm-filters__field label,
.mhm-filters__types legend {
	display: block;
	margin-bottom: 6px;
	color: var(--mhm-secondary);
	font-size: 0.875rem;
	font-weight: 600;
}

.mhm-filters select {
	width: 100%;
	min-height: 48px;
	padding: 0 12px;
	border: 1px solid rgba(18, 40, 56, 0.25);
	border-radius: 6px;
	background-color: #fff;
	color: var(--mhm-secondary);
	font-size: 1rem;
}

.mhm-filters select:focus-visible,
.mhm-filters input:focus-visible {
	outline: 3px solid var(--mhm-accent);
	outline-offset: 2px;
}

.mhm-catalog .mhm-filters__submit {
	justify-content: center;
	min-height: 48px;
}

.mhm-filters__types {
	margin: 20px 0 0;
	padding: 0;
	border: 0;
}

.mhm-filters__types legend {
	padding: 0;
}

.mhm-filters__check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin-right: 24px;
	color: var(--mhm-secondary);
	cursor: pointer;
}

.mhm-filters__check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--mhm-primary-text);
}

.mhm-catalog .mhm-filters__clear {
	margin-top: 8px;
	font-size: 0.875rem;
}

.mhm-filters__clear a,
.mhm-catalog__empty a {
	color: var(--mhm-primary-text);
	font-weight: 600;
}

/* The name search list can be wider than its field so thumbnails and specs fit. */
.mhm-filters .mhm-suggest__popup {
	right: auto;
	width: max(100%, min(400px, calc(100vw - 40px)));
}

@media (min-width: 600px) {
	.mhm-filters {
		padding: 24px;
	}

	.mhm-filters__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mhm-filters__field--keyword {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1024px) {
	.mhm-filters__row {
		grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)) auto;
	}

	.mhm-filters__field--keyword {
		grid-column: auto;
	}

	.mhm-catalog .mhm-filters__submit {
		padding-right: 28px;
		padding-left: 28px;
	}
}

/* ---------- Results ---------- */
.mhm-catalog .mhm-results-count {
	margin: 40px 0 24px;
	font-size: clamp(1.375rem, 3vw, 1.75rem);
}

/* Home card styles are in home.css (shared with the homepage Featured Homes section). */

/* ---------- Pagination ---------- */
.mhm-pagination {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 48px;
	text-align: center;
}

.mhm-catalog .mhm-pagination__status {
	color: #3d5568;
	font-size: 0.875rem;
}

.mhm-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

/* .nav-links in the selector outranks GeneratePress's ".nav-links > *:first-child { padding-left: 0 }". */
.mhm-pagination .nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(18, 40, 56, 0.2);
	border-radius: 6px;
	box-sizing: border-box;
	color: var(--mhm-secondary);
	text-decoration: none;
}

.mhm-pagination a.page-numbers:hover,
.mhm-pagination a.page-numbers:focus-visible {
	border-color: var(--mhm-primary);
	color: var(--mhm-primary-text);
}

.mhm-pagination .page-numbers.current {
	border-color: var(--mhm-primary-text);
	background: var(--mhm-primary-text);
	color: #fff;
}

.mhm-pagination .page-numbers.dots {
	border-color: transparent;
}

/* ---------- Floor plan disclaimer ---------- */
.mhm-catalog .mhm-disclaimer {
	max-width: 760px;
	margin: 40px auto 0;
	color: #4b6275;
	font-size: 0.8125rem;
	line-height: 1.6;
	text-align: center;
}

/* Single home: sits between the last section and the contact call-to-action. */
.mhm-disclaimer-wrap {
	padding-bottom: 40px;
}

.mhm-disclaimer-wrap .mhm-disclaimer {
	margin-top: 0;
	padding-top: 24px;
	border-top: 1px solid rgba(18, 40, 56, 0.1);
}

/* ---------- Empty state ---------- */
.mhm-catalog__empty {
	margin-top: 40px;
	padding: 40px 24px;
	border-radius: 12px;
	background: var(--mhm-bg-alt);
	text-align: center;
}

.mhm-catalog__empty p + p {
	margin-top: 12px;
}

/* ---------- Single home: breadcrumb bar ---------- */
/* ---------- Page banner: optional image, then title and breadcrumb bar ---------- */
.mhm-page-banner__media {
	height: clamp(160px, 22vw, 320px);
	background: var(--mhm-secondary);
}

.mhm-page-banner__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mhm-page-banner__bar {
	padding: 20px 0;
	background: var(--mhm-secondary);
	color: #fff;
}

.mhm-page-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 32px;
}

.mhm-catalog .mhm-page-banner__title {
	margin: 0;
	color: #fff;
	font-family: var(--mhm-font-heading);
	font-size: clamp(1.375rem, 3vw, 1.875rem);
	font-weight: 600;
	line-height: 1.25;
}

.mhm-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin: 0;
	padding: 0;
	color: #d6e3ec;
	font-size: 0.875rem;
	font-weight: 600;
	list-style: none;
}

.mhm-breadcrumb li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.mhm-breadcrumb li + li::before {
	color: rgba(255, 255, 255, 0.45);
	content: "\203A";
	content: "\203A" / "";
	font-size: 1.125rem;
	line-height: 1;
}

.mhm-catalog .mhm-breadcrumb a {
	color: #7fd0fb;
	text-decoration: none;
}

.mhm-catalog .mhm-breadcrumb a:hover {
	color: #fff;
	text-decoration: underline;
}

.mhm-breadcrumb [aria-current="page"] {
	font-weight: 400;
}

@media (max-width: 767px) {
	.mhm-page-banner__bar {
		padding: 16px 0;
	}

	.mhm-page-banner__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ---------- Single home: hero ---------- */
.mhm-home-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	border-bottom: 1px solid rgba(18, 40, 56, 0.08);
}

.mhm-home-hero__media {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #fff;
}

/* Contain, not cover: the home image may be a floor plan that must not be cropped. */
.mhm-home-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: contain;
}

/* The main image opens in the photo viewer (catalog.js) to zoom in. */
.mhm-home-hero__zoom {
	position: relative;
	display: block;
	width: 100%;
	border-radius: 8px;
	cursor: zoom-in;
}

.mhm-home-hero__zoom:focus-visible {
	outline: 3px solid var(--mhm-primary);
	outline-offset: 4px;
}

.mhm-home-hero__zoom-hint {
	position: absolute;
	right: 8px;
	bottom: 8px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(18, 40, 56, 0.85);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	transition: background-color 0.2s ease;
}

.mhm-home-hero__zoom-hint .mhm-icon {
	width: 16px;
	height: 16px;
}

.mhm-home-hero__zoom:hover .mhm-home-hero__zoom-hint,
.mhm-home-hero__zoom:focus-visible .mhm-home-hero__zoom-hint {
	background: var(--mhm-secondary);
}

.mhm-home-hero__summary {
	width: 100%;
	max-width: var(--mhm-max);
	margin: 0 auto;
	padding: 32px var(--mhm-gutter) 48px;
	box-sizing: border-box;
}

.mhm-catalog .mhm-home-hero__summary .mhm-eyebrow {
	margin-bottom: 8px;
}

.mhm-catalog .mhm-home-hero__specs {
	margin-top: 16px;
	font-size: 0.9375rem;
}

.mhm-home-hero__description {
	margin-top: 20px;
	color: #3d5568;
}

.mhm-home-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

/* Phone number shown inside a button, after its label. */
.mhm-button__meta {
	padding-left: 10px;
	border-left: 1px solid rgba(255, 255, 255, 0.5);
	font-weight: 400;
	white-space: nowrap;
}

@media (min-width: 900px) {
	.mhm-home-hero--has-media {
		align-items: center;
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.mhm-home-hero--has-media .mhm-home-hero__media {
		align-self: stretch;
		padding: 32px;
		border-right: 1px solid rgba(18, 40, 56, 0.08);
	}

	.mhm-home-hero--has-media .mhm-home-hero__summary {
		max-width: 620px;
		margin: 0;
		padding: 48px 40px;
	}
}

@media (max-width: 599px) {
	.mhm-home-hero__actions .mhm-button {
		justify-content: center;
		width: 100%;
		box-sizing: border-box;
	}
}

/* Editor content (description and features): restore the spacing home.css resets. */
.mhm-catalog .entry-content > * + * {
	margin-top: 1em;
}

.mhm-catalog .entry-content ul,
.mhm-catalog .entry-content ol {
	margin-bottom: 0;
	margin-left: 1.25em;
}

.mhm-catalog .entry-content a {
	color: var(--mhm-primary-text);
}

/* ---------- Single home: gallery ---------- */
.mhm-catalog #mhm-photos h2,
.mhm-catalog .mhm-home-info h2 {
	margin-bottom: 24px;
	font-size: clamp(1.5rem, 3vw, 2rem);
}

.mhm-gallery {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.mhm-gallery li {
	margin: 0;
}

.mhm-gallery__link {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	background: #fff;
}

.mhm-gallery__link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.mhm-gallery__link:hover img {
	transform: scale(1.05);
}

@media (min-width: 600px) {
	.mhm-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.mhm-gallery {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

/* ---------- Single home: video ---------- */
.mhm-catalog #mhm-video {
	text-align: center;
}

.mhm-catalog #mhm-video h2 {
	margin-bottom: 24px;
	font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Photos and video share one tinted band. */
#mhm-photos + #mhm-video {
	padding-top: 0;
}

.mhm-home-video {
	max-width: 880px;
	margin: 0 auto;
}

/* ---------- Single home: features and details ---------- */
.mhm-home-info {
	display: grid;
	gap: 48px;
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
	.mhm-home-info--split {
		align-items: start;
		grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
	}
}

.mhm-catalog .mhm-home-features h2,
.mhm-catalog .mhm-home-features h3,
.mhm-catalog .mhm-home-features h4,
.mhm-catalog .mhm-home-features h5 {
	margin-top: 1.75em;
	color: var(--mhm-secondary);
	font-size: 1.0625rem;
}

.mhm-catalog .mhm-home-features > :first-child {
	margin-top: 0;
}

/* Long pasted feature lists read better in two columns on wider screens. */
@media (min-width: 600px) {
	.mhm-home-features ul {
		column-gap: 32px;
		columns: 2;
	}

	.mhm-home-features li {
		break-inside: avoid;
	}
}

.mhm-home-info__details {
	padding: 24px;
	border-radius: 12px;
	background: var(--mhm-bg-alt);
}

.mhm-home-details {
	margin: 0;
}

.mhm-home-details div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(18, 40, 56, 0.1);
}

.mhm-home-details dt {
	color: #3d5568;
	font-weight: 400;
}

.mhm-home-details dd {
	margin: 0;
	color: var(--mhm-secondary);
	font-weight: 600;
	text-align: right;
}

/* ---------- Single home: contact call-to-action ---------- */
.mhm-contact-cta__inner {
	display: grid;
	align-items: center;
	gap: 48px;
	grid-template-columns: minmax(0, 1fr);
}

.mhm-contact-cta__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.mhm-contact-cta__content .mhm-eyebrow {
	margin-bottom: 0;
}

.mhm-contact-cta__content > p:not(.mhm-eyebrow) {
	max-width: 520px;
	color: #3d5568;
	font-size: 1.0625rem;
}

.mhm-contact-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 12px;
}

.mhm-contact-cta__media {
	position: relative;
	justify-self: center;
	width: 100%;
	max-width: 440px;
}

/* Tinted frame offset behind the photo. */
.mhm-contact-cta__media::before {
	position: absolute;
	inset: 20px -20px -20px 20px;
	border-radius: 20px;
	background: var(--mhm-primary);
	content: "";
	opacity: 0.15;
}

.mhm-contact-cta__media img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	border-radius: 20px;
	box-shadow: 0 18px 40px rgba(18, 40, 56, 0.18);
	object-fit: cover;
}

.mhm-contact-cta__badge {
	position: absolute;
	top: 28px;
	left: -20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border: 4px solid #fff;
	border-radius: 50%;
	background: var(--mhm-accent);
	box-shadow: 0 10px 24px rgba(18, 40, 56, 0.2);
	color: var(--mhm-secondary);
}

.mhm-contact-cta__badge .mhm-icon {
	width: 26px;
	height: 26px;
}

/* Soft ring that ripples out from the phone badge. */
.mhm-contact-cta__badge::after {
	position: absolute;
	inset: -4px;
	border: 2px solid var(--mhm-accent);
	border-radius: 50%;
	animation: mhm-ring 2.4s ease-out infinite;
	content: "";
}

@keyframes mhm-ring {
	from {
		opacity: 0.8;
		transform: scale(1);
	}

	to {
		opacity: 0;
		transform: scale(1.6);
	}
}

@media (min-width: 768px) {
	.mhm-contact-cta__inner {
		gap: 72px;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	}
}

@media (max-width: 599px) {
	.mhm-contact-cta__actions {
		width: 100%;
	}

	.mhm-contact-cta__actions .mhm-button {
		justify-content: center;
		width: 100%;
		box-sizing: border-box;
	}

	.mhm-contact-cta__media {
		max-width: 320px;
	}

	.mhm-contact-cta__media::before {
		inset: 14px -14px -14px 14px;
	}

	.mhm-contact-cta__badge {
		top: 20px;
		left: -12px;
		width: 56px;
		height: 56px;
	}
}

/* ---------- Photo viewer (dialog) ---------- */
html.mhm-lightbox-open {
	overflow: hidden;
}

.mhm-lightbox {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 64px 16px 72px;
	overflow: hidden;
	border: 0;
	background: transparent;
	color: #fff;
	box-sizing: border-box;
}

.mhm-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.mhm-lightbox::backdrop {
	background: rgba(10, 22, 31, 0.94);
}

.mhm-lightbox__figure {
	max-width: 1200px;
	margin: 0;
	text-align: center;
}

.mhm-lightbox__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 170px);
	margin: 0 auto;
	/* White behind transparent floor plan PNGs so the lines show on the dark backdrop. */
	background: #fff;
	cursor: zoom-in;
	touch-action: none;
	transform-origin: center;
	user-select: none;
	-webkit-user-select: none;
}

.mhm-lightbox.is-zoomed .mhm-lightbox__img {
	cursor: grab;
}

.mhm-lightbox.is-dragging .mhm-lightbox__img {
	cursor: grabbing;
}

/* Zoom out / reset / zoom in, top left (Close is top right). */
.mhm-lightbox__tools {
	position: absolute;
	z-index: 1;
	top: 12px;
	left: 12px;
	display: flex;
	gap: 8px;
}

.mhm-lightbox__tools .mhm-lightbox__btn {
	position: static;
}

.mhm-lightbox__zoom-reset.mhm-lightbox__btn {
	font-size: 0.875rem;
	font-weight: 600;
}

.mhm-lightbox__btn:disabled {
	cursor: default;
	opacity: 0.35;
}

.mhm-lightbox__btn:disabled:hover {
	background: rgba(10, 22, 31, 0.72);
}

.mhm-lightbox__caption {
	margin-top: 12px;
	color: #d6e3ec;
	font-size: 0.875rem;
}

.mhm-lightbox__count {
	position: absolute;
	z-index: 1;
	bottom: 24px;
	left: 50%;
	margin: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(10, 22, 31, 0.72);
	color: #d6e3ec;
	font-size: 0.875rem;
	transform: translateX(-50%);
}

.mhm-lightbox__btn {
	position: absolute;
	z-index: 1;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	/* Dark backing and ring so the controls stay visible over a zoomed-in (often white) image. */
	background: rgba(10, 22, 31, 0.72);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.mhm-lightbox__btn:hover {
	background: rgba(10, 22, 31, 0.95);
}

.mhm-lightbox__btn:focus-visible {
	outline: 3px solid var(--mhm-accent);
	outline-offset: 2px;
}

.mhm-lightbox__close {
	top: 12px;
	right: 12px;
}

.mhm-lightbox__prev,
.mhm-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.mhm-lightbox__prev {
	left: 12px;
}

.mhm-lightbox__next {
	right: 12px;
}

.mhm-lightbox__prev::before,
.mhm-lightbox__next::before {
	display: block;
	width: 12px;
	height: 12px;
	margin: 0 auto;
	border: solid currentcolor;
	border-width: 0 0 3px 3px;
	content: "";
	transform: translateX(2px) rotate(45deg);
}

.mhm-lightbox__next::before {
	transform: translateX(-2px) rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
	.mhm-gallery__link img {
		transition: none;
	}

	.mhm-gallery__link:hover img {
		transform: none;
	}

	.mhm-contact-cta__badge::after {
		display: none;
	}
}
