/**
 * Hooked component styles.
 *
 * Only four things belong in this file:
 *   1. the block style variations registered in functions.php
 *   2. the two effects theme.json cannot express (dot grid, arrow connectors)
 *   3. interaction states
 *   4. the structural guard for the on-blue contrast rule
 *
 * Every value below reads from a theme.json token. If you need a new value,
 * add it to theme.json first. Do not introduce a raw hex here.
 */

/* ---------------------------------------------------------------- cards */

.wp-block-group.is-style-card,
.wp-block-group.is-style-card-accent,
.wp-block-group.is-style-card-compact,
.wp-block-group.is-style-panel {
	background-color: var(--wp--preset--color--white);
	border: var(--wp--custom--border--card);
	border-radius: var(--wp--custom--radius--card);
	padding: clamp(22px, 2.4vw, 32px);
	transition: border-color 0.18s ease;
}

.wp-block-group.is-style-card-accent {
	border-left: 4px solid var(--wp--preset--color--blue);
	border-radius: 10px;
}

.wp-block-group.is-style-card-compact {
	padding: clamp(18px, 1.8vw, 24px);
}

.wp-block-group.is-style-panel {
	border-radius: var(--wp--custom--radius--panel);
	padding: clamp(24px, 2.6vw, 34px);
}

.wp-block-group.is-style-card:hover,
.wp-block-group.is-style-card-accent:hover,
.wp-block-group.is-style-card-compact:hover {
	border-color: rgba(0, 0, 230, 0.45);
}

/* -------------------------------------------------------- blue CTA card */

.wp-block-group.is-style-cta-card {
	background-color: var(--wp--preset--color--blue);
	border-radius: var(--wp--custom--radius--cta);
	padding: clamp(32px, 4.4vw, 64px);
}

/* ------------------------------------------------- the on-blue guarantee
 * Brand rule, stated twice in the client brief: on Hooked blue, text is
 * white and never smaller than 16px. Enforced structurally so a future
 * editor cannot break it by picking a colour in the sidebar.
 */

.is-style-cta-card,
.is-style-cta-card :where(h1, h2, h3, h4, p, li, span, strong, em),
.has-blue-background-color,
.has-blue-background-color :where(h1, h2, h3, h4, p, li, span, strong, em) {
	color: var(--wp--preset--color--white);
}

.is-style-cta-card :where(p, li, span),
.has-blue-background-color :where(p, li, span) {
	font-size: max(1rem, var(--wp--preset--font-size--body));
}

.is-style-cta-card .is-style-eyebrow,
.has-blue-background-color .is-style-eyebrow {
	color: var(--wp--preset--color--white);
	font-size: 1rem;
}

.is-style-cta-card .is-style-muted,
.is-style-cta-card .is-style-caption,
.has-blue-background-color .is-style-muted,
.has-blue-background-color .is-style-caption {
	color: var(--wp--custom--text--on-blue-soft);
}

/* ------------------------------------------------------------ text roles */

.is-style-eyebrow {
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	letter-spacing: var(--wp--custom--tracking--eyebrow);
	line-height: 1.5;
	text-transform: uppercase;
}

.is-style-muted {
	color: var(--wp--custom--text--muted);
	font-size: var(--wp--preset--font-size--small);
}

.is-style-caption {
	color: var(--wp--custom--text--caption);
	font-size: var(--wp--preset--font-size--small);
}

.is-style-number {
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.02em;
}

p.is-style-number-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	flex: 0 0 26px;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

h2.is-style-barred,
h3.is-style-barred {
	border-left: 4px solid var(--wp--preset--color--blue);
	padding-left: clamp(16px, 1.6vw, 24px);
}

/* ------------------------------------------------------- pills and badges */

p.is-style-badge,
p.is-style-pill {
	display: inline-block;
	border-radius: var(--wp--custom--radius--pill);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.2;
	padding: 6px 13px;
	width: auto;
}

/* Solid tint rather than rgba on purpose: an alpha fill reads as
 * "blue text on blue" to contrast checkers, which hides real failures
 * behind a standing false positive. Flattened value of blue at 8%.
 */
p.is-style-badge {
	background-color: var(--wp--custom--tint--blue);
	color: var(--wp--preset--color--blue);
}

/* Tighter horizontal padding than the badge, and a little taller: the seven
 * hero tags have to sit four-then-three inside the card, as in the mockup,
 * not spill onto a third row.
 */
p.is-style-pill {
	border: var(--wp--custom--border--card);
	color: var(--wp--custom--text--body);
	font-weight: 500;
	padding: 8px 10px;
}

/* ------------------------------------------------------------- buttons */

.wp-block-button.is-style-secondary .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	border: 1px solid rgba(17, 18, 23, 0.16);
	color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-inverse .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue);
}

.wp-block-button__link {
	transition: background-color 0.18s ease, color 0.18s ease, transform 0.06s ease;
}

.wp-block-button:not(.is-style-secondary):not(.is-style-inverse) .wp-block-button__link:hover {
	background-color: #0000b4;
}

.wp-block-button.is-style-secondary .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--blue);
}

.wp-block-button.is-style-inverse .wp-block-button__link:hover {
	background-color: rgba(255, 255, 255, 0.88);
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

/* The arrow is decoration, so it lives in CSS rather than in the label.
 * That keeps the accessible name clean and keeps the glyph off the font
 * subset, which does not carry U+2192.
 */
.wp-block-button.is-style-arrow .wp-block-button__link::after {
	content: "";
	display: inline-block;
	vertical-align: middle;
	width: 0.85em;
	height: 0.85em;
	margin-left: 0.5em;
	background-color: currentColor;
	-webkit-mask: var(--hooked-arrow) center / contain no-repeat;
	mask: var(--hooked-arrow) center / contain no-repeat;
}

:root {
	--hooked-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h13M12 5l7 7-7 7'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------ focus ring
 * Ink rather than blue, and an outline rather than a colour change, so
 * focus never depends on colour alone.
 */

:where(a, button, input, select, textarea, .wp-block-button__link):focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
	border-radius: 4px;
}

.has-blue-background-color :where(a, button, .wp-block-button__link):focus-visible {
	outline-color: var(--wp--preset--color--white);
}

/* --------------------------------------------------------- hero dot grid */

.wp-block-group.is-style-dotgrid {
	position: relative;
	isolation: isolate;
}

.wp-block-group.is-style-dotgrid::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(rgba(0, 0, 230, 0.22) 1.1px, transparent 1.1px);
	background-size: 26px 26px;
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
	pointer-events: none;
}

/* --------------------------------------------------- arrow connectors
 * Section 03 draws an arrow between each of the three step cards. They
 * only appear when three cards plus two connectors still fit on one line.
 */

@media (min-width: 1004px) {
	.wp-block-columns.is-style-connected {
		position: relative;
	}

	.wp-block-columns.is-style-connected > .wp-block-column + .wp-block-column::before {
		content: "";
		position: absolute;
		top: 50%;
		left: calc(var(--wp--style--block-gap, 24px) * -1);
		width: var(--wp--style--block-gap, 24px);
		height: 1.1em;
		transform: translate(-6%, -50%);
		background-color: var(--wp--preset--color--blue);
		-webkit-mask: var(--hooked-arrow) center / 22px auto no-repeat;
		mask: var(--hooked-arrow) center / 22px auto no-repeat;
	}

	.wp-block-columns.is-style-connected > .wp-block-column {
		position: relative;
	}
}

/* ------------------------------------------------------------- header */

/* Solid white, no backdrop-filter. A backdrop-filter here would make the
 * header a containing block for fixed-position descendants, which traps the
 * mobile navigation overlay inside the 54px header bar instead of letting it
 * cover the viewport. The mockup header is opaque anyway.
 */
.hooked-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background-color: var(--wp--preset--color--white);
	border-bottom: 1px solid rgba(17, 18, 23, 0.09);
}

.hooked-logo {
	display: block;
	width: auto;
	height: 26px;
	color: var(--wp--preset--color--blue);
}

/* The bar never wraps: labels stay on one line and the whole nav switches
 * to the hamburger below the width where it stops fitting.
 */
.hooked-header .wp-block-navigation-item__content {
	white-space: nowrap;
}

.hooked-logo svg {
	display: block;
	height: 100%;
	width: auto;
}

.hooked-footer .hooked-logo {
	color: var(--wp--preset--color--ink);
	height: 30px;
}

/* Core switches the navigation to its overlay at 600px. Six Dutch link
 * labels plus the CTA need 1140px to stay on one line, so the switch point
 * moves up. This is the one place the theme overrides a core breakpoint;
 * do not add a second override elsewhere, change these two rules instead.
 */

@media (max-width: 1139px) {
	.hooked-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.hooked-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}

.hooked-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: clamp(24px, 6vw, 48px);
}

/* The header CTA is a navigation item rather than a separate button, so the
 * hamburger overlay carries the same links AND the same CTA, as the brief
 * asks, with no second copy to keep in sync.
 */

.hooked-header .nav-cta > a,
.hooked-header .nav-cta > a .wp-block-navigation-item__label {
	color: var(--wp--preset--color--white);
}

.hooked-header .nav-cta > a {
	background-color: var(--wp--preset--color--blue);
	border-radius: var(--wp--custom--radius--pill);
	font-weight: 600;
	padding: 12px 22px;
	transition: background-color 0.18s ease;
}

.hooked-header .nav-cta > a:hover {
	background-color: #0000b4;
	text-decoration: none;
}

.hooked-header .nav-cta > a::after {
	content: "";
	display: inline-block;
	vertical-align: middle;
	width: 0.85em;
	height: 0.85em;
	margin-left: 0.5em;
	background-color: currentColor;
	-webkit-mask: var(--hooked-arrow) center / contain no-repeat;
	mask: var(--hooked-arrow) center / contain no-repeat;
}

/* Inside the open overlay core strips padding from every navigation item,
 * so a pill would render cramped. Rather than out-specify core, the CTA
 * takes a different emphasis there: blue and bold against the plain links.
 */

.hooked-header .is-menu-open .nav-cta > a,
.hooked-header .is-menu-open .nav-cta > a .wp-block-navigation-item__label {
	background-color: transparent;
	color: var(--wp--preset--color--blue);
	font-weight: 700;
}

/* ------------------------------------------------------------- footer */

.hooked-footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
}

.hooked-footer-links li + li {
	margin-top: 10px;
}

.hooked-footer-links a {
	color: var(--wp--custom--text--body);
}

.hooked-footer-links a:hover {
	color: var(--wp--preset--color--blue);
}

@media (max-width: 781px) {
	.hooked-footer-links {
		text-align: left;
	}
}

/* ------------------------------------------------------------ utilities */

.hooked-no-wrap-line {
	display: block;
}
