/* ==========================================================================
   Visit Events — listing, map and single event
   Colours come from the theme's Bootstrap variables, so light/dark
   ([data-bs-theme]) works without extra rules. Fallbacks keep it usable
   on other themes.
   ========================================================================== */

.ve-listing,
.ve-single {
	--ve-primary: var(--bs-primary, #4caf50);
	--ve-primary-rgb: var(--bs-primary-rgb, 76, 175, 80);
	--ve-bg: var(--bs-body-bg, #fff);
	--ve-text: var(--bs-body-color, #212121);
	--ve-muted: var(--bs-secondary-color, rgba(33, 37, 41, 0.65));
	--ve-surface: var(--bs-tertiary-bg, #f4f6f8);
	--ve-border: var(--bs-border-color-translucent, rgba(0, 0, 0, 0.1));
	--ve-radius: 16px;
	--ve-radius-sm: 10px;
	--ve-shadow: 0 1px 2px rgba(15, 20, 25, 0.06), 0 8px 24px rgba(15, 20, 25, 0.06);
	--ve-shadow-hover: 0 2px 4px rgba(15, 20, 25, 0.08), 0 16px 40px rgba(15, 20, 25, 0.12);
}

[data-bs-theme="dark"] .ve-listing,
[data-bs-theme="dark"] .ve-single {
	--ve-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
	--ve-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.4);
}

.ve-listing [hidden],
.ve-single [hidden] {
	display: none !important;
}

/* Toolbar: category chips + List/Map switch ------------------------------- */

.ve-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.ve-filters {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
	margin: -2px;
	flex: 1 1 auto;
	min-width: 0;
}

.ve-filters::-webkit-scrollbar {
	display: none;
}

.ve-filter {
	flex: 0 0 auto;
	padding: 8px 16px;
	border: 1px solid var(--ve-border);
	border-radius: 999px;
	background: var(--ve-bg);
	color: var(--ve-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ve-filter:hover {
	border-color: var(--ve-primary);
}

.ve-filter.is-active {
	border-color: var(--ve-primary);
	background: var(--ve-primary);
	color: #fff;
}

.ve-switch {
	display: inline-flex;
	padding: 4px;
	border-radius: 999px;
	background: var(--ve-surface);
	flex: 0 0 auto;
}

.ve-switch__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 18px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ve-muted);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ve-switch__btn.is-active {
	background: var(--ve-bg);
	color: var(--ve-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ve-filter:focus-visible,
.ve-switch__btn:focus-visible,
.ve-calendar__day:focus-visible,
.ve-calendar__nav:focus-visible,
.ve-locate:focus-visible,
.ve-map-item:focus-visible {
	outline: 3px solid rgba(var(--ve-primary-rgb), 0.5);
	outline-offset: 2px;
}

/* Calendar strip ----------------------------------------------------------- */

.ve-calendar {
	position: sticky;
	top: var(--ve-sticky-offset, 60px);
	z-index: 200;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 32px;
	padding: 10px 0;
	background: var(--ve-bg);
	transition: top 0.3s ease;
}

.ve-calendar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--ve-border);
}

.ve-calendar__track {
	display: grid;
	grid-template-columns: repeat(var(--ve-visible-days, 14), minmax(0, 1fr));
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.ve-calendar__nav {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 1px solid var(--ve-border);
	border-radius: 50%;
	background: var(--ve-bg);
	color: var(--ve-text);
	cursor: pointer;
}

.ve-calendar__nav:hover:not(:disabled) {
	border-color: var(--ve-primary);
	color: var(--ve-primary);
}

.ve-calendar__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.ve-calendar__day {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 2px 12px;
	border-radius: 12px;
	color: var(--ve-text);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

a.ve-calendar__day:hover {
	background: var(--ve-surface);
	color: var(--ve-text);
	text-decoration: none;
}

.ve-calendar__day.is-active,
a.ve-calendar__day.is-active:hover {
	background: var(--ve-primary);
	color: #fff;
}

.ve-calendar__day.is-empty,
.ve-calendar__day.is-filtered {
	opacity: 0.35;
	pointer-events: none;
}

.ve-calendar__weekday,
.ve-calendar__month {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.75;
}

.ve-calendar__number {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.15;
}

.ve-calendar__dot {
	position: absolute;
	bottom: 4px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--ve-primary);
}

.ve-calendar__day.is-empty .ve-calendar__dot,
.ve-calendar__day.is-filtered .ve-calendar__dot {
	display: none;
}

.ve-calendar__day.is-active .ve-calendar__dot {
	background: #fff;
}

/* Day groups ---------------------------------------------------------------- */

.ve-day {
	margin-bottom: 48px;
	scroll-margin-top: calc(var(--ve-sticky-offset, 60px) + 110px);
}

.ve-day__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 14px;
	margin-bottom: 20px;
}

.ve-day__title {
	margin: 0;
	font-size: clamp(20px, 2.2vw, 26px);
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ve-day__title::first-letter {
	text-transform: uppercase;
}

.ve-day__relative {
	display: inline-block;
	margin-right: 8px;
	color: var(--ve-primary);
}

.ve-day__relative::after {
	content: "·";
	margin-left: 8px;
	color: var(--ve-muted);
}

.ve-day__count {
	color: var(--ve-muted);
	font-size: 14px;
}

.ve-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 24px;
}

/* Card ---------------------------------------------------------------------- */

.ve-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--ve-border);
	border-radius: var(--ve-radius);
	background: var(--ve-bg);
	box-shadow: var(--ve-shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ve-card:hover,
.ve-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--ve-shadow-hover);
}

.ve-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--ve-surface);
}

.ve-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.ve-card:hover .ve-card__img {
	transform: scale(1.04);
}

.ve-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--ve-muted);
	font-size: 48px;
	background:
		radial-gradient(circle at 30% 20%, rgba(var(--ve-primary-rgb), 0.18), transparent 60%),
		var(--ve-surface);
}

.ve-chip {
	position: absolute;
	top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(50% - 18px);
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(15, 20, 25, 0.72);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.ve-chip--time {
	left: 12px;
}

.ve-chip--price {
	right: 12px;
	background: rgba(var(--ve-primary-rgb), 0.92);
}

.ve-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8px;
	padding: 18px 20px 20px;
}

.ve-card__cats {
	margin: 0;
	color: var(--ve-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ve-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.ve-card__title a {
	color: var(--ve-text);
	text-decoration: none;
}

.ve-card__title a:hover {
	color: var(--ve-text);
	text-decoration: none;
}

/* Fallback when the theme has no Bootstrap .stretched-link */
.ve-card .stretched-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.ve-card__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--ve-muted);
	font-size: 14px;
	line-height: 1.55;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ve-card__meta {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: auto 0 0;
	padding-top: 6px;
	color: var(--ve-muted);
	font-size: 14px;
}

/* Empty state ---------------------------------------------------------------- */

.ve-empty {
	padding: 64px 24px;
	border: 1px dashed var(--ve-border);
	border-radius: var(--ve-radius);
	text-align: center;
}

.ve-empty .bi {
	color: var(--ve-muted);
	font-size: 44px;
}

.ve-empty__title {
	margin: 12px 0 4px;
	font-size: 22px;
	font-weight: 700;
}

.ve-empty__text {
	margin: 0;
	color: var(--ve-muted);
}

/* Map view ------------------------------------------------------------------- */

.ve-map-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 24px;
	align-items: start;
}

.ve-map-wrap {
	position: sticky;
	top: calc(var(--ve-sticky-offset, 60px) + 16px);
	overflow: hidden;
	border: 1px solid var(--ve-border);
	border-radius: var(--ve-radius);
	box-shadow: var(--ve-shadow);
}

.ve-map {
	height: min(72vh, 680px);
	min-height: 380px;
	background: var(--ve-surface);
	z-index: 0;
}

.ve-locate {
	position: absolute;
	right: 12px;
	bottom: 24px;
	z-index: 500;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--ve-bg);
	color: var(--ve-text);
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.ve-locate:hover {
	color: var(--ve-primary);
}

.ve-locate.is-on .bi {
	color: #1a73e8;
}

.ve-locate.is-loading .bi {
	animation: ve-spin 1s linear infinite;
}

@keyframes ve-spin {
	to { transform: rotate(360deg); }
}

.ve-map-list {
	max-height: min(72vh, 680px);
	overflow-y: auto;
	padding-right: 4px;
}

.ve-map-list__status {
	min-height: 1.2em;
	margin: 0 0 8px;
	color: var(--ve-muted);
	font-size: 13px;
}

.ve-map-list__status:empty {
	display: none;
}

.ve-map-list__items {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ve-map-list__empty {
	color: var(--ve-muted);
}

.ve-map-item {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px;
	border: 1px solid var(--ve-border);
	border-radius: var(--ve-radius-sm);
	background: var(--ve-bg);
	color: var(--ve-text);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ve-map-item:hover,
.ve-map-item.is-active {
	border-color: var(--ve-primary);
	background: rgba(var(--ve-primary-rgb), 0.06);
}

.ve-map-item__img {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--ve-surface);
	color: var(--ve-muted);
	font-size: 22px;
}

.ve-map-item__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ve-map-item__title {
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ve-map-item__date,
.ve-map-item__loc {
	overflow: hidden;
	color: var(--ve-muted);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ve-map-item__dist {
	align-self: start;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(var(--ve-primary-rgb), 0.14);
	color: var(--ve-text);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.ve-map-list__note {
	display: flex;
	gap: 8px;
	margin: 16px 0 0;
	color: var(--ve-muted);
	font-size: 13px;
}

/* Pins, user location, popups (Leaflet) ------------------------------------- */

.ve-pin {
	background: none;
	border: 0;
}

.ve-pin__body {
	position: relative;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 0;
	background: var(--bs-primary, #4caf50);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
	transform: rotate(-45deg);
}

.ve-pin__label {
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	transform: rotate(45deg);
}

.ve-pin__label:empty::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
}

.ve-user {
	background: none;
	border: 0;
}

.ve-user span {
	display: block;
	width: 22px;
	height: 22px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #1a73e8;
	box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
	animation: ve-pulse 2s ease-out infinite;
}

@keyframes ve-pulse {
	0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3); }
	70% { box-shadow: 0 0 0 16px rgba(26, 115, 232, 0), 0 2px 6px rgba(0, 0, 0, 0.3); }
	100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0), 0 2px 6px rgba(0, 0, 0, 0.3); }
}

.leaflet-interactive.ve-user-accuracy,
path.ve-user-accuracy {
	fill: #1a73e8;
	fill-opacity: 0.12;
	stroke: #1a73e8;
	stroke-opacity: 0.35;
	stroke-width: 1;
}

.ve-popup-wrap .leaflet-popup-content-wrapper {
	padding: 0;
	overflow: hidden;
	border-radius: 12px;
	background: var(--bs-body-bg, #fff);
	color: var(--bs-body-color, #212121);
}

.ve-popup-wrap .leaflet-popup-tip {
	background: var(--bs-body-bg, #fff);
}

.ve-popup-wrap .leaflet-popup-content {
	margin: 0;
	line-height: 1.35;
}

/* Fixed width: Leaflet measures the content when it opens, and a grid with a
   shrinkable column would otherwise collapse to a few characters. */
.ve-popup {
	display: flex;
	flex-direction: column;
	width: 280px;
	max-width: calc(100vw - 80px);
	max-height: 300px;
	overflow-x: hidden;
	overflow-y: auto;
}

.ve-popup__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 12px;
	padding: 10px 12px;
	color: inherit !important;
	text-decoration: none !important;
}

.ve-popup__item + .ve-popup__item {
	border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.1));
}

.ve-popup__item:hover {
	background: rgba(var(--bs-primary-rgb, 76, 175, 80), 0.08);
}

.ve-popup__img {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--bs-tertiary-bg, #f4f6f8);
	font-size: 20px;
}

.ve-popup__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	font-size: 13px;
	line-height: 1.35;
}

.ve-popup__title {
	font-size: 15px;
	line-height: 1.3;
}

.ve-popup__img {
	flex: 0 0 auto;
}

/* Room for Leaflet's close button. */
.ve-popup__item:first-child {
	padding-right: 28px;
}

.ve-popup__date,
.ve-popup__loc {
	color: var(--bs-secondary-color, #6c757d);
}

/* Dark map: invert OSM tiles so the map matches the dark theme. */
[data-bs-theme="dark"] .ve-map .leaflet-tile-pane,
[data-bs-theme="dark"] .ve-info__map .leaflet-tile-pane {
	filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9) saturate(0.6);
}

[data-bs-theme="dark"] .leaflet-container {
	background: #1b2126;
}

[data-bs-theme="dark"] .leaflet-control-zoom a,
[data-bs-theme="dark"] .leaflet-control-attribution {
	background: rgba(22, 27, 32, 0.85);
	color: #cfd4d8;
	border-color: #2b333a;
}

[data-bs-theme="dark"] .leaflet-control-attribution a {
	color: #9fd3a1;
}

/* Single event ---------------------------------------------------------------- */

.ve-single__article {
	max-width: 1100px;
	margin: 0 auto;
}

.ve-single__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 24px;
	font-size: 15px;
}

.ve-single__header {
	max-width: 52rem;
}

.ve-single__when {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 28px;
	color: var(--ve-muted);
	font-size: 18px;
}

.ve-single__when.is-past {
	text-decoration: line-through;
}

.ve-single__media {
	margin: 0 0 36px;
	overflow: hidden;
	border-radius: var(--ve-radius);
	box-shadow: var(--ve-shadow);
}

.ve-single__img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 560px;
	object-fit: cover;
}

.ve-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 40px;
	align-items: start;
}

.ve-single__content {
	font-size: 17px;
	line-height: 1.7;
}

.ve-info {
	position: sticky;
	top: calc(var(--ve-sticky-offset, 60px) + 20px);
	padding: 20px;
	border: 1px solid var(--ve-border);
	border-radius: var(--ve-radius);
	background: var(--ve-surface);
}

.ve-info__list {
	margin: 0;
}

.ve-info__row + .ve-info__row {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ve-border);
}

.ve-info__row dt {
	margin-bottom: 4px;
	color: var(--ve-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ve-info__row dd {
	margin: 0;
}

.ve-info__map {
	height: 220px;
	margin-top: 20px;
	border-radius: var(--ve-radius-sm);
	overflow: hidden;
	z-index: 0;
}

.ve-info__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.ve-info__actions .btn {
	flex: 1 1 auto;
}

/* Responsive ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
	.ve-map-layout,
	.ve-single__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.ve-map-wrap,
	.ve-info {
		position: static;
	}

	.ve-map {
		height: 60vh;
	}

	.ve-map-list {
		max-height: none;
		overflow: visible;
	}
}

@media (max-width: 575.98px) {
	.ve-toolbar {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.ve-switch {
		align-self: stretch;
	}

	.ve-switch__btn {
		flex: 1 1 0;
		justify-content: center;
	}

	.ve-calendar__nav {
		width: 30px;
		height: 30px;
	}

	.ve-calendar__number {
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ve-card,
	.ve-card__img,
	.ve-user span,
	.ve-locate.is-loading .bi {
		transition: none;
		animation: none;
	}
}
