/* Directory page: store map ([tc_directory_map]) and Grid/List toggle ([tc_directory_view_toggle]). */

/* ---------- Map + store list ---------- */

.tc-map {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	height: clamp(600px, 75vh, 820px);
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(1, 54, 96, 0.08);
	overflow: hidden;
}
.tc-map-sidebar {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid #efefef;
}
.tc-map-search {
	display: block;
	padding: 14px;
	border-bottom: 1px solid #efefef;
}
.tc-map-search input {
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	color: #000000;
	border: 1px solid #cccccc;
	border-radius: 6px;
	background: #ffffff;
}
.tc-map-search input:focus {
	outline: 2px solid #013660;
	outline-offset: 1px;
	border-color: #013660;
}
.tc-map-list {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	overflow-y: auto;
}
.tc-map-list .tc-map-item {
	padding: 0;
	margin: 0;
	list-style: none;
}
.tc-map-item[hidden] {
	display: none;
}
.tc-map-item-button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px 14px;
	text-align: left;
	background: none;
	border: 0;
	border-left: 3px solid transparent;
	cursor: pointer;
	font: inherit;
}
.tc-map-item-button:hover,
.tc-map-item-button:focus-visible {
	background: #f5f7fa;
}
.tc-map-item-button:focus-visible {
	outline: 2px solid #013660;
	outline-offset: -2px;
}
.tc-map-item.is-active .tc-map-item-button {
	background: #eef2f7;
	border-left-color: #013660;
}
.tc-map-item-logo {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	object-fit: contain;
	padding: 3px;
	background: #ffffff;
	border: 1px solid #efefef;
	border-radius: 4px;
}
.tc-map-item-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}
.tc-map-item-name {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	color: #013660;
}
.tc-map-item-meta {
	font-size: 12px;
	line-height: 1.35;
	color: #333333;
}
.tc-map-item.is-unplaced .tc-map-item-meta {
	font-style: italic;
	color: #777777;
}
.tc-map-item-button .tc-pill {
	flex: 0 0 auto;
	margin: 0;
}

.tc-map-canvas {
	position: relative;
	min-height: 0;
	background: #efefef;
}
.tc-map-notice {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 24px;
	text-align: center;
	font-size: 14px;
	color: #333333;
}
.tc-map--no-map .tc-map-canvas {
	background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 10px, #efefef 10px, #efefef 20px);
}

/* Pins */
.tc-map-pin {
	width: 26px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.tc-map-pin[hidden] {
	display: none !important;
}
.tc-map-pin::before {
	content: "";
	display: block;
	width: 22px;
	height: 22px;
	margin: 0 auto;
	background: #013660;
	border: 3px solid #ffffff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease, background 0.15s ease;
}
.tc-map-pin:hover::before,
.tc-map-pin:focus-visible::before {
	transform: rotate(-45deg) scale(1.15);
}
.tc-map-pin.is-active {
	z-index: 2;
}
.tc-map-pin.is-active::before {
	background: #002854;
	transform: rotate(-45deg) scale(1.3);
	box-shadow: 0 0 0 4px rgba(1, 54, 96, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Popup */
.tc-map .mapboxgl-map {
	font: inherit; /* use the site font instead of Mapbox's Helvetica */
}
.tc-map .mapboxgl-popup-content {
	padding: 14px 16px;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(1, 54, 96, 0.2);
}
.tc-map-popup {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: #333333;
}
.tc-map-popup img {
	width: 72px;
	height: 72px;
	margin-bottom: 4px;
	object-fit: contain;
	border: 1px solid #efefef;
	border-radius: 4px;
	padding: 4px;
}
.tc-map-popup .tc-pill {
	margin: 0;
}
.tc-map-popup-name {
	font-size: 15px;
	color: #013660;
}
.tc-map-popup-address {
	font-weight: 600;
	color: #013660;
}
.tc-map-popup-link {
	margin-top: 6px;
	font-weight: 600;
	color: #013660;
	text-decoration: underline;
}

@media (max-width: 980px) {
	.tc-map {
		grid-template-columns: 1fr;
		grid-template-rows: auto 480px;
		height: auto;
	}
	.tc-map-sidebar {
		border-right: 0;
		border-bottom: 1px solid #efefef;
	}
	.tc-map-list {
		max-height: 260px;
	}
}

/* ---------- Grid / List toggle ---------- */

.tc-view-toggle {
	display: inline-flex;
	padding: 3px;
	background: #ffffff;
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(1, 54, 96, 0.08);
}
.tc-view-toggle button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 16px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: #013660;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}
.tc-view-toggle button svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}
.tc-view-toggle button[aria-pressed="true"] {
	color: #ffffff;
	background: #013660;
}
.tc-view-toggle button:focus-visible {
	outline: 2px solid #013660;
	outline-offset: 2px;
}

/* ---------- List view of the Directory cards ---------- */

.tc-dir-grid.is-list {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 12px !important;
}
.tc-dir-grid.is-list > .tc-dir-card {
	padding: 12px 16px !important;
}
.tc-dir-grid.is-list .tc-dir-card .et_pb_blurb_content {
	display: flex;
	align-items: center;
	gap: 18px;
	max-width: none;
	text-align: left;
}
.tc-dir-grid.is-list .tc-dir-card .et_pb_main_blurb_image {
	flex: 0 0 84px;
	width: 84px !important;
	margin: 0 !important;
}
.tc-dir-grid.is-list .tc-dir-card .et_pb_main_blurb_image img {
	padding: 8%;
}
.tc-dir-grid.is-list .tc-dir-card .et_pb_blurb_container {
	flex: 1;
	align-items: flex-start;
	text-align: left;
}
.tc-dir-grid.is-list .tc-dir-card .et_pb_module_header {
	text-align: left;
}
.tc-dir-grid.is-list .tc-dir-card .tc-pill {
	margin-bottom: 4px;
}
.tc-dir-grid.is-list .tc-dir-card .tc-dir-info {
	margin-top: 2px;
	text-align: left;
}
@media (max-width: 980px) {
	.tc-dir-grid.is-list {
		grid-template-columns: 1fr !important;
	}
}
@media (max-width: 767px) {
	.tc-dir-grid.is-list .tc-dir-card .et_pb_main_blurb_image {
		flex-basis: 64px;
		width: 64px !important;
	}
}

/* Larger popup close button (Mapbox default is ~10px) */
.tc-map .mapboxgl-popup-close-button {
	width: 28px;
	height: 28px;
	font-size: 20px;
	line-height: 1;
	color: #013660;
	border-radius: 0 8px 0 6px;
}
.tc-map .mapboxgl-popup-close-button:hover {
	background: #eef2f7;
}
