/*
 * Exa Group Portfolio — Stylesheet
 * BEM prefix: .egp-
 *
 * Inherits Elementor CSS custom properties from the active theme:
 *   --e-global-color-primary  (dark background)
 *   --e-global-color-accent   (light text / borders)
 *   --e-global-typography-text-*
 *   --e-global-typography-accent-*
 *   --e-global-typography-6c10a53-*  (section title)
 */

/* ── Shared layout ─────────────────────────────────────────────────────────── */

.egp-anchor {
	pointer-events: none;
	position: relative;
	top: -86px;
	width: 100%;
	height: 1px;
}

.egp-inner {
	width: 100%;
	max-width: 1500px;
	margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   TABLE SHORTCODE
   ════════════════════════════════════════════════════════════════════════════ */

.egp-table {
	background-color: var(--e-global-color-primary);
	color: var(--e-global-color-accent);
	padding: 0;
}

/* ── Filter bar ─────────────────────────────────────────────────────────────── */

.egp-table__filters-wrap {
	position: sticky;
	top: 86px;
	z-index: 10;
	background-color: var(--e-global-color-primary);
}

.egp-table__filters {
	display: flex;
	flex-direction: row;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 20px;
	padding: 35px 0;
}

.egp-table__filter-label {
	font-family:    var(--e-global-typography-text-font-family), Sans-serif;
	font-size:      var(--e-global-typography-text-font-size);
	font-weight:    var(--e-global-typography-text-font-weight);
	text-transform: uppercase;
	letter-spacing: var(--e-global-typography-text-letter-spacing);
	color:          var(--e-global-color-accent);
	margin: 0;
	line-height: 1;
	padding-bottom: 10px; /* align with select bottom border */
}

/* Filter field wrapper */
.egp-table__filter-field {
	position: relative;
	min-width: 140px;
}

/* ── Tom Select overrides (scoped to filter bar) ─────────────────────────── */
/*
 * We re-skin Tom Select to match the existing native <select> style:
 * transparent background, bottom border only, white text, custom arrow.
 *
 * Dropdowns are appended to <body> via dropdownParent:'body' in JS,
 * so their styles live under .egp-ts-dropdown at the bottom of this file.
 */

/* Wrapper fills its container */
.egp-table__filter-field .ts-wrapper {
	display: block;
	width: 100%;
	position: relative;
	min-width: 120px;
}

/* Control (the visible input / value area) */
.egp-table__filters .ts-wrapper.single .ts-control,
.egp-table__filters .ts-control {
	appearance: none;
	background-color: transparent !important;
	border: none !important;
	border-bottom: 1px solid var(--e-global-color-accent) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 6px 28px 10px 0 !important; /* top padding gives a taller click target */
	cursor: pointer;
	font-family:     var(--e-global-typography-text-font-family), Sans-serif;
	font-size:       var(--e-global-typography-text-font-size);
	font-weight:     var(--e-global-typography-text-font-weight);
	letter-spacing:  var(--e-global-typography-text-letter-spacing);
	line-height:     var(--e-global-typography-text-line-height);
	color:           var(--e-global-color-accent);
	/* Prevent wrapping when a value + input share the row */
	flex-wrap: nowrap !important;
	overflow: hidden;
}

/* Hide Tom Select's default caret; we draw our own via ::after on wrapper */
.egp-table__filters .ts-wrapper.single .ts-control::after {
	display: none !important;
}

/* Custom arrow — shown via JS class .egp-ts-has-arrow on the wrapper.
 * Arrow is REMOVED when a value is selected (JS toggles the class).
 * This avoids CSS specificity fights with Tom Select's own ::after. */
.egp-table__filters .ts-wrapper.egp-ts-has-arrow::after {
	content: '';
	position: absolute;
	right: 4px;
	bottom: 14px;
	width: 10px;
	height: 10px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'%3E%3Cpath d='M232.02,431.59V0h35.77v431.59l206.8-206.8,25.41,25.22-250,250L0,250l25.41-25.41,206.8,206.8-.2.2Z' fill='white'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	pointer-events: none;
	z-index: 1;
}

/* Input inside control */
.egp-table__filters .ts-control input {
	background: transparent !important;
	color: var(--e-global-color-accent) !important;
	font-family:    var(--e-global-typography-text-font-family), Sans-serif !important;
	font-size:      var(--e-global-typography-text-font-size) !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	width: 0 !important;
	flex: 1 1 0 !important;
}

/* When the control is empty (no selection) let the input expand to show placeholder */
.egp-table__filters .ts-wrapper.egp-ts-has-arrow .ts-control input {
	width: 100% !important;
	flex: 1 1 auto !important;
}

.egp-table__filters .ts-control input::placeholder {
	color: var(--e-global-color-accent);
	opacity: 0.7;
}

/* Selected item — single line, no wrap, ellipsis overflow */
.egp-table__filters .ts-control .item {
	color: var(--e-global-color-accent);
	padding: 0 !important;
	margin: 0 !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: calc(100% - 24px); /* leave room for clear button */
	flex: 0 1 auto;
}

/* Clear button (from clear_button plugin) — replaces arrow when value is set */
.egp-table__filters .ts-control .clear-button {
	position: absolute !important;
	right: 2px;
	top: 50%;
	transform: translateY(-50%);
	margin-top: -2px; /* visual adjustment for bottom-padding offset */
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: var(--e-global-color-accent) !important;
	font-size: 18px;
	line-height: 1;
	padding: 0 4px !important;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s;
}

.egp-table__filters .ts-control:has(div.item) .clear-button {
	opacity: 1;
}

.egp-table__filters .ts-control:has(div.item) .clear-button:hover {
	opacity: 0.6;
}

/* Focus ring — keep outline off, accent on border */
.egp-table__filters .ts-wrapper.focus .ts-control {
	border-bottom-color: var(--e-global-color-accent) !important;
	box-shadow: none !important;
}

/* ── Under construction checkbox ──────────────────────────────────────────── */

.egp-table__filter-check {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	padding-bottom: 10px;
	user-select: none;
}

/* Hide the native checkbox */
.egp-table__filter-check input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Custom square — empty by default */
.egp-table__check-box {
	display: block;
	width: 14px;
	height: 14px;
	border: 1px solid var(--e-global-color-accent);
	flex-shrink: 0;
	transition: background-color 0.15s;
}

/* Filled square when checked */
.egp-table__filter-check input:checked ~ .egp-table__check-box {
	background-color: var(--e-global-color-accent);
}

.egp-table__check-label {
	font-family:    var(--e-global-typography-text-font-family), Sans-serif;
	font-size:      var(--e-global-typography-text-font-size);
	font-weight:    var(--e-global-typography-text-font-weight);
	letter-spacing: var(--e-global-typography-text-letter-spacing);
	line-height:    var(--e-global-typography-text-line-height);
	color:          var(--e-global-color-accent);
	white-space: nowrap;
}

/* ── Apply / Reset buttons ────────────────────────────────────────────────── */

.egp-table__filter-actions {
	display: flex;
	gap: 20px;
	align-items: flex-end;
	padding-bottom: 10px;
}

.egp-table__btn {
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--e-global-color-accent);
	border-radius: 0;
	padding: 0 0 1px;
	margin: 0;
	cursor: pointer;
	font-family:    var(--e-global-typography-accent-font-family), Sans-serif;
	font-size:      var(--e-global-typography-accent-font-size);
	font-weight:    var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	line-height:    var(--e-global-typography-accent-line-height);
	color: var(--e-global-color-accent);
	text-transform: uppercase;
	transition: opacity 0.2s;
}

.egp-table__btn:hover {
	opacity: 0.7;
}

.egp-table__btn--reset {
	opacity: 0.5;
}

.egp-table__btn--reset:hover {
	opacity: 0.8;
}

/* ── Table body ─────────────────────────────────────────────────────────────── */

.egp-table__body {
	/* nothing extra needed */
}

/* Column header row */
.egp-table__header {
	display: flex;
	padding: 20px 0;
	border-bottom: 1px solid var(--e-global-color-accent);
	font-family:    var(--e-global-typography-text-font-family), Sans-serif;
	font-size:      var(--e-global-typography-text-font-size);
	font-weight:    var(--e-global-typography-text-font-weight);
	letter-spacing: var(--e-global-typography-text-letter-spacing);
	line-height:    var(--e-global-typography-text-line-height);
	color:          var(--e-global-color-accent);
}

/* Sortable column headers */
.egp-table__cell--sortable {
	cursor: pointer;
	user-select: none;
	transition: opacity 0.15s;
}

.egp-table__cell--sortable:hover {
	opacity: 0.7;
}

/* Active sort — bold text + small triangle */
.egp-table__cell--sort-active {
	font-weight: 700 !important;
}

.egp-table__cell--sort-asc::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 6px;
	vertical-align: middle;
	border-left:  4px solid transparent;
	border-right: 4px solid transparent;
	border-bottom: 5px solid var(--e-global-color-accent);
}

.egp-table__cell--sort-desc::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 6px;
	vertical-align: middle;
	border-left:  4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid var(--e-global-color-accent);
}

/* Data row */
.egp-table__row {
	display: flex;
	padding: 20px 0;
	border-bottom: 1px solid var(--e-global-color-accent);
	font-family:    var(--e-global-typography-text-font-family), Sans-serif;
	font-size:      var(--e-global-typography-text-font-size);
	font-weight:    var(--e-global-typography-text-font-weight);
	letter-spacing: var(--e-global-typography-text-letter-spacing);
	line-height:    var(--e-global-typography-text-line-height);
	color:          var(--e-global-color-accent);
}

/* Default cell: 20% of row */
.egp-table__cell {
	width: 20%;
	padding-right: 15px;
	text-transform: capitalize;
}

/* Project name — uppercase */
.egp-table__cell--title {
	text-transform: uppercase;
}

/* Last cell — action (link/badge), right-aligned */
.egp-table__cell--action {
	padding-right: 0;
	text-align: right;
	text-transform: none;
}

/* "Discover the project" link */
.egp-table__link {
	font-family:    var(--e-global-typography-accent-font-family), Sans-serif;
	font-size:      var(--e-global-typography-accent-font-size);
	font-weight:    var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	line-height:    var(--e-global-typography-accent-line-height);
	border-bottom: 1px solid var(--e-global-color-accent);
	padding-bottom: 1px;
	color: var(--e-global-color-accent);
	text-decoration: none;
	transition: opacity 0.2s;
}

.egp-table__link:hover {
	opacity: 0.7;
	color: var(--e-global-color-accent);
}

/* "Under construction" badge */
.egp-table__badge {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	font-family:    var(--e-global-typography-accent-font-family), Sans-serif;
	font-size:      var(--e-global-typography-accent-font-size);
	font-weight:    var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	line-height:    var(--e-global-typography-accent-line-height);
	color: var(--e-global-color-accent);
}

.egp-table__badge svg {
	height: 12px;
	width: auto;
	flex-shrink: 0;
}

/* ── Show all / show less toggle ─────────────────────────────────────────── */

.egp-table__toggle {
	text-align: center;
	margin-top: 20px;
	cursor: pointer;
}

/* "View all" span — visible by default */
.egp-table__toggle-show {
	display: inline;
	font-family:    var(--e-global-typography-accent-font-family), Sans-serif;
	font-size:      var(--e-global-typography-accent-font-size);
	font-weight:    var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	line-height:    var(--e-global-typography-accent-line-height);
	border-bottom: 1px solid var(--e-global-color-accent);
	padding-bottom: 1px;
	color: var(--e-global-color-accent);
	transition: opacity 0.2s;
}

.egp-table__toggle-show:hover {
	opacity: 0.7;
}

/* "View less" span — hidden until active */
.egp-table__toggle-less {
	display: none;
	font-family:    var(--e-global-typography-accent-font-family), Sans-serif;
	font-size:      var(--e-global-typography-accent-font-size);
	font-weight:    var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	line-height:    var(--e-global-typography-accent-line-height);
	border-bottom: 1px solid var(--e-global-color-accent);
	padding-bottom: 1px;
	color: var(--e-global-color-accent);
	transition: opacity 0.2s;
}

.egp-table__toggle-less:hover {
	opacity: 0.7;
}

.egp-table__toggle--active .egp-table__toggle-show { display: none; }
.egp-table__toggle--active .egp-table__toggle-less { display: inline; }

/* ── Tom Select dropdown (appended to <body>) ───────────────────────────────
 * These rules target .egp-ts-dropdown which is added via onInitialize in JS.
 * Positioned absolutely by Tom Select JS; z-index must be high enough to
 * clear Elementor headers and any other stacking contexts.
 * ─────────────────────────────────────────────────────────────────────────── */

.egp-ts-dropdown {
	background-color: var(--e-global-color-primary) !important;
	border: 1px solid var(--e-global-color-accent) !important;
	border-top: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	z-index: 99999 !important;
	margin-top: 0;
}

.egp-ts-dropdown .ts-dropdown-content {
	padding: 4px 0;
	max-height: 220px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.egp-ts-dropdown .option {
	color:          var(--e-global-color-accent);
	font-family:    var(--e-global-typography-text-font-family), Sans-serif;
	font-size:      var(--e-global-typography-text-font-size);
	letter-spacing: var(--e-global-typography-text-letter-spacing);
	padding: 6px 12px;
	cursor: pointer;
}

.egp-ts-dropdown .option:hover,
.egp-ts-dropdown .option.active {
	background-color: rgba(255, 255, 255, 0.08);
	color: var(--e-global-color-accent);
}

.egp-ts-dropdown .option.selected {
	background-color: rgba(255, 255, 255, 0.14);
}

.egp-ts-dropdown .no-results {
	color:      var(--e-global-color-accent);
	opacity:    0.5;
	font-size:  var(--e-global-typography-text-font-size);
	padding:    6px 12px;
}

.egp-ts-dropdown .highlight {
	background:  transparent;
	font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════════
   MAP SHORTCODE
   ════════════════════════════════════════════════════════════════════════════ */

.egp-map {
	padding: 0;
}

.egp-map__canvas {
	position: relative;
	height: 50vh;
	max-height: 700px;
	width: 100%;
}

/* Remove Google Maps UI borders/shadows */
.egp-map__canvas * {
	outline:    none !important;
	box-shadow: none !important;
	border:     none !important;
}

/* ── Complianz placeholder ──────────────────────────────────────────────────── */

html:not(.cmplz_marketing) .egp-map__canvas .egp-map__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #f2f2f2;
	text-align: center;
	z-index: 2;
}

html.cmplz_marketing .egp-map__canvas .egp-map__placeholder {
	display: none;
}

.egp-map__placeholder-inner {
	max-width: 520px;
}

.egp-map__placeholder-btn {
	margin-top: 10px;
	padding: 10px 14px;
	cursor: pointer;
	border: 1px solid #333 !important;
	background: transparent;
	font-size: 14px;
}

/* ── Map pins ───────────────────────────────────────────────────────────────── */

.egp-map-pin {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background-color: #4B171D;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
}

.egp-map-pin:hover {
	transform: scale(1.12);
	background-color: #6b2328;
}

/* Cluster pin — slightly larger */
.egp-map-pin--cluster {
	width: 44px;
	height: 44px;
}

.egp-map-pin--cluster .egp-map-pin__count {
	font-size: 13px;
}

/* Filtered pin — plain dot, no count.
 * Applied when the table shortcode has active filters;
 * communicates "these locations match" without misleading numbers. */
.egp-map-pin--filtered {
	width: 14px;
	height: 14px;
}

.egp-map-pin--filtered.egp-map-pin--cluster {
	width: 20px;
	height: 20px;
}

.egp-map-pin__count {
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	font-family: var(--e-global-typography-text-font-family), sans-serif;
	pointer-events: none;
	user-select: none;
}

/* ── InfoWindow ─────────────────────────────────────────────────────────────── */

.egp-infowindow {
	padding: 4px 2px;
	min-width: 200px;
	max-width: 320px;
}

.egp-infowindow__city {
	font-family:    var(--e-global-typography-accent-font-family), sans-serif;
	font-size:      14px;
	font-weight:    600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color:          #1a1a1a;
	margin:         0 0 10px;
	padding:        0;
}

.egp-infowindow__list {
	list-style:  none;
	margin:      0;
	padding:     0;
	max-height:  200px;
	overflow-y:  auto;
	scrollbar-width: thin;
}

.egp-infowindow__item {
	font-family: var(--e-global-typography-text-font-family), sans-serif;
	font-size:   12px;
	color:       #333;
	padding:     4px 0;
	border-bottom: 1px solid #eee;
	line-height: 1.4;
}

.egp-infowindow__item:last-child {
	border-bottom: none;
}

.egp-infowindow__cat {
	text-transform: capitalize;
	opacity: 0.65;
}

.egp-infowindow__title {
	font-weight: 500;
	text-transform: uppercase;
}

.egp-infowindow__year {
	opacity: 0.55;
	font-size: 11px;
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGO WALL SHORTCODE
   ════════════════════════════════════════════════════════════════════════════ */

.egp-logo-wall {
	display: block;
	width: 100%;
}

.egp-logo-wall__list {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
}

/* Desktop / Tablet: 4 columns × 3 rows = 12 items */
.egp-logo-wall__item {
	width: 25%;
}

.egp-logo-wall__logo {
	position: relative;
	aspect-ratio: 5 / 2;
}

.egp-logo-wall__logo-target {
	position: absolute;
	inset: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

img.egp-logo-wall__logo-img {
	max-width: 170px;
	max-height: 40px;
	width: 50%;
	height: 50%;
	/* max-width: 65%;
	max-height: 55%;
	width: auto;
	height: auto; */
	object-fit: contain;
}

/* Hidden pool — stays display:none, JS removes items from it */
.egp-logo-wall__pool {
	display: none;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media only screen and (max-width: 1024px) {
	.egp-table,
	.egp-map {
		padding: 0 40px 40px;
	}

	.egp-table__filters-wrap {
		top: 66px;
	}

	.egp-anchor {
		top: -66px;
	}
}

@media only screen and (max-width: 767px) {
	.egp-table,
	.egp-map {
		padding: 0 25px 40px;
	}

	/* Filter bar stacks vertically */
	.egp-table__filters {
		flex-direction: column;
		align-items: stretch;
		gap: 15px;
		padding: 25px 0;
	}

	.egp-table__filter-field,
	.egp-table__filters .ts-wrapper {
		width: 100%;
		min-width: 0;
	}

	.egp-table__filter-actions {
		padding-bottom: 0;
		padding-top: 5px;
	}

	/* Hide table header row on mobile */
	.egp-table__header {
		display: none;
	}

	/* Stack row cells */
	.egp-table__row {
		flex-direction: column;
	}

	.egp-table__cell {
		width: 100%;
		padding-right: 0;
		margin-bottom: 4px;
	}

	.egp-table__cell--action {
		text-align: left;
		margin-top: 8px;
	}

	.egp-table__badge {
		justify-content: flex-start;
	}

	/* Logo wall: 3 columns × 4 rows on mobile */
	.egp-logo-wall__item {
		width: 33.333%;
	}
}
