/* ==========================================================================
   Hero + programme buttons + enquiry form
   Load AFTER custom.css:
   <link href="assets/css/hero-enquiry.css" rel="stylesheet">
   Everything is prefixed "hx-" so it cannot clash with the theme styles.
   Layout:
     >= 1200px : form sits on the right of the banner, programme buttons
                 straddle the bottom edge of the banner.
     <  1200px : banner image -> programme buttons -> form (stacked).
   ========================================================================== */

.hx-hero {
	--hx-orange: var(--color-style-four, #ec671b);
	--hx-orange-dark: #d4570f;
	--hx-tint: #fff4ec;
	--hx-ink: #171827;
	--hx-muted: #5b5f6b;
	--hx-line: #e6e8ee;
	--hx-error: #c60505;
	position: relative;
	z-index: 3;
	background: #fff;
	font-family: var(--font-default, "Montserrat", sans-serif);
}
.hx-hero *,
.hx-hero *::before,
.hx-hero *::after { box-sizing: border-box; }

/* ---------- Banner images ---------- */
.hx-media img { display: block; width: 100%; height: auto; }

/* ---------- Programme buttons ---------- */
.hx-programmes {
	position: relative;
	z-index: 4;
	margin-top: -30px;
	padding-bottom: 22px;
}
.hx-prog-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
.hx-prog-list li { margin: 0; padding: 0; }

.hx-hero a.hx-prog {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	height: 100%;
	padding: 14px 14px 16px;
	background: #fff;
	border: 1px solid rgba(236, 103, 27, .22);
	border-bottom: 4px solid var(--hx-orange);
	border-radius: 14px;
	box-shadow: 0 16px 34px -16px rgba(23, 24, 39, .5);
	color: var(--hx-ink);
	text-decoration: none;
	transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.hx-hero a.hx-prog:hover,
.hx-hero a.hx-prog:focus-visible {
	background: var(--hx-orange);
	color: #fff;
	transform: translateY(-4px);
	box-shadow: 0 22px 38px -16px rgba(236, 103, 27, .75);
}
.hx-hero a.hx-prog:focus-visible { outline: 3px solid var(--hx-ink); outline-offset: 3px; }

.hx-prog-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--hx-tint);
	color: var(--hx-orange);
	font-size: 20px;
	transition: background-color .25s ease, color .25s ease;
}
.hx-hero a.hx-prog:hover .hx-prog-icon,
.hx-hero a.hx-prog:focus-visible .hx-prog-icon { background: rgba(255, 255, 255, .2); color: #fff; }

.hx-prog-text { display: block; min-width: 0; }
.hx-prog-title {
	display: block;
	font-size: 14px;
	line-height: 1.3;
	font-weight: 700;
}
.hx-prog-sub {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.35;
	font-weight: 500;
	color: var(--hx-muted);
	transition: color .25s ease;
}
.hx-hero a.hx-prog:hover .hx-prog-sub,
.hx-hero a.hx-prog:focus-visible .hx-prog-sub { color: rgba(255, 255, 255, .9); }
.hx-prog-go { display: none; }

/* ---------- Form wrapper (stacked mode) ---------- */
.hx-form-wrap {
	background: var(--hx-tint);
	padding: 28px 0 36px;
}
.hx-form-col { width: 100%; max-width: 560px; margin: 0 auto; }

/* ---------- Form card ---------- */
.hx-card {
	position: relative;
	overflow: hidden;
	min-height: 380px;
	padding: 26px 26px 24px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 60px -18px rgba(23, 24, 39, .35);
}
.hx-card-head h2 {
	margin: 0 0 4px;
	padding: 0;
	font-family: inherit;
	font-size: 26px;
	line-height: 1.15;
	font-weight: 800;
	color: var(--hx-ink);
}
.hx-card-head p {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--hx-muted);
}

.hx-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.hx-field { margin: 0 0 12px; }
.hx-field label {
	display: block;
	margin: 0 0 5px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--hx-ink);
}
.hx-card .hx-input {
	display: block;
	width: 100%;
	min-height: 44px;
	height: 44px;
	padding: 0 14px;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 500;
	color: var(--hx-ink);
	background-color: #f7f8fa;
	border: 1.5px solid var(--hx-line);
	border-radius: 10px;
	box-shadow: none;
	transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.hx-card .hx-input::placeholder { color: #9aa0ad; font-weight: 400; }
.hx-card .hx-input:focus {
	outline: none;
	background-color: #fff;
	border-color: var(--hx-orange);
	box-shadow: 0 0 0 4px rgba(236, 103, 27, .16);
}
.hx-card select.hx-input {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ec671b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}
.hx-card .hx-input.is-invalid {
	border-color: var(--hx-error);
	background-color: #fff6f6;
}
.hx-card .hx-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(198, 5, 5, .14); }
.hx-error {
	display: none;
	margin: 5px 0 0;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hx-error);
}
.hx-field.has-error .hx-error { display: block; }

/* Honeypot: hidden from people, visible to bots */
.hx-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.hx-card button.hx-submit {
	text-transform: none;
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 13px 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: var(--hx-orange);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color .2s ease, transform .15s ease;
}
.hx-card button.hx-submit:hover { background: var(--hx-orange-dark); }
.hx-card button.hx-submit:active { transform: translateY(1px); }
.hx-card button.hx-submit:focus-visible { outline: 3px solid var(--hx-ink); outline-offset: 2px; }
.hx-card button.hx-submit:disabled { opacity: .7; cursor: not-allowed; }

.hx-status {
	display: none;
	margin: 12px 0 0;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	font-weight: 600;
	color: #8a1111;
	background: #fff1f1;
	border-left: 4px solid var(--hx-error);
	border-radius: 6px;
}
.hx-status.is-visible { display: block; }
.hx-status a { color: inherit; text-decoration: underline; }

/* ---------- Loading overlay (freezes the form) ---------- */
.hx-loading {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(255, 255, 255, .82);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s;
	cursor: progress;
}
.hx-is-loading .hx-loading { opacity: 1; visibility: visible; }
.hx-spinner {
	width: 46px;
	height: 46px;
	border: 4px solid var(--hx-tint);
	border-top-color: var(--hx-orange);
	border-radius: 50%;
	animation: hx-spin .8s linear infinite;
}
.hx-loading p { margin: 0; font-size: 14px; font-weight: 700; color: var(--hx-ink); }
@keyframes hx-spin { to { transform: rotate(360deg); } }

/* ---------- Thank-you panel ---------- */
.hx-success {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 28px 26px;
	text-align: center;
	background: #fff;
	color: var(--hx-ink);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.hx-success:focus { outline: none; }
.hx-is-done .hx-success { opacity: 1; visibility: visible; transform: none; }
.hx-success-mark {
	width: 76px;
	height: 76px;
	margin-bottom: 16px;
	border-radius: 50%;
	background: var(--hx-orange);
	display: flex;
	align-items: center;
	justify-content: center;
}
.hx-success-mark svg { width: 40px; height: 40px; }
.hx-success-mark path {
	fill: none;
	stroke: #fff;
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
}
.hx-is-done .hx-success-mark path { animation: hx-draw .5s .25s ease forwards; }
@keyframes hx-draw { to { stroke-dashoffset: 0; } }
.hx-success h3 {
	margin: 0 0 8px;
	font-family: inherit;
	font-size: 30px;
	line-height: 1.1;
	font-weight: 800;
	color: var(--hx-ink);
}
.hx-success p { margin: 0 0 6px; font-size: 15.5px; line-height: 1.5; font-weight: 500; color: var(--hx-muted); max-width: 330px; }
.hx-success .hx-success-alt { margin-top: 10px; font-size: 13px; }
.hx-success .hx-success-alt a { color: var(--hx-orange); font-weight: 700; text-decoration: underline; }
.hx-card button.hx-again {
	margin-top: 18px;
	padding: 9px 22px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--hx-orange);
	background: transparent;
	border: 2px solid var(--hx-orange);
	border-radius: 50px;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.hx-card button.hx-again:hover,
.hx-card button.hx-again:focus-visible { background: var(--hx-orange); color: #fff; outline: none; }

/* ---------- Tablet: 4 buttons in a row, form still stacked ---------- */
@media (min-width: 768px) {
	.hx-programmes { margin-top: -38px; padding-bottom: 30px; }
	.hx-prog-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
	.hx-hero a.hx-prog { padding: 16px 14px 18px; }
	.hx-prog-title { font-size: 14.5px; }
	.hx-form-wrap { padding: 34px 0 48px; }
	.hx-row { grid-template-columns: 1fr 1fr; }
	.hx-card { padding: 30px 32px 28px; }
}

/* ---------- Desktop: form over the banner, buttons straddle its bottom edge ---------- */
@media (min-width: 1200px) {
	.hx-stage { display: grid; }
	.hx-stage > .hx-media,
	.hx-stage > .hx-programmes,
	.hx-stage > .hx-form-wrap { grid-area: 1 / 1; }

	.hx-media img { height: 100%; object-fit: cover; object-position: left center; }

	.hx-form-wrap {
		display: flex;
		align-items: center;
		padding: 26px 0 84px;     /* bottom space clears the straddling buttons */
		background: transparent;
		z-index: 2;
	}
	.hx-form-wrap > .container { display: flex; justify-content: flex-end; }
	.hx-form-col { margin: 0; max-width: 470px; }
	.hx-card { min-height: 0; padding: 24px 26px 22px; }
	.hx-card-head h2 { font-size: 25px; }
	.hx-card-head p { margin-bottom: 14px; }
	.hx-row { grid-template-columns: 1fr 1fr; }

	.hx-programmes {
		align-self: end;
		margin-top: 0;
		padding-bottom: 0;
		transform: translateY(50%);
		z-index: 4;
	}
	.hx-prog-list { gap: 16px; }
	.hx-hero a.hx-prog {
		flex-direction: row;
		align-items: center;
		gap: 12px;
		padding: 14px 16px 14px 14px;
	}
	.hx-prog-go {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		margin-left: auto;
		width: 28px;
		height: 28px;
		border-radius: 50%;
		font-size: 14px;
		color: var(--hx-orange);
		background: var(--hx-tint);
		transition: background-color .25s ease, color .25s ease;
	}
	.hx-hero a.hx-prog:hover .hx-prog-go,
	.hx-hero a.hx-prog:focus-visible .hx-prog-go { background: #fff; color: var(--hx-orange); }
}

@media (min-width: 1400px) {
	.hx-form-col { max-width: 500px; }
	.hx-prog-title { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
	.hx-hero *, .hx-hero *::before, .hx-hero *::after { transition-duration: .01ms !important; }
	.hx-spinner { animation-duration: 2s; }
	.hx-is-done .hx-success-mark path { animation-duration: .01ms; animation-delay: 0s; }
}
