/*
 * Content Grid widget. The cards themselves come from content/assets/content-card.css.
 * Variables set by Elementor controls: --cgr-columns, --cgr-gap, --cgr-accent, --cgr-accent-text.
 */

.cgr {
	--cgr-columns: 3;
	--cgr-gap: 24px;
	--cgr-accent: #111;
	--cgr-accent-text: #fff;
}

/* ---------- Tabs ---------- */

.cgr-tabs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin: 0 0 28px;
	padding: 2px;
	overflow-x: auto;
	scrollbar-width: none;
}

.cgr-tabs::-webkit-scrollbar {
	display: none;
}

/* !important: resets Astra's global button styles. */
.cgr .cgr-tab {
	flex: 0 0 auto;
	margin: 0 !important;
	padding: 0.6em 1.3em !important;
	border: 1px solid rgba( 0, 0, 0, 0.15 ) !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: inherit !important;
	font: inherit;
	font-size: 0.95em;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.cgr .cgr-tab:focus {
	outline: none;
}

.cgr .cgr-tab:focus-visible {
	outline: 2px solid var( --cgr-accent ) !important;
	outline-offset: 2px;
}

.cgr .cgr-tab.is-active {
	border-color: var( --cgr-accent ) !important;
	background: var( --cgr-accent ) !important;
	color: var( --cgr-accent-text ) !important;
}

@media ( hover: hover ) {
	.cgr .cgr-tab:not( .is-active ):hover {
		border-color: var( --cgr-accent ) !important;
	}
}

/* ---------- Grid ---------- */

.cgr-grid {
	display: grid;
	grid-template-columns: repeat( var( --cgr-columns ), minmax( 0, 1fr ) );
	gap: var( --cgr-gap );
	transition: opacity 0.2s ease;
}

.cgr.is-loading .cgr-grid {
	opacity: 0.45;
	pointer-events: none;
}

/* Highlighted first card: full row, image beside the text (not on phones). */
@media ( min-width: 768px ) {
	.cgr--highlight-first .cgr-grid > .cc-card:first-child {
		grid-column: 1 / -1;
	}

	.cgr--highlight-first .cgr-grid > .cc-card:first-child .cc-link {
		flex-direction: row;
	}

	.cgr--highlight-first .cgr-grid > .cc-card:first-child .cc-media {
		flex: 0 0 55%;
		aspect-ratio: 16 / 10;
	}

	.cgr--highlight-first .cgr-grid > .cc-card:first-child .cc-body {
		justify-content: center;
		padding: 32px 36px;
	}

	.cgr--highlight-first .cgr-grid > .cc-card:first-child .cc-title {
		font-size: 1.6em;
	}

	.cgr--highlight-first .cgr-grid > .cc-card:first-child .cc-excerpt {
		font-size: 1em;
	}
}

/* ---------- Empty & load more ---------- */

.cgr-empty {
	margin: 24px 0;
	text-align: center;
	opacity: 0.75;
}

.cgr-more {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.cgr-more[hidden] {
	display: none;
}

.cgr .cgr-more-btn {
	margin: 0 !important;
	padding: 0.85em 2.2em !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var( --cgr-accent ) !important;
	color: var( --cgr-accent-text ) !important;
	font: inherit;
	font-weight: 600;
	box-shadow: none !important;
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.cgr .cgr-more-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

@media ( hover: hover ) {
	.cgr .cgr-more-btn:not( :disabled ):hover {
		transform: translateY( -2px );
	}
}
