/*
Theme Name:        MHTrack Homestead
Theme URI:         https://mhtrack.com
Description:       MHTrack-managed dealer website theme. Thin, Elementor-compatible presentation shell; all visual tokens are generated from MHTrack tenant branding, and inventory pages render from code-owned templates for seamless continuity with Elementor-composed pages (ADR-014).
Version:           0.1.0-dev
Author:            MHTrack
Requires at least: 7.0
Requires PHP:      8.3
Text Domain:       mhtrack
*/

/* ---------------------------------------------------------------------
   Design tokens. --mht-color-* custom properties are generated from
   MHTrack branding (Site_Config::print_branding_css); everything below
   consumes them with sane fallbacks, so the same palette drives these
   templates and Elementor-composed pages alike.
--------------------------------------------------------------------- */
:root {
	--mht-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mht-text: #1d2733;
	--mht-text-soft: #5b6774;
	--mht-surface: #ffffff;
	--mht-surface-soft: #f4f6f8;
	--mht-border: #e2e7ec;
	--mht-radius: 10px;
	--mht-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 16px rgba(16, 24, 40, 0.06);
	--mht-primary: var(--mht-color-primary, #003f7b);
	--mht-accent: var(--mht-color-accent, #2a8e27);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--mht-font-body);
	color: var(--mht-text);
	background: var(--mht-surface);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--mht-primary); }

h1, h2, h3 { line-height: 1.25; color: var(--mht-text); }

.mht-container {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 1.25rem;
}

.mht-button {
	display: inline-block;
	background: var(--mht-primary);
	color: #fff;
	padding: 0.7rem 1.4rem;
	border-radius: var(--mht-radius);
	text-decoration: none;
	font-weight: 600;
}
.mht-button:hover { filter: brightness(1.1); }

/* Header / footer fallbacks -------------------------------------- */
.mht-header {
	border-bottom: 1px solid var(--mht-border);
	background: var(--mht-surface);
}
.mht-header__inner {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0.85rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.mht-header__brand { text-decoration: none; }
.mht-header__logo { max-height: 56px; width: auto; }
.mht-header__name {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--mht-primary);
}
.mht-nav {
	display: flex;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.mht-nav a {
	text-decoration: none;
	color: var(--mht-text);
	font-weight: 500;
}
.mht-nav a:hover { color: var(--mht-primary); }

.mht-footer {
	margin-top: 4rem;
	border-top: 1px solid var(--mht-border);
	background: var(--mht-surface-soft);
}
.mht-footer__inner {
	max-width: 72rem;
	margin: 0 auto;
	padding: 1.5rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	color: var(--mht-text-soft);
}

.mht-main { min-height: 60vh; }

/* Badges + notices ------------------------------------------------ */
.mht-badge {
	display: inline-block;
	background: var(--mht-surface-soft);
	color: var(--mht-text-soft);
	border: 1px solid var(--mht-border);
	border-radius: 999px;
	padding: 0.1rem 0.7rem;
	font-size: 0.8rem;
	font-weight: 600;
}
.mht-badge--sold {
	background: #b42318;
	border-color: #b42318;
	color: #fff;
}
.mht-notice {
	background: var(--mht-surface-soft);
	border: 1px solid var(--mht-border);
	border-left: 4px solid var(--mht-primary);
	border-radius: var(--mht-radius);
	padding: 0.9rem 1.1rem;
	margin: 1.25rem 0;
}

/* Archive grid ---------------------------------------------------- */
.mht-archive__header { padding: 2rem 0 0.5rem; }
.mht-archive__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 1.5rem;
	padding: 1rem 0 2rem;
}
.mht-card {
	display: block;
	background: var(--mht-surface);
	border: 1px solid var(--mht-border);
	border-radius: var(--mht-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: var(--mht-shadow);
	transition: transform 120ms ease, box-shadow 120ms ease;
}
.mht-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(16, 24, 40, 0.1), 0 12px 28px rgba(16, 24, 40, 0.1);
}
.mht-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	background: var(--mht-surface-soft);
}
.mht-card__media img { width: 100%; height: 100%; object-fit: cover; }
.mht-card__placeholder { display: block; width: 100%; height: 100%; }
.mht-card__badge { position: absolute; top: 0.75rem; left: 0.75rem; }
.mht-card__body { padding: 1rem 1.1rem 1.2rem; }
.mht-card__title { margin: 0 0 0.25rem; font-size: 1.05rem; }
.mht-card__specs { margin: 0 0 0.5rem; color: var(--mht-text-soft); font-size: 0.9rem; }
.mht-card__price { margin: 0; }
.mht-card__price-label { color: var(--mht-text-soft); font-size: 0.85rem; margin-right: 0.35rem; }
.mht-card__price-amount { font-weight: 700; font-size: 1.15rem; color: var(--mht-primary); }

.mht-pagination { text-align: center; padding-bottom: 2.5rem; }
.mht-pagination .page-numbers {
	display: inline-block;
	padding: 0.4rem 0.8rem;
	margin: 0 0.15rem;
	border: 1px solid var(--mht-border);
	border-radius: 6px;
	text-decoration: none;
}
.mht-pagination .page-numbers.current {
	background: var(--mht-primary);
	border-color: var(--mht-primary);
	color: #fff;
}

/* Home detail ----------------------------------------------------- */
.mht-breadcrumb {
	padding: 1.25rem 0 0.5rem;
	color: var(--mht-text-soft);
	font-size: 0.9rem;
	display: flex;
	gap: 0.5rem;
}
.mht-home__gallery {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.6rem;
	margin: 0.5rem 0 1.5rem;
}
.mht-home__photo { margin: 0; border-radius: var(--mht-radius); overflow: hidden; background: var(--mht-surface-soft); }
.mht-home__photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.mht-home__photo--hero { grid-column: span 4; }
.mht-home__photo--hero img { aspect-ratio: 16 / 9; }

.mht-home__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--mht-border);
}
.mht-home__title { margin: 0 0 0.4rem; font-size: 1.8rem; }
.mht-home__meta { margin: 0; display: flex; gap: 0.5rem; }
.mht-home__price { text-align: right; }
.mht-home__price-label { display: block; color: var(--mht-text-soft); font-size: 0.9rem; }
.mht-home__price-amount { font-size: 1.9rem; font-weight: 700; color: var(--mht-primary); }
.mht-home__price-was { display: block; color: var(--mht-text-soft); }

.mht-home__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	padding: 1.5rem 0 3rem;
}
.mht-home__section { margin-bottom: 1.75rem; }
.mht-home__section h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
.mht-home__features {
	columns: 2;
	margin: 0;
	padding-left: 1.2rem;
}
.mht-home__floorplan { border: 1px solid var(--mht-border); border-radius: var(--mht-radius); }

.mht-specs { margin: 0; border: 1px solid var(--mht-border); border-radius: var(--mht-radius); overflow: hidden; }
.mht-specs__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
}
.mht-specs__row:nth-child(odd) { background: var(--mht-surface-soft); }
.mht-specs__row dt { color: var(--mht-text-soft); }
.mht-specs__row dd { margin: 0; font-weight: 600; }

.mht-home__inquiry {
	background: var(--mht-surface-soft);
	border: 1px solid var(--mht-border);
	border-radius: var(--mht-radius);
	padding: 1.25rem;
}

/* Lead form (shared with the shortcode/widget everywhere) --------- */
.mht-lead-form__field { margin: 0 0 0.9rem; }
.mht-lead-form__field label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
}
.mht-lead-form__required { color: #b42318; margin-left: 0.15rem; }
.mht-lead-form input[type="text"],
.mht-lead-form input[type="email"],
.mht-lead-form input[type="tel"],
.mht-lead-form input[type="datetime-local"],
.mht-lead-form textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--mht-border);
	border-radius: 8px;
	font: inherit;
	background: var(--mht-surface);
}
.mht-lead-form input:focus,
.mht-lead-form textarea:focus {
	outline: 2px solid var(--mht-primary);
	outline-offset: 1px;
	border-color: var(--mht-primary);
}
.mht-lead-form input[aria-invalid="true"],
.mht-lead-form textarea[aria-invalid="true"] { border-color: #b42318; }
.mht-lead-form__error { display: block; color: #b42318; font-size: 0.85rem; margin-top: 0.25rem; }
.mht-lead-form__consent { font-size: 0.85rem; color: var(--mht-text-soft); }
.mht-lead-form__consent label { display: flex; gap: 0.5rem; align-items: flex-start; }
.mht-lead-form__submit {
	background: var(--mht-accent);
	color: #fff;
	border: 0;
	border-radius: var(--mht-radius);
	padding: 0.75rem 1.5rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
}
.mht-lead-form__submit:hover { filter: brightness(1.08); }
.mht-lead-form__submit:disabled { opacity: 0.6; cursor: wait; }
.mht-lead-form__status--success { color: var(--mht-accent); font-weight: 600; }
.mht-lead-form__status--error { color: #b42318; font-weight: 600; }
.mht-lead-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.mht-lead-form__notice {
	border-radius: var(--mht-radius);
	padding: 1rem 1.2rem;
	border: 1px solid var(--mht-border);
}
.mht-lead-form__notice--success { border-left: 4px solid var(--mht-accent); }
.mht-lead-form__notice--error { border-left: 4px solid #b42318; }

/* Front page ------------------------------------------------------ */
.mht-hero {
	background:
		linear-gradient(135deg, var(--mht-primary) 0%, var(--mht-color-primary-deep, var(--mht-primary)) 100%);
	color: #fff;
	padding: 4.5rem 0 5rem;
}
.mht-hero__inner { max-width: 46rem; }
.mht-hero__title { color: #fff; font-size: 2.4rem; margin: 0 0 1rem; }
.mht-hero__lede { font-size: 1.15rem; opacity: 0.92; margin: 0 0 1.75rem; }
.mht-button--accent { background: var(--mht-accent); }
.mht-button--ghost {
	background: transparent;
	color: var(--mht-primary);
	border: 1px solid var(--mht-border);
}

.mht-front-section { padding: 3rem 0; }
.mht-front-section h2 { font-size: 1.5rem; margin: 0 0 1.25rem; }
.mht-front-section__more { text-align: center; margin-top: 1.5rem; }
.mht-front-section--alt { background: var(--mht-surface-soft); }
.mht-front-columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
}
@media (min-width: 900px) {
	.mht-front-columns { grid-template-columns: 1fr 1fr; }
}
.mht-front-form {
	background: var(--mht-surface);
	border: 1px solid var(--mht-border);
	border-radius: var(--mht-radius);
	padding: 1.5rem;
	box-shadow: var(--mht-shadow);
}
.mht-checklist { list-style: none; margin: 0; padding: 0; }
.mht-checklist li {
	padding: 0.45rem 0 0.45rem 2rem;
	position: relative;
}
.mht-checklist li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--mht-accent);
	font-weight: 700;
}

/* Pages / prose / blog -------------------------------------------- */
.mht-page__header { padding: 2.25rem 0 0.75rem; }
.mht-page__header h1 { margin: 0 0 0.35rem; }
.mht-page__meta { color: var(--mht-text-soft); font-size: 0.9rem; margin: 0; }
.mht-prose { max-width: 46rem; padding-bottom: 3rem; }
.mht-prose img { border-radius: var(--mht-radius); }
.mht-prose a { color: var(--mht-primary); }
.mht-prose blockquote {
	border-left: 4px solid var(--mht-primary);
	margin: 1.5rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	color: var(--mht-text-soft);
}
.mht-page--builder { padding-bottom: 0; }

.mht-post-list { max-width: 46rem; padding: 1rem 0 2rem; }
.mht-post-item { padding: 1.5rem 0; border-bottom: 1px solid var(--mht-border); }
.mht-post-item__title { margin: 0 0 0.25rem; font-size: 1.25rem; }
.mht-post-item__title a { text-decoration: none; color: var(--mht-text); }
.mht-post-item__title a:hover { color: var(--mht-primary); }

/* Gone (410) / 404 ------------------------------------------------- */
.mht-gone { padding: 3rem 1.25rem; max-width: 40rem; }
.mht-gone .mht-button { margin-right: 0.5rem; }

/* Responsive ------------------------------------------------------ */
@media (min-width: 900px) {
	.mht-home__body { grid-template-columns: 1.7fr 1fr; }
	.mht-home__photo--hero { grid-column: span 2; grid-row: span 2; }
	.mht-home__gallery { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
	.mht-header__inner { flex-direction: column; align-items: flex-start; }
	.mht-home__gallery { grid-template-columns: repeat(2, 1fr); }
	.mht-home__photo--hero { grid-column: span 2; }
	.mht-home__features { columns: 1; }
}
