/**
 * TARKA Locations — front end styles.
 *
 * Everything is scoped under .tarka-locations so the plugin can't leak into the
 * theme, and so theme styles are less likely to leak in.
 */

.tarka-locations {
	--tarka-navy: #27295b;
	--tarka-navy-dark: #1b1d40;
	--tarka-pink: #ffcde1;
	--tarka-pink-deep: #f5a9c9;
	--tarka-white: #ffffff;
	--tarka-grey: #f2f5f7;
	--tarka-ink: #2a2c4e;
	--tarka-muted: #5c5f80;
	--tarka-soft: #8b8fb3;
	--tarka-radius: 14px;
	--tarka-display: "Anton", "Montserrat", sans-serif;
	--tarka-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

	font-family: var(--tarka-body);
	color: var(--tarka-ink);
	box-sizing: border-box;
}

.tarka-locations *,
.tarka-locations *::before,
.tarka-locations *::after {
	box-sizing: border-box;
}

.tarka-locations h2,
.tarka-locations h3 {
	font-family: var(--tarka-display);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--tarka-navy);
	margin: 0;
}

.tarka-locations p {
	margin: 0;
}

.tarka-locations img {
	max-width: 100%;
	display: block;
}

.tarka-locations .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Pills ---------- */
.tarka-locations .tarka-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--tarka-pink);
	color: var(--tarka-navy);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	white-space: nowrap;
	line-height: 1.3;
}

.tarka-locations .tarka-pill.is-outline {
	background: transparent;
	border: 1.5px solid var(--tarka-navy);
}

/* ---------- Hero ----------
 * By default the hero is unstyled — no background, no padding — so it can sit
 * directly under a theme page-title section that already supplies the navy band
 * and the spacing. Add panel="yes" to the shortcode for the self-contained
 * navy panel instead (useful if it's ever dropped onto a plain page).
 */
.tarka-locations .tarka-hero {
	padding: 0;
	margin-bottom: 22px;
	text-align: center;
}

.tarka-locations .tarka-hero.has-panel {
	background: var(--tarka-navy);
	border-radius: 20px;
	padding: 46px 24px 30px;
}

.tarka-locations .tarka-eyebrow {
	color: var(--tarka-navy);
	font-weight: 800;
	font-size: 12.5px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.tarka-locations .tarka-hero-title {
	font-size: clamp(30px, 5vw, 52px);
	line-height: 1.05;
	max-width: 820px;
	margin: 0 auto;
}

.tarka-locations .tarka-hero-sub {
	color: var(--tarka-muted);
	max-width: 560px;
	margin: 16px auto 0;
	font-size: 15.5px;
	line-height: 1.55;
}

.tarka-locations .tarka-hero.has-panel .tarka-eyebrow {
	color: var(--tarka-pink);
}

.tarka-locations .tarka-hero.has-panel .tarka-hero-title {
	color: var(--tarka-white);
}

.tarka-locations .tarka-hero.has-panel .tarka-hero-sub {
	color: #d7d9ee;
}

.tarka-locations .tarka-finder {
	max-width: 620px;
	margin: 0 auto;
	background: var(--tarka-white);
	border: 1.5px solid #e3e6ef;
	border-radius: 18px;
	padding: 10px;
	display: flex;
	gap: 8px;
}

/* Only push the search box down when there's hero copy above it. */
.tarka-locations .tarka-eyebrow + .tarka-finder,
.tarka-locations .tarka-hero-title + .tarka-finder,
.tarka-locations .tarka-hero-sub + .tarka-finder {
	margin-top: 26px;
}

.tarka-locations .tarka-hero.has-panel .tarka-finder {
	border-color: transparent;
	box-shadow: 0 18px 40px rgba(27, 29, 64, 0.25);
	margin-top: 26px;
}

.tarka-locations .tarka-postcode {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	padding: 14px 18px;
	font-family: var(--tarka-body);
	font-size: 15px;
	font-weight: 600;
	color: var(--tarka-navy);
	background: transparent;
	text-transform: uppercase;
}

.tarka-locations .tarka-postcode::placeholder {
	color: #a9adc9;
	text-transform: none;
	font-weight: 500;
}

.tarka-locations .tarka-find-btn {
	background: var(--tarka-navy);
	color: var(--tarka-white);
	border: none;
	padding: 14px 26px;
	border-radius: 12px;
	font-family: var(--tarka-body);
	font-weight: 800;
	font-size: 13.5px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.tarka-locations .tarka-find-btn:hover {
	background: var(--tarka-navy-dark);
}

.tarka-locations .tarka-find-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.tarka-locations .tarka-finder-msg {
	max-width: 620px;
	margin: 12px auto 0;
	text-align: center;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tarka-muted);
	min-height: 20px;
}

.tarka-locations .tarka-finder-msg.is-error {
	color: #b3253b;
}

.tarka-locations .tarka-finder-msg.is-success {
	color: #1e7a52;
}

.tarka-locations .tarka-hero.has-panel .tarka-finder-msg {
	color: #c9cbe6;
}

.tarka-locations .tarka-hero.has-panel .tarka-finder-msg.is-error {
	color: #ffb3c8;
}

.tarka-locations .tarka-hero.has-panel .tarka-finder-msg.is-success {
	color: #b9f0d5;
}

/* ---------- Filters ---------- */
.tarka-locations .tarka-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 20px;
}

.tarka-locations .tarka-filters-label {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--tarka-soft);
	margin-right: 4px;
}

.tarka-locations .tarka-chip {
	background: var(--tarka-white);
	border: 1.5px solid #e3e6ef;
	color: var(--tarka-navy);
	padding: 8px 16px;
	border-radius: 999px;
	font-family: var(--tarka-body);
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tarka-locations .tarka-chip:hover {
	border-color: var(--tarka-navy);
}

.tarka-locations .tarka-chip.is-active {
	background: var(--tarka-navy);
	border-color: var(--tarka-navy);
	color: var(--tarka-white);
}

/* ---------- Layout ---------- */
.tarka-locations .tarka-layout {
	display: grid;
	grid-template-columns: minmax(320px, 420px) 1fr;
	gap: 22px;
	align-items: flex-start;
}

.tarka-locations .tarka-layout.tarka-no-map {
	grid-template-columns: 1fr;
}

.tarka-locations .tarka-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: var(--tarka-col-height, 640px);
	overflow-y: auto;
	/* Cards lift 2px on hover and carry a shadow. Without room inside the scroll
	 * container, the top edge of the first card is clipped at scroll position 0. */
	padding: 4px 6px 4px 4px;
}

.tarka-locations .tarka-list::-webkit-scrollbar {
	width: 6px;
}

.tarka-locations .tarka-list::-webkit-scrollbar-thumb {
	background: #d6d9e6;
	border-radius: 6px;
}

.tarka-locations .tarka-map-col {
	position: sticky;
	top: 90px;
}

.tarka-locations .tarka-map {
	width: 100%;
	height: var(--tarka-col-height, 640px);
	border-radius: var(--tarka-radius);
	box-shadow: 0 8px 24px rgba(27, 29, 64, 0.1);
	z-index: 0;
}

@media (max-width: 880px) {
	.tarka-locations .tarka-layout {
		grid-template-columns: 1fr;
	}

	.tarka-locations .tarka-map-col {
		order: -1;
		position: relative;
		top: 0;
	}

	.tarka-locations .tarka-map {
		height: 460px;
	}

	.tarka-locations .tarka-list {
		max-height: none;
		overflow: visible;
	}
}

/* On a phone the input and button side by side leave the field too narrow to
 * show its own placeholder. Stacking gives the postcode full width. */
@media (max-width: 560px) {
	.tarka-locations .tarka-finder {
		flex-direction: column;
		gap: 6px;
	}

	.tarka-locations .tarka-postcode {
		padding: 13px 16px;
		text-align: center;
	}

	.tarka-locations .tarka-find-btn {
		width: 100%;
		padding: 14px 20px;
	}
}

/* ---------- Venue card ---------- */
.tarka-locations .tarka-card {
	background: var(--tarka-white);
	border-radius: var(--tarka-radius);
	padding: 18px 18px 16px;
	box-shadow: 0 3px 12px rgba(27, 29, 64, 0.06);
	border: 2px solid transparent;
	transition: border-color 0.15s ease, transform 0.15s ease;
	cursor: pointer;
}

.tarka-locations .tarka-card:hover,
.tarka-locations .tarka-card.is-active,
.tarka-locations .tarka-card:focus-visible {
	border-color: var(--tarka-pink);
	transform: translateY(-2px);
}

.tarka-locations .tarka-card:focus-visible {
	outline: 2px solid var(--tarka-navy);
	outline-offset: 2px;
}

.tarka-locations .tarka-card-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.tarka-locations .tarka-card-name {
	font-size: 19px;
	letter-spacing: 0.2px;
}

.tarka-locations .tarka-distance {
	flex-shrink: 0;
	background: var(--tarka-navy);
	color: var(--tarka-white);
	font-size: 11px;
	font-weight: 800;
	padding: 5px 10px;
	border-radius: 999px;
	text-transform: uppercase;
	white-space: nowrap;
}

.tarka-locations .tarka-closest {
	margin-bottom: 8px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.8px;
	color: #1e7a52;
	text-transform: uppercase;
}

.tarka-locations .tarka-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 12px;
}

.tarka-locations .tarka-card-address {
	font-size: 13px;
	color: var(--tarka-muted);
	line-height: 1.5;
	margin-bottom: 12px;
}

.tarka-locations .tarka-card-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.tarka-locations .tarka-btn {
	text-decoration: none;
	font-size: 12.5px;
	font-weight: 700;
	padding: 9px 14px;
	border-radius: 9px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	line-height: 1.2;
	transition: background 0.15s ease;
}

.tarka-locations .tarka-btn.is-quiet {
	background: var(--tarka-grey);
	color: var(--tarka-navy);
}

.tarka-locations .tarka-btn.is-quiet:hover {
	background: #e4e8f0;
	color: var(--tarka-navy);
}

.tarka-locations .tarka-btn.is-primary {
	background: var(--tarka-pink);
	color: var(--tarka-navy);
}

.tarka-locations .tarka-btn.is-primary:hover {
	background: var(--tarka-pink-deep);
	color: var(--tarka-navy);
}

/* ---------- Empty / contact panel ---------- */
.tarka-locations .tarka-empty {
	background: var(--tarka-white);
	border-radius: var(--tarka-radius);
	padding: 28px;
	text-align: center;
	color: var(--tarka-soft);
	font-size: 14px;
	font-weight: 600;
}

.tarka-locations .tarka-contact-panel {
	background: var(--tarka-white);
	border-radius: var(--tarka-radius);
	padding: 26px 24px;
	box-shadow: 0 3px 12px rgba(27, 29, 64, 0.06);
	border: 2px solid var(--tarka-pink);
}

.tarka-locations .tarka-contact-panel h3 {
	font-size: 20px;
	margin-bottom: 10px;
}

.tarka-locations .tarka-contact-panel p {
	font-size: 13.5px;
	color: var(--tarka-muted);
	line-height: 1.6;
	margin: 0 0 16px;
}

/* ---------- Map pins and popups ---------- */
.tarka-locations .tarka-pin {
	width: 40px;
	height: 48px;
	position: relative;
	display: block;
}

/* The badge and tail are decoration inside Leaflet's marker element. On touch,
 * a tap that lands on one of them is delivered with that span as the target and
 * Leaflet's own marker handler never fires — so the map never moved. Letting
 * pointer events fall through means every tap reaches the marker itself. */
.tarka-locations .tarka-pin,
.tarka-locations .tarka-pin-badge,
.tarka-locations .tarka-pin-tail,
.tarka-locations .tarka-pin-badge img {
	pointer-events: none;
}

.tarka-locations .leaflet-marker-icon {
	pointer-events: auto;
}

.tarka-locations .tarka-pin-badge {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--tarka-white);
	border: 3px solid var(--tarka-navy);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-shadow: 0 4px 10px rgba(27, 29, 64, 0.35);
	transition: transform 0.15s ease, border-color 0.15s ease;
}

/* Matches the prototype exactly: a 24px image centred in a white badge, with the
 * badge's overflow:hidden clipping it to the circle. */
.tarka-locations .tarka-pin-badge img {
	width: 24px;
	height: 24px;
	max-width: 24px;
	object-fit: contain;
	display: block;
}

.tarka-locations .tarka-pin-tail {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 0;
	transform: translateX(-50%);
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 10px solid var(--tarka-navy);
}

.tarka-locations .tarka-pin.is-highlight .tarka-pin-badge {
	border-color: var(--tarka-pink-deep);
	transform: scale(1.12);
}

.tarka-locations .tarka-user-pin {
	display: block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tarka-pink);
	border: 3px solid var(--tarka-navy);
	box-shadow: 0 3px 8px rgba(27, 29, 64, 0.4);
}

.tarka-locations .leaflet-popup-content-wrapper {
	border-radius: 12px;
	padding: 2px;
}

/* Leaflet sets an uneven margin on .leaflet-popup-content (13px 24px 13px 20px)
 * and reserves no space below the last row. Rather than fight it value-by-value,
 * zero it out and let our own wrapper own the padding — that way the spacing is
 * even on all four sides regardless of what Leaflet ships.
 *
 * The width is deliberately left to Leaflet (set via the maxWidth/minWidth popup
 * options in JS). Forcing it here with !important desynced the bubble's real
 * width from the width Leaflet uses for its auto-pan maths, so on a narrow map
 * it would position the popup past the container edge and clip the title. */
.tarka-locations .leaflet-popup-content {
	margin: 0;
	font-family: var(--tarka-body);
}

.tarka-locations .tarka-popup {
	padding: 18px;
}

@media (max-width: 560px) {
	.tarka-locations .tarka-popup {
		padding: 15px;
	}

	.tarka-locations .tarka-popup-name {
		font-size: 16px;
	}
}

.tarka-locations .tarka-popup > *:last-child {
	margin-bottom: 0;
}

/* Leaflet applies maxHeight by making the content scrollable. Keep that tidy. */
.tarka-locations .leaflet-popup-scrolled {
	border: none;
	overscroll-behavior: contain;
}

.tarka-locations .tarka-popup-name {
	font-family: var(--tarka-display);
	font-size: 17px;
	color: var(--tarka-navy);
	text-transform: uppercase;
	margin-bottom: 6px;
}

.tarka-locations .tarka-popup .tarka-pill {
	padding: 4px 9px;
	font-size: 10px;
}

.tarka-locations .tarka-popup-address {
	font-size: 12px;
	color: var(--tarka-muted);
	line-height: 1.45;
	margin-bottom: 8px;
}

.tarka-locations .tarka-popup .tarka-btn {
	font-size: 11px;
	padding: 7px 10px;
	border-radius: 7px;
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	.tarka-locations .tarka-card,
	.tarka-locations .tarka-chip,
	.tarka-locations .tarka-btn,
	.tarka-locations .tarka-pin-badge {
		transition: none;
	}

	.tarka-locations .tarka-card:hover,
	.tarka-locations .tarka-card.is-active {
		transform: none;
	}
}
