/**
 * Home — Countries explorer grid (home preview + /countries/ archive).
 *
 * @package EveryCountry
 */

/* Same solid base as hero / page (no gradient); no map (hero only). */
.ebc-explore {
	background-color: var( --ebc-hero-canvas, #1a212a ) !important;
	background-image: none !important;
	color: #f8fafc !important;
	border-top: none !important;
}

.ebc-explore__inner {
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
}

.ebc-explore__header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.ebc-explore__title {
	margin: 0 0 0.5rem;
	font-size: clamp( 1.65rem, 3.2vw, 2.1rem );
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.2;
	color: #f8fafc !important;
}

.ebc-explore__subtitle {
	margin: 0 auto;
	max-width: 34rem;
	font-size: clamp( 1rem, 1.4vw, 1.1rem );
	line-height: 1.55;
	color: rgba( 226, 232, 240, 0.72 ) !important;
}

/* ——— Grid ——— */
.ebc-explore__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 14.5rem, 1fr ) );
	gap: 1.25rem 1.2rem;
}

.ebc-explore-card {
	margin: 0;
}

.ebc-explore-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	background: var( --ebc-dk-card, #1f2937 );
	border: 1px solid var( --ebc-dk-hairline, rgba( 255, 255, 255, 0.04 ) );
	border-radius: 14px;
	overflow: hidden;
	box-shadow:
		0 1px 0 rgba( 255, 255, 255, 0.04 ),
		0 8px 24px rgba( 0, 0, 0, 0.35 );
	transition:
		border-color 0.25s ease,
		box-shadow 0.3s ease,
		transform 0.3s cubic-bezier( 0.22, 1, 0.36, 1 );
}

.ebc-explore-card__link:focus-visible {
	outline: 2px solid var( --ebc-accent, #3b82f6 );
	outline-offset: 2px;
}

.ebc-explore-card__link:hover,
.ebc-explore-card__link:focus {
	border-color: rgba( 59, 130, 246, 0.45 );
	box-shadow:
		0 12px 32px rgba( 0, 0, 0, 0.45 ),
		0 0 0 1px rgba( 59, 130, 246, 0.2 );
	transform: translateY( -5px ) scale( 1.015 );
}

/* ——— Top visual ——— */
.ebc-explore-card__media {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 4 / 3;
	min-height: 6.5rem;
	overflow: hidden;
}

.ebc-explore-card__media--photo {
	background: var( --ebc-dk-section, #1a212a );
}

.ebc-explore-card__media--photo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient( 180deg, transparent 45%, rgba( 0, 0, 0, 0.45 ) 100% );
	opacity: 0.9;
}

.ebc-explore-card__img-el,
.ebc-explore-card__media--photo .ebc-explore-card__img-el,
.ebc-explore-card__media--photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ebc-explore-card__media--synthetic {
	--ebc-h: 210;
}

.ebc-explore-card__synthetic {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(
		150deg,
		hsl( var( --ebc-h ) 46% 42% ) 0%,
		hsl( calc( var( --ebc-h ) + 22 ) 40% 30% ) 100%
	);
}

.ebc-explore-card__synthetic-ribbon {
	position: absolute;
	top: 0.5rem;
	left: 0.6rem;
	opacity: 0.95;
	filter: drop-shadow( 0 2px 8px rgba( 0, 0, 0, 0.35 ) );
}

.ebc-explore-card__synthetic-waves {
	position: absolute;
	bottom: 0.35rem;
	left: 50%;
	transform: translateX( -50% );
	opacity: 0.9;
}

.ebc-explore-card__synthetic-initial {
	position: relative;
	z-index: 1;
	font-size: clamp( 2.1rem, 5vw, 2.5rem );
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
	color: rgba( 255, 255, 255, 0.95 );
	text-shadow: 0 2px 16px rgba( 0, 0, 0, 0.4 );
}

/* ——— Text block ——— */
.ebc-explore-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	flex: 1 1 auto;
	padding: 0.9rem 1rem 1.05rem;
}

.ebc-explore-card__name {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: #f1f5f9;
}

.ebc-explore-card__badge {
	display: inline-block;
	margin: 0;
	padding: 0.2rem 0.6rem 0.22rem;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-transform: none;
	border-radius: 999px;
	white-space: nowrap;
}

.ebc-explore-card__badge--not {
	color: rgba( 203, 213, 225, 0.95 );
	background: #374151;
	border: 1px solid rgba( 255, 255, 255, 0.1 );
}

.ebc-explore-card__badge--visited {
	color: #6ee7b7;
	background: rgba( 6, 78, 59, 0.5 );
	border: 1px solid rgba( 52, 211, 153, 0.35 );
}

/* CTA — primary + secondary-style outline (View All) */
.ebc-explore__actions {
	margin: 2.25rem 0 0;
	text-align: center;
}

.ebc-explore__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.85rem;
	padding: 0.6em 1.6em;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	color: #fff !important;
	background: #3b82f6;
	border: 1px solid #3b82f6;
	border-radius: 8px;
	transition: filter 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	box-shadow: 0 4px 16px rgba( 59, 130, 246, 0.35 );
}

.ebc-explore__cta:hover,
.ebc-explore__cta:focus {
	color: #fff !important;
	filter: brightness( 1.08 );
	box-shadow: 0 6px 22px rgba( 59, 130, 246, 0.45 );
	transform: translateY( -1px );
}

.ebc-explore__empty {
	text-align: center;
	color: rgba( 203, 213, 225, 0.65 ) !important;
	margin: 0 0 1.5rem;
}

@media ( max-width: 600px ) {
	.ebc-explore.alignfull {
		padding-left: var( --wp--preset--spacing--40, 1.25rem ) !important;
		padding-right: var( --wp--preset--spacing--40, 1.25rem ) !important;
	}

	.ebc-explore__grid {
		grid-template-columns: 1fr 1fr;
		gap: 1rem;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ebc-explore-card__link {
		transition: border-color 0.2s ease, box-shadow 0.2s ease;
	}

	.ebc-explore-card__link:hover,
	.ebc-explore-card__link:focus,
	.ebc-explore__cta:hover,
	.ebc-explore__cta:focus {
		transform: none;
	}
}

/* ——— Archive: /countries/ (same cards; filters + pagination) ——— */
.ebc-explore--archive {
	box-sizing: border-box;
	width: 100%;
	max-width: none !important;
}

#ebc-main.ebc-explore--archive {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.ebc-explore__header--archive .ebc-explore__subtitle {
	margin-bottom: 0.65rem;
}

.ebc-explore__header--archive .ebc-explore__filters {
	margin-top: 2rem;
}

.ebc-explore__filters.ebc-filters {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.65rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ebc-explore__filters .ebc-filters__pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.45rem 1.1rem;
	font-size: 0.88rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none !important;
	color: rgba( 226, 232, 240, 0.88 ) !important;
	background: rgba( 255, 255, 255, 0.06 );
	border: 1px solid rgba( 255, 255, 255, 0.12 );
	border-radius: 999px;
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease;
}

.ebc-explore__filters .ebc-filters__pill:hover,
.ebc-explore__filters .ebc-filters__pill:focus {
	color: #fff !important;
	border-color: rgba( 59, 130, 246, 0.45 );
	box-shadow: 0 0 0 1px rgba( 59, 130, 246, 0.15 );
}

.ebc-explore__filters .ebc-filters__pill.is-active {
	color: #fff !important;
	background: #3b82f6;
	border-color: #3b82f6;
	box-shadow: 0 4px 14px rgba( 59, 130, 246, 0.35 );
}

.ebc-explore__filters .ebc-filters__pill.is-active:hover,
.ebc-explore__filters .ebc-filters__pill.is-active:focus {
	filter: brightness( 1.06 );
	color: #fff !important;
}

.ebc-explore__search-meta {
	margin: 0.85rem 0 0;
	font-size: 0.9rem;
}

.ebc-explore__search-clear {
	color: #60a5fa;
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid rgba( 96, 165, 250, 0.45 );
}

.ebc-explore__search-clear:hover,
.ebc-explore__search-clear:focus {
	color: #93c5fd;
}

.ebc-explore__pagination {
	margin: 2.5rem 0 0;
	padding: 0;
}

.ebc-explore__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.45rem 0.65rem;
}

.ebc-explore__pagination a,
.ebc-explore__pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.35rem;
	min-height: 2.35rem;
	padding: 0.25rem 0.65rem;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none !important;
	border-radius: 8px;
	border: 1px solid rgba( 255, 255, 255, 0.12 );
	background: rgba( 255, 255, 255, 0.04 );
	color: rgba( 226, 232, 240, 0.9 ) !important;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.ebc-explore__pagination a:hover,
.ebc-explore__pagination a:focus {
	border-color: rgba( 59, 130, 246, 0.5 );
	color: #fff !important;
}

.ebc-explore__pagination span.current {
	background: #3b82f6;
	border-color: #3b82f6;
	color: #fff !important;
}

.ebc-explore__pagination span.dots {
	border: none;
	background: transparent;
	min-width: auto;
	color: rgba( 148, 163, 184, 0.85 ) !important;
}
