/* ============================================================
   Castle — theme custom CSS
   Loaded after the compiled Tailwind build (assets/tailwind.css).
   Contains the bespoke component styles that are not utilities:
   logo wordmark, header dropdowns, mobile menu, CF7 forms and
   Elementor page integration.
   ============================================================ */

/* ---- Elementor page + Theme Builder integration ---- */
.castle-site .elementor-widget-container {
	margin: 0;
	padding: 0;
}
.castle-site .elementor-section,
.castle-site .elementor-container,
.castle-site .elementor-column,
.castle-site .elementor-widget {
	margin: 0;
}
.castle-site .elementor-section > .elementor-container {
	max-width: none !important;
	width: 100% !important;
	margin-left: auto;
	margin-right: auto;
}
.castle-site .elementor-container > .elementor-column {
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.castle-site .elementor-column > .elementor-element-populated {
	padding: 0 !important;
}
.castle-site .elementor-widget,
.castle-site .elementor-widget-container,
.castle-site .elementor-shortcode,
.castle-site .elementor-widget-html {
	max-width: none !important;
}

/* Theme Builder header wrapper must stay sticky like the original */
.elementor-location-header {
	position: sticky;
	top: 0;
	z-index: 50;
	width: 100%;
}
.elementor-location-header .elementor-section,
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-column,
.elementor-location-header .elementor-widget-container {
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
}

/* Footer menus rendered via wp_nav_menu inside Theme Builder */
.castle-footer-menu {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}
.castle-footer-menu a {
	color: color-mix(in oklab, var(--color-navy-foreground, #e8eef5) 80%, transparent);
	text-decoration: none;
	transition: color 0.15s ease;
}
.castle-footer-menu a:hover {
	color: var(--color-accent, #f5a623);
}
.elementor-location-footer .elementor-section,
.elementor-location-footer .elementor-container,
.elementor-location-footer .elementor-column,
.elementor-location-footer .elementor-widget-container {
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
}
/* Elementor's .elementor img{height:auto} (0,1,1) overrides Tailwind's
   h-* utilities (0,1,0), collapsing every utility-sized image to its natural
   aspect ratio. Restore the utility heights at equal specificity. */
.castle-site .elementor img.h-44 {
	height: calc(var(--spacing) * 44);
}
.castle-site .elementor img.h-56 {
	height: calc(var(--spacing) * 56);
}
.castle-site .elementor img.h-64 {
	height: calc(var(--spacing) * 64);
}
.castle-site .elementor img.h-full {
	height: 100%;
}
.castle-site .elementor img.rounded-2xl {
	border-radius: calc(var(--radius) + 8px);
}
.castle-site .elementor img.shadow-card-hover {
	box-shadow: var(--shadow-card-hover);
}

/* Hide CF7 chrome that should stay out of the visual layout */
.wpcf7 .hidden-fields-container,
.wpcf7 .screen-reader-response,
.wpcf7 .wpcf7-spinner {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Keep response output available after submit (hidden only while empty/init) */
.wpcf7 .wpcf7-response-output {
	display: none;
}
.wpcf7-form.sent .wpcf7-response-output,
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output,
.wpcf7-form.spam .wpcf7-response-output {
	display: block;
}

/* Form shell card — owns layout so fields never leak into parent page grids */
.castle-form-shell {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	background-color: #ffffff;
}
.castle-form-shell.castle-form--dark {
	background-color: rgba(91, 22, 26, 0.4);
}
.castle-form-shell .wpcf7-castle {
	display: block;
	margin-top: 1.25rem;
}
.castle-form-shell .wpcf7,
.castle-form-shell .wpcf7-form {
	display: block;
	margin: 0;
}
.castle-form-shell .castle-field-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}
@media (min-width: 640px) {
	.castle-form-shell:not(.castle-form--compact):not(.castle-form--quick) .castle-field-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.wpcf7-castle .castle-field {
	margin-top: 0;
	min-width: 0;
}

@media (min-width: 640px) {
	.castle-site .elementor img.sm\:h-56 {
		height: calc(var(--spacing) * 56);
	}
	.castle-site .elementor img.sm\:h-72 {
		height: calc(var(--spacing) * 72);
	}
	.castle-site .elementor img.sm\:h-80 {
		height: calc(var(--spacing) * 80);
	}
}
.castle-site .site-main,
.castle-site main#main {
	padding: 0;
}

/* ---- Logo wordmark (matches the original vector wordmark) ---- */
.castle-logo {
	display: inline-flex;
	width: fit-content;
	max-width: 100%;
	flex-shrink: 0;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	line-height: 1;
	color: #5c1a2e;
	transform: scale(1.15);
	transform-origin: left;
}
.castle-logo__main {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 0.18em;
}
.castle-logo__sub {
	margin-top: 4px;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 7.5px;
	font-weight: 600;
	letter-spacing: 0.22em;
}
.castle-logo--dark {
	transform: none;
	transform-origin: initial;
	border-radius: 0.375rem;
	background: #ffffff;
	padding: 0.375rem 0.5rem;
}

/* ---- Desktop dropdowns (Services / Locations) ---- */
.castle-dd-panel {
	transition: opacity 0.15s ease;
}
.castle-dd.open .castle-dd-panel {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* ---- Mobile menu ---- */
.castle-toggle-open,
.castle-toggle-close {
	pointer-events: none;
}
.castle-chev,
.castle-dd-toggle .castle-ic {
	transition: transform 0.15s ease;
}
.castle-mobile-dd[aria-expanded="true"] .castle-chev {
	transform: rotate(180deg);
}

/* ---- FAQ accordion (remove native marker, allow open shadow) ---- */
.castle-site summary::-webkit-details-marker {
	display: none;
}
.castle-site summary {
	list-style: none;
}
.castle-site details > summary::before {
	content: none;
}
.castle-site details > summary {
	-webkit-tap-highlight-color: transparent;
}
.castle-site details > summary::-moz-list-bullet {
	list-style: none;
}
.castle-site details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	cursor: pointer;
}

/* ---- Contact Form 7 (styled to match the original EnquiryForm) ---- */
.wpcf7-castle form {
	margin: 0;
}
.wpcf7-castle form p {
	margin: 0;
}
.wpcf7-castle form p br {
	display: none;
}
.wpcf7-castle .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}
.wpcf7-castle .castle-field-span2 {
	grid-column: 1 / -1;
}
.wpcf7-castle label {
	display: block;
	margin-bottom: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.42857143;
	color: #2b1311;
}
.wpcf7-castle input[type="text"],
.wpcf7-castle input[type="tel"],
.wpcf7-castle input[type="email"],
.wpcf7-castle textarea,
.wpcf7-castle input[type="submit"],
.wpcf7-castle .wpcf7-submit {
	box-sizing: border-box;
	max-width: 100%;
}
.wpcf7-castle input[type="text"],
.wpcf7-castle input[type="tel"],
.wpcf7-castle input[type="email"],
.wpcf7-castle textarea {
	width: 100%;
	border-radius: 0.5rem;
	border: 1px solid #e5dcd8;
	background: #ffffff;
	font-size: 0.875rem;
	line-height: 1.42857143;
	color: #2b1311;
	padding: 0.75rem 1rem;
	font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.wpcf7-castle textarea {
	height: 6rem;
	min-height: 6rem;
	resize: vertical;
}
.wpcf7-castle input::placeholder,
.wpcf7-castle textarea::placeholder {
	color: #6e5755;
	opacity: 0.55;
}
.wpcf7-castle input:focus,
.wpcf7-castle textarea:focus {
	outline: none;
	box-shadow: 0 0 0 2px #9d3438;
	border-color: #9d3438;
}
.wpcf7-castle .castle-submit,
.wpcf7-castle input.wpcf7-submit,
.wpcf7-castle .wpcf7-submit {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: 0.5rem;
	background: #da9e3f;
	color: #310e03;
	font-family: "Sora", ui-sans-serif, system-ui, sans-serif;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.5;
	padding: 0.875rem 1.5rem;
	margin-top: 1.25rem;
	box-shadow: 0 8px 24px -8px rgba(218, 158, 63, 0.55);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.wpcf7-castle .castle-submit:hover,
.wpcf7-castle input.wpcf7-submit:hover,
.wpcf7-castle .wpcf7-submit:hover {
	background: #ce871b;
}
.wpcf7-castle .castle-submit:disabled,
.wpcf7-castle input.wpcf7-submit:disabled {
	opacity: 0.7;
	cursor: default;
}
.wpcf7-castle .wpcf7-not-valid-tip {
	color: #b91c1c;
	font-size: 0.75rem;
	margin-top: 0.25rem;
	display: block;
}
.wpcf7-castle .wpcf7-form-control:not(.castle-submit):not(.wpcf7-not-valid-tip).wpcf7-not-valid {
	border-color: #b91c1c;
}
.wpcf7-castle .wpcf7-response-output {
	font-size: 0.875rem;
	line-height: 1.5;
	margin: 0.75rem 0 0;
	padding: 0.625rem 0.875rem;
	border-radius: 0.5rem;
	border-width: 1px;
}
.wpcf7-castle .wpcf7-form.sent .wpcf7-response-output {
	border-color: #16a34a;
	color: #166534;
	background: #f0fdf4;
}
.wpcf7-castle .wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-castle .wpcf7-form.failed .wpcf7-response-output {
	border-color: #b91c1c;
	color: #7f1d1d;
	background: #fef2f2;
}

/* ---- Form variants: compact (single column) & quick (tight + no message) ---- */
.castle-form--compact .castle-field-grid,
.castle-form--quick .castle-field-grid {
	grid-template-columns: minmax(0, 1fr);
}
.castle-form--quick .castle-field-grid {
	gap: 0.625rem;
}
.castle-form--quick .wpcf7-castle label {
	font-size: 0.75rem;
	line-height: 16px;
	margin-bottom: 0.25rem;
}
.castle-form--quick .wpcf7-castle input[type="text"],
.castle-form--quick .wpcf7-castle input[type="tel"],
.castle-form--quick .wpcf7-castle input[type="email"],
.castle-form--quick .wpcf7-castle textarea {
	padding: 0.5rem 0.75rem;
}
.castle-form--quick .castle-field-message {
	display: none;
}
.castle-form--quick .wpcf7-castle .castle-submit,
.castle-form--quick .wpcf7-castle .wpcf7-submit {
	margin-top: 0.75rem;
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	line-height: 1.42857143;
}

/* ---- Dark form variant (used on navy backgrounds if ever enabled) ---- */
.castle-form--dark .wpcf7-castle label {
	color: rgba(249, 244, 240, 0.8);
}
.castle-form--dark .wpcf7-castle input[type="text"],
.castle-form--dark .wpcf7-castle input[type="tel"],
.castle-form--dark .wpcf7-castle input[type="email"],
.castle-form--dark .wpcf7-castle textarea {
	border-color: rgba(91, 22, 26, 1);
	background: rgba(91, 22, 26, 0.6);
	color: #f9f4f0;
}
.castle-form--dark .wpcf7-castle input::placeholder,
.castle-form--dark .wpcf7-castle textarea::placeholder {
	color: rgba(249, 244, 240, 0.5);
	opacity: 1;
}
.castle-form--dark .wpcf7-castle input:focus,
.castle-form--dark .wpcf7-castle textarea:focus {
	box-shadow: 0 0 0 2px #da9e3f;
	border-color: #da9e3f;
}

/* ---- Home hero (absolute image + gradient overlay needs overflow clip) ---- */
.castle-hero-home {
	position: relative;
	overflow: hidden;
}

/* ---- Misc helpers ---- */
.castle-site .castle-prose p + p {
	margin-top: 1rem;
}
