/*
 * Shared WNYPress account switchboard for static properties.
 * The component is intentionally self-contained and inherits no theme styles.
 */

.wny-account-switchboard {
	--wny-switchboard-ink: #111827;
	--wny-switchboard-muted: #667085;
	--wny-switchboard-line: #e1e6ed;
	--wny-switchboard-blue: #1463ff;
	position: relative;
	flex: 0 0 auto;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
}

.wny-switchboard-trigger,
.wny-switchboard-signin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	margin: 0;
	padding: 0 12px;
	color: var(--wny-switchboard-ink);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	box-shadow: none;
	font: inherit;
	font-weight: 650;
	text-decoration: none;
	cursor: pointer;
	transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.wny-switchboard-signin {
	border-color: var(--wny-switchboard-line);
	background: #fff;
}

.wny-switchboard-trigger:hover,
.wny-switchboard-trigger:focus-visible,
.wny-switchboard-signin:hover,
.wny-switchboard-signin:focus-visible,
.wny-account-switchboard.is-open .wny-switchboard-trigger {
	color: var(--wny-switchboard-blue);
	background: #f4f7ff;
	border-color: #cbd8f5;
	outline: none;
}

.wny-switchboard-trigger-avatar,
.wny-switchboard-trigger-initials {
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	border-radius: 50%;
}

.wny-switchboard-trigger-avatar {
	display: block;
	object-fit: cover;
}

.wny-switchboard-trigger-initials {
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(145deg, #1463ff, #28c8df);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.03em;
}

.wny-switchboard-trigger-name {
	max-width: 112px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wny-switchboard-chevron {
	position: relative;
	top: -1px;
	font-size: 15px;
	line-height: 1;
	transition: transform 160ms ease;
}

.wny-account-switchboard.is-open .wny-switchboard-chevron {
	transform: rotate(180deg);
}

.wny-switchboard-panel {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 12px);
	right: 0;
	width: min(330px, calc(100vw - 28px));
	padding: 18px 0 12px;
	color: var(--wny-switchboard-ink);
	background: #fff;
	border: 1px solid var(--wny-switchboard-line);
	border-radius: 12px;
	box-shadow: 0 22px 60px rgba(16, 24, 40, 0.18);
}

.wny-switchboard-panel[hidden] {
	display: none;
}

.wny-switchboard-identity {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	padding: 0 22px 16px;
}

.wny-switchboard-avatar,
.wny-switchboard-initials {
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.wny-switchboard-avatar {
	display: block;
	object-fit: cover;
}

.wny-switchboard-initials {
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(145deg, #1463ff, #28c8df);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.04em;
}

.wny-switchboard-identity-copy {
	display: grid;
	min-width: 0;
}

.wny-switchboard-identity-copy strong,
.wny-switchboard-identity-copy small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wny-switchboard-identity-copy strong {
	color: #101828;
	font-size: 16px;
	font-weight: 750;
}

.wny-switchboard-identity-copy small {
	margin-top: 2px;
	color: var(--wny-switchboard-muted);
	font-size: 12px;
	font-weight: 500;
}

.wny-switchboard-section {
	padding: 10px 0;
	border-top: 1px solid var(--wny-switchboard-line);
}

.wny-switchboard-section:first-of-type {
	padding-top: 8px;
}

.wny-switchboard-heading {
	display: block;
	padding: 3px 22px 6px;
	color: #344054;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wny-switchboard-link {
	display: flex;
	align-items: center;
	min-height: 38px;
	padding: 8px 22px;
	color: #283548 !important;
	background: transparent;
	border: 0;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.45;
	text-decoration: none !important;
}

.wny-switchboard-link:hover,
.wny-switchboard-link:focus-visible {
	color: #0b55d9 !important;
	background: #f3f7ff;
	outline: none;
}

.wny-switchboard-link-signout {
	color: #9b1c1c !important;
}

.wny-switchboard-link-signout:hover,
.wny-switchboard-link-signout:focus-visible {
	color: #7f1d1d !important;
	background: #fff5f5;
}

@media (max-width: 760px) {
	.primary-nav .wny-account-switchboard {
		order: 10;
		margin-top: 4px;
		padding-top: 12px;
		border-top: 1px solid var(--wny-switchboard-line);
	}

	.primary-nav .wny-switchboard-trigger,
	.primary-nav .wny-switchboard-signin {
		width: 100%;
		justify-content: flex-start;
		min-height: 46px;
		padding-inline: 12px;
	}

	.primary-nav .wny-switchboard-panel {
		position: static;
		width: 100%;
		margin-top: 8px;
		box-shadow: none;
	}
}

@media (max-width: 900px) {
	.header-inner > .wny-account-switchboard {
		margin-left: auto;
	}

	.header-inner > .wny-account-switchboard .wny-switchboard-trigger-name {
		display: none;
	}
}

@media (max-width: 480px) {
	.header-inner > .wny-account-switchboard .wny-switchboard-trigger,
	.header-inner > .wny-account-switchboard .wny-switchboard-signin {
		width: 42px;
		min-width: 42px;
		padding: 0;
		font-size: 0;
	}

	.header-inner > .wny-account-switchboard .wny-switchboard-signin::before {
		content: "A";
		display: grid;
		width: 26px;
		height: 26px;
		place-items: center;
		color: #fff;
		background: #111827;
		border-radius: 50%;
		font-size: 11px;
		font-weight: 800;
	}

	.header-inner > .wny-account-switchboard .wny-switchboard-chevron {
		display: none;
	}

	.header-inner > .wny-account-switchboard .wny-switchboard-panel {
		position: fixed;
		top: 70px;
		right: 10px;
		left: 10px;
		width: auto;
		max-height: calc(100vh - 82px);
		overflow-y: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wny-account-switchboard *,
	.wny-account-switchboard *::before,
	.wny-account-switchboard *::after {
		transition: none !important;
	}
}
