/*
 * Home Detox UK's page sections, built from core blocks.
 *
 * Each section is a core Group with a class from here. The block patterns in patterns/ insert a
 * ready-made one. Spacing comes from a class: hduk-pt-N and hduk-pb-N on desktop and tablet,
 * hduk-mpt-N and hduk-mpb-N below 768px. Loaded on the front end and in the editor.
 */

:root {
	--hduk-green: #21533a;
	--hduk-green-dark: #0f2819;
	--hduk-gold: #e7bf45;
	--hduk-blue: #5eb3e4;
	--hduk-blue-dark: #4f98c1;
	--hduk-grey: #888b7d;
	--hduk-page: #faf9f3;
	--hduk-serif: Georgia, 'Times New Roman', serif;
	--hduk-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/*
 * On this classic theme WordPress wraps a Group's contents in an extra div on the front end, but
 * not in the editor. Taking that div out of the layout makes both work the same.
 */
[class*="hduk-"] > .wp-block-group__inner-container { display: contents; }

/* ---- Section spacing ---- */
.hduk-pt-0 { padding-top: 0; }
.hduk-pt-20 { padding-top: 20px; }
.hduk-pt-40 { padding-top: 40px; }
.hduk-pt-60 { padding-top: 60px; }
.hduk-pt-80 { padding-top: 80px; }
.hduk-pb-0 { padding-bottom: 0; }
.hduk-pb-20 { padding-bottom: 20px; }
.hduk-pb-40 { padding-bottom: 40px; }
.hduk-pb-60 { padding-bottom: 60px; }
.hduk-pb-80 { padding-bottom: 80px; }

@media (max-width: 767px) {
	.hduk-mpt-0 { padding-top: 0; }
	.hduk-mpt-10 { padding-top: 10px; }
	.hduk-mpt-15 { padding-top: 15px; }
	.hduk-mpt-30 { padding-top: 30px; }
	.hduk-mpt-40 { padding-top: 40px; }
	.hduk-mpt-45 { padding-top: 45px; }
	.hduk-mpt-60 { padding-top: 60px; }
	.hduk-mpb-0 { padding-bottom: 0; }
	.hduk-mpb-15 { padding-bottom: 15px; }
	.hduk-mpb-30 { padding-bottom: 30px; }
	.hduk-mpb-40 { padding-bottom: 40px; }
	.hduk-mpb-60 { padding-bottom: 60px; }
}

/* ---- Shared type ---- */
.hduk-hero, .hduk-text, .hduk-cta, .hduk-features, .hduk-faq {
	position: relative;
	background-color: var(--hduk-page);
}

.hduk-hero__text :is(h1, h2),
.hduk-text__inner :is(h1, h2),
.hduk-cta__content :is(h1, h2),
.hduk-features__header :is(h1, h2),
.hduk-faq__content :is(h1, h2) {
	font-family: var(--hduk-serif);
	font-size: 48px;
	line-height: 1.2;
	color: var(--hduk-green);
	margin: 0 0 24px;
	font-weight: 400;
}

.hduk-hero__text :is(h3, h4, h5, h6),
.hduk-text__inner :is(h3, h4, h5, h6),
.hduk-cta__content :is(h3, h4, h5, h6),
.hduk-features__header :is(h3, h4, h5, h6),
.hduk-faq__content :is(h3, h4, h5, h6) {
	font-family: var(--hduk-serif);
	color: var(--hduk-green);
	margin-top: 0;
	margin-bottom: 1rem;
	font-weight: 400;
}

.hduk-hero__text p,
.hduk-text__inner p,
.hduk-features__header p,
.hduk-faq__content p {
	font-family: var(--hduk-sans);
	font-size: 18px;
	line-height: 1.6;
	color: var(--hduk-grey);
	margin: 0 0 32px;
}

.hduk-hero__text :is(ul, ol),
.hduk-text__inner :is(ul, ol) {
	font-family: var(--hduk-sans);
	font-size: 18px;
	line-height: 1.6;
	color: var(--hduk-grey);
	margin: 0 0 32px;
	padding-left: 30px;
}

.hduk-hero__text li,
.hduk-text__inner li {
	font-family: var(--hduk-sans);
	font-size: 18px;
	line-height: 1.6;
	color: var(--hduk-grey);
	margin-bottom: 8px;
}

.hduk-hero__text p:last-child,
.hduk-hero__text :is(ul, ol):last-child,
.hduk-features__header p:last-child,
.hduk-faq__content p:last-child {
	margin-bottom: 0;
}

/* ---- Buttons ---- */
.wp-block-buttons.hduk-buttons {
	margin-top: 32px;
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.hduk-buttons .wp-block-button__link.wp-element-button {
	display: inline-block;
	text-decoration: none;
	font-family: var(--hduk-sans);
	font-size: 18px;
	font-weight: 600;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	padding: 16px 40px;
	border-radius: 8px;
	transition: all 0.2s ease;
	border: 2px solid var(--hduk-blue);
	background-color: var(--hduk-blue);
	color: #fff;
	cursor: pointer;
	text-align: center;
	box-shadow: none;
}

.hduk-buttons .wp-block-button__link.wp-element-button:hover {
	background-color: var(--hduk-blue-dark);
	border-color: var(--hduk-blue-dark);
	color: #fff;
}

.hduk-buttons .is-style-outline .wp-block-button__link.wp-element-button {
	background-color: transparent;
	color: var(--hduk-blue);
}

.hduk-buttons .is-style-outline .wp-block-button__link.wp-element-button:hover {
	background-color: var(--hduk-blue);
	border-color: var(--hduk-blue);
	color: #fff;
}

/* ---- Hero: text beside an image ---- */
.hduk-hero { overflow: hidden; }

.hduk-hero__container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 60px;
}

.hduk-hero__content {
	flex: 1;
	max-width: 500px;
}

/* An empty button row used to sit here, and the layout depends on its 32px. */
.hduk-hero__content:not(:has(.hduk-buttons))::after {
	content: "";
	display: block;
	height: 32px;
}

.wp-block-image.hduk-hero__image {
	flex: 1;
	position: relative;
	margin: 0;
}

.wp-block-image.hduk-hero__image img {
	position: relative;
	z-index: 2;
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

/* ---- Text: a centred or left-aligned column ---- */
.hduk-text {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.hduk-text__inner {
	width: 100%;
	max-width: 800px;
	text-align: center;
}

.hduk-text-left .hduk-text__inner { text-align: left; }
.hduk-text-wide .hduk-text__inner { max-width: 1170px; }

.hduk-text__inner .hduk-buttons { justify-content: center; }
.hduk-text-left .hduk-text__inner .hduk-buttons { justify-content: flex-start; }

.hduk-text__inner a:not(.wp-block-button__link) {
	color: var(--hduk-green);
	text-decoration: underline;
}

.hduk-text__inner a:not(.wp-block-button__link):hover { color: var(--hduk-gold); }

/* ---- Call to action: heading, phone number, button ---- */
.hduk-cta { overflow: hidden; }

.hduk-cta__container {
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	text-align: center;
}

.hduk-cta__content { margin-bottom: 30px; }

p.hduk-cta__phone {
	margin: 0 0 30px;
	font-family: var(--hduk-serif);
	font-size: 40px;
	font-weight: 700;
}

.hduk-cta__phone a {
	font-family: var(--hduk-serif);
	font-size: 40px;
	font-weight: 700;
	color: var(--hduk-green);
	text-decoration: underline;
	transition: color 0.2s ease;
}

.hduk-cta__phone a:hover { color: var(--hduk-green-dark); }

.hduk-cta .hduk-buttons {
	margin-top: 0;
	justify-content: center;
}

/* ---- Features: a grid of icon, title and text ---- */
.hduk-features__container {
	max-width: 1200px;
	margin: 0 auto;
}

.hduk-features__header {
	text-align: center;
	margin-bottom: 60px;
}

.hduk-features__header p {
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

.hduk-features__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	width: 100%;
	justify-content: center;
}

.hduk-feature {
	width: calc(33.333% - 20px);
	text-align: center;
	padding: 20px;
	background: transparent;
}

.wp-block-image.hduk-feature__icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.wp-block-image.hduk-feature__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.hduk-feature h3 {
	font-family: var(--hduk-serif);
	font-size: 24px;
	font-weight: 400;
	color: var(--hduk-green);
	margin: 0 0 15px;
	line-height: 1.3;
}

.hduk-feature p {
	font-family: var(--hduk-sans);
	font-size: 16px;
	color: var(--hduk-grey);
	margin: 0;
	line-height: 1.6;
}

/* ---- FAQ: native details and summary ---- */
.hduk-faq__container {
	max-width: 800px;
	margin: 0 auto;
}

.hduk-faq__content {
	margin-bottom: 40px;
	text-align: center;
}

.hduk-faq__items {
	display: flex;
	flex-direction: column;
	gap: 0;
}

details.hduk-faq__item {
	background: transparent;
	border: 0;
	border-top: 1px solid #e5e5e7;
	border-radius: 0;
	overflow: hidden;
	margin: 0;
	padding: 0;
	interpolate-size: allow-keywords;
}

details.hduk-faq__item:last-child { border-bottom: 1px solid #e5e5e7; }

.hduk-faq__item > summary {
	width: 100%;
	padding: 24px 0;
	background: transparent;
	border: 0;
	font-family: var(--hduk-sans);
	font-size: 18px;
	font-weight: 600;
	line-height: calc(1.7 * var(--bodyfontsize));
	color: #1d1d1f;
	text-align: left;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	list-style: none;
	transition: opacity 0.2s ease;
}

.hduk-faq__item > summary::-webkit-details-marker { display: none; }
.hduk-faq__item > summary:hover { opacity: 0.7; }

.hduk-faq__item > summary::after {
	content: "";
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	background-color: #86868b;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 18L15 12L9 6' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 18L15 12L9 6' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.3s ease;
}

.hduk-faq__item[open] > summary::after { transform: rotate(90deg); }

.hduk-faq__item::details-content {
	block-size: 0;
	opacity: 0;
	overflow: hidden;
	transition: block-size 0.3s ease, opacity 0.3s ease, content-visibility 0.3s allow-discrete;
}

.hduk-faq__item[open]::details-content {
	block-size: auto;
	opacity: 1;
}

.hduk-faq__item p {
	font-family: var(--hduk-sans);
	font-size: 16px;
	line-height: 1.6;
	color: var(--hduk-grey);
	margin: 0 0 1rem;
}

.hduk-faq__item p:last-child { margin-bottom: 24px; }

/* ---- Photo with a caption ---- */
.wp-block-image.hduk-photo {
	width: fit-content;
	margin: 0 0 35px;
}

.wp-block-image.hduk-photo .wp-element-caption {
	margin: 0.2em 0 0;
	font-size: 0.8em;
	text-align: left;
}

/* ---- Tablet and below ---- */
@media (max-width: 991px) {
	.hduk-hero__container {
		flex-direction: column;
		gap: 20px;
	}

	.wp-block-image.hduk-hero__image {
		order: 1;
		flex: 1;
		width: 100%;
		max-width: 400px;
		margin: 0 auto;
	}

	.hduk-hero__content {
		order: 2;
		max-width: 100%;
	}

	.hduk-hero__text :is(h1, h2) { font-size: 36px; }
	.hduk-hero__text p, .hduk-hero__text li { font-size: 16px; }
	.hduk-hero__text :is(ul, ol) { font-size: 16px; text-align: left; }
	.hduk-hero__text li { text-align: left; }

	.hduk-text__inner { max-width: 700px; }
	.hduk-text-wide .hduk-text__inner { max-width: 1070px; }

	.hduk-feature { width: calc(50% - 15px); }
}

/* ---- Phones ---- */
@media (max-width: 767px) {
	.hduk-hero__container { gap: 25px; }

	.hduk-hero__text :is(h1, h2),
	.hduk-text__inner :is(h1, h2),
	.hduk-cta__content :is(h1, h2),
	.hduk-features__header :is(h1, h2),
	.hduk-faq__content :is(h1, h2) {
		font-size: 28px;
		margin-bottom: 16px;
	}

	.hduk-hero__text p, .hduk-hero__text li,
	.hduk-text__inner p, .hduk-text__inner li { font-size: 14px; }

	.hduk-hero__text :is(ul, ol),
	.hduk-text__inner :is(ul, ol) {
		font-size: 14px;
		padding-left: 20px;
	}

	.wp-block-image.hduk-hero__image { max-width: 350px; }

	.wp-block-buttons.hduk-buttons {
		flex-direction: column;
		align-items: stretch;
		gap: 15px;
	}

	.hduk-buttons .wp-block-button { width: 100%; }

	.hduk-buttons .wp-block-button__link.wp-element-button {
		padding: 14px 32px;
		font-size: 16px;
		width: 100%;
	}

	.hduk-text__inner { max-width: 100%; }
	.hduk-text-wide .hduk-text__inner { max-width: 100%; }
	.hduk-text-inset .hduk-text__inner { padding: 0 20px; }

	.hduk-cta__content { margin-bottom: 20px; }
	p.hduk-cta__phone { margin-bottom: 20px; font-size: 26px; }
	.hduk-cta__phone a { font-size: 26px; }

	.hduk-cta .wp-block-buttons.hduk-buttons { align-items: center; gap: 20px; }
	.hduk-cta .hduk-buttons .wp-block-button__link.wp-element-button { max-width: 300px; }
	.hduk-cta .hduk-buttons .wp-block-button { width: 100%; max-width: 300px; }

	.hduk-features__header { margin-bottom: 40px; }
	.hduk-features__header p { font-size: 16px; margin-bottom: 20px; }
	.hduk-features__grid { gap: 20px; }
	.hduk-feature { width: 100%; }
	.hduk-feature h3 { font-size: 20px; }
	.hduk-feature p { font-size: 15px; }

	.hduk-faq__content p { font-size: 16px; }
	.hduk-faq__item > summary { padding: 20px 0; font-size: 16px; }
	.hduk-faq__item > summary::after { flex-basis: 20px; width: 20px; height: 20px; }
	.hduk-faq__item p:last-child { margin-bottom: 20px; }
}

/* A heading with the wider gap below it, at every width. Comes last so it wins. */
.hduk-hero__text :is(h1, h2, h3, h4, h5, h6).hduk-gap-32,
.hduk-text__inner :is(h1, h2, h3, h4, h5, h6).hduk-gap-32 { margin-bottom: 32px; }
