/* ── Map container ────────────────────────────────────────────────────────── */

.parcel-map-wrapper {
	position: relative;
	width: 100%;
}

.parcel-events-map {
	width: 100%;
	height: 520px;
	border-radius: 4px;
	overflow: hidden;
}

/* ── Filters wrapper ─────────────────────────────────────────────────────── */

.parcel-events-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 24px 32px;
	padding: 16px 0;
}

/* ── Wide layout ─────────────────────────────────────────────────────────── */
/* In a constrained post-content the two blocks would be capped at the theme's
   contentSize; lift them to wideSize (the same cap .alignwide gets). Filters
   go into a grid on desktop; below 1024px the flex-wrap rule above applies. */

.is-layout-constrained > .parcel-events-filters,
.is-layout-constrained > .parcel-map-wrapper {
	max-width: var( --wp--style--global--wide-size, 90rem );
}

@media ( min-width: 1024px ) {
	.parcel-events-filters {
		display: grid;
		grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	}

	/* Row 1: the two dropdowns (columns 1-2), Reset directly after them
	   (column 3, left-aligned, same box as the selects: 36px high, grey),
	   Submit link at the right end (column 4). Row 2: the four pill groups. */
	.parcel-events-filters > .parcel-filter--dates        { grid-area: 1 / 1; }
	.parcel-events-filters > .parcel-filter--location     { grid-area: 1 / 2; }
	.parcel-events-filters > .parcel-filter__reset {
		grid-area: 1 / 3;
		justify-self: start;
		align-self: end;
		box-sizing: border-box;
		height: 36px;            /* = .parcel-filter select { height: 36px } */
		padding: 6px 16px;
		background: #e5e5e5;
		border: 1px solid #ccc;  /* same border colour as the selects */
		color: #333;
		font-size: 0.9375rem;    /* same as the selects */
	}
	.parcel-events-filters > .parcel-filter__reset:hover {
		background: #d8d8d8;
	}
	.parcel-events-filters > .parcel-filter__submit {
		grid-area: 1 / 4;
		justify-self: end;
		align-self: end;
		display: inline-flex;
		align-items: center;
		box-sizing: border-box;
		height: 36px;
	}
	.parcel-filter--dates select,
	.parcel-filter--location select {
		width: 100%;
		min-width: 0;
	}
	.parcel-events-map {
		height: 600px;
	}
	.parcel-events-filters > .parcel-filter--event-type   { grid-area: 2 / 1; }
	.parcel-events-filters > .parcel-filter--language     { grid-area: 2 / 2; }
	.parcel-events-filters > .parcel-filter--modality     { grid-area: 2 / 3; }
	.parcel-events-filters > .parcel-filter--participants { grid-area: 2 / 4; }
}

/* ── Individual filter ───────────────────────────────────────────────────── */

.parcel-filter {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.parcel-filter > label:first-child {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #666;
}

.parcel-filter select {
	padding: 6px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9375rem;
	background: #fff;
	cursor: pointer;
	height: 36px;
	min-width: 160px;
}

.parcel-filter select:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* ── Tag cloud ───────────────────────────────────────────────────────────── */

.parcel-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: 480px;
}

.parcel-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border: 1.5px solid #053245;
	border-radius: 20px;
	background: #053245;
	font-size: 0.8125rem;
	color: #fff;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, opacity 0.15s;
	white-space: nowrap;
	line-height: 1.4;
}

.parcel-tag:hover {
	opacity: 0.8;
}

.parcel-tag.is-active {
	background: #fff;
	border-color: #053245;
	color: #053245;
}

.parcel-tag.is-active:hover {
	background: #f0f4f6;
}

.parcel-tag__count {
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0.7;
}

.parcel-tag.is-active .parcel-tag__count {
	opacity: 1;
}

/* Parcel Event Meta block — each value renders as a .parcel-tag pill; this
   wrapper just spaces multiple pills apart without touching .parcel-tag-cloud
   (the filters block), which already spaces its own tags via flex gap. */
.parcel-event-meta__tags {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* "Multi-day event" label, under the date range. */
.parcel-event-meta__multiday {
	display: block;
	font-size: 0.875em;
}

/* ── Map legend ──────────────────────────────────────────────────────────── */

.parcel-map-legend {
	position: absolute;
	bottom: 24px;
	right: 10px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 6px;
	font-size: 0.8rem;
	box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.parcel-legend-item {
	display: flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.parcel-legend-dot {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 1.5px solid rgba(0,0,0,0.15);
}

.parcel-legend-dot--past        { background: #F1F0EC; border-color: #B8B7B0; }
.parcel-legend-dot--technical   { background: #DBFD7A; border-color: #A8C840; }
.parcel-legend-dot--trainers    { background: #38D9B2; border-color: #1FA88A; }

/* ── Static icon-type filter tags ────────────────────────────────────────── */

.parcel-tag--past {
	background: #F1F0EC;
	border-color: #B8B7B0;
	color: #555;
}
.parcel-tag--past:hover       { opacity: 0.8; }
.parcel-tag--past.is-active   { background: #fff; border-color: #B8B7B0; color: #333; box-shadow: 0 0 0 2px #B8B7B0; }

.parcel-tag--technical {
	background: #DBFD7A;
	border-color: #A8C840;
	color: #3a4a00;
}
.parcel-tag--technical:hover       { opacity: 0.8; }
.parcel-tag--technical.is-active   { background: #fff; border-color: #A8C840; color: #3a4a00; box-shadow: 0 0 0 2px #A8C840; }

.parcel-tag--trainers {
	background: #38D9B2;
	border-color: #1FA88A;
	color: #053d2e;
}
.parcel-tag--trainers:hover       { opacity: 0.8; }
.parcel-tag--trainers.is-active   { background: #fff; border-color: #1FA88A; color: #053d2e; box-shadow: 0 0 0 2px #1FA88A; }


/* ── Reset button ────────────────────────────────────────────────────────── */

.parcel-filter__reset {
	padding: 6px 16px;
	height: 36px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #f0f0f0;
	font-size: 0.9375rem;
	cursor: pointer;
	white-space: nowrap;
	align-self: flex-end;
	transition: background 0.15s;
}

.parcel-filter__reset:hover {
	background: #e0e0e0;
}

/* ── Submit event button (call to action, follows Reset) ─────────────────── */

.parcel-filter__submit {
	display: inline-block;
	align-self: flex-end;
	padding: 6px 16px;
	border-radius: 4px;
	background: var(--wp--preset--color--primary, #053245);
	border: 1px solid var(--wp--preset--color--primary, #053245);
	color: #fff;
	font-size: 0.9375rem;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s;
}

.parcel-filter__submit:hover,
.parcel-filter__submit:focus {
	background: var(--wp--preset--color--background-deep, #032233);
	border-color: var(--wp--preset--color--background-deep, #032233);
	color: #fff;
	text-decoration: none;
}

/* The theme underlines links in post content with
   `.entry-content a:not(.wp-block-button__link)` (specificity 0,2,1, assets/css/main.css),
   which beats the single-class rule above. This selector (0,3,1; more with the
   pseudo-class) wins in every link state without !important. */
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link),
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link):hover,
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link):focus,
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link):focus-visible,
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link):visited,
.parcel-events-filters > a.parcel-filter__submit:not(.wp-block-button__link):active {
	text-decoration: none;
}

/* ── Events overview (cards) ─────────────────────────────────────────────── */
/* Reuses the site's cards-grid pattern classes (clickable-card, cards-grid__card,
   cards-grid__thumb) so these cards match styling already defined in the theme. */

.parcel-events-overview {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: var( --wp--preset--spacing--lg, 24px );
	padding: 8px 0;
}

.parcel-events-overview__empty {
	grid-column: 1 / -1;
	color: #666;
	font-style: italic;
}

.parcel-event-card__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	background: #f0f0f0;
}

.parcel-event-card__image--placeholder {
	background: linear-gradient( 135deg, #f1f0ec 0%, #e2e2e2 100% );
}

.parcel-event-card__location {
	margin: 0;
	color: #053245;
}

.parcel-event-card__date {
	font-size: 0.9375rem;
	font-weight: 400;
	color: #444;
}

.parcel-event-card__title {
	margin: 4px 0 0;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.3;
	color: #666;
}

@media ( max-width: 781px ) {
	.parcel-events-overview {
		grid-template-columns: 1fr;
	}
}

/* ── Event overlay (map marker "Read more") ──────────────────────────────── */

.parcel-event-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #fff;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.75s ease, visibility 0s linear 0.75s;
}

.parcel-event-overlay.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.75s ease, visibility 0s linear 0s;
}

@media ( prefers-reduced-motion: reduce ) {
	.parcel-event-overlay {
		transition: none;
	}
}

.parcel-event-overlay__close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #053245;
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.25 );
}

.parcel-event-overlay__close:hover {
	opacity: 0.85;
}

.parcel-event-overlay__content {
	
	margin: 0 auto;
	
}

.parcel-event-overlay__content .parcel-event-single{

}

.parcel-event-overlay__close-link {
    margin-top: 32px;
    color: #053245;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
    display: block;
    width: 100%;
    padding-bottom: 32px;
}

.parcel-event-overlay__close-link:hover {
	opacity: 0.75;
}

@media ( max-width: 640px ) {
	.parcel-event-overlay__content {
		padding: 70px 16px 40px;
	}
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Mobile stacking order: Filters, Map, Overview (Overview is a separate
   block below the columns row, so it already stacks last). */
@media ( max-width: 781px ) {
	.wp-block-columns:has( .parcel-events-map ):has( .parcel-events-filters ) {
		flex-direction: column;
	}

	.wp-block-columns .wp-block-column:has( .parcel-events-filters ) {
		order: -1;
	}
}

@media ( max-width: 640px ) {
	.parcel-events-map {
		height: 320px;
	}

	.parcel-filter {
		min-width: calc( 50% - 8px );
	}
}

/* ── Single event template (post-content) ────────────────────────────────── */
/* Same visual language as the map/overview overlay, for the block markup
   pasted into the "Single Event" template's post-content area. */

.parcel-event-single__image img {
	object-fit: cover;
	border-radius: 6px;
}

.parcel-event-single__meta,
.parcel-event-single__badges {
	margin-top: 14px;
}

.parcel-event-single__badges .wp-block-post-terms {
	padding: 4px 10px;
	border-radius: 20px;
	background: #053245;
	color: #fff;
	font-size: 0.8125rem;
}

.parcel-event-single__badges .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

.parcel-event-single__field-label {
	margin: 0;
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #666;
}

.parcel-event-single__field-value {
	margin: 2px 0 0;
}

/* Hide a field row entirely when its value is empty. The Parcel Event Meta
   block renders nothing at all (not even an empty tag) when its field has no
   value, so this checks for absence rather than emptiness. */
.parcel-event-single__field:not( :has( .parcel-event-single__field-value ) ) {
	display: none;
}

.parcel-event-single__apply {
	margin-top: 20px;
}

.event-template-content h4,
.parcel-event-overlay__content h4{
	margin: 16px 0 8px 0;
	font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
}

.event-template-content p, .event-template-content .entry-content,
.parcel-event-overlay__content p{
	margin: 0px;
}
