/*
Theme Name: Hydryon
Author: Azurith Labs
Description: Full Site Editing block theme for the HYDRYON product information page by Azurith Labs. After activating, run `wp hydryon install-home` to create the home page.
Tags: full-site-editing, block-templates, block-patterns, accessibility-ready, one-column
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hydryon
*/

/*
 * Layout rules the core blocks cannot express on their own. Colours, type
 * and spacing come from theme.json presets; only structural sizes live here.
 */

/* ---------- Hero banner ---------- */
.hydryon-hero.wp-block-cover {
	min-height: max(50vw, 20rem) !important;
	position: relative;
}

.hydryon-hero .wp-block-cover__inner-container {
	align-self: flex-start;
}

/* Figma places the still at 1540x813 offset -100px inside the 1440x720 frame. */
@media (min-width: 782px) {
	.hydryon-hero .wp-block-cover__image-background {
		left: -6.94%;
		width: 106.94%;
		height: 112.9%;
		max-width: none;
	}
}

.hydryon-lockup {
	width: fit-content;
}

.hydryon-lockup .wp-block-image {
	margin: 0;
}

.hydryon-lockup .hydryon-lockup__divider {
	width: 4.25rem;
	height: 1px;
	border: 0;
	margin: 0;
	opacity: 1;
}

.hydryon-hero__notice {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: max-content;
	max-width: calc(100% - 2 * var(--wp--preset--spacing--90));
	margin: 0 !important;
}

/* ---------- Icon boxes (Figma frames are 68px / 71px squares) ---------- */
.hydryon-icon-box {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 4.25rem;
	height: 4.25rem;
}

.hydryon-icon-box--lg {
	width: 4.4375rem;
	height: 4.4375rem;
	margin-inline: auto;
}

.hydryon-icon-box .wp-block-image,
.hydryon-icon-box figure {
	margin: 0;
}

/* ---------- Molecule + engineered gel ---------- */
.hydryon-product-media .wp-block-image {
	margin: 0;
}

/* ---------- Contact pill ---------- */
.hydryon-email-pill {
	width: min(37.25rem, 100%);
	margin-inline: auto;
}

.hydryon-email-pill p {
	margin: 0;
	flex: 1 1 auto;
	text-align: center;
}

.hydryon-email-pill a {
	color: inherit;
	text-decoration: none;
}

.hydryon-email-pill a:hover,
.hydryon-email-pill a:focus-visible {
	text-decoration: underline;
}

.hydryon-email-pill .wp-block-image {
	margin: 0;
	flex: 0 0 auto;
}

@media (max-width: 781px) {
	.hydryon-email-pill {
		padding-inline: var(--wp--preset--spacing--50) !important;
	}

	.hydryon-email-pill .wp-block-image img {
		width: 2.25rem !important;
		height: auto !important;
	}

	.hydryon-email-pill p {
		font-size: var(--wp--preset--font-size--large) !important;
	}
}

/* ---------- Footer wave ---------- */
.hydryon-wave.wp-block-cover {
	min-height: 40vw !important;
}

/*
 * The cover grows with the viewport (40vw) but the spacer is capped, so on
 * wide screens the statement would float up into the wave lines. Stretch the
 * inner container to the cover's height and pin the statement to the bottom;
 * the spacer stays as the minimum clearance.
 */
.hydryon-wave .wp-block-cover__inner-container {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	width: 100%;
}

.hydryon-wave .wp-block-cover__inner-container > :last-child {
	margin-top: auto;
}

/* ---------- Tablet and below: the Figma "Preview Mobile Layout" ---------- */
@media (max-width: 781px) {
	.hydryon-research .wp-block-column {
		text-align: left;
	}

	.hydryon-research .has-text-align-center {
		text-align: left;
	}

	.hydryon-research .wp-block-column {
		padding-left: 0 !important;
	}

	.hydryon-hero.wp-block-cover {
		min-height: max(50vw, 21rem) !important;
	}

	.hydryon-hero .hydryon-hero__notice {
		top: auto;
		bottom: var(--wp--preset--spacing--70);
		transform: translateX(-50%);
		padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50) !important;
	}

	.hydryon-hero .hydryon-lockup {
		padding: var(--wp--preset--spacing--30) !important;
		gap: var(--wp--preset--spacing--20);
	}

	.hydryon-hero .hydryon-lockup img {
		width: 2.75rem !important;
		height: auto !important;
	}

	.hydryon-hero .hydryon-lockup .hydryon-lockup__divider {
		width: 2.75rem;
	}

	.hydryon-hero .hydryon-hero__notice p {
		font-size: var(--wp--preset--font-size--small) !important;
	}

	.hydryon-topics .wp-block-column .has-text-align-center {
		text-align: left;
	}

	.hydryon-product-media {
		flex-direction: row !important;
		justify-content: center;
		align-items: center !important;
	}

	.hydryon-product-media .wp-block-image {
		width: 46%;
	}

	.hydryon-product-media .wp-block-image img {
		width: 100% !important;
		height: auto !important;
	}

	.hydryon-copy-column.wp-block-column {
		border-left: 0 !important;
		padding-left: 0 !important;
	}

	.hydryon-topics .wp-block-column {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: var(--wp--preset--spacing--50);
		border-left: 0 !important;
		text-align: left;
	}

	.hydryon-topics .wp-block-column > * {
		text-align: left;
	}

	.hydryon-topics .hydryon-icon-box--lg {
		margin: 0;
	}

	.hydryon-topics .hydryon-topic__text {
		margin: 0 !important;
	}

	.hydryon-wave.wp-block-cover {
		min-height: 0 !important;
	}

	.hydryon-wave.wp-block-cover .wp-block-cover__image-background {
		object-position: 50% 100% !important;
	}
}

/* ---------- Page chrome ---------- */
.wp-site-blocks > footer,
.wp-site-blocks > main {
	margin-block-start: 0;
}

/* The notice centres on the whole banner, so the inner container must not be its containing block. */
.hydryon-hero .wp-block-cover__inner-container {
	position: static;
}

.hydryon-hero .hydryon-lockup {
	position: relative;
	z-index: 2;
}

.hydryon-hero .hydryon-hero__notice {
	z-index: 2;
}
