/*
 * /services/agencja-wynajmu-nieruchomosci/ on the copy of 27.11.2026
 * (eteria-core migrations/rental.php) and its two-goal form (eteria-core
 * rental-form.php). Everything else on the page is the shared sections,
 * blocks and styles.
 */

/* Hero: the three figures of the copy (rating, transactions, the advisor)
 * in one «Linia» row. The block's own rows hold two or four figures
 * (stat/style.css), which leaves three as two plus one; here they share one
 * row from 600 px up: each opens no row but the first, and all stand in the
 * first and the last row. Phones keep the block's two per row. */
@media (min-width: 600px) {

	.e-rental-hero.is-style-section-page-hero .wp-block-group.e-rental-figures.is-layout-grid {
		grid-template-columns: repeat(3, minmax(auto, 1fr));
	}

	.e-rental-hero.is-style-section-page-hero .e-rental-figures.is-layout-grid > :is(.wp-block-eteria-stat, .wp-block-eteria-google-rating):nth-child(n) {
		--e-stat-start: 0;
		--e-stat-first: 1;
		--e-stat-last: 1;
		grid-column: auto;
	}

	.e-rental-hero.is-style-section-page-hero .e-rental-figures.is-layout-grid > :is(.wp-block-eteria-stat, .wp-block-eteria-google-rating):first-child {
		--e-stat-start: 1;
	}
}

/* Contact: the advisor's card beside the form (review of 28.11) — her
 * photo on top, the heading, the hours and the phone under it, in one
 * frame. From a tablet up the card is as tall as the form and the photo
 * takes what the text leaves. */
.e-rental-advisor.wp-block-group {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: var(--wp--preset--color--graphite-mid);
	border: 1px solid var(--wp--preset--color--border-dark);
}

.e-rental-advisor > .wp-block-eteria-agent-card {
	aspect-ratio: 3 / 2;
}

.e-rental-advisor > .wp-block-eteria-agent-card .e-agent-card__photo {
	object-position: 50% 22%;
}

.e-rental-advisor > .wp-block-eteria-agent-card .e-agent-card__info {
	min-height: 140px;
}

@media (min-width: 782px) {

	.e-rental-contact .wp-block-column:has(> .e-rental-advisor) {
		display: flex;
		flex-direction: column;
	}

	.e-rental-advisor.wp-block-group {
		flex: 1 0 auto;
	}

	.e-rental-advisor > .wp-block-eteria-agent-card {
		flex: 1 0 auto;
		min-height: 260px;
	}
}

/* The phone button never splits the number: the card is narrow beside
 * the form on a tablet, where the button spans it in a smaller size. */
.e-rental-advisor .wp-block-button__link {
	white-space: nowrap;
}

@media (min-width: 782px) and (max-width: 1199px) {

	.e-rental-advisor .wp-block-buttons > .wp-block-button {
		flex: 1 1 100%;
	}

	.e-rental-advisor .wp-block-button__link {
		width: 100%;
		padding-inline: 12px;
		font-size: 0.75rem;
		letter-spacing: 0.1em;
	}
}

/* Form ------------------------------------------------------------------- */

/* Each goal's fields sit on the form's own two-column grid. */
.e-rent-form__group {
	display: contents;
}

.e-rent-form__group[hidden] {
	display: none;
}

/* The chosen goal shows its fields without scripts too (and in the editor's
 * canvas); the script adds the button label and disables the hidden half. */
.e-rent-form:has(.e-rent-form__goal .wpcf7-list-item.first input:checked) .e-rent-form__group[data-goal="tenant"],
.e-rent-form:has(.e-rent-form__goal .wpcf7-list-item.last input:checked) .e-rent-form__group[data-goal="owner"] {
	display: none;
}

@media (min-width: 600px) {

	.e-contact-form .wpcf7-form .e-rent-form > .e-rent-form__wide,
	.e-contact-form .wpcf7-form .e-rent-form__group > .e-rent-form__wide {
		grid-column: 1 / -1;
	}
}

.e-contact-form .wpcf7-form .e-rent-form__intro {
	margin: 0;
	color: rgb(240 240 230 / 0.8);
}

/* The goal: a two-way switch (review of 28.11: two boxes drawn like the
 * fields under them did not read as one control). A pill track, the
 * chosen half in cream sliding between the two; the radios stay in the
 * page for the keyboard and screen readers. */
.e-rent-form__goal,
.e-rent-form__anchor {
	scroll-margin-top: 120px;
}

.e-contact-form:not(.is-style-district) .wpcf7-form .e-rent-form__goal .wpcf7-form-control-wrap {
	margin-top: 0;
}

.e-contact-form .wpcf7-form .e-rent-form__goal .wpcf7-radio {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 4px;
	background-color: rgb(240 240 230 / 0.06);
	border: 1px solid rgb(240 240 230 / 0.16);
	border-radius: 999px;
}

.e-contact-form .wpcf7-form .e-rent-form__goal .wpcf7-radio::before {
	content: "";
	position: absolute;
	inset: 4px auto 4px 4px;
	width: calc(50% - 4px);
	background-color: var(--wp--preset--color--cream);
	border-radius: 999px;
	transition: transform 0.25s ease;
}

.e-contact-form .wpcf7-form .e-rent-form__goal .wpcf7-radio:has(.wpcf7-list-item.last input:checked)::before {
	transform: translateX(100%);
}

.e-contact-form .wpcf7-form .e-rent-form__goal .wpcf7-list-item {
	position: relative;
	z-index: 1;
	margin: 0;
	border-radius: 999px;
}

.e-contact-form:not(.is-style-district) .wpcf7-form .e-rent-form__goal .wpcf7-list-item label {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 6px 16px;
	text-align: center;
	cursor: pointer;
}

.e-contact-form .wpcf7-form .e-rent-form__goal input[type="radio"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.e-contact-form:not(.is-style-district) .wpcf7-form .e-rent-form__goal .wpcf7-list-item-label {
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 400;
	line-height: 1.25;
	color: rgb(240 240 230 / 0.75);
	transition: color 0.25s ease;
}

.e-contact-form:not(.is-style-district) .wpcf7-form .e-rent-form__goal .wpcf7-list-item:has(input:checked) .wpcf7-list-item-label {
	font-weight: 500;
	color: var(--wp--preset--color--graphite);
}

.e-contact-form .wpcf7-form .e-rent-form__goal .wpcf7-list-item:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}

.e-contact-form:not(.is-style-district) .wpcf7-form .e-rent-form__goal .wpcf7-list-item:not(:has(input:checked)):hover .wpcf7-list-item-label {
	color: var(--wp--preset--color--cream);
}

/* The privacy note sits under the button: no extra margin in the grid. */
.e-contact-form .wpcf7-form .e-rent-form .e-contact-form__note {
	margin: 0;
}

/* Closing banner: the phone under the two goals, a gold link with the
 * phone icon rather than a third box. */
.e-rental-closing .wp-block-button.is-style-ghost .wp-block-button__link {
	gap: 10px;
	padding: 6px 0;
	color: var(--wp--preset--color--gold);
}

.e-rental-closing .wp-block-button.is-style-ghost .wp-block-button__link::before {
	content: "";
	width: 1rem;
	height: 1rem;
	background-color: currentcolor;
	mask: url(../../icons/phone.svg) center / contain no-repeat;
}

.e-rental-closing .wp-block-button.is-style-ghost .wp-block-button__link:hover {
	color: var(--wp--preset--color--text-inverse);
}
