/* ==========================================================================
   Expojump Fair Calendar — styles
   --------------------------------------------------------------------------
   Colors below are placeholders (a professional navy/amber pairing) since
   they could not be read automatically from expojump.com. Replace the
   values in :root with your exact brand hex codes — everything else in
   this file references them, so a handful of edits here re-skins the
   whole calendar.
   ========================================================================== */

:root {
	--ej-primary: #0b2a4a;      /* main brand color: header title, links, active states */
	--ej-primary-dark: #071d33; /* hover/pressed state for primary */
	--ej-accent: #f2a71b;       /* accent: date badges, buttons, highlights */
	--ej-accent-dark: #d6900f;
	--ej-bg: #f7f8fa;           /* page background */
	--ej-card-bg: #ffffff;
	--ej-text: #1c1f26;
	--ej-text-muted: #667085;
	--ej-border: #e5e7eb;
	--ej-header-bg: #3771c1;    /* full-width header band on archive pages */
	--ej-radius: 10px;
	--ej-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
	--ej-shadow-hover: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.ej-fairs-container {
	box-sizing: border-box;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Header ---------- */
.ej-fairs-archive,
.ej-fair-single {
	background: var(--ej-bg);
	color: var(--ej-text);
	padding: 48px 0 72px;
}

/* Archive pages start with the full-width blue header band. */
.ej-fairs-archive {
	padding-top: 0;
}

/*
 * 100vw includes the vertical scrollbar on desktop, so clip sideways
 * overflow at page level (clip, unlike hidden, keeps sticky headers working).
 */
body:has(.ej-fairs-header) {
	overflow-x: clip;
}

/*
 * Full-width band: breaks out of whatever content width the theme wraps
 * the page in, then .ej-fairs-container re-centers the text inside it.
 */
.ej-fairs-header {
	position: relative;
	left: 50%;
	width: 100vw;
	margin-left: -50vw;
	margin-bottom: 32px;
	padding: 48px 0;
	background: var(--ej-header-bg);
	color: #fff;
	text-align: center;
}

.ej-fairs-title {
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	color: var(--ej-primary);
	margin: 0 0 8px;
}

.ej-fairs-subtitle {
	color: var(--ej-text-muted);
	font-size: 16px;
	margin: 0;
}

/*
 * Flex + explicit margins/line-heights so theme typography (h1/p margins,
 * large line-heights) can't push the text off-center inside the band.
 */
.ej-fairs-header {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ej-fairs-header > .ej-fairs-container {
	width: 100%;
}

.ej-fairs-header .ej-fairs-title {
	margin: 0 0 8px;
	padding: 0;
	line-height: 1.2;
	color: #fff;
}

.ej-fairs-header .ej-fairs-subtitle {
	margin: 0;
	padding: 0;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 600px) {
	.ej-fairs-header {
		padding: 32px 0;
		margin-bottom: 24px;
	}

	.ej-fairs-header .ej-fairs-subtitle {
		font-size: 15px;
	}
}

/* ---------- Filters ---------- */
/*
 * Desktop: one bar — search + Country + City inline.
 * Mobile (≤ 900px): search + "Filters" button; Country/City move into a
 * bottom sheet (.ej-fairs-sheet) with a backdrop and an apply button.
 */
.ej-fairs-filters {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--ej-card-bg);
	border: 1px solid var(--ej-border);
	border-radius: var(--ej-radius);
	padding: 16px;
	margin-bottom: 32px;
	box-shadow: var(--ej-shadow);
}

.ej-fairs-filters__search {
	position: relative;
	flex: 1 1 280px;
	min-width: 0;
	display: flex;
	align-items: center;
}

.ej-fairs-filters__search svg {
	position: absolute;
	left: 12px;
	color: var(--ej-text-muted);
	pointer-events: none;
}

.ej-fairs-filters__search input {
	width: 100%;
	padding: 10px 12px 10px 38px;
	border: 1px solid var(--ej-border);
	border-radius: 8px;
	font-size: 15px;
	color: var(--ej-text);
	background: var(--ej-bg);
	-webkit-appearance: none;
	appearance: none;
}

.ej-fairs-filters__search input:focus {
	outline: none;
	border-color: var(--ej-primary);
	background: var(--ej-card-bg);
}

.ej-fairs-filters .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* "Filters" button — mobile only */
.ej-fairs-filters__toggle {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--ej-border);
	border-radius: 8px;
	background: var(--ej-card-bg);
	color: var(--ej-primary);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.ej-fairs-filters__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--ej-accent);
	color: var(--ej-primary-dark);
	font-size: 12px;
	font-weight: 700;
}

/* Desktop: the "sheet" is just the inline group of selects */
.ej-fairs-sheet {
	flex: 1 1 420px;
	min-width: 0;
}

.ej-fairs-sheet__head,
.ej-fairs-sheet__foot,
.ej-fairs-sheet-backdrop {
	display: none;
}

.ej-fairs-sheet__body {
	display: flex;
	gap: 10px;
}

.ej-fairs-sheet__field {
	flex: 1 1 0;
	min-width: 0;
}

.ej-fairs-sheet__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.ej-fairs-sheet select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ej-border);
	border-radius: 8px;
	font-size: 14px;
	color: var(--ej-text);
	background-color: var(--ej-bg);
	cursor: pointer;
}

.ej-fairs-sheet select:focus {
	outline: none;
	border-color: var(--ej-primary);
}

/* ---------- Grid & cards ---------- */
.ej-fairs-results {
	position: relative;
	min-height: 120px;
}

.ej-fairs-results.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.ej-fairs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 24px;
}

.ej-fairs-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--ej-text-muted);
	padding: 48px 0;
	font-size: 16px;
}

.ej-fair-card {
	background: var(--ej-card-bg);
	border: 1px solid var(--ej-border);
	border-radius: var(--ej-radius);
	overflow: hidden;
	box-shadow: var(--ej-shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ej-fair-card:hover {
	box-shadow: var(--ej-shadow-hover);
	transform: translateY(-3px);
}

.ej-fair-card--past {
	opacity: 0.65;
}

.ej-fair-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.ej-fair-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	background: var(--ej-border);
	overflow: hidden;
}

.ej-fair-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ej-fair-card__image--placeholder {
	background: linear-gradient(135deg, var(--ej-border), var(--ej-bg));
}

.ej-fair-card__date-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--ej-accent);
	color: var(--ej-primary-dark);
	font-size: 13px;
	font-weight: 700;
	padding: 5px 10px;
	border-radius: 999px;
	box-shadow: var(--ej-shadow);
}

.ej-fair-card__past-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(28, 31, 38, 0.75);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 999px;
}

.ej-fair-card__body {
	padding: 16px;
}

.ej-fair-card__category {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ej-accent-dark);
	margin-bottom: 6px;
}

.ej-fair-card__title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ej-primary);
	margin: 0 0 8px;
}

.ej-fair-card__location {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--ej-text-muted);
	margin: 0;
}

.ej-fair-card__pin {
	flex-shrink: 0;
	color: var(--ej-text-muted);
}

/* ---------- Load more ---------- */
.ej-fairs-load-more-wrap {
	text-align: center;
	margin-top: 36px;
}

.ej-fairs-load-more {
	background: #fff;
	border: 1px solid var(--ej-primary);
	color: var(--ej-primary);
	font-weight: 600;
	font-size: 15px;
	padding: 12px 28px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.ej-fairs-load-more:hover {
	background: var(--ej-primary);
	color: #fff;
}

.ej-fairs-load-more:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---------- Country / city / category archives ---------- */
.ej-fairs-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.75);
	margin-bottom: 16px;
}

.ej-fairs-breadcrumb a {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

.ej-fairs-breadcrumb a:hover {
	text-decoration: underline;
}

.ej-fairs-term__header {
	margin: 0;
}

.ej-fairs-term__intro {
	max-width: 820px;
	margin: 0 auto 32px;
	font-size: 16px;
	line-height: 1.75;
	color: var(--ej-text);
	text-align: center;
}

.ej-fairs-term__intro p {
	margin: 0 0 1em;
}

.ej-fairs-term__related {
	background: var(--ej-card-bg);
	border: 1px solid var(--ej-border);
	border-radius: var(--ej-radius);
	box-shadow: var(--ej-shadow);
	padding: 16px;
	margin-bottom: 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.ej-fairs-term__related-label {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ej-text-muted);
}

.ej-fairs-term__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ej-fairs-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid var(--ej-border);
	border-radius: 999px;
	background: var(--ej-bg);
	color: var(--ej-primary);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.ej-fairs-chip:hover {
	border-color: var(--ej-primary);
	background: var(--ej-card-bg);
}

.ej-fairs-chip--parent {
	background: var(--ej-primary);
	border-color: var(--ej-primary);
	color: #fff;
}

.ej-fairs-chip--parent:hover {
	background: var(--ej-primary-dark);
	color: #fff;
}

.ej-fairs-chip__count {
	font-size: 12px;
	font-weight: 700;
	color: var(--ej-text-muted);
}

.ej-fairs-pagination {
	margin-top: 36px;
}

.ej-fairs-pagination ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.ej-fairs-pagination a,
.ej-fairs-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--ej-border);
	border-radius: 8px;
	background: var(--ej-card-bg);
	color: var(--ej-primary);
	font-weight: 600;
	text-decoration: none;
}

.ej-fairs-pagination a:hover {
	border-color: var(--ej-primary);
}

.ej-fairs-pagination .current {
	background: var(--ej-primary);
	border-color: var(--ej-primary);
	color: #fff;
}

.ej-fairs-pagination .dots {
	border: none;
	background: none;
}

.ej-fairs-term__back {
	text-align: center;
	margin-top: 40px;
}

.ej-fairs-term__back a {
	color: var(--ej-primary);
	font-weight: 600;
	text-decoration: none;
}

.ej-fairs-term__back a:hover {
	text-decoration: underline;
}

/* ---------- Venue page info box ---------- */
.ej-fairs-venue-info {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 40px;
	background: var(--ej-card-bg);
	border: 1px solid var(--ej-border);
	border-radius: var(--ej-radius);
	box-shadow: var(--ej-shadow);
	padding: 16px 20px;
	margin-bottom: 24px;
}

.ej-fairs-venue-info__item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ej-fairs-venue-info__label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ej-text-muted);
}

.ej-fairs-venue-info__value {
	font-size: 15px;
	color: var(--ej-text);
	word-break: break-word;
}

.ej-fairs-venue-info__value a {
	color: var(--ej-primary);
	text-decoration: none;
}

.ej-fairs-venue-info__value a:hover {
	text-decoration: underline;
}

/* ---------- Single fair page ---------- */
.ej-fair-single__back {
	margin-bottom: 20px;
}

.ej-fair-single__back a {
	color: var(--ej-primary);
	font-weight: 600;
	text-decoration: none;
}

.ej-fair-single__back a:hover {
	text-decoration: underline;
}

/*
 * Desktop: content on the left spanning both rows; featured image at the
 * top of the right column with the info box underneath it.
 * Mobile (see media query): image → content → info box.
 */
.ej-fair-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	grid-template-rows: auto 1fr;
	grid-template-areas:
		"main hero"
		"main sidebar";
	column-gap: 40px;
	row-gap: 20px;
	align-items: start;
}

.ej-fair-single__hero {
	grid-area: hero;
	border-radius: var(--ej-radius);
	overflow: hidden;
	box-shadow: var(--ej-shadow);
	background: var(--ej-card-bg);
}

.ej-fair-single__image {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.ej-fair-single__image--placeholder {
	background: linear-gradient(135deg, var(--ej-border), var(--ej-bg));
}

.ej-fair-single__main {
	grid-area: main;
	min-width: 0;
}

.ej-fair-single__sidebar {
	grid-area: sidebar;
	align-self: stretch;
}

.ej-fair-single__tags {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.ej-fair-tag {
	background: rgba(242, 167, 27, 0.15);
	color: var(--ej-accent-dark);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 5px 10px;
	border-radius: 999px;
}

.ej-fair-single__title {
	font-size: clamp(26px, 3.6vw, 36px);
	font-weight: 700;
	color: var(--ej-primary);
	margin: 0 0 16px;
	line-height: 1.25;
}

.ej-fair-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 24px;
}

.ej-fair-single__meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--ej-text-muted);
	font-size: 15px;
	font-weight: 600;
}

.ej-fair-single__meta-item svg {
	color: var(--ej-accent-dark);
}

.ej-fair-single__location a {
	color: var(--ej-primary);
	text-decoration: none;
	border-bottom: none;
}

.ej-fair-single__location a:hover {
	text-decoration: underline;
}

.ej-fair-single__content {
	font-size: 16px;
	line-height: 1.75;
	color: var(--ej-text);
}

.ej-fair-single__content p {
	margin: 0 0 1.2em;
}

/* Sidebar info box */
.ej-fair-infobox {
	background: var(--ej-card-bg);
	border: 1px solid var(--ej-border);
	border-radius: var(--ej-radius);
	padding: 20px;
	box-shadow: var(--ej-shadow);
	position: sticky;
	top: 24px;
}

.ej-fair-infobox__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--ej-primary);
	margin: 0 0 14px;
}

.ej-fair-infobox__list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ej-fair-infobox__list li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border-bottom: 1px solid var(--ej-border);
	padding-bottom: 10px;
}

.ej-fair-infobox__list li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.ej-fair-infobox__label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ej-text-muted);
}

.ej-fair-infobox__value {
	font-size: 14px;
	color: var(--ej-text);
	word-break: break-word;
}

.ej-fair-infobox__value a {
	color: var(--ej-primary);
	text-decoration: none;
}

.ej-fair-infobox__value a:hover {
	text-decoration: underline;
}

.ej-fair-infobox__cta {
	display: block;
	text-align: center;
	background: var(--ej-accent);
	color: var(--ej-primary-dark);
	font-weight: 700;
	padding: 12px;
	border-radius: 8px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.ej-fair-infobox__cta:hover {
	background: var(--ej-accent-dark);
	color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.ej-fair-single__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto;
		grid-template-areas:
			"hero"
			"main"
			"sidebar";
		row-gap: 28px;
	}

	.ej-fair-single__image {
		aspect-ratio: 16 / 9;
	}

	.ej-fair-infobox {
		position: static;
	}
}

@media (max-width: 900px) {
	.ej-fairs-filters {
		padding: 12px;
		gap: 10px;
		margin-bottom: 24px;
	}

	.ej-fairs-filters__toggle {
		display: inline-flex;
	}

	.ej-fairs-sheet-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(16, 24, 40, 0.5);
		opacity: 0;
		transition: opacity 0.3s ease;
		z-index: 100000;
	}

	.ej-fairs-sheet-backdrop.is-visible {
		opacity: 1;
	}

	.ej-fairs-sheet-backdrop[hidden] {
		display: none;
	}

	.ej-fairs-sheet {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100001;
		display: flex;
		flex-direction: column;
		max-height: 88vh;
		background: var(--ej-card-bg);
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -10px 40px rgba(16, 24, 40, 0.15);
		transform: translateY(100%);
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}

	.ej-fairs-sheet.is-open {
		transform: translateY(0);
		visibility: visible;
		transition: transform 0.3s ease, visibility 0s;
	}

	.ej-fairs-sheet__head {
		display: block;
		padding: 10px 20px 4px;
	}

	.ej-fairs-sheet__handle {
		display: block;
		width: 48px;
		height: 5px;
		margin: 0 auto 14px;
		border-radius: 999px;
		background: var(--ej-border);
	}

	.ej-fairs-sheet__title-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
	}

	.ej-fairs-sheet__title {
		margin: 0;
		font-size: 18px;
		font-weight: 700;
		color: var(--ej-primary);
	}

	.ej-fairs-sheet__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border: none;
		border-radius: 999px;
		background: var(--ej-bg);
		color: var(--ej-text);
		cursor: pointer;
	}

	.ej-fairs-sheet__body {
		flex-direction: column;
		gap: 16px;
		padding: 16px 20px 20px;
		overflow-y: auto;
	}

	.ej-fairs-sheet__label {
		position: static;
		width: auto;
		height: auto;
		margin: 0 0 6px;
		overflow: visible;
		clip: auto;
		display: block;
		font-size: 13px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--ej-text-muted);
	}

	.ej-fairs-sheet select {
		padding: 13px 12px;
		font-size: 16px; /* 16px stops iOS from zooming into the field */
	}

	.ej-fairs-sheet__foot {
		display: block;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--ej-border);
		background: var(--ej-card-bg);
	}

	.ej-fairs-sheet__apply {
		width: 100%;
		padding: 14px;
		border: none;
		border-radius: 10px;
		background: var(--ej-primary);
		color: #fff;
		font-size: 16px;
		font-weight: 700;
		cursor: pointer;
	}

	.ej-fairs-sheet__apply:hover {
		background: var(--ej-primary-dark);
	}

	.ej-fairs-filters__search input {
		font-size: 16px;
	}
}

html.ej-fairs-sheet-lock,
html.ej-fairs-sheet-lock body {
	overflow: hidden;
}
