/*
 * Kensington Wing: the few rules theme.json can't express.
 * Loaded on the front end and in the editors (inc/setup.php).
 */

/* Header, main and footer sit flush; sections bring their own spacing. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* The header menu has seven items plus a button, so it collapses to the overlay below
   1100px, not only below core's 600px. These selectors mirror core's navigation CSS. */
@media (min-width: 600px) and (max-width: 1099px) {
	.kw-header-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.kw-header-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

.kw-header-nav .wp-block-navigation__responsive-container-open svg {
	width: 30px;
	height: 30px;
}

/* Hidden on phones, as on the old site (the header "Contact Us" button). */
@media (max-width: 599px) {
	.kw-hide-on-mobile {
		display: none !important;
	}
}

/* Footer bottom bar: centred on phones. */
@media (max-width: 781px) {
	.kw-footer-bar .wp-block-column {
		text-align: center;
	}

	.kw-footer-bar .wp-block-buttons,
	.kw-footer-bar .wp-block-navigation__container,
	.kw-footer-bar .wp-block-social-links,
	.kw-footer-bar .wp-block-image {
		justify-content: center;
		margin-inline: auto;
	}

	.kw-footer-bar .wp-block-image img {
		margin-inline: auto;
	}
}

/* Post cards in Query Loops (archive, related posts). */
.kw-post-card {
	height: 100%;
}

/* Cards stretch to their row. A featured image needs a definite width, or a photo narrower
   than the card gets a box sized from its own width and overflows onto the title. */
.kw-post-card .wp-block-post-featured-image,
.kw-team-card .wp-block-post-featured-image {
	width: 100%;
}

.kw-post-card .wp-block-post-title a {
	color: inherit;
}

.kw-post-card .wp-block-read-more {
	color: var(--wp--preset--color--purple);
	font-weight: 700;
	text-transform: uppercase;
}

/* Patterns (patterns/*.php). Section spacing and colours are block settings; these are the
   rules the editor can't set. */

/* Hero banner: its title paragraph is optional. */
.kw-hero__title:empty {
	display: none;
}

.kw-hero .wp-block-cover__inner-container {
	width: 100%;
}

/* Text beside an image: images fill their column, as Elementor's did. */
.kw-split .wp-block-image img {
	width: 100%;
	height: auto;
}

/* Card grid: cards in a row end level, with their buttons at the bottom. */
.kw-cards > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.kw-cards > .wp-block-column > .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--20);
}

/* Team grid cards. */
.kw-team-card {
	height: 100%;
}

.kw-team-card .wp-block-post-title a {
	color: inherit;
}

.kw-team-card .wp-block-post-featured-image img {
	object-position: top center;
}

/* Blog: the featured (sticky) post as a banner. */
.kw-featured-post .wp-block-post-title a {
	color: inherit;
}

.kw-featured-post .wp-block-read-more {
	display: inline-block;
	padding: 10px 30px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--super-dark-grey);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	text-transform: uppercase;
	text-decoration: none;
}

/* Form pages: the short purple rule under the heading. */
.wp-block-separator.kw-divider {
	width: 150px;
	max-width: 15%;
	min-width: 80px;
	height: 3px;
	margin-inline: 0;
	border: 0;
}

/* In a constrained section, line the rule up with the left edge of the content above it. */
.is-layout-constrained > .wp-block-separator.kw-divider {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
}

/* FAQ (core Details). */
.kw-faq .wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--purple-tint);
	padding-block: var(--wp--preset--spacing--20);
}

.kw-faq .wp-block-details summary {
	color: var(--wp--preset--color--purple);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	cursor: pointer;
}

.kw-faq .wp-block-details > :not(summary) {
	margin-block-start: 0.75em;
}

/* Contact Form 7 (forms built by scripts/forms.mjs). */
.wpcf7-form {
	max-width: 1000px;
}

.wpcf7-form > p,
.wpcf7-form > fieldset {
	margin: 0 0 1.25em;
}

.wpcf7-form fieldset {
	min-width: 0;
	padding: 0;
	border: 0;
}

.wpcf7-form label,
.wpcf7-form legend {
	display: block;
	padding: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
}

.wpcf7-form .wpcf7-list-item label {
	display: inline-flex;
	gap: 0.5em;
	align-items: center;
	font-weight: 400;
}

.wpcf7-form .wpcf7-list-item {
	display: block;
	margin: 0.35em 0 0;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="date"],
.wpcf7-form select,
.wpcf7-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 600px;
	margin-top: 0.4em;
	padding: 8px 10px;
	border: 1px solid var(--wp--preset--color--dark-grey);
	border-radius: 2px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--super-dark-grey);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
}

.wpcf7-form textarea {
	max-width: none;
	height: 7em;
}

.kw-required {
	color: #d63637;
}

.kw-description {
	display: block;
	margin-top: 0.25em;
	color: var(--wp--preset--color--super-dark-grey);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 400;
}

/* First and last name side by side. */
.wpcf7-form fieldset > p {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1em;
	margin: 0;
}

.wpcf7-form fieldset > p > br {
	display: none;
}

.wpcf7-form fieldset > p > .wpcf7-form-control-wrap:has(input[type="text"]) {
	flex: 0 1 292px;
}

/* Two columns of choices (the consultant list on form 7099). */
.wpcf7-form .kw-columns-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 2em;
}

@media (max-width: 599px) {
	.wpcf7-form .kw-columns-2 {
		grid-template-columns: minmax(0, 1fr);
	}
}

.wpcf7-form .wpcf7-submit {
	padding: 10px 30px;
	border: 0;
	border-radius: 5px;
	background: var(--wp--preset--color--purple);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
	cursor: pointer;
}

.wpcf7-form .wpcf7-submit:hover,
.wpcf7-form .wpcf7-submit:focus {
	background: var(--wp--preset--color--dark-purple);
}

/* Card images fill their column, whatever their own width. */
.kw-cards .wp-block-image img {
	width: 100%;
}

/* "Quick links" list on /your-pregnancy-journey/: links, not bullets. */
.kw-quick-links {
	list-style: none;
	padding-left: 0;
}

.kw-quick-links li {
	margin-bottom: 0.75em;
}

/* Mailchimp embed on /join-our-mailing-list/: its own CSS fixes it at 600px. */
.kw-mailing-list #mc_embed_signup {
	width: auto;
	max-width: 600px;
	margin-inline: auto;
}

.kw-mailing-list #mc-embedded-subscribe-form input {
	max-width: 100%;
}

@media (max-width: 400px) {
	.kw-mailing-list #mc_embed_signup .foot {
		display: grid;
		grid-template-columns: auto auto;
	}

	.kw-mailing-list #mc_embed_signup .foot .refferal_badge {
		width: 150px !important;
	}
}
