/* Edinburgh Art Festival — home page Festival Map marker styles. */

:root {
	/* Per-type pin colours — mirror the archive's scheme, mapped to the EAF brand palette. */
	--eaf-pin-eaf:        #FF2613; /* new-red    — EAF venue */
	--eaf-pin-civic:      #2CB3DD; /* new-blue   — Civic */
	--eaf-pin-year-round: #00815C; /* new-green  — Year-round venue */
	--eaf-pin-partner:    #f9c4ce; /* new-pink   — Partner */
	--eaf-pin-fallback:   #FFFFFF; /* uncategorised — white, visible on dark basemap */
}

.eaf-venue-marker {
	position: relative;
	display: block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--eaf-pin-fallback); /* JS overrides per-marker via inline style */
	border: 2px solid #111111; /* new-black */
	box-sizing: border-box;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

/* Dark inner disc — turns the marker into a ring/donut so colour reads on the rim
 * (matches the archive's pin style). */
.eaf-venue-marker::before {
	content: '';
	position: absolute;
	top: 4px;
	right: 4px;
	bottom: 4px;
	left: 4px;
	background: #111111; /* matches the border + sits flat on dark-v11 basemap */
	border-radius: 50%;
	pointer-events: none;
}

/* Hover/focus tooltip showing the venue title (matches the archive). */
.eaf-venue-marker::after {
	content: attr(data-title);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #111111;
	color: #FFFFFF;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.12s ease-out;
	z-index: 3;
}

.eaf-venue-marker:hover::after,
.eaf-venue-marker:focus-visible::after {
	opacity: 1;
}

/* Lift hovered marker above its neighbours so the tooltip never gets clipped
 * by another pin's wrapper. */
.mapboxgl-marker:has(.eaf-venue-marker:hover),
.mapboxgl-marker:has(.eaf-venue-marker:focus-visible) {
	z-index: 2;
}

.eaf-venue-marker:hover {
	transform: scale(1.3);
}

.eaf-venue-marker:focus-visible {
	outline: none;
	transform: scale(1.3);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
}

/* ----------------------------- */
/* Legend (under the heading column) */
/* ----------------------------- */
.eaf-map-legend {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 16px;
	font-size: 14px;
}

.eaf-map-legend__item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.eaf-map-legend__swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #111111;
	flex-shrink: 0;
}
.eaf-map-legend__swatch--eaf        { background: var(--eaf-pin-eaf); }
.eaf-map-legend__swatch--civic      { background: var(--eaf-pin-civic); }
.eaf-map-legend__swatch--year-round { background: var(--eaf-pin-year-round); }
.eaf-map-legend__swatch--partner    { background: var(--eaf-pin-partner); }

@media (prefers-reduced-motion: reduce) {
	.eaf-venue-marker {
		transition: none;
	}
}

/* Make the Mapbox marker wrapper match our marker element so the cursor
 * and hover region cover the whole 16x16 hit area. */
.mapboxgl-marker:has(.eaf-venue-marker) {
	cursor: pointer;
}

/* Reset the button defaults that <button> brings vs the old <a> */
.eaf-venue-marker {
	padding: 0;
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
}

/* -------------------------------------------------------------- */
/* Popup styling — override Mapbox defaults to match EAF palette. */
/* -------------------------------------------------------------- */
.eaf-venue-popup-wrapper .mapboxgl-popup-content {
	padding: 0;
	border-radius: 0;
	background: #ede600; /* new-yellow */
	color: #111111; /* new-black */
	font-family: 'GT Flexa', sans-serif;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.eaf-venue-popup-wrapper .mapboxgl-popup-close-button {
	width: 32px;
	height: 32px;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	color: #111111;
	background: transparent;
	border: 0;
	border-bottom: 2px solid #111111;
	border-left: 2px solid #111111;
	font-weight: 700;
}

.eaf-venue-popup-wrapper .mapboxgl-popup-close-button:hover,
.eaf-venue-popup-wrapper .mapboxgl-popup-close-button:focus-visible {
	background: #111111;
	color: #ede600;
	outline: none;
}

/* Hide the popup tip entirely — the popup floats above the pin with no pointer. */
.eaf-venue-popup-wrapper .mapboxgl-popup-tip {
	display: none;
}

/* The card itself (anchor) */
.eaf-venue-popup {
	display: block;
	color: #111111;
	text-decoration: none;
	width: 100%;
}

.eaf-venue-popup__img {
	display: block;
	width: 100%;
	height: 170px;
	object-fit: cover;
}

.eaf-venue-popup__body {
	padding: 16px 20px 20px;
}

.eaf-venue-popup__title {
	font-family: 'GT Flexa', sans-serif;
	font-weight: 900; /* GT Flexa Black */
	font-size: 20px;
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 12px;
	color: #111111;
}

.eaf-venue-popup__cta {
	display: inline-block;
	font-family: 'GT Flexa', sans-serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #111111;
	border-bottom: 3px solid #111111;
	padding-bottom: 2px;
	transition: transform 0.12s ease-out;
}

.eaf-venue-popup:hover .eaf-venue-popup__cta,
.eaf-venue-popup:focus-visible .eaf-venue-popup__cta {
	transform: translateX(4px);
}
