/* ============================================================
   Yellow Book – Map Shortcodes  v1.0.1
   /wp-content/themes/your-child-theme/css/map-shortcodes.css
   ============================================================ */

/* Wrapper */
.yb-map {
	position: relative;
	display: inline-block;
	width: 100%;
	max-width: 720px;
}

.yb-map__caption {
	font-size: 0.875rem;
	margin-bottom: 0.75em;
	color: #555;
}

.yb-map__caption-main,
.yb-map__caption-alt {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 0.5em;
	font-size: 0.8rem;
	line-height: 1.4;
}

.yb-map__caption-main::before,
.yb-map__caption-alt::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 24px;
	flex-shrink: 0;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	margin-top: 1px;
}

/* Gold pin for main caption */
.yb-map__caption-main::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill='%23e8a020' d='M12 0C7.03 0 3 4.03 3 9c0 6.75 9 23 9 23s9-16.25 9-23C21 4.03 16.97 0 12 0z'/%3E%3Ccircle cx='12' cy='9' r='4' fill='%23fff' opacity='.6'/%3E%3C/svg%3E");
}

/* Orange pin for alt caption */
.yb-map__caption-alt::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill='%23e05a00' d='M12 0C7.03 0 3 4.03 3 9c0 6.75 9 23 9 23s9-16.25 9-23C21 4.03 16.97 0 12 0z'/%3E%3Ccircle cx='12' cy='9' r='4' fill='%23fff' opacity='.6'/%3E%3C/svg%3E");
}

.yb-map__image {
	display: block;
	width: 100%;
	height: auto;
}

/* Marker pin button */

.yb-marker {
	position: absolute;
	transform: translate(-50%, -100%);
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	cursor: pointer;
	width: 28px;
	height: 36px;
	z-index: 10;
	transition: transform 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
}

.yb-marker:hover {
	transform: translate(-50%, -100%) scale(1.2);
	background: none !important;
	z-index: 20;
}

.yb-marker[aria-expanded="true"] {
	transform: translate(-50%, -100%) scale(1.15);
	z-index: 20;
}

/* Remove any focus ring that themes add as a dark box */
.yb-marker:focus,
.yb-marker:focus-visible {
	outline: none !important;
	box-shadow: none !important;
	background: none !important;
}

.yb-marker__pin {
	width: 100%;
	height: 100%;
	fill: #e8a020;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
	display: block;
}

.yb-marker__pin-dot {
	fill: #fff;
	opacity: 0.6;
}

/* Grey/orange variant */
.yb-marker--grey .yb-marker__pin {
	fill: #e05a00;
}

/* Popup */

.yb-marker-popup {
	position: absolute;
	z-index: 100;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 4px 20px rgba(0,0,0,0.18);
	width: 420px;
	max-width: 85vw;
	max-height: 65vh;
	overflow-y: auto;
	border-radius: 2px;
	/* Default: open to the right */
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
}

/* Flip to left when pin is in right half of map */
.yb-marker-popup--left {
	left: auto;
	right: 18px;
}

.yb-marker-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 8px;
	border-bottom: 1px solid #eee;
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 1;
}

.yb-marker-popup__title {
	margin: 0 !important;
	font-size: 1.05rem !important;
	font-weight: 600 !important;
	color: #222 !important;
	border: none !important;
	padding: 0 !important;
}

.yb-marker-popup__close {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 0 0 0 10px !important;
	margin: 0 !important;
	transition: color 0.1s;
	-webkit-appearance: none;
	appearance: none;
}

.yb-marker-popup__close:hover {
	color: #333;
	background: none !important;
}

.yb-marker-popup__close:focus {
	outline: none !important;
	box-shadow: none !important;
}

.yb-marker-popup__body {
	padding: 10px 14px 12px;
}

.yb-marker-popup__body h4 {
	margin: 0.75em 0 0 !important;
	font-size: 0.8rem !important;
	font-weight: 700 !important;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #333;
	border-bottom: 1px solid #eee;
	padding-bottom: 4px !important;
}

.yb-marker-popup__body h4:first-child {
	margin-top: 0 !important;
}

.yb-marker-popup__body p {
	margin: 0.15em 0;
	font-size: 0.85rem;
}

.yb-marker-popup__body a {
	color: #1a6e9f;
	text-decoration: none;
	font-size: 0.85rem;
}

.yb-marker-popup__body a:hover {
	text-decoration: underline;
}

.yb-marker-popup__body strong {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 1px;
}

/* Suppress wpautop-injected line breaks inside popup rows */
.yb-marker-popup__body br {
	display: none;
}

/* Row / Column grid (inside popups) */

.yb-row {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	align-items: center;
	margin: 6px 0 0;
	padding: 6px 0;
	border-bottom: 1px solid #f5f5f5;
}

.yb-row:last-child {
	border-bottom: none;
}

.yb-col { box-sizing: border-box; min-width: 0; }

.yb-col-1  { flex: 0 0 calc(100% /12 * 1);  max-width: calc(100% /12 * 1);  }
.yb-col-2  { flex: 0 0 calc(100% /12 * 2);  max-width: calc(100% /12 * 2);  }
.yb-col-3  { flex: 0 0 calc(100% /12 * 3);  max-width: calc(100% /12 * 3);  }
.yb-col-4  { flex: 0 0 calc(100% /12 * 4);  max-width: calc(100% /12 * 4);  }
.yb-col-5  { flex: 0 0 calc(100% /12 * 5);  max-width: calc(100% /12 * 5);  }
.yb-col-6  { flex: 0 0 calc(100% /12 * 6);  max-width: calc(100% /12 * 6);  }
.yb-col-7  { flex: 0 0 calc(100% /12 * 7);  max-width: calc(100% /12 * 7);  }
.yb-col-8  { flex: 0 0 calc(100% /12 * 8);  max-width: calc(100% /12 * 8);  }
.yb-col-9  { flex: 0 0 calc(100% /12 * 9);  max-width: calc(100% /12 * 9);  }
.yb-col-10 { flex: 0 0 calc(100% /12 * 10); max-width: calc(100% /12 * 10); }
.yb-col-11 { flex: 0 0 calc(100% /12 * 11); max-width: calc(100% /12 * 11); }
.yb-col-12 { flex: 0 0 100%; max-width: 100%; }

/* Photo column */
.yb-marker-popup__body .yb-col-2 {
	flex: 0 0 76px;
	max-width: 76px;
}

/* Text column: take remaining space */
.yb-marker-popup__body .yb-col-10 {
	flex: 1 1 0;
	max-width: none;
}

.yb-marker-popup__body img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	object-position: top center;
	border-radius: 2px;
	border: 3px solid #e8a020;
	box-sizing: border-box;
}

/* Overlay */

.yb-map-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 50;
	background: transparent;
}

.yb-map-overlay--active {
	display: block;
}