/* TMLC Tournament Map — compact, premium homepage module */

.tmlc-map-section {
	overflow-x: clip;
	--tmlc-accent: #03c4eb;
	--tmlc-accent-dark: #0296b0;
	--tmlc-live: #d64545;
	--tmlc-open: #1f9d55;
	--tmlc-sold: #b06a1f;
	--tmlc-past: #8892a0;
	--tmlc-ink: #0e1a24;
	--tmlc-muted: #596573;
	--tmlc-land: #e6ecf0;
	--tmlc-land-stroke: #ffffff;

	padding: 64px 0 72px;
	background: #ffffff;
}

.tmlc-map-section .container {
	max-width: 1180px;
}

/* ---------- header ---------- */

.tmlc-map-header {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	gap: 20px;
	margin-bottom: 28px;
	padding: 0 4px;
}

.tmlc-map-eyebrow {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--tmlc-accent);
	margin-bottom: 6px;
}

.tmlc-map-title {
	font-size: 32px;
	line-height: 1.1;
	margin: 0;
	color: var(--tmlc-ink);
	letter-spacing: -0.01em;
}

.tmlc-map-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 12px;
	color: var(--tmlc-muted);
	font-weight: 600;
}

.tmlc-map-legend .tmlc-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tmlc-map-legend .tmlc-legend-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tmlc-past);
}

.tmlc-legend-item--live .tmlc-legend-dot     { background: var(--tmlc-live); }
.tmlc-legend-item--open .tmlc-legend-dot     { background: var(--tmlc-open); }
.tmlc-legend-item--sold_out .tmlc-legend-dot { background: var(--tmlc-sold); }
.tmlc-legend-item--past .tmlc-legend-dot     { background: var(--tmlc-past); }

@media (max-width: 700px) {
	.tmlc-map-header {
		grid-template-columns: 1fr;
	}
	.tmlc-map-title { font-size: 26px; }
}

/* ---------- map stage ---------- */

.tmlc-map-stage {
	position: relative;
	width: 100%;
	max-width: 100%;
	border-radius: 14px;
	background: linear-gradient(180deg, #f7fafc 0%, #edf2f5 100%);
	box-shadow: inset 0 0 0 1px rgba(14, 26, 36, 0.06), 0 20px 40px -24px rgba(14, 26, 36, 0.18);
	padding: 14px 20px;
	box-sizing: border-box;
	overflow: visible;
}

.tmlc-map-section,
.tmlc-map-section * {
	box-sizing: border-box;
}

.tmlc-map-inner {
	position: relative;
	width: 100%;
	aspect-ratio: 920 / 420;
	margin: 0 auto;
}

.tmlc-map-svg {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.tmlc-map-svg svg {
	width: 100%;
	height: 100%;
	display: block;
}

.tmlc-map-svg .state path,
.tmlc-map-svg path {
	fill: var(--tmlc-land);
	transition: fill 180ms ease;
}

.tmlc-map-svg .borders { stroke: var(--tmlc-land-stroke); }

/* ---------- pins (resort logos) ---------- */

.tmlc-pin {
	position: absolute;
	transform: translate(-50%, -50%);
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	outline: none;
	width: 56px;
	height: 56px;
	z-index: 2;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.tmlc-pin__logo {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 8px 18px -8px rgba(14, 26, 36, 0.35), 0 0 0 2px rgba(14, 26, 36, 0.05);
	transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
	overflow: hidden;
	z-index: 2;
}

.tmlc-pin__logo img {
	width: 78%;
	height: 78%;
	object-fit: contain;
	display: block;
}

.tmlc-pin__ring {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid transparent;
	pointer-events: none;
	z-index: 1;
	transition: border-color 200ms ease, transform 200ms ease;
}

.tmlc-pin:hover .tmlc-pin__logo,
.tmlc-pin:focus-visible .tmlc-pin__logo,
.tmlc-pin.is-active .tmlc-pin__logo {
	transform: scale(1.08);
	box-shadow: 0 14px 26px -10px rgba(14, 26, 36, 0.45), 0 0 0 2px rgba(14, 26, 36, 0.08);
}

.tmlc-pin:focus-visible .tmlc-pin__ring {
	border-color: var(--tmlc-accent);
}

/* ---- status variants ---- */

/* live = red pulse, logo full color */
.tmlc-pin--live .tmlc-pin__ring {
	border-color: var(--tmlc-live);
	box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.45);
	animation: tmlc-live-pulse 1.8s ease-out infinite;
}

/* open = subtle green ring, static */
.tmlc-pin--open .tmlc-pin__ring {
	border-color: var(--tmlc-open);
}

/* sold_out = amber ring, static */
.tmlc-pin--sold_out .tmlc-pin__ring {
	border-color: var(--tmlc-sold);
}

/* past = desaturated, smaller */
.tmlc-pin--past {
	width: 46px;
	height: 46px;
}

.tmlc-pin--past .tmlc-pin__logo {
	filter: grayscale(0.8);
	opacity: 0.75;
	background: #f5f7f9;
}

.tmlc-pin--past:hover .tmlc-pin__logo,
.tmlc-pin--past:focus-visible .tmlc-pin__logo,
.tmlc-pin--past.is-active .tmlc-pin__logo {
	filter: grayscale(0);
	opacity: 1;
}

.tmlc-pin--past .tmlc-pin__ring {
	border-color: var(--tmlc-past);
	border-style: dashed;
}

@keyframes tmlc-live-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.55); }
	70%  { box-shadow: 0 0 0 14px rgba(214, 69, 69, 0); }
	100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.tmlc-pin--live .tmlc-pin__ring { animation: none; }
}

/* ---------- popover ---------- */

.tmlc-popover {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 10;
	width: 280px;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 18px)) scale(0.96);
	transition: opacity 180ms ease, transform 180ms ease;
}

.tmlc-popover.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, calc(-100% - 18px)) scale(1);
}

.tmlc-popover.is-below {
	transform: translate(-50%, 18px) scale(0.96);
}

.tmlc-popover.is-below.is-open {
	transform: translate(-50%, 18px) scale(1);
}

.tmlc-popover__inner {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 18px 50px -14px rgba(14, 26, 36, 0.35), 0 0 0 1px rgba(14, 26, 36, 0.05);
	padding: 18px 20px 20px;
}

.tmlc-popover__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--tmlc-muted);
	cursor: pointer;
	padding: 0;
	margin: 0;
	transition: background 150ms ease, color 150ms ease;
	z-index: 2;
}

.tmlc-popover__close:hover,
.tmlc-popover__close:focus-visible {
	background: #f0f3f5;
	color: var(--tmlc-ink);
	outline: none;
}

.tmlc-popover__backdrop {
	display: none;
}

.tmlc-popover__arrow {
	position: absolute;
	left: 50%;
	bottom: -7px;
	transform: translateX(-50%) rotate(45deg);
	width: 14px;
	height: 14px;
	background: #ffffff;
	box-shadow: 2px 2px 6px -2px rgba(14, 26, 36, 0.2);
}

.tmlc-popover.is-below .tmlc-popover__arrow {
	bottom: auto;
	top: -7px;
	transform: translateX(-50%) rotate(225deg);
}

.tmlc-popover__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.tmlc-popover__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: #f5f7f9;
	border-radius: 10px;
	flex: 0 0 auto;
	overflow: hidden;
}

.tmlc-popover__logo img {
	width: 78%;
	height: 78%;
	object-fit: contain;
}

.tmlc-popover__status {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #eef2f5;
	color: var(--tmlc-muted);
	white-space: nowrap;
}

.tmlc-popover__status[data-status="live"]     { background: rgba(214, 69, 69, 0.12); color: var(--tmlc-live); }
.tmlc-popover__status[data-status="open"]     { background: rgba(31, 157, 85, 0.12); color: var(--tmlc-open); }
.tmlc-popover__status[data-status="sold_out"] { background: rgba(176, 106, 31, 0.14); color: var(--tmlc-sold); }
.tmlc-popover__status[data-status="past"]     { background: rgba(136, 146, 160, 0.15); color: var(--tmlc-past); }

.tmlc-popover__title {
	font-size: 17px;
	line-height: 1.2;
	margin: 0 0 4px;
	color: var(--tmlc-ink);
	letter-spacing: -0.005em;
}

.tmlc-popover__venue {
	font-size: 13px;
	color: var(--tmlc-ink);
	font-weight: 600;
	margin: 0 0 6px;
}

.tmlc-popover__meta {
	font-size: 12px;
	color: var(--tmlc-muted);
	margin: 0 0 10px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.tmlc-popover__sep { opacity: 0.4; }

.tmlc-popover__blurb {
	font-size: 13px;
	line-height: 1.45;
	color: var(--tmlc-muted);
	margin: 0 0 14px;
}

.tmlc-popover__cta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--tmlc-accent-dark);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 150ms ease, border-color 150ms ease;
}

.tmlc-popover__cta:hover,
.tmlc-popover__cta:focus-visible {
	color: var(--tmlc-ink);
	border-bottom-color: currentColor;
	outline: none;
}

/* ---------- responsive ---------- */

@media (max-width: 768px) {
	.tmlc-map-section {
		padding: 40px 0 48px;
	}

	.tmlc-map-stage {
		padding: 8px 0;
		border-radius: 12px;
		overflow: hidden; /* popover uses position:fixed on mobile, so safe */
	}
	.tmlc-map-inner {
		aspect-ratio: 920 / 540;
		width: calc(100% - 40px); /* inset so edge pins stay fully visible */
	}

	.tmlc-pin {
		width: 36px;
		height: 36px;
	}

	.tmlc-pin--past {
		width: 30px;
		height: 30px;
	}

	/* Full-screen modal: the popover IS the backdrop; inner is the card. */
	.tmlc-popover {
		position: fixed;
		inset: 0;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		width: auto;
		z-index: 9999;
		background: rgba(14, 26, 36, 0.55);
		display: flex;
		align-items: flex-end;
		justify-content: center;
		padding: 0;
		opacity: 0;
		pointer-events: none;
		transform: none !important;
		transition: opacity 200ms ease;
	}

	.tmlc-popover.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	.tmlc-popover__arrow { display: none; }
	.tmlc-popover__backdrop { display: none !important; }

	.tmlc-popover__inner {
		width: 100%;
		max-width: 480px;
		max-height: 85vh;
		margin: 0;
		padding: 18px 18px 22px;
		border-radius: 16px 16px 0 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		background: #ffffff;
		box-shadow: 0 -12px 40px rgba(14, 26, 36, 0.25);
	}

	.tmlc-popover__head {
		padding-right: 40px;
		margin-bottom: 10px;
	}

	.tmlc-popover__logo {
		width: 40px;
		height: 40px;
		border-radius: 8px;
	}

	.tmlc-popover__title  { font-size: 18px; margin-bottom: 2px; }
	.tmlc-popover__venue  { font-size: 13px; margin-bottom: 4px; }
	.tmlc-popover__meta   { font-size: 12px; margin-bottom: 10px; }
	.tmlc-popover__blurb  { font-size: 13px; line-height: 1.45; margin-bottom: 14px; }
	.tmlc-popover__status { font-size: 10px; padding: 4px 9px; letter-spacing: 1.1px; }
	.tmlc-popover__cta    { font-size: 13px; }

	.tmlc-popover__close {
		top: 8px;
		right: 8px;
		width: 40px;
		height: 40px;
		background: #f0f3f5;
		color: var(--tmlc-ink);
	}
}
