/* =========================================================
   Course map pages - full screen layout
   Used by _templates/maps/_maptemplate.cfm
   ========================================================= */

:root {
	--map-blue: #10437C;
	--map-link: #2969B0;
	--map-text: #333;
	--map-muted: #666;
	--map-border: #e5e5e5;
	--map-bg: #f6f8fb;
	--map-active-bg: #eef4fb;
	--map-header-h: auto;
	--map-list-w: 360px;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: var(--map-text);
	background: var(--map-bg);
}

a {
	color: var(--map-link);
}

/* ---------- App shell: header on top, map + list fill the screen ---------- */

.map-app {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
}

/* ---------- Header ---------- */

.map-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 20px;
	padding: 10px 16px;
	background: #fff;
	border-bottom: 1px solid var(--map-border);
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
	position: relative;
	z-index: 2;
}

.map-header #logo a {
	display: block;
	line-height: 0;
}

.map-header #logo img {
	height: 44px;
	width: auto;
	display: block;
}

.map-header__text {
	flex: 1;
	min-width: 240px;
}

.map-header h1 {
	margin: 0;
	font-size: 20px;
	line-height: 1.2;
	color: var(--map-blue);
}

.map-header__intro {
	margin: 3px 0 0;
	font-size: 13px;
	color: var(--map-muted);
}

/* ---------- Legend ---------- */

.map-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: var(--map-muted);
}

.map-legend li {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.map-legend__dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

.map-legend__dot--public  { background: #2E7D32; }
.map-legend__dot--private { background: #10437C; }
.map-legend__dot--resort  { background: #B07D1A; }
.map-legend__dot--casino  { background: #B3261E; }
.map-legend__dot--simulator { background: #6A3FA0; }
.map-legend__dot--community { background: #00838F; }
.map-legend__dot--attraction { background: #546E7A; }

/* ---------- Share buttons (right end of the header) ---------- */

.map-share {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.map-share__label {
	font-size: 12px;
	color: var(--map-muted);
	margin-right: 2px;
}

.map-share__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--map-border);
	border-radius: 50%;
	background: #fff;
	color: var(--map-blue);
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.map-share__btn:hover,
.map-share__btn:focus-visible {
	border-color: var(--map-link);
	background: var(--map-active-bg);
	outline: none;
}

.map-share__btn svg {
	display: block;
}

/* Filled icons (Facebook, X) take the button color; outline icons set their own stroke */
.map-share__btn svg:not([fill]) {
	fill: currentColor;
}

/* "Link copied" bubble under the copy button */
.map-share__btn.is-copied::after {
	content: attr(data-msg);
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	white-space: nowrap;
	padding: 4px 8px;
	font-size: 12px;
	color: #fff;
	background: var(--map-blue);
	border-radius: 4px;
}

/* ---------- Map + list area ---------- */

.map-body {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--map-list-w);
}

.map-body--nolist {
	grid-template-columns: 1fr;
}

#map {
	width: 100%;
	height: 100%;
}

.map-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 40px 14px;
	text-align: center;
	color: var(--map-muted);
}

/* ---------- Markers ---------- */

.map-flag {
	cursor: pointer;
	line-height: 0;
}

/* Scale the inner pin; MapLibre owns the transform on the marker itself */
.map-flag svg {
	display: block;
	filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
	transition: transform .15s ease;
	transform-origin: bottom center;
}

.map-flag.is-hover svg,
.map-flag.is-active svg {
	transform: scale(1.3);
}

.map-flag.is-hover,
.map-flag.is-active {
	z-index: 3;
}

/* Nudge the flag and pole inside the pin (positive = right / down) */
.map-flag svg :not(:first-child) {
	transform: translate(3px, 2px);
}

/* ---------- Popups ---------- */

.maplibregl-popup-content {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	line-height: 1.4;
	padding: 12px 14px;
}

.map-popup__name {
	font-size: 14px;
	font-weight: bold;
	margin-bottom: 4px;
}

.map-popup__cat {
	color: #777;
	font-size: 12px;
	margin-bottom: 6px;
}

.map-popup__social {
	margin-top: 8px;
}

.map-popup__social img {
	width: 24px;
	height: 24px;
	margin-right: 4px;
}

/* ---------- Course list (right column) ---------- */

.map-list {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--map-bg);
	border-left: 1px solid var(--map-border);
}

.map-summary {
	margin: 0;
	padding: 12px 14px 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--map-text);
	background: #fff;
}

.map-list__count {
	padding: 10px 14px;
	font-size: 13px;
	color: #555;
	background: #fff;
	border-bottom: 1px solid var(--map-border);
}

.map-list__items {
	flex: 1;
	overflow-y: auto;
	padding: 10px;
}

.map-list__empty {
	color: #777;
	padding: 20px 4px;
	text-align: center;
}

.course-card {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var(--map-border);
	border-radius: 6px;
	padding: 10px 12px;
	margin-bottom: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.course-card:hover,
.course-card:focus {
	border-color: var(--map-link);
	outline: none;
}

.course-card.is-active {
	border-color: var(--map-link);
	background: var(--map-active-bg);
}

.course-card[hidden] {
	display: none;
}

.course-card__logo {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--map-border);
	border-radius: 6px;
	padding: 4px;
	box-sizing: border-box;
}

/* No-logo placeholder: soft tint of the course type color */
.course-card__logo--public  { background: #edf6ee; border-color: #d3e8d5; }
.course-card__logo--private { background: #eaf0f7; border-color: #cfdcec; }
.course-card__logo--resort  { background: #faf3e5; border-color: #eedfbd; }
.course-card__logo--casino  { background: #fbecea; border-color: #f0cfcb; }
.course-card__logo--simulator { background: #f2edf8; border-color: #ddd0ee; }
.course-card__logo--community { background: #e6f4f5; border-color: #c4e3e6; }
.course-card__logo--attraction { background: #eef1f3; border-color: #d3dade; }

.course-card__logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.course-card__text {
	flex: 1;
	min-width: 0;
}

/* ---------- Social icons on cards (mapShowSocial = true) ---------- */

.course-card__social {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 7px;
}

.course-card__social a {
	display: block;
	line-height: 0;
	border-radius: 4px;
	transition: transform .15s ease;
}

.course-card__social a:hover,
.course-card__social a:focus-visible {
	transform: translateY(-1px);
}

.course-card__social img {
	width: 22px;
	height: 22px;
}

/* ---------- App download badges ---------- */

.course-card__apps,
.map-popup__apps {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
}

.course-card__apps a,
.map-popup__apps a {
	display: block;
	line-height: 0;
}

.course-card__apps img,
.map-popup__apps img {
	height: 30px;
	width: auto;
}

.map-popup__apps img {
	height: 28px;
}

/* ---------- Photo cards (mapShowPhotos = true) ---------- */

.course-card--photo {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	padding: 0;
	overflow: hidden;
}

.course-card__photo {
	position: relative;
	aspect-ratio: 2 / 1;
	background: #e9edf2;
}

.course-card__photo > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.course-card__badge {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	box-sizing: border-box;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* Flag badge when there's no logo: keep the tint, add a white edge so it reads on the photo */
.course-card__badge.course-card__logo--public,
.course-card__badge.course-card__logo--private,
.course-card__badge.course-card__logo--resort,
.course-card__badge.course-card__logo--casino,
.course-card__badge.course-card__logo--simulator,
.course-card__badge.course-card__logo--community,
.course-card__badge.course-card__logo--attraction {
	border: 2px solid #fff;
}

.course-card__badge img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.course-card--photo .course-card__text {
	padding: 10px 12px;
}

/* Photo file missing: drop the photo area */
.course-card--nophoto .course-card__photo {
	display: none;
}

.course-card__name {
	font-weight: bold;
	font-size: 14px;
	line-height: 1.3;
	margin: 0 0 2px;
}

.course-card__name a {
	text-decoration: none;
}

.course-card__name a:hover {
	text-decoration: underline;
}

.course-card__meta {
	font-size: 12px;
	color: var(--map-muted);
}

/* ---------- Ad below the app ---------- */

.map-ad {
	padding: 16px;
	text-align: center;
	background: #fff;
	border-top: 1px solid var(--map-border);
}

/* ---------- Tablet and phone: stack map over list, page scrolls ---------- */

@media (max-width: 900px) {
	.map-app {
		height: auto;
	}

	.map-header #logo img {
		height: 36px;
	}

	.map-header h1 {
		font-size: 18px;
	}

	.map-share {
		margin-left: 0;
	}

	.map-body {
		grid-template-columns: 1fr;
	}

	#map {
		height: 60vh;
		height: 60dvh;
		min-height: 360px;
	}

	.map-list {
		border-left: 0;
		border-top: 1px solid var(--map-border);
	}

	.map-list__items {
		overflow: visible;
	}
}
