/*
 * WayHome: listing index (every keyword URL and /property-search/).
 */

.index-header {
	padding-block: var(--space-m) var(--space-s);
	background-color: var(--color-bg-alt);
}

/*
 * The section size rather than the full page H1: the listing index is a tool
 * and the filters and results are what the page is for, so its title stays a
 * step smaller than an editorial page's. 26px on a phone to 34px on a laptop.
 */
.index-header h1 {
	margin: 0;
	font-size: var(--step-section);
	letter-spacing: var(--tracking-tight);
}

.index-header__count {
	margin: var(--space-2xs) 0 0;
	font-size: var(--step-ui);
	color: var(--color-text-muted);
}

.index-header__intro {
	max-width: var(--measure);
	margin-top: var(--space-s);
	color: var(--color-text-muted);
}

.index-header__intro p {
	margin: 0 0 var(--space-2xs);
}

/* --- Filter bar ----------------------------------------------------------- */

.filter-bar {
	margin-block: var(--space-s) var(--space-m);
	padding: var(--card-pad);
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-1);
}

.filter-bar__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs);
	margin-bottom: var(--space-s);
}

.filter-bar__tab {
	padding: var(--space-2xs) var(--space-s);
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--step--1);
	color: var(--color-text);
	text-decoration: none;
	background-color: var(--color-surface);
	border-radius: var(--radius-pill);
}

.filter-bar__tab:hover {
	background-color: var(--azure-100);
	color: var(--color-text);
}

.filter-bar__tab.is-on {
	color: var(--color-text-invert);
	background-color: var(--navy-900);
}

/*
 * Area, type and bedrooms, each full width on a phone and three equal columns
 * on a desktop, with the submit button on the end. Price, furnishing,
 * completion and sort are in the "More filters" disclosure below, which the
 * template opens whenever one of them is set.
 */
.filter-bar__row {
	display: grid;
	gap: var(--space-s);
	grid-template-columns: 1fr;
	align-items: end;
}

@media (width >= 700px) {
	.filter-bar__row {
		grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	}
}

.filter-bar__form .field {
	margin: 0;
	min-width: 0;
}

.filter-bar__actions {
	display: flex;
	align-items: center;
	gap: var(--space-s);
	margin: 0;
}

.filter-bar__actions .btn {
	width: 100%;
}

@media (width >= 700px) {
	.filter-bar__actions .btn {
		width: auto;
	}
}

.filter-bar__reset {
	margin: var(--space-s) 0 0;
}

.filter-bar__clear {
	font-size: var(--step--1);
}

/* --- Empty state ---------------------------------------------------------- */

.p-empty {
	max-width: var(--measure);
	margin-block: var(--space-xl);
	padding: var(--space-l);
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-l);
}

/*
 * A panel heading, not a section heading. The section scale is 56px at desktop
 * and that is far too loud inside a 68ch box that is telling somebody there is
 * nothing here.
 */
.p-empty h2 {
	margin-top: 0;
	max-width: none;
	font-size: var(--step-3);
	line-height: var(--lh-heading);
}

.p-empty__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs) var(--space-m);
	margin: var(--space-s) 0;
	padding: 0;
	list-style: none;
}

.p-empty__actions {
	margin-bottom: 0;
}

/* --- Internal link blocks -------------------------------------------------- */

.link-blocks__grid {
	display: grid;
	gap: var(--space-m);
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	margin-top: var(--space-m);
}

.link-block {
	padding: var(--space-s);
	background-color: var(--color-bg-alt);
	border-radius: var(--radius-l);
}

.link-block__title {
	margin: 0 0 var(--space-2xs);
	font-size: var(--step-0);
}

.link-block__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.link-block__list li {
	display: flex;
	justify-content: space-between;
	gap: var(--space-2xs);
	padding-block: var(--space-3xs);
	border-bottom: 1px solid var(--color-border);
}

.link-block__list li:last-child {
	border-bottom: 0;
}

.link-block__count {
	flex: none;
	font-size: var(--step--1);
	color: var(--color-text-muted);
	font-variant-numeric: tabular-nums;
}

.link-blocks__more {
	margin-top: var(--space-m);
	font-family: var(--font-heading);
	font-weight: 700;
}

.link-blocks__more .icon {
	width: 1em;
	height: 1em;
	vertical-align: -0.1em;
}

/* --- Search widget on an index -------------------------------------------- */

.wh-listing-index .pagination {
	margin-block: var(--space-l) var(--space-2xl);
}
/*
 * WayHome: the property card and the grid it sits in.
 *
 * Shared by the listing index, the "similar properties" block and (from
 * Phase 4) the place pages, so it lives in its own sheet rather than being
 * written twice.
 */

.p-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
	gap: var(--space-m);
	margin-block: var(--space-l);
}

.p-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-l);
	transition:
		box-shadow var(--dur) var(--ease),
		transform var(--dur) var(--ease),
		border-color var(--dur) var(--ease);
}

.p-card:hover,
.p-card:has(:focus-visible) {
	border-color: transparent;
	box-shadow: var(--shadow-2);
	transform: translateY(-2px);
}

.p-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background-color: var(--grey-100);
}

.p-card__media-link {
	display: block;
	height: 100%;
}

.p-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--dur-slow) var(--ease);
}

.p-card:hover .p-card__media img {
	transform: scale(1.04);
}

.p-card .media--empty {
	width: 100%;
	height: 100%;
}

.p-card__badges {
	position: absolute;
	inset-block-start: var(--space-2xs);
	inset-inline-start: var(--space-2xs);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs);
	max-width: calc(100% - var(--space-xl));
}

.p-card__ribbon {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	margin: 0;
	padding: var(--space-2xs) var(--space-s);
	font-family: var(--font-heading);
	font-weight: 700;
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	font-size: var(--step--1);
	color: var(--color-text-invert);
	background-color: rgb(29 41 62 / 88%);
}

.p-card__whatsapp {
	position: absolute;
	inset-block-start: var(--space-2xs);
	inset-inline-end: var(--space-2xs);
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	color: var(--color-text-invert);
	background-color: var(--color-whatsapp);
	border-radius: var(--radius-pill);
	box-shadow: var(--shadow-1);
}

.p-card__whatsapp:hover {
	background-color: var(--whatsapp-dark);
}

.p-card__whatsapp .icon {
	width: 1.1rem;
	height: 1.1rem;
}

.p-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--space-2xs);
	padding: var(--card-pad);
}

.p-card__price {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--step-2);
	font-weight: var(--weight-heading-strong);
	font-variant-numeric: tabular-nums;
	letter-spacing: var(--tracking-snug);
	line-height: var(--lh-tight);
}

.p-card__title {
	margin: 0;
	max-width: none;
	font-family: var(--font-heading);
	font-size: var(--step-1);
	font-weight: var(--weight-heading);
	line-height: var(--lh-heading);
	letter-spacing: var(--tracking-snug);
	text-wrap: balance;
}

.p-card__title a {
	color: var(--color-text);
	text-decoration: none;
}

.p-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.p-card__title a:hover {
	color: var(--color-link);
}

.p-card__where {
	display: flex;
	align-items: center;
	gap: var(--space-3xs);
	margin: 0;
	font-size: var(--step--1);
	color: var(--color-text-muted);
}

.p-card__where .icon {
	flex: none;
	width: 0.9rem;
	height: 0.9rem;
	color: var(--color-link);
}

.p-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs) var(--space-s);
	margin: auto 0 0;
	padding: var(--space-2xs) 0 0;
	list-style: none;
	border-top: 1px solid var(--color-border);
	font-size: var(--step--1);
}

.p-card__facts li {
	display: flex;
	align-items: center;
	gap: var(--space-3xs);
}

.p-card__facts .icon {
	width: 1rem;
	height: 1rem;
	color: var(--color-text-muted);
}

.p-card__ref {
	margin: 0;
	font-size: var(--step--1);
	color: var(--grey-400);
	letter-spacing: var(--tracking-wide);
}

.p-card--closed .p-card__media img {
	filter: grayscale(0.55);
}

@media print {
	.p-card__whatsapp {
		display: none;
	}
}
/*
 * WayHome: the Buy / Rent / Holiday homes search widget.
 *
 * Loaded wherever the widget renders (the home page today, the header search
 * later), not by template, because the widget is a component.
 */

.search-widget {
	margin-top: var(--space-m);
	padding: var(--card-pad);
	background-color: var(--color-bg);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-2);
	text-align: start;
}

.search-widget__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs);
	margin-bottom: var(--space-s);
}

.search-widget__tab {
	padding: var(--space-2xs) var(--space-m);
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--step--1);
	color: var(--color-text);
	background-color: var(--color-surface);
	border: 0;
	border-radius: var(--radius-pill);
	cursor: pointer;
}

.search-widget__tab:hover {
	background-color: var(--azure-100);
}

.search-widget__tab.is-on {
	color: var(--color-text-invert);
	background-color: var(--navy-900);
}

/*
 * Where, Type and Beds, each full width on a phone and three equal columns on
 * a desktop, with the submit button on the end of the row. Anything else the
 * widget can ask for lives in the "More filters" disclosure below.
 */
.search-widget__row {
	display: grid;
	gap: var(--space-s);
	grid-template-columns: 1fr;
	align-items: end;
}

@media (width >= 700px) {
	.search-widget__row {
		grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
	}
}

/* --------------------------------------------------------------------------
 * The glass strip
 *
 * Over the hero photograph the widget is a dark translucent bar with hairline
 * dividers between the fields, the way the best listing sites in this market
 * do it. The fields themselves lose their boxes: on a dark bar a white input
 * is a row of five bright rectangles, where a label over a value reads as one
 * control. Everything keeps its real <label> and <select>, so nothing changes
 * for a screen reader or for a visitor with scripting off.
 * ----------------------------------------------------------------------- */

.search-widget--glass {
	max-width: 68rem;
	margin-top: var(--space-l);
	padding: var(--space-s);
	background-color: rgb(9 16 30 / 55%);
	backdrop-filter: blur(14px);
	border: 1px solid rgb(255 255 255 / 16%);
	border-radius: var(--radius-l);
	box-shadow: 0 18px 48px rgb(9 16 30 / 28%);
	color: var(--white);
}

.search-widget--glass .search-widget__tab {
	color: rgb(255 255 255 / 82%);
	background-color: rgb(255 255 255 / 10%);
}

.search-widget--glass .search-widget__tab:hover {
	background-color: rgb(255 255 255 / 20%);
	color: var(--white);
}

.search-widget--glass .search-widget__tab.is-on {
	background-color: var(--white);
	color: var(--ink);
}

.search-widget--glass .field__label {
	font-size: var(--step--2);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--tracking-eyebrow);
	color: rgb(255 255 255 / 72%);
}

.search-widget--glass :is(select, input[type="text"], input[type="number"]) {
	min-height: 2.25rem;
	padding-inline: 0;
	font-family: var(--font-heading);
	font-size: var(--step-0);
	font-weight: var(--weight-heading);
	color: var(--white);
	background-color: transparent;
	border: 0;
	border-radius: 0;
}

.search-widget--glass select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5 12 15.5 18 9.5'/%3E%3C/svg%3E");
	background-position: right 0 center;
	padding-inline-end: 1.6rem;
}

/* The native menu is painted by the OS, so its options need a real surface. */
.search-widget--glass select option {
	color: var(--ink);
	background-color: var(--white);
}

.search-widget--glass :is(select, input):focus {
	outline: 3px solid var(--white);
	outline-offset: 4px;
	background-color: transparent;
}

.search-widget--glass ::placeholder {
	color: rgb(255 255 255 / 60%);
}

@media (width >= 900px) {
	/* Where takes the extra room: it is the only field with a long value. */
	.search-widget--glass .search-widget__row {
		grid-template-columns: 1.5fr 1fr 0.8fr auto auto;
		gap: 0;
		align-items: center;
	}

	/* Hairlines between the fields, never before the first one. */
	.search-widget--glass .search-widget__row > * {
		padding-inline: var(--space-m);
	}

	.search-widget--glass .search-widget__row > *:first-child {
		padding-inline-start: var(--space-2xs);
	}

	.search-widget--glass .search-widget__row > * + *:not(.search-widget__submit) {
		border-inline-start: 1px solid rgb(255 255 255 / 18%);
	}

	.search-widget--glass .search-widget__submit {
		padding-inline-end: 0;
	}

	.search-widget--glass .search-widget__submit .btn {
		width: auto;
		min-height: var(--control-height-lg);
		padding-inline: var(--space-l);
	}

	/*
	 * "More filters" becomes the fifth cell of the strip and its panel drops
	 * out underneath, so opening it does not push the button off the row.
	 */
	.search-widget--glass .more-filters {
		position: relative;
		margin-block-start: 0;
		align-self: center;
	}

	.search-widget--glass .more-filters__panel {
		position: absolute;
		inset-inline-end: 0;
		inset-block-start: calc(100% + var(--space-s));
		z-index: var(--z-mega);
		width: max-content;
		min-width: 22rem;
		margin-block-start: 0;
		padding: var(--space-m);
		background-color: var(--white);
		border: 1px solid var(--color-border);
		border-radius: var(--radius-l);
		box-shadow: var(--shadow-2);
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.search-widget--glass .more-filters__panel .field__label {
		color: var(--color-text-muted);
	}

	.search-widget--glass .more-filters__panel input {
		min-height: var(--control-height);
		padding: 12px 14px;
		font-family: var(--font-body);
		font-weight: 400;
		color: var(--ink);
		border: 1px solid var(--color-border-field);
		border-radius: var(--radius-m);
	}

	.search-widget--glass .more-filters__panel input:focus {
		outline: 3px solid var(--color-focus);
		outline-offset: 2px;
	}
}

.search-widget--glass .more-filters > summary {
	font-family: var(--font-heading);
	font-size: var(--step--1);
	font-weight: var(--weight-heading-strong);
	color: var(--white);
	text-decoration: none;
	white-space: nowrap;
}

.search-widget--glass .more-filters > summary:hover {
	color: var(--white);
	text-decoration: underline;
}

.search-widget--glass .search-widget__list {
	color: var(--ink);
}

.search-widget .field {
	margin: 0;
	min-width: 0;
}

.search-widget .field select,
.search-widget .field input {
	width: 100%;
}

.search-widget__submit {
	margin: 0;
}

.search-widget__submit .btn {
	width: 100%;
}

/* --- Combobox ------------------------------------------------------------- */

.search-widget__combo {
	position: relative;
	display: block;
}

/* The attribute wins over the class until the script removes it. */
.search-widget__combo[hidden] {
	display: none;
}

.search-widget__input {
	width: 100%;
}

.search-widget__list {
	position: absolute;
	z-index: var(--z-mega);
	inset-inline: 0;
	inset-block-start: calc(100% + 4px);
	max-height: 18rem;
	overflow-y: auto;
	margin: 0;
	padding: var(--space-3xs);
	list-style: none;
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-m);
	box-shadow: var(--shadow-2);
}

.search-widget__option {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2xs);
	padding: var(--space-2xs) var(--space-xs);
	border-radius: var(--radius-s);
	cursor: pointer;
}

.search-widget__option.is-active,
.search-widget__option:hover {
	background-color: var(--azure-100);
}

.search-widget__option-label {
	font-weight: 500;
}

.search-widget__option-kind {
	flex: none;
	font-size: var(--step--1);
	color: var(--color-text-muted);
}
/*
 * WayHome: lead forms.
 *
 * Only what the theme's components.css does not already cover. Field, label,
 * hint, error, reference, required marker and button styling come from the
 * theme; this file adds the layout, the honeypot, the choice rows, the notices
 * and the dialog. Every custom property carries a fallback, so a form still
 * looks right if it is rendered on a page that has not loaded tokens.css.
 *
 * This sheet is enqueued after the theme's bundle, so anything declared here at
 * the same specificity wins. Nothing the theme is meant to own may be set here.
 */

.wh-form-wrap {
	display: flow-root;
	max-width: 46rem;
}

.wh-form__title {
	margin: 0 0 var(--space-2xs, 0.5rem);
	font-family: var(--font-heading, system-ui, sans-serif);
	line-height: var(--lh-heading, 1.2);
}

.wh-form__intro {
	margin: 0 0 var(--space-m, 1.5rem);
	color: var(--color-text-muted, #484848);
}

.wh-form {
	display: flex;
	flex-direction: column;
	gap: var(--wh-form-gap, 0.75rem);
}

.wh-form__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wh-form-gap, 0.75rem);
}

@media (min-width: 40em) {
	.wh-form__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wh-form__grid > .field {
		grid-column: 1 / -1;
	}

	.wh-form__grid > .field--half {
		grid-column: auto;
	}
}

.wh-form-wrap--compact .wh-form__grid {
	grid-template-columns: 1fr;
}

/* The theme styles .field; these only fill the gaps. */

.field--checkbox_group {
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.field__error[hidden] {
	display: none;
}

.field__error::before {
	content: "!";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 1.1em;
	block-size: 1.1em;
	margin-inline-end: 0.35em;
	font-weight: 700;
	color: var(--white, #fff);
	background-color: var(--coral-700, #c63b40);
	border-radius: var(--radius-pill, 999px);
}

/* --- Choices ----------------------------------------------------------- */

.wh-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: var(--space-2xs, 0.5rem);
	margin-block-start: var(--space-3xs, 0.25rem);
}

.wh-choice {
	display: flex;
	align-items: flex-start;
	gap: var(--space-2xs, 0.5rem);
	padding: var(--space-2xs, 0.5rem);
	line-height: var(--lh-ui, 1.35);
	border-radius: var(--radius-m, 8px);
	cursor: pointer;
}

.wh-choice:hover {
	background-color: var(--grey-100, #f7f7f7);
}

.wh-choice input[type="checkbox"] {
	inline-size: 1.25rem;
	block-size: 1.25rem;
	min-block-size: 0;
	margin-block-start: 0.15em;
	flex: none;
	accent-color: var(--coral-700, #c63b40);
}

.field--consent {
	font-size: var(--step--1, 0.875rem);
}

.field--consent .wh-choice {
	padding-inline: 0;
}

.field--consent .wh-choice:hover {
	background-color: transparent;
}

/* --- Honeypot ----------------------------------------------------------
 * Off screen rather than display:none, because the simplest bots skip
 * anything that is display none and fill everything else.
 * -------------------------------------------------------------------- */

.wh-hp {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --- Reference row -------------------------------------------------------
 * A quiet line of context, not a highlighted panel. The theme sets the size
 * and the colour; only the line-up belongs here.
 * ---------------------------------------------------------------------- */

.wh-form__ref {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs, 0.25rem);
	align-items: baseline;
	margin: 0;
}

/* --- Actions, status, notices ------------------------------------------- */

.wh-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s, 1rem);
	align-items: center;
}

.wh-form__busy {
	font-size: var(--step--1, 0.875rem);
	color: var(--color-text-muted, #484848);
}

.wh-form__busy[hidden] {
	display: none;
}

.wh-form__status:empty {
	display: none;
}

.wh-form__notice,
.wh-form__status:not(:empty) {
	padding: var(--space-xs, 0.75rem) var(--space-s, 1rem);
	margin-block-end: var(--space-m, 1.5rem);
	background-color: var(--color-bg-alt, #eef8fb);
	border-inline-start: 4px solid var(--sky-700, #0b6a7e);
	border-radius: var(--radius-s, 4px);
}

.wh-form__notice--error,
.wh-form__status--error {
	border-inline-start-color: var(--coral-700, #c63b40);
}

.wh-form__done[hidden] {
	display: none;
}

.wh-form__done {
	padding: var(--space-s, 1rem);
	background-color: var(--color-bg-alt, #eef8fb);
	border-inline-start: 4px solid var(--sky-700, #0b6a7e);
	border-radius: var(--radius-s, 4px);
}

.wh-form__done p {
	margin: 0 0 var(--space-2xs, 0.5rem);
}

.wh-form__done p:last-child {
	margin-block-end: 0;
}

.wh-form[data-wayhome-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

.wh-form__turnstile {
	min-block-size: 65px;
}

/* --- Dialog ------------------------------------------------------------- */

.wh-dialog {
	inline-size: min(34rem, calc(100vw - 2rem));
	padding: 0;
	color: var(--color-text, #111);
	background-color: var(--color-bg, #fff);
	border: 1px solid var(--color-border, #ebebeb);
	border-radius: var(--radius-l, 16px);
	box-shadow: var(--shadow-2, 0 12px 32px rgb(17 17 17 / 18%));
}

.wh-dialog::backdrop {
	background-color: rgb(17 17 17 / 55%);
}

.wh-dialog__inner {
	position: relative;
	padding: var(--space-l, 2rem);
}

.wh-dialog__close {
	position: absolute;
	inset-block-start: var(--space-2xs, 0.5rem);
	inset-inline-end: var(--space-2xs, 0.5rem);
}

.wh-dialog .wh-form-wrap {
	max-width: none;
}

@media (prefers-reduced-motion: reduce) {
	.wh-form,
	.wh-choice {
		transition: none;
	}
}