/* BaAlawi POLISH Q1.1: shared interaction and visual refinement, 8 Oct 2026. */

/* Keep account access in the same button family as the Home hero actions. */
.ba-account-link {
	box-sizing: border-box;
	border-radius: 0.6rem;
	transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ba-account-link--signin,
.ba-account-link--account {
	border-color: var(--wp--preset--color--forest-dark);
	background: transparent;
	color: var(--wp--preset--color--forest-dark);
}

.ba-account-link--create {
	border-radius: 0.6rem;
}

.ba-account-link--signin:hover,
.ba-account-link--signin:focus-visible,
.ba-account-link--account:hover,
.ba-account-link--account:focus-visible {
	border-color: var(--wp--preset--color--forest-dark);
	background: var(--wp--preset--color--forest-dark);
	color: var(--wp--preset--color--ivory);
	box-shadow: 0 8px 20px rgba(30, 41, 51, 0.11);
	transform: translateY(-1px);
}

.ba-account-link:focus-visible,
.ba-nav .wp-block-navigation-item__content:focus-visible,
.wp-block-button__link:focus-visible,
.wp-block-search__button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--wp--preset--color--clay) 34%, transparent);
	outline-offset: 2px;
}

/* Preserve the Home CTA hierarchy and make secondary actions the account-button reference. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1px;
	border-color: var(--wp--preset--color--forest-dark);
	border-radius: 0.6rem;
	background: transparent;
	color: var(--wp--preset--color--forest-dark);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	border-color: var(--wp--preset--color--forest-dark);
	background: var(--wp--preset--color--forest-dark);
	color: var(--wp--preset--color--ivory);
}

/* Give archive and discovery searches the same deliberate geometry as the CTA system. */
:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__inside-wrapper {
	align-items: stretch;
	gap: 0.65rem;
	padding: 0;
	border: 0;
}

:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__input {
	box-sizing: border-box;
	min-height: 3.1rem;
	padding: 0.72rem 0.9rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--forest-dark) 28%, transparent);
	border-radius: 0.6rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--forest-dark);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__input:focus {
	border-color: var(--wp--preset--color--clay);
	outline: 0;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--clay) 18%, transparent);
}

:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__button {
	min-height: 3.1rem;
	margin: 0;
	padding-inline: 1.25rem;
	border-radius: 0.6rem;
	font-weight: 700;
	transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__button:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(30, 41, 51, 0.1);
}

/* Keep the mobile-menu account action consistent with desktop CTA geometry. */
@media (max-width: 782px) {
	.ba-nav .wp-block-navigation__responsive-container.is-menu-open .ba-nav-account-create .wp-block-navigation-item__content {
		border-radius: 0.6rem;
	}
}

@media (max-width: 600px) {
	:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__inside-wrapper {
		flex-wrap: wrap;
	}

	:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__input,
	:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__button {
		width: 100%;
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ba-account-link,
	:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__button,
	:is(.ba-learn-intro, .ba-search-intro, .ba-404-card) .wp-block-search__input {
		transition: none;
	}
}

/* Q1.1 follow-on: calmer header, collapsible archive search and shared premium interaction rhythm. */
.ba-header-inner > .wp-block-group:last-child {
	min-width: 0;
	gap: 0.55rem;
}

.ba-brand {
	margin-right: clamp(1.25rem, 2vw, 2rem);
}

.ba-nav .wp-block-navigation__container {
	gap: clamp(0.85rem, 1.1vw, 1.25rem);
}

/* Header search defaults to one accessible icon and reveals the field only on intent. */
.ba-header-search {
	position: relative;
	flex: 0 0 2.75rem;
	width: 2.75rem;
	min-width: 2.75rem;
	margin-left: 0.1rem;
}

.ba-header-search .wp-block-search__inside-wrapper {
	position: relative;
	display: block;
	width: 2.75rem;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	overflow: visible;
}

.ba-header-search .wp-block-search__input {
	position: absolute;
	top: calc(100% + 1.5rem);
	right: 0;
	z-index: 60;
	box-sizing: border-box;
	width: min(20rem, calc(100vw - 2rem));
	min-width: 0;
	min-height: 3.15rem;
	padding: 0.78rem 1rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--forest-dark) 18%, transparent);
	border-radius: 0.72rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--forest-dark);
	box-shadow: 0 16px 38px rgba(30, 41, 51, 0.16);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-0.35rem) scale(0.985);
	transform-origin: top right;
	transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ba-header-search.is-open .wp-block-search__input {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.ba-header-search .wp-block-search__input:focus {
	border-color: var(--wp--preset--color--clay);
	outline: 0;
	box-shadow: 0 16px 38px rgba(30, 41, 51, 0.16), 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--clay) 18%, transparent);
}

.ba-header-search .wp-block-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 2.75rem;
	height: 2.75rem;
	min-width: 2.75rem;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.7rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--forest-dark) 14%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--white) 94%, var(--wp--preset--color--ivory));
	color: var(--wp--preset--color--forest-dark);
	box-shadow: none;
	transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ba-header-search .wp-block-search__button:hover,
.ba-header-search .wp-block-search__button:focus-visible,
.ba-header-search.is-open .wp-block-search__button {
	border-color: var(--wp--preset--color--clay);
	background: var(--wp--preset--color--clay);
	color: var(--wp--preset--color--white);
	box-shadow: 0 8px 18px rgba(30, 41, 51, 0.11);
	transform: translateY(-1px);
}

/* A single calmer button language across public pages. */
.wp-block-button__link {
	border-radius: 0.6rem;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(30, 41, 51, 0.11);
}

.ba-text-link a,
.ba-learn-pathway a,
.ba-query-card a:not(.wp-block-button__link) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color 160ms ease, text-decoration-color 160ms ease;
}

.ba-text-link a:hover,
.ba-text-link a:focus-visible,
.ba-learn-pathway a:hover,
.ba-learn-pathway a:focus-visible,
.ba-query-card a:not(.wp-block-button__link):hover,
.ba-query-card a:not(.wp-block-button__link):focus-visible {
	color: var(--wp--preset--color--clay);
	text-decoration-color: currentColor;
}

/* Reduce the old SaaS-like lift and keep archive cards editorial. */
.ba-pathway-card:hover,
.ba-archive-card:hover,
.ba-region-card:hover,
.ba-contribution-card:hover,
.ba-query-card:hover,
.ba-learn-pathway:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(30, 41, 51, 0.08);
}

.ba-learn-pathway {
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (min-width: 783px) and (max-width: 1100px) {
	.ba-header-search { display: block; }
}

@media (max-width: 1100px) {
	.ba-brand { margin-right: 0.65rem; }
	.ba-nav .wp-block-navigation__container { gap: 0.78rem; }
}

@media (max-width: 782px) {
	.ba-brand { margin-right: 0; }
	.ba-header-inner > .wp-block-group:last-child { gap: 0.4rem; }
	.ba-header-search { margin-left: 0; }
	.ba-header-search .wp-block-search__input {
		width: min(22rem, calc(100vw - 1.5rem));
		right: -0.15rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ba-header-search .wp-block-search__input,
	.ba-header-search .wp-block-search__button,
	.ba-text-link a,
	.ba-learn-pathway a,
	.ba-query-card a:not(.wp-block-button__link),
	.ba-learn-pathway {
		transition: none;
	}
}

/* Q1.1 full-bleed internal hero system, owner-approved 8 Oct 2026.
 * Editorial content stays on the canonical wide grid. The decorative surface
 * spans 100vw behind it without participating in layout or widening the page. */
:is(
	.ba-learn-shell,
	.ba-places-shell,
	.ba-contact-shell,
	.ba-contribute-shell,
	.ba-policy-shell,
	.ba-page-shell,
	.ba-archive-shell,
	.ba-search-shell
) > :is(.ba-page-intro, .ba-archive-intro, .ba-search-intro) {
	position: relative;
	isolation: isolate;
	overflow: visible;
	border-left: 0;
	background: transparent !important;
}

:is(
	.ba-learn-shell,
	.ba-places-shell,
	.ba-contact-shell,
	.ba-contribute-shell,
	.ba-policy-shell,
	.ba-page-shell,
	.ba-archive-shell,
	.ba-search-shell
) > :is(.ba-page-intro, .ba-archive-intro, .ba-search-intro)::after {
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 100vw;
	max-width: none;
	transform: translateX(-50%);
	background:
		radial-gradient(circle at 92% 18%, rgba(243, 163, 106, .2), transparent 13rem),
		linear-gradient(130deg, rgba(255, 252, 248, .9), rgba(74, 122, 127, .1));
	pointer-events: none;
}
