/* Ecosystem Grid — front-end (CSS variables overridable via Grid settings) */

.ecosystem-grid {
	--eg-border: rgba(255, 255, 255, 0.08);
	--eg-title: #ffffff;
	--eg-heading: var(--eg-title);
	--eg-muted: rgba(255, 255, 255, 0.55);
	--eg-icon: rgba(255, 255, 255, 0.45);
	--eg-icon-hover: rgba(255, 255, 255, 0.95);
	--eg-logo-bg: rgba(255, 255, 255, 0.06);
	--eg-text-align: center;
	--eg-cols-mobile: 2;
	--eg-cols-tablet: 3;
	--eg-cols-desktop: 5;
	--eg-gap: 1.25rem;
	--eg-icon-size: 18px;
	--eg-title-font-size: 0.95rem;
	color: var(--eg-title);
	margin: 2rem 0;
}

.ecosystem-grid__heading {
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	font-weight: 600;
	letter-spacing: 0.02em;
	margin: 0 0 1.25rem;
	text-transform: uppercase;
	color: var(--eg-heading);
	text-align: var(--eg-text-align);
}

.ecosystem-grid__cards {
	display: grid;
	grid-template-columns: repeat(var(--eg-cols-mobile), minmax(0, 1fr));
	gap: var(--eg-gap);
	align-items: stretch;
}

@media (min-width: 768px) {
	.ecosystem-grid__cards {
		grid-template-columns: repeat(var(--eg-cols-tablet), minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.ecosystem-grid__cards {
		grid-template-columns: repeat(var(--eg-cols-desktop), minmax(0, 1fr));
	}
}

.ecosystem-grid__app-hit {
	display: flex;
	flex-direction: column;
	align-items: inherit;
	width: 100%;
	text-decoration: none;
	color: inherit;
}

.ecosystem-grid__app-hit:hover .ecosystem-grid__title,
.ecosystem-grid__app-hit:focus-visible .ecosystem-grid__title {
	text-decoration: underline;
}

.ecosystem-grid__app-hit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}

.ecosystem-grid__card {
	background: transparent;
	border: 1px solid var(--eg-border);
	border-radius: 12px;
	padding: 1rem 1rem 0.85rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: var(--eg-text-align);
	min-height: 100%;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.ecosystem-grid__card:hover {
	border-color: rgba(255, 255, 255, 0.18);
	transform: translateY(-2px);
}

.ecosystem-grid__logo-wrap {
	width: 100%;
	max-width: 104px;
	aspect-ratio: 1;
	border-radius: 14px;
	background: var(--eg-logo-bg, rgba(255, 255, 255, 0.06));
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.85rem;
	overflow: hidden;
}

.ecosystem-grid__logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 10px;
}

.ecosystem-grid__logo--placeholder {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
}

.ecosystem-grid__title {
	font-size: var(--eg-title-font-size, 0.95rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	margin: 0 0 0.35rem;
	text-transform: uppercase;
	word-break: break-word;
	color: var(--eg-title);
}

.ecosystem-grid__subtitle {
	font-size: 0.78rem;
	color: var(--eg-muted);
	margin: 0 0 0.75rem;
	line-height: 1.35;
}

.ecosystem-grid__socials {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 0.5rem;
	margin-top: auto;
	padding-bottom: 0.15rem;
	min-height: 28px;
}

.ecosystem-grid__social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--eg-icon);
	transition: color 0.15s ease, opacity 0.15s ease;
	opacity: 0.95;
}

.ecosystem-grid__social--icon-only {
	cursor: default;
	pointer-events: none;
}

.ecosystem-grid__social:hover,
.ecosystem-grid__social:focus-visible {
	color: var(--eg-icon-hover);
	opacity: 1;
	outline: none;
}

.ecosystem-grid__icon {
	display: block;
	flex-shrink: 0;
	width: var(--eg-icon-size);
	height: var(--eg-icon-size);
}

/* Tokens: trading links */
.ecosystem-grid__trades {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem;
	margin-top: auto;
	padding-bottom: 0.15rem;
	width: 100%;
}

.ecosystem-grid__trade-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.45rem;
	border-radius: 6px;
	border: 1px solid var(--eg-border);
	color: var(--eg-muted);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ecosystem-grid__trade-link:hover,
.ecosystem-grid__trade-link:focus-visible {
	color: var(--eg-icon-hover);
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.04);
	outline: none;
}

.ecosystem-grid__trade-label {
	white-space: nowrap;
}

.ecosystem-grid__card--token .ecosystem-grid__title {
	margin-bottom: 0.65rem;
}

.ecosystem-grid__card--wallet .ecosystem-grid__title {
	margin-bottom: 0.65rem;
}

/* Pagination */
.ecosystem-grid__pagination {
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--eg-border);
}

.ecosystem-grid__pagination-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.65rem 1rem;
}

.ecosystem-grid__pagination-link {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.85rem;
	border-radius: 8px;
	border: 1px solid var(--eg-border);
	color: var(--eg-muted);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ecosystem-grid__pagination-link:not(.ecosystem-grid__pagination-link--disabled):hover,
.ecosystem-grid__pagination-link:not(.ecosystem-grid__pagination-link--disabled):focus-visible {
	color: var(--eg-icon-hover);
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.04);
	outline: none;
}

.ecosystem-grid__pagination-link--disabled {
	opacity: 0.4;
	cursor: default;
	pointer-events: none;
}

.ecosystem-grid__pagination-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ecosystem-grid__pagination-pages li {
	margin: 0;
}

.ecosystem-grid__pagination-num,
.ecosystem-grid__pagination-current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.35rem;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 500;
}

.ecosystem-grid__pagination-num {
	border: 1px solid var(--eg-border);
	color: var(--eg-muted);
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.ecosystem-grid__pagination-num:hover,
.ecosystem-grid__pagination-num:focus-visible {
	color: var(--eg-icon-hover);
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.04);
	outline: none;
}

.ecosystem-grid__pagination-current {
	border: 1px solid rgba(255, 255, 255, 0.35);
	color: var(--eg-title);
	background: rgba(255, 255, 255, 0.06);
}

.ecosystem-grid__pagination-ellipsis span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	color: var(--eg-muted);
	font-size: 0.875rem;
	opacity: 0.75;
}
