/**
 * Metro House: tokens, type, layout and shared components.
 *
 * Breakpoints match Elementor's defaults: tablet <= 1024px, mobile <= 767px.
 * Figma frames: desktop 1440, tablet 834, mobile 390.
 * Section styles live in assets/css/parts/<widget>.css.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                             */
/* ------------------------------------------------------------------ */

:root {
	--mh-c-ink: #171c29;
	--mh-c-blue: #1f4e8c;
	--mh-c-blue-dark: #173c6d;
	--mh-c-line: #d4dce7;
	--mh-c-muted: #586172;
	--mh-c-sand: #f3f0ea;
	--mh-c-white: #ffffff;
	--mh-c-error: #ad3131;

	--mh-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
	--mh-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--mh-max: 1200px;
	--mh-gutter: 120px;
	--mh-section-pad: 96px;
	--mh-radius: 12px;
	--mh-radius-control: 8px;

	--mh-fs-display: 80px;
	--mh-lh-display: 88px;
	--mh-fs-h1: 56px;
	--mh-lh-h1: 64px;
	--mh-fs-h2: 36px;
	--mh-lh-h2: 44px;
	--mh-fs-h3: 28px;
	--mh-lh-h3: 36px;
	--mh-fs-lead: 18px;
	--mh-lh-lead: 28px;
	--mh-fs-body: 16px;
	--mh-lh-body: 24px;
	--mh-fs-small: 14px;
	--mh-lh-small: 20px;
	--mh-fs-label: 12px;
	--mh-lh-label: 16px;
	/* Big numbers (rates, commute minutes use h3). */
	--mh-fs-figure: 56px;
	--mh-lh-figure: 64px;
}

@media (max-width: 1279px) {
	:root {
		--mh-gutter: 32px;
	}
}

@media (max-width: 1024px) {
	:root {
		--mh-section-pad: 72px;
		--mh-fs-display: 56px;
		--mh-lh-display: 62px;
		--mh-fs-h1: 36px;
		--mh-lh-h1: 44px;
	}
}

@media (max-width: 767px) {
	:root {
		--mh-gutter: 20px;
		--mh-section-pad: 56px;
		--mh-fs-display: 44px;
		--mh-lh-display: 48px;
		--mh-fs-h1: 36px;
		--mh-lh-h1: 44px;
		--mh-fs-h2: 32px;
		--mh-lh-h2: 40px;
		--mh-fs-h3: 26px;
		--mh-lh-h3: 32px;
		--mh-fs-lead: 16px;
		--mh-lh-lead: 24px;
		--mh-fs-figure: 36px;
		--mh-lh-figure: 44px;
	}
}

/* Palettes. Elementor colour controls override these per widget. */
.mh--paper,
.mh--sand,
.mh--ink {
	--mh-heading: var(--mh-c-ink);
	--mh-text: var(--mh-c-ink);
	--mh-muted: var(--mh-c-muted);
	--mh-line: var(--mh-c-line);
	--mh-accent: var(--mh-c-blue);
	--mh-on-accent: var(--mh-c-white);
	--mh-field: var(--mh-c-white);
}

.mh--paper {
	--mh-bg: var(--mh-c-white);
}

.mh--sand {
	--mh-bg: var(--mh-c-sand);
}

.mh--ink {
	--mh-bg: var(--mh-c-ink);
	--mh-heading: var(--mh-c-white);
	--mh-text: var(--mh-c-white);
	--mh-muted: rgba(255, 255, 255, 0.78);
	--mh-line: var(--mh-c-line);
	--mh-field: transparent;
}

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	background: var(--mh-c-white);
	color: var(--mh-c-ink);
	font-family: var(--mh-sans);
	font-size: var(--mh-fs-body);
	line-height: var(--mh-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
	max-width: 100%;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--mh-c-blue);
	outline-offset: 2px;
}

.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;
}

.mh-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 1000;
	padding: 12px 16px;
	border-radius: var(--mh-radius-control);
	background: var(--mh-c-blue);
	color: var(--mh-c-white);
	font-weight: 600;
	text-decoration: none;
}

.mh-skip-link:focus {
	top: 16px;
}

/* A section rendered by a Metro House widget. */
.mh {
	/* Reset, so a section placed inside a narrow column (e.g. [mh_commute] in a post) keeps its 1200 container. */
	--mh-max: 1200px;
	position: relative;
	background: var(--mh-bg);
	color: var(--mh-text);
	font-family: var(--mh-sans);
	font-size: var(--mh-fs-body);
	line-height: var(--mh-lh-body);
}

/* Zero specificity, so a section's own margins (".mh-heading__text { margin-top }") always win. */
:where(.mh) :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd) {
	margin: 0;
}

:where(.mh) :where(ul, ol) {
	list-style: none;
	padding: 0;
}

/* Vertical rhythm: every section uses these, Elementor "Padding" controls override them. */
.mh-pad {
	padding-top: var(--mh-pad-t, var(--mh-section-pad));
	padding-bottom: var(--mh-pad-b, var(--mh-section-pad));
}

.mh-container {
	width: min(var(--mh-max), 100% - 2 * var(--mh-gutter));
	margin-inline: auto;
}

/* Wider container used by the Apartments page (64px gutters at 1440). */
.mh-container--wide {
	--mh-max: 1312px;
	width: min(var(--mh-max), 100% - 2 * min(var(--mh-gutter), 64px));
}

.mh-container--narrow {
	--mh-max: 760px;
}

/* ------------------------------------------------------------------ */
/* Type                                                               */
/* ------------------------------------------------------------------ */

.mh-display,
.mh-h1,
.mh-h2,
.mh-h3,
.mh-figure-value {
	font-family: var(--mh-serif);
	font-weight: 400;
	color: var(--mh-heading, var(--mh-c-ink));
	letter-spacing: 0;
}

.mh-display {
	font-size: var(--mh-fs-display);
	line-height: var(--mh-lh-display);
}

.mh-h1 {
	font-size: var(--mh-fs-h1);
	line-height: var(--mh-lh-h1);
}

.mh-h2 {
	font-size: var(--mh-fs-h2);
	line-height: var(--mh-lh-h2);
}

.mh-h3 {
	font-size: var(--mh-fs-h3);
	line-height: var(--mh-lh-h3);
}

.mh-figure-value {
	font-size: var(--mh-fs-figure);
	line-height: var(--mh-lh-figure);
}

.mh-lead {
	font-size: var(--mh-fs-lead);
	line-height: var(--mh-lh-lead);
}

.mh-small {
	font-size: var(--mh-fs-small);
	line-height: var(--mh-lh-small);
}

.mh-label {
	font-family: var(--mh-sans);
	font-size: var(--mh-fs-label);
	line-height: var(--mh-lh-label);
	font-weight: 600;
	text-transform: uppercase;
}

.mh-muted {
	color: var(--mh-muted, var(--mh-c-muted));
}

.mh-eyebrow {
	color: var(--mh-muted);
}

/* Section heading: title then one line of text 16px under it. */
.mh-heading {
	margin-bottom: 40px;
}

.mh-heading .mh-eyebrow {
	margin-bottom: 32px;
}

.mh-heading__text {
	margin-top: 16px;
	color: var(--mh-text);
}

@media (max-width: 767px) {
	.mh-heading {
		margin-bottom: 32px;
	}

	.mh-heading .mh-eyebrow {
		margin-bottom: 24px;
	}
}

/* ------------------------------------------------------------------ */
/* Buttons and links                                                  */
/* ------------------------------------------------------------------ */

.mh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: var(--mh-radius-control);
	font-family: var(--mh-sans);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mh .mh-btn--primary,
.mh-btn--primary {
	background: var(--mh-accent, var(--mh-c-blue));
	color: var(--mh-on-accent, var(--mh-c-white));
}

.mh .mh-btn--primary:hover,
.mh-btn--primary:hover {
	background: var(--mh-c-blue-dark);
	color: var(--mh-c-white);
}

.mh .mh-btn--outline,
.mh-btn--outline {
	background: var(--mh-c-white);
	border-color: var(--mh-c-line);
	color: var(--mh-c-ink);
}

.mh .mh-btn--outline:hover,
.mh-btn--outline:hover {
	border-color: var(--mh-c-ink);
	color: var(--mh-c-ink);
}

.mh-btn--block {
	width: 100%;
}

.mh .mh-link,
.mh-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--mh-heading, var(--mh-c-ink));
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.mh .mh-link:hover,
.mh-link:hover {
	text-decoration-thickness: 2px;
}

.mh-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
}

/* ------------------------------------------------------------------ */
/* Form fields (booking bars, enquiry form, newsletter)               */
/* ------------------------------------------------------------------ */

.mh-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.mh-field__label {
	color: var(--mh-text, var(--mh-c-ink));
}

/* Boxed control: 48px, 1px rule, white. Selects and the date field share it. */
.mh-control {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--mh-c-line);
	border-radius: 10px;
	background: var(--mh-field, var(--mh-c-white));
	color: var(--mh-c-ink);
}

.mh-control:focus-within {
	border-color: var(--mh-c-ink);
}

.mh-control select,
.mh-control input {
	flex: 1;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font-family: var(--mh-sans);
	font-size: 16px;
	line-height: 24px;
	appearance: none;
	-webkit-appearance: none;
}

.mh-control select {
	padding-right: 28px;
	cursor: pointer;
}

.mh-control__icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
}

.mh-control__lead {
	flex: none;
}

/* Date: native input under the formatted text; theme.js opens the picker. */
.mh-control--date {
	cursor: pointer;
}

.mh-control__value {
	display: none;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mh-js .mh-control--date .mh-control__value {
	display: block;
}

.mh-js .mh-control--date input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.mh-js .mh-control--date input::-webkit-calendar-picker-indicator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Plain text input (enquiry form, newsletter). */
.mh-input {
	width: 100%;
	min-height: 48px;
	padding: 12px;
	border: 1px solid var(--mh-c-line);
	border-radius: var(--mh-radius-control);
	background: var(--mh-c-white);
	color: var(--mh-c-ink);
	font-family: var(--mh-sans);
	font-size: 16px;
	line-height: 24px;
}

.mh-input::placeholder {
	color: var(--mh-c-muted);
	opacity: 1;
}

.mh-input:focus {
	outline: 0;
	border-color: var(--mh-c-ink);
}

.mh-form-note {
	color: var(--mh-muted);
	font-size: var(--mh-fs-small);
	line-height: var(--mh-lh-small);
}

.mh-form-note:empty {
	display: none;
}

/* ------------------------------------------------------------------ */
/* FAQ accordion                                                      */
/* ------------------------------------------------------------------ */

.mh-faq__item {
	border-bottom: 1px solid var(--mh-line);
}

.mh-faq__q {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 16px 0;
	list-style: none;
	cursor: pointer;
}

.mh-faq__q::-webkit-details-marker {
	display: none;
}

.mh-faq__question {
	padding-top: 10px;
	color: var(--mh-heading);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
}

.mh-faq__icon {
	flex: none;
	width: 44px;
	height: 44px;
	padding: 10px;
	color: var(--mh-heading);
	transition: transform 0.2s ease;
}

.mh-faq__item[open] .mh-faq__icon {
	transform: rotate(45deg);
}

.mh-faq__a {
	padding-bottom: 16px;
	color: var(--mh-muted);
	font-size: var(--mh-fs-lead);
	line-height: var(--mh-lh-lead);
}

.mh-faq__a p + p {
	margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Photos with captions                                               */
/* ------------------------------------------------------------------ */

.mh-figure {
	margin: 0;
	min-width: 0;
}

.mh-figure__media {
	overflow: hidden;
	border-radius: var(--mh-radius);
	background: var(--mh-c-line);
}

.mh .mh-figure__media img,
.mh-figure__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.mh-figure__caption {
	margin-top: 10px;
	color: var(--mh-text);
}

/* Photo credit on a full-bleed photo. */
.mh-credit {
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--mh-fs-small);
	line-height: var(--mh-lh-small);
}

/* Horizontal scroll rows (tablet and phone card rows, photo strips). */
.mh-scroll {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--mh-gutter);
	scrollbar-width: none;
}

.mh-scroll::-webkit-scrollbar {
	display: none;
}

.mh-scroll > * {
	flex: none;
	scroll-snap-align: start;
}

/* Bleeds a scroll row to the viewport edge while its first item lines up with the container. */
.mh-bleed {
	margin-inline: calc(-1 * var(--mh-gutter));
	padding-inline: var(--mh-gutter);
}

/* ------------------------------------------------------------------ */
/* Elementor integration                                              */
/* ------------------------------------------------------------------ */

/* Metro House widgets bring their own spacing; remove wrapper gaps around them. */
.elementor-widget[class*="elementor-widget-mh-"],
.elementor-widget[class*="elementor-widget-mh-"] > .elementor-widget-container {
	margin: 0;
	padding: 0;
}
