/**
 * Cluster switcher — sibling domain navigation on cluster pages.
 * Paper-adapted tiles aligned with home .hero-interactive__door (not work-domain-door).
 * Top + bottom instances share these rules.
 */

.cluster-switcher {
	--cluster-switcher-ink: var(--studio-ink, #0e1a1f);
	--cluster-switcher-tile-border: rgba(26, 26, 26, 0.14);
	--cluster-switcher-tile-border-hover: rgba(26, 26, 26, 0.28);
	--cluster-switcher-tile-fill: rgba(26, 26, 26, 0.04);
	--cluster-switcher-tile-fill-hover: rgba(26, 26, 26, 0.07);
	--cluster-switcher-index: rgba(26, 26, 26, 0.22);
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--40);
}

.cluster-switcher--top {
	border-bottom: 1px solid var(--wp--preset--color--subtle);
	margin-bottom: 0;
}

.cluster-switcher--bottom {
	border-top: 1px solid var(--wp--preset--color--subtle);
	margin-top: 0;
}

.cluster-switcher__back {
	display: inline-block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	margin-bottom: var(--wp--preset--spacing--30);
	letter-spacing: 0.01em;
}

.cluster-switcher__back:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cluster-switcher__tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--preset--spacing--30);
}

.cluster-switcher__tile {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-height: 8.5rem;
	padding: var(--wp--preset--spacing--40);
	text-align: left;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	background: var(--cluster-switcher-tile-fill);
	border: 2px solid var(--cluster-switcher-tile-border);
	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		color 0.25s ease,
		transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 0.25s ease;
}

a.cluster-switcher__tile:hover {
	background: var(--cluster-switcher-tile-fill-hover);
	border-color: var(--cluster-switcher-tile-border-hover);
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(14, 26, 31, 0.1);
}

a.cluster-switcher__tile:focus-visible {
	outline: 2px solid var(--cluster-switcher-ink);
	outline-offset: 3px;
}

.cluster-switcher__tile--current {
	background: var(--cluster-switcher-ink);
	border-color: var(--cluster-switcher-ink);
	color: var(--wp--preset--color--base);
	box-shadow: 0 16px 40px rgba(14, 26, 31, 0.18);
	transform: translateY(-4px);
	cursor: default;
	pointer-events: none;
}

.cluster-switcher__num {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 300;
	line-height: 1;
	color: var(--cluster-switcher-index);
}

.cluster-switcher__tile--current .cluster-switcher__num {
	color: var(--wp--preset--color--base);
	opacity: 0.85;
}

.cluster-switcher__name {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.1rem, 2vw, 1.35rem);
	font-weight: 400;
	line-height: 1.15;
	color: inherit;
}

.cluster-switcher__tag {
	margin-top: auto;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.cluster-switcher__tile--current .cluster-switcher__tag {
	color: rgba(250, 249, 247, 0.55);
}

/* Mobile — segmented control (home hero doors @640px) */
@media (max-width: 640px) {
	.cluster-switcher__tiles {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 0;
		padding: 3px;
		background: var(--wp--preset--color--subtle);
		border: 1px solid var(--cluster-switcher-tile-border);
		border-radius: 6px;
	}

	.cluster-switcher__tile {
		flex: 1 1 0;
		min-width: 0;
		min-height: auto;
		margin: 0;
		padding: 0.65rem 0.45rem;
		text-align: center;
		border: none;
		border-radius: 4px;
		background: transparent;
		box-shadow: none;
		transform: none !important;
		gap: 0.15rem;
	}

	.cluster-switcher__tile + .cluster-switcher__tile {
		border-left: 1px solid var(--cluster-switcher-tile-border);
	}

	a.cluster-switcher__tile:hover {
		background: var(--cluster-switcher-tile-fill-hover);
		transform: none;
		box-shadow: none;
	}

	.cluster-switcher__tile--current {
		background: var(--wp--preset--color--base);
		color: var(--wp--preset--color--contrast);
		border-color: transparent;
		box-shadow: 0 2px 8px rgba(14, 26, 31, 0.12);
		transform: none !important;
	}

	.cluster-switcher__tile--current + .cluster-switcher__tile {
		border-left-color: var(--cluster-switcher-tile-border);
	}

	.cluster-switcher__num,
	.cluster-switcher__tag {
		display: none;
	}

	.cluster-switcher__name {
		font-family: var(--wp--preset--font-family--sans);
		font-size: 0.68rem;
		font-weight: 600;
		line-height: 1.2;
		letter-spacing: 0.02em;
		overflow-wrap: break-word;
		hyphens: auto;
	}

	.cluster-switcher__tile--current .cluster-switcher__name {
		color: var(--wp--preset--color--contrast);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cluster-switcher__tile,
	a.cluster-switcher__tile:hover,
	.cluster-switcher__tile--current {
		transition: none;
		transform: none !important;
	}
}
