/*
 * LCCL Map – Public Frontend Styles
 * Business directory map + list view.
 */

/* ==========================================================================
   Wrapper
   ========================================================================== */

#lccl-alliance-wrap {
	max-width: 1400px;
	margin: 0 auto;
	font-family: inherit;
	box-sizing: border-box;
}

#lccl-alliance-wrap *,
#lccl-alliance-wrap *::before,
#lccl-alliance-wrap *::after {
	box-sizing: inherit;
}

/* ==========================================================================
   Controls (search + filters)
   ========================================================================== */

.lccl-controls {
	padding: 16px;
	background: #f5f5f7;
	border-radius: 8px;
	margin-bottom: 12px;
}

/* Search row */
.lccl-search-wrap {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

#lccl-search {
	flex: 1;
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.95em;
	line-height: 1.4;
	background: #fff;
	transition: border-color 0.15s;
}

#lccl-search:focus {
	outline: none;
	border-color: #9b59b6;
	box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

/* Clear button */
.lccl-clear-btn {
	white-space: nowrap;
	padding: 8px 14px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	color: #555;
	font-size: 0.85em;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.lccl-clear-btn:hover {
	background: #9b59b6;
	color: #fff;
	border-color: #9b59b6;
}

/* Tier pills */
.lccl-tier-pills {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.lccl-tier-pill {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid #ccc;
	border-radius: 999px;
	background: #fff;
	color: #444;
	font-size: 0.85em;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.lccl-tier-pill:hover {
	border-color: #9b59b6;
	color: #9b59b6;
}

.lccl-tier-pill.active {
	background: #9b59b6;
	border-color: #9b59b6;
	color: #fff;
}

/* Ownership pills (Affirming / LGBT+ Owned) — mutually exclusive */
.lccl-ownership-pills {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.lccl-ownership-pill {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid #ccc;
	border-radius: 999px;
	background: #fff;
	color: #444;
	font-size: 0.85em;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.lccl-ownership-pill:hover {
	border-color: #2980b9;
	color: #2980b9;
}

.lccl-ownership-pill.active {
	background: #2980b9;
	border-color: #2980b9;
	color: #fff;
}

/* Category nested list */
.lccl-cat-list-wrap {
	margin-bottom: 10px;
}

.lccl-cat-list,
.lccl-cat-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lccl-cat-children {
	padding-left: 16px;
	display: none; /* collapsed by default */
}

.lccl-cat-has-children.lccl-cat-open > .lccl-cat-children {
	display: block;
}

.lccl-cat-row {
	display: flex;
	align-items: center;
}

.lccl-cat-btn {
	flex: 1;
	text-align: left;
	background: none;
	border: none;
	padding: 5px 6px;
	font-size: 0.78em;
	color: #333;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.12s, color 0.12s;
	white-space: normal;
	word-break: break-word;
}

.lccl-cat-btn:hover {
	background: #ede4f5;
	color: #6a1fa0;
}

.lccl-cat-item.lccl-cat-active > .lccl-cat-row > .lccl-cat-btn,
.lccl-cat-item.lccl-cat-active > .lccl-cat-btn {
	background: #9b59b6;
	color: #fff;
	font-weight: 600;
}

.lccl-cat-chevron {
	background: none;
	border: none;
	padding: 4px 6px;
	cursor: pointer;
	color: #888;
	font-size: 0.75em;
	line-height: 1;
	transition: transform 0.2s, color 0.12s;
	transform-origin: center;
	flex-shrink: 0;
}

.lccl-cat-chevron:hover {
	color: #9b59b6;
}

.lccl-cat-has-children.lccl-cat-open > .lccl-cat-row > .lccl-cat-chevron {
	transform: rotate( 90deg );
}

/* Filter row (tier pills) */
.lccl-filter-row {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}

.lccl-filter-row select {
	min-width: 180px;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.9em;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s;
}

.lccl-filter-row select:focus {
	outline: none;
	border-color: #9b59b6;
	box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.2);
}

/* Tag pills row */
.lccl-tag-filters {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 6px;
}

.lccl-tag-pill {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid #bbb;
	border-radius: 999px;
	background: #fff;
	color: #444;
	font-size: 0.82em;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	user-select: none;
}

.lccl-tag-pill:hover {
	border-color: #9b59b6;
	color: #9b59b6;
}

.lccl-tag-pill.active {
	background: #9b59b6;
	border-color: #9b59b6;
	color: #fff;
}

/* ==========================================================================
   View toggle (mobile only – hidden on desktop)
   ========================================================================== */

.lccl-view-toggle {
	display: none; /* shown via media query on mobile */
	flex-direction: row;
	margin-bottom: 0;
	border: 1px solid #ccc;
	border-radius: 6px;
	overflow: hidden;
}

.lccl-toggle-btn {
	flex: 1;
	padding: 10px 0;
	border: none;
	background: #fff;
	color: #555;
	font-size: 0.95em;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	text-align: center;
}

.lccl-toggle-btn:not(:last-child) {
	border-right: 1px solid #ccc;
}

.lccl-toggle-btn.active {
	background: #9b59b6;
	color: #fff;
}

.lccl-toggle-btn:hover:not(.active) {
	background: #f0e6f8;
}

/* ==========================================================================
   Main layout (map + list panels)
   ========================================================================== */

.lccl-main {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
}

/* Category sidebar */
.lccl-cat-sidebar {
	width: 200px;
	flex-shrink: 0;
	border-right: 1px solid #e0e0e0;
	padding: 12px 10px;
	overflow-y: auto;
	max-height: 600px;
	background: #fafafa;
}

.lccl-cat-sidebar-label {
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #888;
	margin: 0 0 8px 6px;
}

/* Content wrapper (map + list) */
.lccl-content {
	flex: 1;
	display: flex;
	flex-direction: row;
	min-width: 0;
}

/* Map panel */
.lccl-map-panel {
	width: 55%;
	position: relative;
	height: 600px;
	flex-shrink: 0;
}

#lccl-mapbox-container {
	width: 100%;
	height: 100%;
}

/* List panel */
.lccl-list-panel {
	width: 45%;
	overflow-y: auto;
	max-height: 600px;
	background: #fff;
	border-left: 1px solid #ddd;
}

/* ==========================================================================
   List status bar
   ========================================================================== */

.lccl-list-status {
	padding: 10px 16px;
	color: #666;
	font-style: italic;
	font-size: 0.85em;
	border-bottom: 1px solid #eee;
	background: #fafafa;
}

/* ==========================================================================
   Business card
   ========================================================================== */

.lccl-business-card {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
	transition: background 0.12s;
	position: relative;
}

.lccl-card-body {
	flex: 1;
	min-width: 0;
}

.lccl-business-card:last-child {
	border-bottom: none;
}

.lccl-business-card:hover {
	background: #faf5ff;
}

.lccl-business-card.highlighted {
	border-left: 4px solid #9b59b6;
	background: #f9f4ff;
	padding-left: 12px; /* compensate for added border */
}

/* Card header: legacy class kept for any theme overrides */
.lccl-card-header {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 6px;
}

.lccl-card-logo {
	width: 72px;
	height: 72px;
	object-fit: cover;
	flex-shrink: 0;
	align-self: flex-start;
	border-radius: 6px;
	flex-shrink: 0;
}

.lccl-card-logo-placeholder {
	width: 72px;
	height: 72px;
	flex-shrink: 0;
	align-self: flex-start;
	background: #eee;
	border-radius: 6px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 24px;
}

.lccl-card-title-wrap {
	flex: 1;
	min-width: 0;
}

.lccl-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.lccl-card-name {
	font-size: 0.82em;
	font-weight: 600;
	margin: 0 0 2px 0;
	line-height: 1.3;
}

/* Category breadcrumb */
.lccl-card-category {
	font-size: 0.70em;
	color: #777;
	margin: 0 0 3px 0;
}

/* ==========================================================================
   Tier badges
   ========================================================================== */

.lccl-tier-badge {
	display: inline-block;
	font-size: 0.67em;
	padding: 2px 7px;
	border-radius: 4px;
	font-weight: 600;
	white-space: nowrap;
	vertical-align: middle;
	margin-top: 2px;
}

.tier-community {
	background: #e0e0e0;
	color: #555;
}

.tier-self-declared-allied {
	background: #d0e8ff;
	color: #1a5fa8;
}

.tier-self-declared-lgbtq {
	background: #b3d4ff;
	color: #0d3d7a;
}

.tier-verified-allied {
	background: #fff0cc;
	color: #8a6000;
}

.tier-verified-lgbtq {
	background: #ffe5a0;
	color: #6b4a00;
}

/* ==========================================================================
   Card description (line-clamp)
   ========================================================================== */

.lccl-card-description {
	font-size: 0.73em;
	color: #444;
	margin: 4px 0 4px 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.5;
}

/* ==========================================================================
   Card footer
   ========================================================================== */

/* Social / phone row */
.lccl-card-social {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 4px 0 0 0;
}

.lccl-card-phone {
	font-size: 0.70em;
	color: #555;
	margin-right: 4px;
}

.lccl-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	color: #555;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}

.lccl-social-link:hover {
	color: #9b59b6;
	background: #f0e8f8;
}

.lccl-social-link svg {
	display: block;
}

/* .lccl-card-footer kept for potential theme compatibility */
.lccl-card-footer {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	font-size: 0.82em;
}


.lccl-nonprofit-badge {
	background: #d4edda;
	color: #155724;
	font-size: 0.72em;
	font-weight: 600;
}

/* ==========================================================================
   Mapbox map marker (custom HTML)
   ========================================================================== */

.lccl-map-marker {
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.lccl-map-marker-dot {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	transition: transform 0.1s ease;
}

.lccl-map-marker:hover .lccl-map-marker-dot {
	transform: scale(1.25);
}

/* ==========================================================================
   Mapbox popup overrides
   ========================================================================== */

.lccl-popup {
	min-width: 200px;
	font-size: 0.88em;
	line-height: 1.4;
}

.lccl-popup-logo {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 6px;
}

.lccl-popup-name {
	display: block;
	font-weight: 700;
	font-size: 1em;
	margin-bottom: 4px;
}

.lccl-popup-phone {
	display: block;
	color: #555;
	margin-top: 4px;
}

.lccl-popup-website {
	display: block;
	color: #1a5fa8;
	text-decoration: none;
	margin-top: 2px;
}

.lccl-popup-website:hover {
	text-decoration: underline;
}

.lccl-popup-list-link {
	display: inline-block;
	margin-top: 8px;
	font-size: 0.9em;
	color: #9b59b6;
	text-decoration: none;
	font-weight: 600;
}

.lccl-popup-list-link:hover {
	text-decoration: underline;
}

/* Ensure mapbox popup content has our class applied */
.mapboxgl-popup-content .lccl-popup {
	padding: 2px 0;
}

/* ==========================================================================
   Mobile styles (< 900px)
   ========================================================================== */

@media (max-width: 899px) {

	/* Show view toggle on mobile */
	.lccl-view-toggle {
		display: flex;
		margin-bottom: 0;
		border-radius: 0;
		border-left: none;
		border-right: none;
		border-top: 1px solid #ddd;
	}

	/* Stack everything vertically */
	.lccl-main {
		flex-direction: column;
	}

	.lccl-cat-sidebar {
		width: 100%;
		max-height: none;
		border-right: none;
		border-bottom: 1px solid #e0e0e0;
		background: none;
	}

	.lccl-content {
		flex-direction: column;
	}

	/* Map panel full width, shorter height */
	.lccl-map-panel {
		width: 100%;
		height: 350px;
	}

	/* List panel full width, no max-height */
	.lccl-list-panel {
		width: 100%;
		max-height: none;
		border-left: none;
		border-top: 1px solid #ddd;
	}

	/* Mobile panel show/hide — JS toggles data-active attribute */
	.lccl-map-panel[data-mobile-hidden="true"],
	.lccl-list-panel[data-mobile-hidden="true"] {
		display: none;
	}

	/* Tag pills: smaller on mobile */
	.lccl-tag-pill {
		font-size: 0.78em;
		padding: 4px 10px;
	}

	/* Filter row stacks on very small screens */
	.lccl-filter-row {
		flex-direction: column;
		gap: 8px;
	}
}
