/**
 * Space enquiry form - the few things class parity alone cannot express.
 *
 * The form is styled by the child theme, not by this file: the widget wrapper
 * is given `venues-single-v3 venues-v3-sidebar` in
 * class-venues-enquiry-space-form.php, so venues-onelisting/style.css
 * (1966-2080) styles it exactly as it styles the venue form. Only the four
 * rules below are needed on top, and each exists to undo something another
 * stylesheet does specifically to the Directorist sidebar.
 *
 * Loaded only while space pages are switched on, and declared to depend on the
 * child theme stylesheet so it always follows it in source order.
 */

/**
 * 1. Undo the child theme's hard hide.
 *
 * venues-onelisting/style.css:4847 hides the widget outright, so the markup
 * would render into a display:none card and nothing would be visible. The
 * selector is repeated verbatim so specificity matches and source order decides.
 */
body.single-at_biz_dir.venues-single-space .directorist-sidebar .directorist-card.widget_block:has(.venues-directorist-enquiry-sidebar) {
	display: block;
}

/**
 * 2. Strip the Directorist widget card's own chrome.
 *
 * The form now draws its own white card (style.css:1966), so leaving the outer
 * card in place would stack one card inside another.
 *
 * `overflow` matters as much as the rest: Directorist sets `overflow: hidden`
 * on .directorist-card, which crops anything drawn outside the box. The form's
 * shadow is `0 18px 42px` -- entirely outside its own border box -- so it was
 * being applied and then clipped away, present in the computed styles but
 * invisible on the page.
 */
body.single-at_biz_dir.venues-single-space .directorist-sidebar .directorist-card.widget_block:has(.venues-directorist-enquiry-sidebar),
body.single-at_biz_dir.venues-single-space .directorist-sidebar .directorist-card.widget_block:has(.venues-directorist-enquiry-sidebar) > .directorist-card__body {
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
	padding: 0;
}

/**
 * 3. Drop the sticky positioning that comes with `.venues-v3-sidebar`.
 *
 * style.css:1956 sticks that container against the v3 nav bar. Space pages have
 * no such nav, so the offset would be measured against a bar that is not there.
 */
body.single-at_biz_dir.venues-single-space .venues-directorist-enquiry-sidebar.venues-v3-sidebar {
	position: static;
	top: auto;
}

/**
 * 4. Restore the select boxes.
 *
 * Directorist's own sidebar styling (`.directorist-sidebar .directorist-card
 * select`, main.css) restyles them as underlined fields: it removes the top,
 * right and left borders, zeroes the radius and drops the side padding. That
 * selector scores 0-2-1, exactly tying the theme's `.venues-v3-sidebar
 * .directorist-enquiry-form select` (style.css:2027), and it wins on source
 * order -- so the selects come out borderless while the inputs, which
 * Directorist does not target, look correct.
 *
 * Re-stating the box here at 0-4-1 settles it. The border colour is the one
 * value that has to be repeated rather than inherited, because main.css also
 * sets `border-bottom` explicitly; keep it in step with style.css:2027 if the
 * theme palette changes.
 */
body.single-at_biz_dir.venues-single-space .directorist-sidebar .directorist-card .directorist-enquiry-form select {
	border: 1px solid #dfe3e8;
	border-radius: 6px;
	padding: 8px 10px;
	height: auto;
	min-height: 38px;
}
