/**
 * Tokenomicon Banner page block.
 *
 * Uses the Tokenomicon brand system (Inter display, JetBrains Mono accents,
 * #4F7CFF primary on a dark navy field) rather than the FinOps Foundation one.
 * Editable sizes and colours arrive as custom properties set inline on the
 * section by page-blocks/tokenomicon-banner.php.
 */

.tokenomicon-banner {
	position: relative;
	overflow: hidden;
	background-color: var(--tb-bg, #0a0f1e);
	/* Flex + a min-height keeps the content vertically centred when the banner
	   is taller than its content. Defaults to auto height when unset. */
	display: flex;
	align-items: center;
	min-height: var(--tb-min-height, auto);
}

/* Two mirrored radial glows behind the columns. */
.tokenomicon-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 140% at 18% 50%, rgba(79, 124, 255, 0.28), transparent 70%),
		radial-gradient(60% 140% at 82% 50%, rgba(79, 124, 255, 0.28), transparent 70%);
	background:
		radial-gradient(
			60% 140% at 18% 50%,
			color-mix(in srgb, var(--tb-glow, #4f7cff) var(--tb-glow-opacity, 28%), transparent),
			transparent 70%
		),
		radial-gradient(
			60% 140% at 82% 50%,
			color-mix(in srgb, var(--tb-glow, #4f7cff) var(--tb-glow-opacity, 28%), transparent),
			transparent 70%
		);
}

/* A background image replaces the gradients entirely. */
.tokenomicon-banner--has-image::before {
	display: none;
}

.tokenomicon-banner__inner {
	position: relative;
	z-index: 1;
	width: 100%;
}

/* Only applied when a Content Max Width is set, otherwise the theme's own
   .container widths stand. Two classes so this beats .container, whose
   breakpoint max-widths live in media queries and add no specificity. */
.tokenomicon-banner--custom-width .tokenomicon-banner__inner {
	max-width: var(--tb-content-max-width);
	margin-inline: auto;
}

.tokenomicon-banner__grid {
	display: grid;
	grid-template-columns: 1fr;
	align-items: center;
	gap: 2rem;
}

/* 1024px matches the theme's Tailwind `lg` breakpoint. */
@media (min-width: 1024px) {
	.tokenomicon-banner__grid {
		grid-template-columns: 1fr 1fr;
		gap: 3rem;
	}
}

/* ── Left column ─────────────────────────────────────────────────── */

.tokenomicon-banner__left {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
	min-width: 0;
}

.tokenomicon-banner .tokenomicon-banner__title {
	margin: 0;
	font-family: "Inter", "IBM Plex Sans", sans-serif;
	font-size: var(--tb-title-size-mobile, 36px);
	font-style: normal;
	font-weight: 600;
	line-height: 110%;
	letter-spacing: -0.03em;
	color: var(--tb-title-colour, #ffffff);
	text-wrap: pretty;
	/* Optional wrap point. The min() keeps a px limit from overflowing narrow
	   viewports, and the 100% default means "no limit beyond the column". */
	max-width: min(var(--tb-title-max-width, 100%), 100%);
}

@media (min-width: 1024px) {
	.tokenomicon-banner .tokenomicon-banner__title {
		font-size: var(--tb-title-size, 64px);
		letter-spacing: -2px;
	}
}

.tokenomicon-banner .tokenomicon-banner__subtitle {
	margin: 0;
	font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	font-size: var(--tb-subtitle-size, 20px);
	font-style: normal;
	font-weight: 400;
	line-height: 170%;
	letter-spacing: 0.02em;
	color: var(--tb-subtitle-colour, #4f7cff);
}

/* ── Right column ────────────────────────────────────────────────── */

.tokenomicon-banner__right {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 1rem;
	min-width: 0;
}

@media (min-width: 1024px) {
	.tokenomicon-banner__right {
		align-items: center;
	}
}

.tokenomicon-banner__image {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: var(--tb-right-image-max-h, 40px);
}

.tokenomicon-banner .tokenomicon-banner__right-title {
	margin: 0;
	font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	font-size: var(--tb-right-title-size, 28px);
	font-weight: 400;
	line-height: 130%;
	color: var(--tb-right-title-colour, #ffffff);
	max-width: 100%;
	overflow-wrap: break-word;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.tokenomicon-banner__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	/* The parent is `align-items: flex-start`, so without this the row sizes to
	   max-content and overflows instead of wrapping on narrow screens. */
	max-width: 100%;
}

.tokenomicon-banner .tokenomicon-banner__button {
	display: inline-flex;
	height: 48px;
	padding: 0 24px;
	justify-content: center;
	align-items: center;
	border-radius: 8px;
	font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.tokenomicon-banner .tokenomicon-banner__button--primary {
	background-color: #4f7cff;
	color: #ffffff;
	border: 1px solid #4f7cff;
}

.tokenomicon-banner .tokenomicon-banner__button--primary:hover,
.tokenomicon-banner .tokenomicon-banner__button--primary:focus {
	background-color: #3a68f0;
	border-color: #3a68f0;
	color: #ffffff;
}

.tokenomicon-banner .tokenomicon-banner__button--outline {
	background-color: transparent;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.tokenomicon-banner .tokenomicon-banner__button--outline:hover,
.tokenomicon-banner .tokenomicon-banner__button--outline:focus {
	background-color: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.6);
	color: #ffffff;
}

.tokenomicon-banner .tokenomicon-banner__button:focus-visible {
	outline: 2px solid #8bb0ff;
	outline-offset: 2px;
}
