/**
 * Block pattern layout and presentation for The Bath Authority.
 *
 * Loaded on the front end and in the block editor so patterns match in both places.
 *
 * @package the-bath-authority
 */

.tba-hero-shell {
	background: linear-gradient(
		125deg,
		var(--wp--preset--color--cream) 0%,
		var(--wp--preset--color--white) 45%,
		var(--wp--preset--color--sand) 100%
	);
}

.tba-comparison-table table {
	border-collapse: collapse;
	width: 100%;
}

.tba-comparison-table th,
.tba-comparison-table td {
	border: 1px solid var(--wp--preset--color--slate-200);
	padding: 12px;
	text-align: left;
}

.tba-comparison-table .wp-block-table {
	display: block;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tba-comparison-table table {
	min-width: 520px;
}

/* ========================================
   TBA Hero Banner pattern (hero-home-2)
   Spacing, colors, and gaps live in block attributes; CSS is presentation-only.
   ======================================== */

.tba-hero-banner {
	margin-block-end: var(--wp--preset--spacing--40);
}

.tba-hero-banner .wp-block-cover__inner-container {
	margin-inline: auto;
	padding-inline: 1.25rem;
	box-sizing: border-box;
}

@media (min-width: 782px) {
	.tba-hero-banner .wp-block-cover__inner-container {
		padding-inline: 80px;
	}
}

.tba-hero-banner figure.tba-hero-logo {
	line-height: 0;
	filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.tba-hero-banner .tba-hero-logo img {
	width: auto;
	max-width: min(320px, 100%);
	height: auto;
}

.tba-hero-banner .tba-hero-headline {
	font-size: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
	line-height: 1.15;
	text-shadow: 7px 0 10px rgba(0, 0, 0, 0.3);
}

.tba-hero-banner .tba-hero-subheading {
	font-weight: 700;
	text-shadow: 5px 0 8px rgba(0, 0, 0, 0.2);
}

/*
 * Hero grid: desktop = copy | form, brand row under copy; mobile = copy, form, brand (below form).
 * blockGap on .tba-hero-brand-row is editor-adjustable in the block sidebar.
 */
.tba-hero-banner .tba-hero-layout {
	display: grid;
	grid-template-columns: minmax(0, 58%) minmax(0, 42%);
	grid-template-areas:
		"main form"
		"brand form";
	column-gap: var(--wp--preset--spacing--40);
	row-gap: var(--wp--preset--spacing--30);
	align-items: start;
}

.tba-hero-banner .tba-hero-layout > .tba-hero-columns {
	display: contents;
}

.tba-hero-banner .tba-hero-main {
	grid-area: main;
	min-width: 0;
}

.tba-hero-banner .tba-hero-form-column {
	grid-area: form;
	min-width: 0;
}

.tba-hero-banner .tba-hero-brand-row {
	grid-area: brand;
	align-self: end;
	min-width: 0;
}

.tba-hero-banner .tba-gdi-logo-mark {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 3px;
	flex-shrink: 0;
}

.tba-hero-banner .tba-gdi-logo-mark .wp-block-image {
	margin: 0;
	flex: 0 0 auto;
	width: auto;
	max-width: none;
}

.tba-hero-banner .tba-gdi-logo-symbol img,
.tba-hero-banner .tba-gdi-logo-text img {
	display: block;
	height: 20px;
	width: auto;
	max-height: 20px;
}

.tba-hero-banner .tba-hero-disclaimer {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 0.625rem !important;
	line-height: 1.35;
}

/* Form card: shadow and sticky behavior (not available as block attributes). */
.tba-hero-banner .tba-hero-form {
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	height: fit-content;
	position: sticky;
	top: 20px;
}

.tba-hero-banner .tba-hero-form a {
	color: var(--wp--preset--color--sky-deep);
}

.wp-block-details summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--sky-deep);
	outline-offset: 2px;
	border-radius: 4px;
}

.heavyset-form-placeholder {
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px dashed #ccc;
	border-radius: 4px;
	text-align: center;
}

.heavyset-form-placeholder p {
	color: #999;
	margin: 0;
}

/* ========================================
   Mobile Responsiveness (768px and below)
   ======================================== */

@media (max-width: 768px) {
	.tba-hero-banner figure.tba-hero-logo,
	.tba-hero-banner .tba-hero-logo,
	.tba-hero-banner .tba-hero-title-stack .wp-block-image:has(img[src*="bath_logo_table"]) {
		display: none;
	}

	.tba-hero-banner .tba-hero-layout {
		grid-template-columns: 1fr;
		grid-template-areas:
			"main"
			"form"
			"brand";
		row-gap: var(--wp--preset--spacing--30);
	}

	.tba-hero-banner .tba-hero-brand-row {
		align-self: stretch;
		flex-wrap: nowrap;
		align-items: center;
	}

	.tba-hero-banner .tba-hero-headline {
		font-size: 2rem;
	}

	.tba-hero-banner .tba-hero-cta-buttons {
		width: 100%;
	}

	.tba-hero-banner .tba-hero-cta-buttons .wp-block-button,
	.tba-hero-banner .tba-hero-cta-buttons .wp-block-button__link {
		width: 100%;
	}

	.tba-hero-banner .tba-hero-form {
		position: static;
		width: 90%;
		margin-inline: auto;
	}
}

/* Neutralize parent theme top padding — TBA uses full-bleed hero cover block.
   Scoped to .theme-the-bath-authority body class to win specificity over the parent rule. */
.theme-the-bath-authority .entry-content:not(:has(.banner-section, .location-search-map)) {
    padding-top: 0;
}