/*
 * The house page's date bar and offer band — Task 008-11, 2026-11-15.
 * Loaded only on a house page, only when inc/house-booking-row.php draws
 * the bar there. Ana chose from docs/design/kuca-ispod-heroja-reference.html
 * ("Drugi krug" R2, §2 arrangement d, §3): the glance row first, full width;
 * the bar as a white card centred under it (T1); the offer as a quiet band
 * across the whole width under the section (drawn after it, see the PHP).
 * Moved here from style.css (014-6's block, ~line 1510), so the bar's
 * house-page dress lives in one file the parallel sessions do not share.
 *
 * WHY THE FIELDS GET A REAL EDGE. Until now a date field was only a bottom
 * line in `border` (#DDDBD8): 1.29:1 on the page (#F8F7F3), 1.38:1 on
 * white — under the 3:1 a form field's boundary needs (WCAG 1.4.11), so
 * "dd.mm.yyyy." read as a label. A white card alone does not fix it:
 * white on the page is 1.07:1. The edge is `muted` (#696663): 5.70:1 on
 * the white card, 5.32:1 on the page. Measured from the hex values
 * (sRGB relative luminance), 2026-11-15.
 *
 * THE BUTTON keeps 014-6's house colour (`--vm-color-deep`, text
 * `--vm-color-on-accent` = white): Filaus 5.81:1, Casa Laurea 11.58:1,
 * Palmotta 10.09:1, Diamond 6.99:1.
 *
 * Tokens only. The few plain numbers are sizes (a field's width, the
 * icon's size, two corner radii from the drawing), not colour, type or
 * spacing.
 */

/* -- The stack: glance row, then the card ------------------------------- */

.vm-property-facts__inner:has( > .vm-property-facts__book ) {
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: flex-start;
	gap: var( --wp--preset--spacing--30 );
}

.vm-property-facts__inner:has( > .vm-property-facts__book ) > * {
	margin-block: 0;
}

/* Position only — what the row looks like is Task 008-10's. Today's pills
   (until 008-10's glance style replaces them) sit centred above the
   centred card instead of hanging on the left. */
.vm-property-facts__inner:has( > .vm-property-facts__book ) > .vm-fact-row {
	width: 100%;
}

.vm-property-facts__inner:has( > .vm-property-facts__book ) > .vm-fact-row--pill {
	justify-content: center;
}

.vm-property-facts__book {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	min-width: 0;
}

/* -- The card (T1) ------------------------------------------------------ */

.vm-property-facts__book .vma-stay {
	margin: 0;
	max-width: 100%;
	/* Book now lands here: a little air between the header and the card. */
	scroll-margin-top: var( --wp--preset--spacing--20 );
}

.vm-property-facts__book .vma-stay__form,
.vm-property-facts__book .vma-stay__offline {
	background-color: var( --wp--preset--color--white );
	border: 0;
	border-radius: 4px;
	box-shadow: 0 var( --wp--preset--spacing--10 ) var( --wp--preset--spacing--30 ) color-mix( in srgb, var( --wp--preset--color--contrast ) 12%, transparent );
	padding: var( --wp--preset--spacing--20 );
}

/* The rule-12 line ("Online booking is temporarily unavailable…") in the
   same card — information, so it keeps a readable measure. */
.vm-property-facts__book .vma-stay__offline {
	max-width: 32rem;
	margin: 0;
}

/* Fields and button on one grid; each field's label / box / message are
   rows of it (subgrid), so the button lines up with the boxes whether or
   not a message is showing under them. */
.vm-property-facts__book .vma-stay__row {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 12.25rem ) ) auto;
	grid-template-rows: auto auto auto;
	column-gap: calc( var( --wp--preset--spacing--20 ) * 0.75 );
	row-gap: 0;
	align-items: stretch;
}

.vm-property-facts__book .vma-stay__field {
	display: grid;
	grid-row: 1 / span 3;
	grid-template-rows: subgrid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 0;
	min-width: 0;
}

.vm-property-facts__book .vma-stay__label {
	grid-row: 1;
	margin-bottom: calc( var( --wp--preset--spacing--10 ) * 0.9 );
}

.vm-property-facts__book .vma-stay__input {
	grid-row: 2;
	grid-column: 1;
	background-color: var( --wp--preset--color--white );
	border: 1px solid var( --wp--preset--color--muted );
	border-radius: 3px;
	color: var( --wp--preset--color--contrast );
	font-size: var( --wp--preset--font-size--small );
	line-height: var( --wp--custom--typography--title-line-height );
	padding: calc( var( --wp--preset--spacing--20 ) * 0.7 ) calc( var( --wp--preset--spacing--20 ) * 0.75 );
	width: 100%;
}

.vm-property-facts__book .vma-stay__input[aria-invalid="true"] {
	border-color: var( --wp--preset--color--contrast );
	box-shadow: inset 0 0 0 1px var( --wp--preset--color--contrast );
}

.vm-property-facts__book .vma-stay__error {
	grid-row: 3;
	margin-top: calc( var( --wp--preset--spacing--10 ) * 0.75 );
	max-width: 100%;
}

.vm-property-facts__book .vma-stay__submit {
	grid-row: 2;
	grid-column: 3;
	align-self: stretch;
	white-space: nowrap;
	padding-inline: calc( var( --wp--preset--spacing--20 ) * 1.25 );
}

/*
 * The calendar icon inside the box, in the house's colour (the drawing's
 * `.cal`). Chrome and Safari: the browser's own picker button stays where
 * it is and still opens the calendar — it is only made invisible, and our
 * icon is drawn over it without catching the click. Firefox does not know
 * this pseudo-element, skips the block, and shows its own icon instead —
 * one icon in every browser, never two. The mask's colour is irrelevant
 * (only its shape is used); the fill is the house token.
 */
@supports selector( ::-webkit-calendar-picker-indicator ) {
	.vm-property-facts__book .vma-stay__field::after {
		content: "";
		grid-row: 2;
		grid-column: 1;
		justify-self: end;
		align-self: center;
		width: 1.125rem;
		height: 1.125rem;
		margin-inline-end: calc( var( --wp--preset--spacing--20 ) * 0.75 );
		background-color: var( --vm-color-primary, var( --wp--preset--color--accent ) );
		-webkit-mask: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='1.5'/%3E%3Cpath d='M3.5 9.5h17M8 3v4M16 3v4'/%3E%3C/svg%3E" ) center / contain no-repeat;
		mask: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='1.5'/%3E%3Cpath d='M3.5 9.5h17M8 3v4M16 3v4'/%3E%3C/svg%3E" ) center / contain no-repeat;
		pointer-events: none;
	}

	.vm-property-facts__book .vma-stay__input::-webkit-calendar-picker-indicator {
		cursor: pointer;
		height: 1.125rem;
		margin: 0;
		opacity: 0;
		padding: 0;
		width: 1.125rem;
	}
}

/* "See accommodation", a quiet text link under the card. */
.vm-property-facts__rooms {
	margin: calc( var( --wp--preset--spacing--10 ) * 1.25 ) 0 0;
	font-size: var( --wp--preset--font-size--small );
	text-align: center;
}

.vm-property-facts__rooms a {
	color: var( --vm-color-deep, var( --wp--preset--color--contrast ) );
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* -- The offer band: full width, after the section ---------------------- */

.vm-house-offers {
	background-color: var( --wp--preset--color--surface );
	border-block: 1px solid var( --wp--preset--color--border );
}

/* border-box, as the facts row's own container is, so the band's text
   starts where the page's text does (139px at 1440, 24px at 390). */
.vm-house-offers__inner {
	box-sizing: border-box;
	padding-block: var( --wp--preset--spacing--20 );
}

/* 013-4's rule gives the line a bottom margin with !important (it sat
   above the bar then), and the list has its own side padding for /offers/;
   in the band the container's padding and the band's own do both jobs. */
.vm-house-offers .vm-offer-list.vm-offer-list--house {
	margin-block: 0 !important;
	max-width: none;
	padding-inline: 0;
}

/* -- Phone: the same order; two dates side by side, the button under ---- */

@media ( max-width: 600px ) {
	.vm-property-facts__book {
		align-self: stretch;
		align-items: stretch;
	}

	.vm-property-facts__book .vma-stay__row {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		grid-template-rows: auto auto auto auto;
		column-gap: calc( var( --wp--preset--spacing--10 ) * 1.25 );
	}

	.vm-property-facts__book .vma-stay__submit {
		grid-row: 4;
		grid-column: 1 / -1;
		margin-top: calc( var( --wp--preset--spacing--10 ) * 1.5 );
		min-height: 2.75rem; /* a 44px touch target, the boxes' own height */
		padding-block: calc( var( --wp--preset--spacing--20 ) * 0.75 );
	}

	.vm-property-facts__book .vma-stay__input {
		padding-inline: calc( var( --wp--preset--spacing--20 ) * 0.625 );
	}

	.vm-property-facts__book .vma-stay__field::after {
		margin-inline-end: calc( var( --wp--preset--spacing--20 ) * 0.625 );
	}

	.vm-property-facts__book .vma-stay__offline {
		max-width: none;
	}

	.vm-property-facts__rooms {
		text-align: left;
	}
}
