/**
 * ws-form/knowledgebase-panel
 *
 * Main tab chrome: blocks/shared/tabs.css (.wsft-tabs / .wsft-tab).
 * Notes alerts: blocks/alert/style.css (.wsft-alert.alert).
 */

.wsft-knowledgebase-panel,
.wp-block-ws-form-knowledgebase-panel {
	margin: 0 0 1.25rem;
	max-width: 100%;
	min-width: 0;
}

.wsft-knowledgebase-panel__inner {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius, 0.125rem);
	box-sizing: border-box;
	max-width: 100%;
	overflow: hidden;
	width: 100%;
}

.wsft-knowledgebase-panel__tabs {
	padding: 0 1rem;
}

.wsft-knowledgebase-panel__tabs .wsft-tabs__list {
	border-bottom-color: var(--wp--preset--color--border);
}

.wsft-knowledgebase-panel__tabs .wsft-tabs__mobile {
	padding: 0.75rem 0;
}

.wsft-knowledgebase-panel__panel {
	box-sizing: border-box;
	padding: 1rem 1.5rem;
}

.wsft-knowledgebase-panel__panel[hidden] {
	display: none !important;
}

/* On This Page */
.wsft-knowledgebase-panel__toc {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.wsft-knowledgebase-panel__toc-link {
	color: var(--wp--preset--color--logo-blue);
	font-size: 0.8125rem; /* 13px */
	font-weight: 300;
	line-height: 1.4;
	padding: 0.25rem 0;
	text-decoration: none;
}

.wsft-knowledgebase-panel__toc-link:hover,
.wsft-knowledgebase-panel__toc-link:focus {
	color: var(--wp--preset--color--logo-blue);
	text-decoration: underline;
}

.wsft-knowledgebase-panel__toc-sep {
	color: var(--wp--preset--color--text-light);
	margin-left: 0.25rem;
}

/* Notes */
.wsft-knowledgebase-panel__notes {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.wsft-knowledgebase-panel__notes .wsft-alert.alert {
	margin: 0;
}

/* Integrations sub-tabs (plugin-style pills) */
.wsft-knowledgebase-panel__subtabs {
	align-items: center;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--border);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: -1rem -1.5rem 1.25rem;
	padding: 0.75rem 1.5rem;
}

.wsft-knowledgebase-panel__subtab {
	background: var(--wp--preset--color--soft-gray);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	color: var(--wp--preset--color--text-dark);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.8125rem; /* 13px */
	font-weight: 500;
	line-height: 1.3;
	min-height: 2rem;
	padding: 0.375rem 0.75rem;
	transition: background-color var(--wp--custom--transition, 200ms ease-in-out),
		color var(--wp--custom--transition, 200ms ease-in-out),
		border-color var(--wp--custom--transition, 200ms ease-in-out);
}

.wsft-knowledgebase-panel__subtab:hover {
	border-color: var(--wp--preset--color--text-light);
}

.wsft-knowledgebase-panel__subtab:focus {
	outline: none;
}

.wsft-knowledgebase-panel__subtab:focus-visible {
	box-shadow: 0 0 0 2px var(--wp--preset--color--white), 0 0 0 4px var(--wp--preset--color--logo-blue);
	outline: 2px solid transparent;
}

.wsft-knowledgebase-panel__subtab.is-active,
.wsft-knowledgebase-panel__subtab.is-active:hover {
	background: var(--wp--preset--color--logo-blue);
	border-color: var(--wp--preset--color--logo-blue);
	color: var(--wp--preset--color--white);
	cursor: default;
}

.wsft-knowledgebase-panel__download[hidden] {
	display: none !important;
}

.wsft-knowledgebase-panel__editions-head {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	justify-content: space-between;
	margin: 0 0 0.875rem;
}

.wsft-knowledgebase-panel__editions-label {
	color: var(--wp--preset--color--text-light);
	font-size: 0.75rem; /* 12px */
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-decoration: none;
	text-transform: uppercase;
}

a.wsft-knowledgebase-panel__editions-label {
	color: var(--wp--preset--color--logo-blue);
}

a.wsft-knowledgebase-panel__editions-label:hover,
a.wsft-knowledgebase-panel__editions-label:focus {
	color: var(--wp--preset--color--logo-blue);
	text-decoration: underline;
}

.wsft-knowledgebase-panel__editions-link {
	align-items: center;
	color: var(--wp--preset--color--logo-blue);
	display: inline-flex;
	font-size: 0.875rem; /* 14px */
	font-weight: 600;
	gap: 0.25rem;
	text-decoration: none;
}

.wsft-knowledgebase-panel__editions-link:hover,
.wsft-knowledgebase-panel__editions-link:focus {
	color: var(--wp--preset--color--logo-blue);
	text-decoration: underline;
}

.wsft-knowledgebase-panel__editions {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.wsft-knowledgebase-panel__edition {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius, 0.125rem);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	justify-content: space-between;
	min-width: 0;
	padding: 0.875rem 1rem;
}

.wsft-knowledgebase-panel__edition.is-included {
	background: var(--wp--preset--color--soft-blue);
	border-color: var(--wp--preset--color--accent-blue);
}

.wsft-knowledgebase-panel__edition-name {
	color: var(--wp--preset--color--text-dark);
	font-size: 0.875rem; /* 14px */
	font-weight: 600;
	line-height: 1.3;
}

.wsft-knowledgebase-panel__edition-status {
	color: var(--wp--preset--color--text-light);
	font-size: 0.75rem; /* 12px */
	font-weight: 500;
	line-height: 1.35;
	margin-top: 0.625rem;
}

.wsft-knowledgebase-panel__edition.is-included .wsft-knowledgebase-panel__edition-status {
	color: var(--wp--preset--color--semantic-green);
	font-weight: 600;
}

.wsft-knowledgebase-panel__included {
	align-items: center;
	display: inline-flex;
	gap: 0.375rem;
}

.wsft-knowledgebase-panel__buy {
	align-items: center;
	background-color: var(--wp--preset--color--logo-blue);
	border: 1px solid var(--wp--preset--color--logo-blue);
	border-radius: var(--wp--custom--border-radius, 0.125rem);
	box-sizing: border-box;
	color: var(--wp--preset--color--white);
	display: inline-flex;
	font-size: 0.75rem; /* 12px */
	font-weight: 600;
	justify-content: center;
	line-height: 1.2;
	min-height: 2.125rem; /* 34px */
	padding: 0.375rem 0.75rem;
	text-decoration: none;
	width: 100%;
}

.wsft-knowledgebase-panel__buy:hover,
.wsft-knowledgebase-panel__buy:focus {
	background-color: var(--wp--preset--color--accent-blue);
	border-color: var(--wp--preset--color--accent-blue);
	color: var(--wp--preset--color--white);
}

.wsft-knowledgebase-panel__fineprint {
	color: var(--wp--preset--color--text-light);
	font-size: 0.75rem; /* 12px */
	line-height: 1.35;
	margin: 0.75rem 0 0;
}

/* Related */
.wsft-knowledgebase-panel__related {
	display: flex;
	flex-direction: column;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wsft-knowledgebase-panel__related-item {
	margin: 0;
	padding: 0;
}

.wsft-knowledgebase-panel__related-item:not(:last-child) {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.wsft-knowledgebase-panel__related-link {
	align-items: center;
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	padding: 0.625rem 0;
	text-decoration: none;
}

.wsft-knowledgebase-panel__related-copy {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
}

.wsft-knowledgebase-panel__related-title {
	color: var(--wp--preset--color--text-dark);
	font-size: 0.875rem; /* 14px */
	font-weight: 500;
	line-height: 1.35;
}

.wsft-knowledgebase-panel__related-type {
	color: var(--wp--preset--color--text-light);
	font-size: 0.75rem; /* 12px */
	line-height: 1.35;
}

.wsft-knowledgebase-panel__related-arrow {
	color: var(--wp--preset--color--logo-blue);
	flex-shrink: 0;
	font-size: 0.875rem;
}

.wsft-knowledgebase-panel__related-link:hover .wsft-knowledgebase-panel__related-title,
.wsft-knowledgebase-panel__related-link:focus .wsft-knowledgebase-panel__related-title {
	color: var(--wp--preset--color--logo-blue);
}

@media (max-width: 640px) {
	.wsft-knowledgebase-panel__editions {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsft-knowledgebase-panel__subtab {
		transition: none;
	}
}
