/* Editorial visual roles. Layout, media crops, and destination markup stay with each renderer. */
:where(.wp-site-blocks main, .editor-styles-wrapper) {
	--tgs-editorial-ink: var(--wp--preset--color--ink);
	--tgs-editorial-paper: var(--wp--preset--color--paper);
	--tgs-editorial-rule: 2px solid var(--tgs-editorial-ink);
	--tgs-editorial-card-offset: 7px;
	--tgs-editorial-card-motion: 140ms ease-out;
	--tgs-editorial-action-motion: 120ms ease;
	--tgs-editorial-inset: clamp(1rem, 1.7vw, 1.4rem);
	--tgs-editorial-title-size: clamp(1.35rem, 1.9vw, 1.85rem);
}

:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-card--article, .tgs-entity-card, .tgs-program-directory-card,
	.tgs-guide-directory-card, .tgs-program-related-card, .tgs-masters-card,
	.tgs-test-core-card, .tgs-link-card, .tgs-silo-card, .tgs-grad-branch-card,
	.tgs-home-nav-card, .tgs-author-directory-card
) {
	background-color: var(--tgs-editorial-paper);
	border: 3px solid var(--tgs-editorial-ink);
	border-radius: 0;
	box-shadow: var(--tgs-editorial-card-offset) var(--tgs-editorial-card-offset) 0 var(--tgs-accent);
	color: var(--tgs-editorial-ink);
	transition: background-color var(--tgs-editorial-card-motion), box-shadow var(--tgs-editorial-card-motion), transform var(--tgs-editorial-card-motion);
}

:where(.wp-site-blocks main, .editor-styles-wrapper) :is(.tgs-article-card, .tgs-program-related-card, .tgs-home-resource):is([data-silo="india"], [data-silo="tests"]) {
	--tgs-accent-contrast: var(--tgs-editorial-paper);
}

/* Cards with a separate body keep the border around the media and body together. */
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-program-directory-card__body, .tgs-article-card__body, .tgs-guide-directory-card__body,
	.tgs-entity-card:not(.tgs-entity-card--editorial), .tgs-test-core-card,
	.tgs-home-nav-card, .tgs-author-directory-card, .tgs-program-related-card
) {
	padding: var(--tgs-editorial-inset);
}
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-entity-directory__grid .tgs-program-directory-card__body,
	.tgs-article-category .tgs-article-card__body
) {
	gap: .65rem;
}

/* Numbered links retain their compact row and divider geometry. */
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-card--list-row {
	background: var(--tgs-editorial-paper);
	border: var(--tgs-editorial-rule);
	border-radius: 0;
	box-shadow: none;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(.tgs-career, .tgs-industry, .tgs-cornerstone) .tgs-card--list-row {
	background: transparent;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-cornerstone .tgs-card--list-row {
	border: 0;
	border-top: 1px solid #c5c0b7;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-card--list-row > a {
	transition: background-color var(--tgs-editorial-card-motion);
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-card--list-row > a:is(:hover, :focus-visible) {
	background: var(--tgs-accent);
	color: var(--tgs-accent-contrast, var(--tgs-editorial-ink));
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-card--list-row > a:is(:hover, :focus-visible) :is(.tgs-card--list-row__index, .tgs-card--list-row__arrow) {
	color: inherit;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-card--list-row > a:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -3px;
}

:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-card--article, .tgs-program-directory-card, .tgs-guide-directory-card, .tgs-entity-card, .tgs-test-core-card
) h3 {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--tgs-editorial-title-size);
	font-weight: 900;
	letter-spacing: -.03em;
	line-height: 1.15;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-article-card--compact {
	--tgs-editorial-title-size: 1.2rem;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-card--article, .tgs-program-directory-card, .tgs-guide-directory-card, .tgs-entity-card, .tgs-test-core-card
) h3 a {
	color: inherit;
	text-decoration: none;
}

/* The surface owns the title and supporting text color, including dark accents. */
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-card--article, .tgs-program-directory-card, .tgs-guide-directory-card, .tgs-entity-card,
	.tgs-test-core-card, .tgs-home-nav-card, .tgs-silo-card, .tgs-link-card,
	.tgs-grad-branch-card, .tgs-author-directory-card, .tgs-program-related-card, .tgs-card--list-row
) :is(
	h2, h3, .tgs-article-card__excerpt, .tgs-program-directory-card__excerpt,
	.tgs-guide-directory-card__excerpt, .tgs-entity-card__excerpt
),
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-program-related-card__body :is(strong, p) {
	color: inherit;
}

/* All label aliases consume one badge, including standard text-only directories. */
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-program-directory-card__label, .tgs-article-card__label, .tgs-guide-directory-card__label,
	.tgs-entity-card__label, .tgs-program-related-card__type
) {
	display: inline-block;
	width: fit-content;
	max-width: 100%;
	margin: 0 0 1rem;
	padding: .35rem .55rem;
	background: var(--tgs-accent);
	color: var(--tgs-accent-contrast, var(--tgs-editorial-ink));
	border: var(--tgs-editorial-rule);
	box-shadow: none;
	font: 900 .7rem/1.7 var(--wp--preset--font-family--body);
	letter-spacing: .08em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

/* Card actions preserve their rendered arrow and move with the parent card. */
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-program-directory-card__cta, .tgs-article-card__cta, .tgs-guide-directory-card__cta,
	.tgs-entity-card__link, .tgs-test-core-card__cta,
	:where(.tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card) .wp-block-button__link
) {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: .45rem;
	padding: .65rem .85rem;
	background: var(--tgs-editorial-ink);
	color: var(--tgs-editorial-paper);
	border: var(--tgs-editorial-rule);
	border-radius: 0;
	box-shadow: 4px 4px 0 var(--tgs-accent);
	font: 900 .76rem/1.55 var(--wp--preset--font-family--body);
	letter-spacing: .06em;
	text-decoration: none;
	text-transform: uppercase;
}

/* Standalone navigation actions use the existing Gutenberg primary and outline variants. */
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(.wp-block-button__link:where(:not(:where(.tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card) *)), .tgs-button, .tgs-editorial-hub__callout > a) {
	display: inline-flex;
	min-height: 3.75rem;
	align-items: center;
	justify-content: center;
	padding: 1rem 1.5rem;
	background: var(--tgs-accent);
	color: var(--tgs-accent-contrast, var(--tgs-editorial-ink));
	border: var(--tgs-editorial-rule);
	border-radius: 0;
	box-shadow: var(--tgs-editorial-action-shadow, var(--tgs-shadow-small));
	font: 900 .82rem/1.2 var(--wp--preset--font-family--body);
	letter-spacing: .11em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: box-shadow var(--tgs-editorial-action-motion), transform var(--tgs-editorial-action-motion);
}

@media (hover: hover) and (pointer: fine) {
	:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
		.tgs-card--article, .tgs-entity-card, .tgs-program-directory-card, .tgs-guide-directory-card,
		.tgs-program-related-card, .tgs-masters-card, .tgs-test-core-card, .tgs-link-card,
		.tgs-silo-card, .tgs-grad-branch-card, .tgs-home-nav-card, .tgs-author-directory-card
	):is(:hover, :focus-within) {
		background-color: var(--tgs-accent);
		color: var(--tgs-accent-contrast, var(--tgs-editorial-ink));
		box-shadow: 10px 10px 0 var(--tgs-editorial-ink);
		transform: translateY(-6px);
	}
	:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
		.tgs-card--article, .tgs-entity-card, .tgs-program-directory-card, .tgs-guide-directory-card,
		.tgs-program-related-card, .tgs-test-core-card, .tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card
	):is(:hover, :focus-within) :is(
		.tgs-program-directory-card__label, .tgs-article-card__label, .tgs-guide-directory-card__label,
		.tgs-entity-card__label, .tgs-program-related-card__type,
		.tgs-program-directory-card__cta, .tgs-article-card__cta, .tgs-guide-directory-card__cta,
		.tgs-entity-card__link, .tgs-test-core-card__cta, .wp-block-button__link
	) {
		background: var(--tgs-editorial-paper);
		color: var(--tgs-editorial-ink);
	}
	:where(.wp-site-blocks main, .editor-styles-wrapper) :is(.wp-block-button__link:where(:not(:where(.tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card) *)), .tgs-button, .tgs-editorial-hub__callout > a):hover {
		box-shadow: var(--tgs-editorial-action-hover-shadow, var(--tgs-shadow));
		transform: translate(-2px, -2px);
	}
}

:where(.wp-site-blocks main, .editor-styles-wrapper) :is(.wp-block-button__link:where(:not(:where(.tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card) *)), .tgs-button, .tgs-editorial-hub__callout > a):active {
	box-shadow: var(--tgs-editorial-action-active-shadow, 2px 2px 0 var(--tgs-editorial-ink));
	transform: translate(2px, 2px);
}
/* The existing accent panels use a paper action with the primary offset. */
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-hub-crosslinks .wp-block-button__link {
	background: var(--tgs-editorial-paper);
	color: var(--tgs-editorial-ink);
}
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-button-secondary, .tgs-ug-secondary, .tgs-gsr-secondary, .tgs-cr-secondary, .is-style-outline
) .wp-block-button__link {
	--tgs-editorial-action-shadow: none;
	--tgs-editorial-action-hover-shadow: none;
	--tgs-editorial-action-active-shadow: none;
	background: var(--tgs-editorial-paper);
	color: var(--tgs-editorial-ink);
}

:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-card--article, .tgs-program-directory-card, .tgs-guide-directory-card, .tgs-entity-card, .tgs-test-core-card
) h3 a:focus-visible,
:where(.wp-site-blocks main, .editor-styles-wrapper) .tgs-program-related-card:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}
:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
	.tgs-program-directory-card__cta, .tgs-article-card__cta, .tgs-guide-directory-card__cta,
	.tgs-entity-card__link, .tgs-test-core-card__cta, .wp-block-button__link, .tgs-button, .tgs-editorial-hub__callout > a
):focus-visible {
	outline: 3px solid var(--tgs-accent);
	outline-offset: 4px;
}

@media (max-width: 767px) {
	:where(.wp-site-blocks main, .editor-styles-wrapper) { --tgs-editorial-card-offset: 5px; }
}

@media (prefers-reduced-motion: reduce) {
	:where(.wp-site-blocks main, .editor-styles-wrapper) :is(
		.tgs-card--article, .tgs-entity-card, .tgs-program-directory-card, .tgs-guide-directory-card,
		.tgs-program-related-card, .tgs-masters-card, .tgs-test-core-card, .tgs-link-card,
		.tgs-silo-card, .tgs-grad-branch-card, .tgs-home-nav-card, .tgs-author-directory-card,
		.wp-block-button__link:where(:not(:where(.tgs-home-nav-card, .tgs-silo-card, .tgs-link-card, .tgs-grad-branch-card) *)), .tgs-button, .tgs-editorial-hub__callout > a
	):is(:hover, :focus-within, :active) {
		transform: none;
		transition: none;
	}
}
