/* Bute Park – Conference centre hire forms.
 * Inherits the theme's fonts. Adjust the custom properties to match the site.
 * Sizes are in px, not rem: the site sets the root font size to 10px. */

.bp-hire {
	--bp-accent: #2e6b30;
	--bp-error: #b3261e;
	--bp-border: #c9ccc9;
	--bp-muted: #555;
	--bp-section-bg: #f2f5f0;   /* Shade behind each form section */
	--bp-card-bg: #fff;          /* Cost summary / booking panels */
	--bp-focus: #ffbf47;
	--bp-option-indent: 10px;    /* Nudges radios and checkboxes in from the left */
	--bp-sticky-top: 24px;     /* Increase if the site has a fixed header */
	--bp-aside-width: 320px;

	max-width: none;
}

.bp-hire [hidden] { display: none !important; }

/* ---------- Two-column layout: form + sticky summary ----------
 * Switches on the width of the form itself (not the screen), so it works
 * whatever the theme's content width. Below that it stacks, summary last. */

.wpcf7-form:has(> .bp-hire) { container-type: inline-size; }

/* The theme's .wrapper has overflow: hidden, which stops sticky positioning working.
   On pages with this form: clip horizontally only (keeps the off-canvas menu hidden
   without breaking sticky), and display: flow-root so the wrapper still grows to
   contain the footer – without it the footer gets clipped off the page. */
.wrapper:has(.bp-hire) {
	overflow: visible;
	overflow-x: clip;
	display: flow-root;
}

.bp-aside { margin-top: 24px; }

@container (min-width: 832px) {
	.bp-hire {
		display: grid;
		grid-template-columns: minmax(0, 1fr) var(--bp-aside-width);
		gap: 32px;
	}
	.bp-aside {
		align-self: start;
		margin-top: 0;
		position: sticky;
		top: var(--bp-sticky-top);
		max-height: calc(100vh - var(--bp-sticky-top) - 16px);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

/* Account for the WordPress admin bar when logged in. */
.admin-bar .bp-hire { --bp-sticky-top: calc(24px + 32px); }

/* ---------- Sections ---------- */

.bp-section {
	margin: 0 0 24px;
	padding: 24px 28px;
	background: var(--bp-section-bg);
	border-radius: 8px;
}
.bp-section > h2 {
	margin: 0 0 20px;
	padding-bottom: 9.6px;
	border-bottom: 2px solid var(--bp-accent);
}
.bp-section h3 { margin: 28px 0 12px; }
.bp-section > .bp-field:last-child,
.bp-section > fieldset:last-child { margin-bottom: 0; }

.bp-field {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
	min-width: 0;
}
.bp-field > label,
.bp-field > legend {
	display: block;
	font-weight: 700;
	margin: 0 0 5.6px;
	padding: 0;
}
.bp-req { font-weight: 400; color: var(--bp-muted); font-size: .9em; }
.bp-help { color: var(--bp-muted); margin: 0 0 8px; font-size: .95em; }

.bp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(192px, 1fr)); gap: 0 24px; }

/* ---------- Inputs ---------- */

.bp-hire input[type="text"],
.bp-hire input[type="email"],
.bp-hire input[type="tel"],
.bp-hire input[type="date"],
.bp-hire select,
.bp-hire textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 9.6px 11.2px;
	border: 2px solid var(--bp-border);
	border-radius: 4px;
	font: inherit;
	background: #fff;
}
.bp-hire select,
.bp-hire input[type="date"] { max-width: 320px; }
.bp-hire input[type="file"] { max-width: 100%; }

.bp-hire :focus-visible {
	outline: 3px solid var(--bp-focus);
	outline-offset: 2px;
}

/* ---------- Radios and checkboxes ---------- */

.bp-hire .wpcf7-radio,
.bp-hire .wpcf7-checkbox,
.bp-hire .wpcf7-acceptance {
	display: block;
	padding-left: var(--bp-option-indent);
}
.bp-hire .wpcf7-list-item { display: block; margin: 0 0 8px; }
.bp-hire .wpcf7-list-item > label {
	display: flex;
	align-items: flex-start;
	gap: 9.6px;
	cursor: pointer;
}
.bp-hire .wpcf7-list-item input[type="radio"],
.bp-hire .wpcf7-list-item input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 2.4px 0 0;
	flex: none;
	accent-color: var(--bp-accent);
}

/* Room layout cards */
.bp-layouts .wpcf7-radio {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 12px;
}
.bp-layouts .wpcf7-list-item { margin: 0; }
.bp-layouts .wpcf7-list-item > label {
	flex-wrap: wrap;
	height: 100%;
	box-sizing: border-box;
	padding: 9.6px;
	border: 2px solid var(--bp-border);
	border-radius: 6px;
	background: #fff;
}
.bp-layouts .wpcf7-list-item > label:has(input:checked) {
	border-color: var(--bp-accent);
	box-shadow: 0 0 0 1px var(--bp-accent);
}
.bp-layout-img {
	display: block;
	width: 100%;
	max-width: 205px;            /* The images' natural size – don't upscale */
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	margin: 0 auto 6.4px;
}
.bp-hire .wpcf7-list-item-label { line-height: 1.5; }
.bp-hire .wpcf7-list-item-label a { display: inline; } /* Theme sets links to inline-block */
.bp-layouts .wpcf7-list-item-label { flex: 1; font-size: .95em; }

/* ---------- Notices ---------- */

.bp-notice {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-left: 5px solid var(--bp-accent);
	background: #fff;
}

/* ---------- Side panels: cost summary and booking ---------- */

.bp-card {
	margin: 0 0 16px;
	padding: 20px;
	background: var(--bp-card-bg);
	border: 2px solid var(--bp-border);
	border-radius: 8px;
}
.bp-card h2 { margin: 0 0 12px; font-size: 20px; }
.bp-price { border-color: var(--bp-accent); }
.bp-book .bp-field { margin-bottom: 16px; }

.bp-price-table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: .95em; }
.bp-price-table th,
.bp-price-table td { padding: 7.2px 0; border-bottom: 1px solid var(--bp-border); text-align: left; vertical-align: top; font-weight: 400; }
.bp-price-table td { text-align: right; white-space: nowrap; padding-left: 12px; }
.bp-price-table tfoot th,
.bp-price-table tfoot td { font-weight: 700; }
.bp-price-total th,
.bp-price-total td { font-size: 1.15em; border-bottom: 0; }
.bp-price-note { display: block; font-size: .85em; color: var(--bp-muted); }

/* ---------- Errors ---------- */

.bp-has-error {
	padding-left: 16px;
	border-left: 5px solid var(--bp-error);
}
.bp-hire .wpcf7-not-valid { border-color: var(--bp-error) !important; }
.bp-hire .wpcf7-not-valid-tip { color: var(--bp-error); font-weight: 700; margin-top: 5.6px; }

.bp-errors {
	margin: 0 0 16px;
	padding: 13.6px 16px;
	border: 3px solid var(--bp-error);
	border-radius: 4px;
	font-size: .95em;
}
.bp-errors-title { margin: 0 0 6.4px; font-size: 17.6px; }
.bp-errors p { margin: 0 0 6.4px; }
.bp-errors ul { margin: 0; padding-left: 17.6px; }
.bp-errors li { margin: 0 0 5.6px; }
.bp-errors a { color: var(--bp-error); font-weight: 400; }

/* ---------- Submit ---------- */

.bp-hire .bp-submit {
	display: block;
	width: 100%;
	padding: 13.6px 20px;
	font: inherit;
	font-weight: 700;
	border: 0;
	border-radius: 4px;
	background: var(--bp-accent);
	color: #fff;
	cursor: pointer;
}
.bp-hire .bp-submit:hover { filter: brightness(1.1); }
.bp-book .bp-help { margin: 12px 0 0; }
.bp-hire .wpcf7-spinner { display: block; margin: 8px auto 0; }
