/* Mobile Home Mama - front page styles. Also loaded on home catalog pages for the shared section, card and button styles. */

:root {
	--mhm-primary-text: #0570b0; /* Darker blue for small text on light backgrounds (AA contrast). */
}

/* Let sections run full width inside GeneratePress's page container. */
.home .site.grid-container {
	max-width: none;
	padding: 0;
}

.home .site-content {
	display: block;
}

.mhm-home {
	overflow-x: clip;
	background: var(--mhm-bg);
	color: var(--mhm-secondary);
	font-family: var(--mhm-font);
	line-height: 1.7;
}

.mhm-container {
	width: 100%;
	max-width: var(--mhm-max);
	margin: 0 auto;
	padding: 0 var(--mhm-gutter);
	box-sizing: border-box;
}

.mhm-home h1,
.mhm-home h2,
.mhm-home h3 {
	margin: 0;
	color: var(--mhm-secondary);
	line-height: 1.2;
}

.mhm-home h2 {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.mhm-home h3 {
	font-size: 1.25rem;
}

.mhm-home p {
	margin: 0;
}

.mhm-accent {
	color: var(--mhm-primary);
}

.mhm-accent--amber {
	color: var(--mhm-accent);
}

.mhm-eyebrow {
	margin-bottom: 12px;
	color: var(--mhm-primary-text);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.mhm-eyebrow--light {
	color: #7fd0fb;
}

.mhm-home .mhm-center {
	margin-top: 32px;
	text-align: center;
}

.mhm-home .mhm-center--spaced {
	margin-top: 48px;
}

/* ---------- Icons ---------- */
.mhm-icon {
	flex: none;
	width: 1.25em;
	height: 1.25em;
}

.mhm-icon-badge {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--mhm-bg-alt);
	color: var(--mhm-primary-text);
}

.mhm-icon-badge .mhm-icon {
	width: 24px;
	height: 24px;
}

.mhm-icon-badge--lg {
	width: 64px;
	height: 64px;
	background: var(--mhm-primary);
	color: #fff;
}

.mhm-icon-badge--lg .mhm-icon {
	width: 30px;
	height: 30px;
}

/* ---------- Buttons ---------- */
.mhm-home .mhm-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 2px solid var(--mhm-primary);
}

.mhm-button__icon {
	width: 1.1em;
	height: 1.1em;
	transition: transform 0.25s ease;
}

.mhm-button:hover .mhm-button__icon,
.mhm-button:focus-visible .mhm-button__icon {
	transform: translateX(4px);
}

.mhm-home .mhm-button--outline {
	background: transparent;
	color: var(--mhm-primary-text);
	border-color: var(--mhm-primary);
}

.mhm-home .mhm-button--outline:hover,
.mhm-home .mhm-button--outline:focus-visible {
	background: var(--mhm-primary);
	border-color: var(--mhm-primary);
	color: #fff;
}

.mhm-home .mhm-button--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.7);
	color: #fff;
}

.mhm-home .mhm-button--ghost:hover,
.mhm-home .mhm-button--ghost:focus-visible {
	background: #fff;
	border-color: #fff;
	color: var(--mhm-secondary);
}

.mhm-home a:focus-visible,
.mhm-home button:focus-visible,
.mhm-carousel__track:focus-visible {
	outline: 3px solid var(--mhm-accent);
	outline-offset: 3px;
}

/* ---------- Sections ---------- */
.mhm-section {
	padding: 56px 0;
}

.mhm-section--alt {
	background: var(--mhm-bg-alt);
}

.mhm-section__header {
	max-width: 680px;
	margin: 0 auto 40px;
	text-align: center;
}

.mhm-section__header p:last-child {
	margin-top: 12px;
	color: #3d5568;
}

.mhm-section__header--split {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	max-width: none;
	text-align: left;
}

.mhm-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr;
}

/* ---------- Hero ---------- */
.mhm-hero {
	position: relative;
	background-color: #122838;
	background-image:
		linear-gradient(105deg, rgba(18, 40, 56, 0.92) 20%, rgba(18, 40, 56, 0.45) 70%, rgba(18, 40, 56, 0.3)),
		url("../images/Hero%20image.png");
	background-position: center;
	background-size: cover;
	color: #fff;
	display: flex;
	min-height: 80vh;
}

.mhm-hero__inner {
	display: grid;
	flex: 1;
	align-items: center;
	gap: 32px;
	padding-top: 56px;
	padding-bottom: 56px;
	grid-template-columns: 1fr;
}

.mhm-hero__content {
	max-width: 640px;
}

.mhm-home .mhm-hero h1 {
	color: #fff;
	font-size: clamp(2.25rem, 6vw, 3.75rem);
}

.mhm-hero__lead {
	margin-top: 20px;
	color: #e3eef5;
	font-size: 1.0625rem;
}

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

/* Feature card: three rows stacked vertically, as in the mockup. */
.mhm-hero__features {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
	color: var(--mhm-secondary);
	list-style: none;
}

.mhm-hero__feature {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 24px;
}

.mhm-hero__feature + .mhm-hero__feature {
	border-top: 1px solid rgba(18, 40, 56, 0.1);
}

.mhm-hero__feature strong {
	display: block;
	line-height: 1.3;
}

.mhm-hero__feature-text {
	display: block;
	color: #3d5568;
	font-size: 0.875rem;
	line-height: 1.4;
}

/* ---------- Cards (home types) ---------- */
.mhm-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(18, 40, 56, 0.1);
	border-radius: 12px;
	background: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mhm-card:hover {
	box-shadow: 0 16px 36px rgba(18, 40, 56, 0.14);
	transform: translateY(-6px);
}

.mhm-card__media,
.mhm-about__media {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #d4eef9, #e9f7fc);
	color: rgba(18, 40, 56, 0.35);
}

.mhm-card__media {
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

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

.mhm-card:hover .mhm-card__media img {
	transform: scale(1.06);
}

.mhm-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 24px;
}

.mhm-card__body p {
	margin-bottom: 12px;
	color: #3d5568;
}

.mhm-card__body .mhm-button {
	margin-top: auto;
}

/* ---------- Home cards (template-parts/home-card.php: catalog and Featured Homes) ---------- */
.mhm-card__media {
	position: relative;
}

/* Floor-plan images: show the whole drawing (no cropping) on white. */
.mhm-card--home .mhm-card__media {
	border-bottom: 1px solid rgba(18, 40, 56, 0.08);
	background: #fff;
}

.mhm-card--home .mhm-card__media img {
	padding: 16px;
	box-sizing: border-box;
	object-fit: contain;
}

.mhm-card--home .mhm-card__body {
	gap: 12px;
	padding: 20px;
}

.mhm-card--home h3 {
	font-size: 1.0625rem;
}

.mhm-specs {
	display: grid;
	gap: 8px 12px;
	grid-template-columns: 1fr 1fr;
	width: 100%;
	margin: 0;
	padding: 0;
	color: #3d5568;
	font-size: 0.875rem;
	list-style: none;
}

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

.mhm-specs .mhm-icon {
	width: 1.1em;
	height: 1.1em;
	color: #6b8294;
}

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

.mhm-home-card .mhm-card__media {
	text-decoration: none;
}

.mhm-home .mhm-home-card__type {
	margin: 0;
	color: var(--mhm-primary-text);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mhm-card--home .mhm-card__title {
	font-size: 1.25rem;
}

.mhm-card__title a {
	color: inherit;
	text-decoration: none;
}

.mhm-card__title a:hover {
	color: var(--mhm-primary-text);
	text-decoration: underline;
}

.mhm-card__placeholder {
	width: 64px;
	height: 64px;
}

.mhm-specs--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.mhm-home .mhm-home-card__summary {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.6;
}

.mhm-home-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: 100%;
	margin-top: auto;
	padding-top: 8px;
}

.mhm-home .mhm-home-card__actions .mhm-button {
	flex: 1 1 0;
	min-width: max-content;
	width: auto;
	margin-top: 0;
	padding: 10px 16px;
}

/* ---------- Search / filter box ---------- */
.mhm-search {
	padding: 32px 0 0;
}

.mhm-search__box {
	padding: 32px 20px;
	border-radius: 16px;
	background: var(--mhm-bg-alt);
}

.mhm-search__box .mhm-section__header {
	margin-bottom: 24px;
}

.mhm-search__form {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr;
}

.mhm-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 14px;
	border: 1px solid rgba(18, 40, 56, 0.12);
	border-radius: 8px;
	background: #fff;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mhm-field:hover {
	border-color: rgba(7, 156, 242, 0.5);
}

.mhm-field:focus-within {
	border-color: var(--mhm-primary);
	box-shadow: 0 0 0 3px rgba(7, 156, 242, 0.2);
}

.mhm-field label {
	color: #3d5568;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
}

.mhm-search .mhm-field select {
	width: 100%;
	margin: 0;
	padding: 2px 24px 2px 0;
	border: 0;
	border-radius: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122838' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 14px;
	box-shadow: none;
	color: var(--mhm-secondary);
	cursor: pointer;
	font-family: var(--mhm-font);
	font-size: 1rem;
	line-height: 1.5;
	outline: 0;
	-webkit-appearance: none;
	appearance: none;
}

.mhm-search__submit {
	justify-content: center;
	min-height: 52px;
}

.mhm-search__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 12px;
	margin-top: 20px;
	font-size: 0.875rem;
}

.mhm-search__links ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mhm-search__links li + li {
	margin-left: 12px;
	padding-left: 12px;
	border-left: 1px solid rgba(18, 40, 56, 0.25);
}

.mhm-search__links a {
	color: var(--mhm-primary-text);
	font-weight: 600;
	text-decoration: none;
	background: linear-gradient(currentcolor, currentcolor) left bottom / 0 1px no-repeat;
	transition: background-size 0.3s ease, color 0.25s ease;
}

.mhm-search__links a:hover,
.mhm-search__links a:focus-visible {
	background-size: 100% 1px;
	color: var(--mhm-primary-dark);
}

/* ---------- Videos ---------- */
.mhm-video h3 {
	margin-top: 14px;
	font-size: 1.0625rem;
}

.mhm-video__thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	background: linear-gradient(135deg, #122838, #0b4a73);
	box-shadow: 0 8px 20px rgba(18, 40, 56, 0.15);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mhm-video__thumb:hover {
	box-shadow: 0 14px 30px rgba(18, 40, 56, 0.25);
	transform: translateY(-4px);
}

.mhm-video__thumb img,
.mhm-video__thumb iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.mhm-video__play {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--mhm-primary);
	color: #fff;
	transition: transform 0.3s ease, background-color 0.3s ease;
}

.mhm-video__play .mhm-icon {
	width: 28px;
	height: 28px;
	margin-left: 3px;
}

.mhm-video__thumb:hover .mhm-video__play {
	background: var(--mhm-primary-dark);
	transform: scale(1.1);
}

/* ---------- Testimonials carousel ---------- */
.mhm-carousel {
	position: relative;
}

.mhm-carousel__track {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 4px 0;
	overflow-x: auto;
	list-style: none;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.mhm-carousel__track::-webkit-scrollbar {
	display: none;
}

.mhm-review {
	position: relative;
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 36px 32px 32px;
	border-radius: 12px;
	background: var(--mhm-bg-alt);
	box-sizing: border-box;
	text-align: center;
	scroll-snap-align: start;
}

.mhm-review__quote-mark {
	position: absolute;
	top: 14px;
	left: 24px;
	color: var(--mhm-primary);
	font-family: var(--mhm-font-heading);
	font-size: 3rem;
	line-height: 1;
	opacity: 0.35;
}

.mhm-review blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	color: #2c4358;
	font-size: 1rem;
}

.mhm-review__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-top: auto; /* Keep the avatar and name together at the bottom of cards with shorter reviews. */
	border-radius: 50%;
	background: var(--mhm-primary);
	color: #fff;
	font-family: var(--mhm-font-heading);
	font-size: 1.25rem;
	font-weight: 600;
}

.mhm-review__author {
	display: flex;
	flex-direction: column;
}

/* Arrows sit outside the cards (desktop/tablet only); dots work everywhere. */
.mhm-carousel__btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--mhm-primary);
	cursor: pointer;
	transform: translateY(-50%);
	transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.mhm-carousel__btn .mhm-icon {
	width: 32px;
	height: 32px;
	stroke-width: 2.5;
}

.mhm-carousel__btn:hover:not(:disabled) {
	color: var(--mhm-primary-dark);
}

.mhm-carousel__btn--prev:hover:not(:disabled) {
	transform: translate(-3px, -50%);
}

.mhm-carousel__btn--next:hover:not(:disabled) {
	transform: translate(3px, -50%);
}

.mhm-carousel__btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.mhm-carousel__btn--prev {
	left: 0;
}

.mhm-carousel__btn--next {
	right: 0;
}

.mhm-carousel__dots {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 24px;
}

.mhm-carousel__dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #b8d9e8;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.25s ease;
}

.mhm-carousel__dot:hover {
	background: var(--mhm-primary-dark);
}

.mhm-carousel__dot[aria-current="true"] {
	background: var(--mhm-primary);
	transform: scale(1.2);
}

/* ---------- Why choose us ---------- */
.mhm-reason {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 8px;
	text-align: center;
}

.mhm-reason .mhm-icon-badge {
	transition: transform 0.3s ease;
}

.mhm-reason:hover .mhm-icon-badge {
	transform: translateY(-4px) scale(1.06);
}

.mhm-reason p {
	color: #3d5568;
}

/* ---------- About ---------- */
.mhm-about {
	display: grid;
	align-items: center;
	gap: 32px;
	grid-template-columns: 1fr;
}

.mhm-about__media {
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(18, 40, 56, 0.15);
}

.mhm-about__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%; /* Keep the face in frame when cropping the square photo. */
}

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

.mhm-about__content .mhm-eyebrow {
	margin-bottom: 0;
}

.mhm-about__content p:not(.mhm-eyebrow) {
	color: #3d5568;
}

/* ---------- Closing CTA ---------- */
.mhm-cta {
	padding: 72px 0;
	background-color: #122838;
	background-image:
		linear-gradient(135deg, rgba(18, 40, 56, 0.9) 0%, rgba(11, 74, 115, 0.78) 100%),
		url("../images/footer%20CTA.png");
	background-position: center;
	background-size: cover;
	color: #fff;
	text-align: center;
}

.mhm-cta__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	max-width: 760px;
}

.mhm-cta__inner .mhm-eyebrow {
	margin-bottom: 0;
}

.mhm-home .mhm-cta h2 {
	color: #fff;
}

.mhm-cta__inner > p:not(.mhm-eyebrow) {
	color: #d6e3ec;
}

/* ---------- Hero entrance (CSS-only, plays on page load) ---------- */
.mhm-hero__content > *,
.mhm-hero__features {
	animation: mhm-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mhm-hero__content > :nth-child(2) {
	animation-delay: 0.1s;
}

.mhm-hero__content > :nth-child(3) {
	animation-delay: 0.2s;
}

.mhm-hero__content > :nth-child(4) {
	animation-delay: 0.3s;
}

.mhm-hero__features {
	animation-delay: 0.45s;
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
	.mhm-section {
		padding: 80px 0;
	}

	.mhm-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}

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

	.mhm-section__header--split {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
	}

	.mhm-search__box {
		padding: 40px 32px;
	}

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

	.mhm-search__submit {
		grid-column: 1 / -1;
	}

	.mhm-review {
		flex-basis: calc(50% - 10px);
	}

	/* Leave room for the arrows beside the cards. */
	.mhm-carousel {
		padding: 0 56px;
	}

	.mhm-carousel.is-ready .mhm-carousel__btn {
		display: inline-flex;
	}

	.mhm-about {
		gap: 56px;
		grid-template-columns: 1fr 1fr;
	}
}

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

	.mhm-search__form {
		grid-template-columns: repeat(4, 1fr) auto;
	}

	.mhm-search__submit {
		grid-column: auto;
		padding-right: 28px;
		padding-left: 28px;
	}

	.mhm-hero__inner {
		gap: 64px;
		padding-top: 104px;
		padding-bottom: 104px;
		grid-template-columns: minmax(0, 1fr) 360px;
	}

	/* Sit the feature card lower than the heading, toward the hero's bottom. */
	.mhm-hero__features {
		align-self: end;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.mhm-card,
	.mhm-card__media img,
	.mhm-video__thumb,
	.mhm-video__play,
	.mhm-reason .mhm-icon-badge,
	.mhm-button__icon,
	.mhm-field,
	.mhm-search__links a,
	.mhm-carousel__btn {
		transition: none;
	}

	.mhm-hero__content > *,
	.mhm-hero__features {
		animation: none;
	}

	.mhm-card:hover,
	.mhm-card:hover .mhm-card__media img,
	.mhm-video__thumb:hover,
	.mhm-video__thumb:hover .mhm-video__play,
	.mhm-reason:hover .mhm-icon-badge {
		transform: none;
	}

	.mhm-carousel__track {
		scroll-behavior: auto;
	}
}
